signSignatureRequest

Signs a signature request using the provided signer. This method handles different types of signature requests including personal_sign, eth_signTypedData_v4, and authorization.

Import

1import { signSignatureRequest } from "@account-kit/wallet-client";

Usage

1// Sign a personal message
2const result = await client.signSignatureRequest({
3type: 'personal_sign',
4data: 'Hello, world!'
5});
6
7// Sign typed data (EIP-712)
8const result = await client.signSignatureRequest({
9type: 'eth_signTypedData_v4',
10data: {
11domain: { ... },
12types: { ... },
13primaryType: '...',
14message: { ... }
15}
16});

Parameters

signer

SmartAccountSigner

  • The signer to use for signing the request

params

SignSignatureRequestParams

  • The signature request parameters

params.type

string

  • The type of signature request (‘personal_sign’, ‘eth_signTypedData_v4’, or ‘signature_with_authorization’)

params.data

SignSignatureRequestParams["data"]

  • The data to sign, format depends on the signature type

Returns

Promise<SignSignatureRequestResult> A Promise that resolves to the signature result