Skip to content

Commit

Permalink
Fix signAndVerify for Keyless (#387)
Browse files Browse the repository at this point in the history
* Fix signAndVerify for Keyless

* Add changeset
  • Loading branch information
heliuchuan authored Aug 1, 2024
1 parent 74f99d2 commit 3d9ae51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-doors-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aptos-labs/wallet-adapter-core": patch
---

Fix Keyless sign and verify
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 3d9ae51

Please sign in to comment.