Sign messages
Signs an arbitrary message using the current wallet's private key.
This method is typically used for identity verification, secure login flows, or proving wallet ownership without sending a transaction.
signMessage(message: string, nonce?: string): Promise<WalletSignMessageOutput>
WalletSignMessageOutput:
Name
Is Required
Description
message
Yes
The original message that was passed to the signMessage
function.
nonce
Yes
The nonce used during signing. If not provided, it is auto-generated.
fullMessage
Yes
The final message that was actually signed. Typically includes the nonce.
signature
Yes
The generated signature in hexadecimal format.
Sign a message and retrieve a signature that represents the wallet
const MESSAGE = "Hello, Fantasys!";
const result = await wallet.signMessage(MESSAGE);
const { signature, fullMessage } = result;
// You can then verify the signature
Last updated