verifyTypedData

Example

import { verifyTypedData } from "thirdweb/utils";
const isValid = await verifyTypedData({
address: "0x...",
signature: "0x...",
client,
chain,
domain: {
name: "Ether Mail",
version: "1",
chainId: 1,
verifyingContract: "0x0000000000000000000000000000000000000000",
},
primaryType: "Mail",
types: {
Person: [
{ name: "name", type: "string" },
{ name: "wallet", type: "address" },
],
Mail: [
{ name: "from", type: "Person" },
{ name: "to", type: "Person" },
{ name: "contents", type: "string" },
],
},
message: {
from: {
name: "Cow",
wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826",
},
to: {
name: "Bob",
wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB",
},
contents: "Hello, Bob!",
},
});

Parameters

Returns

A promise that resolves to true if the signature is valid, or false otherwise.