Sign message
Wander Injected API signMessage() function
Argument
Type
Description
Options
export interface SignMessageOptions {
hashAlgorithm?: "SHA-256" | "SHA-384" | "SHA-512";
}Example usage
// connect to the extension
await window.arweaveWallet.connect(["SIGNATURE"]);
// message to be signed
const data = new TextEncoder().encode("The hash of this msg will be signed.");
// create signature
const signature = await window.arweaveWallet.signMessage(data);
// verify signature
const isValidSignature = await window.arweaveWallet.verifyMessage(data, signature);
console.log(`The signature is ${isValidSignature ? "valid" : "invalid"}`);Verification without Wander
Last updated
Was this helpful?