signTypedData

1function signTypedData(client, signer, params): Promise<`0x${string}`>;

Defined in: account-kit/wallet-client/src/client/actions/signTypedData.ts:46

Signs typed data (EIP-712) using the smart account. This method requests the account associated with the signer and uses it to sign the typed data.

Example

1// Sign typed data
2const signature = await client.signTypedData({
3 domain: {
4 name: "Example DApp",
5 version: "1",
6 chainId: 1,
7 verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
8 },
9 types: {
10 Person: [
11 { name: "name", type: "string" },
12 { name: "wallet", type: "address" },
13 ],
14 },
15 primaryType: "Person",
16 message: {
17 name: "John Doe",
18 wallet: "0xAaAaAaAaAaAaAaAaAaAAAAAAAAaaaAaAaAaaAaAa",
19 },
20});

Parameters

ParameterTypeDescription

client

InnerWalletApiClient

The wallet API client to use for the request

signer

SmartWalletSigner

The signer of the smart account

params

SignTypedDataParams

The typed data to sign, following EIP-712 format

Returns

Promise<`0x${string}`>

A Promise that resolves to the signature as a hex string