From 3d9ae510eb496b6b67555974f2aaa658e5a4a4c7 Mon Sep 17 00:00:00 2001 From: Oliver He Date: Thu, 1 Aug 2024 17:07:22 -0400 Subject: [PATCH] Fix signAndVerify for Keyless (#387) * Fix signAndVerify for Keyless * Add changeset --- .changeset/good-doors-design.md | 5 +++++ .../src/AIP62StandardWallets/WalletStandard.ts | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .changeset/good-doors-design.md diff --git a/.changeset/good-doors-design.md b/.changeset/good-doors-design.md new file mode 100644 index 00000000..654ef9b1 --- /dev/null +++ b/.changeset/good-doors-design.md @@ -0,0 +1,5 @@ +--- +"@aptos-labs/wallet-adapter-core": patch +--- + +Fix Keyless sign and verify diff --git a/packages/wallet-adapter-core/src/AIP62StandardWallets/WalletStandard.ts b/packages/wallet-adapter-core/src/AIP62StandardWallets/WalletStandard.ts index 0fc1b304..282cb20f 100644 --- a/packages/wallet-adapter-core/src/AIP62StandardWallets/WalletStandard.ts +++ b/packages/wallet-adapter-core/src/AIP62StandardWallets/WalletStandard.ts @@ -10,13 +10,13 @@ import { AptosConnectOutput, } from "@aptos-labs/wallet-standard"; import { + AnyPublicKey, + AnyPublicKeyVariant, AnyRawTransaction, PendingTransactionResponse, Aptos, MultiEd25519Signature, MultiEd25519PublicKey, - KeylessPublicKey, - KeylessSignature, } from "@aptos-labs/ts-sdk"; import { WalletReadyState } from "../constants"; @@ -188,7 +188,10 @@ export class WalletStandardCore { // For Keyless wallet accounts we skip verification for now. // TODO: Remove when client-side verification is done in SDK. - if (account.publicKey instanceof KeylessPublicKey && response.args.signature instanceof KeylessSignature) { + if ( + account.publicKey instanceof AnyPublicKey && + account.publicKey.variant === AnyPublicKeyVariant.Keyless + ) { return true; }