diff --git a/packages/example/components/chains/aptosMartian/example.tsx b/packages/example/components/chains/aptosMartian/example.tsx index 3c8b5727f..b024c1201 100644 --- a/packages/example/components/chains/aptosMartian/example.tsx +++ b/packages/example/components/chains/aptosMartian/example.tsx @@ -192,13 +192,13 @@ export default function Example() { const res = await provider?.signMessage(obj); return JSON.stringify(res); }} - onValidate={(request: string, result: string) => { + onValidate={async (request: string, result: string) => { const { fullMessage, signature } = JSON.parse(result) as SignMessageResponse; - + const account = await provider?.account(); const isValidSignature = nacl.sign.detached.verify( Buffer.from(fullMessage), - hexToBytes(signature), - hexToBytes(stripHexPrefix(account?.publicKey)), + hexToBytes(stripHexPrefix(signature)), + hexToBytes(stripHexPrefix(account?.publicKey ?? '')), ); return Promise.resolve(isValidSignature.toString());