Skip to content
Alchemy Logo

signTypedData

function 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.

// Sign typed data
const signature = await client.signTypedData({
  domain: {
    name: "Example DApp",
    version: "1",
    chainId: 1,
    verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC",
  },
  types: {
    Person: [
      { name: "name", type: "string" },
      { name: "wallet", type: "address" },
    ],
  },
  primaryType: "Person",
  message: {
    name: "John Doe",
    wallet: "0xAaAaAaAaAaAaAaAaAaAAAAAAAAaaaAaAaAaaAaAa",
  },
});

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

Promise<`0x${string}`>

A Promise that resolves to the signature as a hex string

Was this page helpful?