Skip to content

Commit

Permalink
fix: update to wallet supported method: verifyOwner
Browse files Browse the repository at this point in the history
  • Loading branch information
charleslavon committed Sep 12, 2023
1 parent 14053c6 commit 54149cf
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/components/vm/VmInitializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,11 @@ export default function VmInitializer() {
});

if (signedMessage) {
const verifiedSignature = wallet.verifySignature({
message,
nonce,
recipient,
publicKey: signedMessage.publicKey,
signature: signedMessage.signature,
});
const verifiedFullKeyBelongsToUser = await wallet.verifyFullKeyBelongsToUser({
publicKey: signedMessage.publicKey,
accountId: signedMessage.accountId,
network: wallet.selector.options.network,
const verifiedFullKeyBelongsToUser = await wallet.verifyOwner({
message: signedMessage,
});

if (verifiedFullKeyBelongsToUser && verifiedSignature) {
if (verifiedFullKeyBelongsToUser) {
alert(`Successfully verify signed message: '${message}': \n ${JSON.stringify(signedMessage)}`);
} else {
alert(`Failed to verify signed message '${message}': \n ${JSON.stringify(signedMessage)}`);
Expand Down

0 comments on commit 54149cf

Please sign in to comment.