Skip to main content

Function Signature

Description

Signs EIP-712 typed data using the EVM wallet identified by the supplied walletMetadata. The client formats the typed data, recovers key shares if needed, signs with the wallet’s key, and returns the serialized ECDSA signature as a hex string. Use this for permit flows, order signing, and other structured data that requires typed-data signing.
When you pass externalServerKeyShares (the caller-supplied path), walletMetadata.externalServerKeySharesBackupInfo must also be present — signTypedData throws if shares are supplied but backup metadata is missing. The full walletMetadata returned from createWalletAccount / importPrivateKey already includes it; identity-only metadata from fetchWalletMetadata will be rejected.

Parameters

Required Parameters

  • walletMetadata (WalletMetadata) — Non-sensitive wallet metadata persisted from createWalletAccount() / importPrivateKey(). The signer address comes from walletMetadata.accountAddress.
  • typedData (TypedData) — The EIP-712 typed data to sign (viem’s TypedData type)

Optional Parameters

  • password (string) — Required if the wallet was created with backUpToDynamic: true. Used for backup decryption when externalServerKeyShares is not provided.
  • externalServerKeyShares (ServerKeyShare[]) — Caller-supplied plaintext shares. If omitted, the SDK recovers from backup using password.
  • onError ((error: Error) => void) — Callback invoked if an error occurs during signing

Returns

  • Promise<string> — The serialized ECDSA signature as a hex string

Usage

Direct (DynamicEvmWalletClient)

Call signTypedData on your authenticated DynamicEvmWalletClient:

Viem-style (getWalletClient)

For a viem-style API (e.g. with signTypedData(typedData) where the account is implicit), use getWalletClient. The returned wallet client’s signTypedData forwards to the same client implementation.

Key shares and password

  • If the wallet was created with automatic backup (backUpToDynamic: true), you typically do not need externalServerKeyShares.
  • If the wallet was created with manual backup (backUpToDynamic: false), pass externalServerKeyShares when calling signTypedData.
  • If the wallet is password-protected, pass password; otherwise omit it.

Error handling

Last modified on May 21, 2026