signMessage

Signs a message using the smart account. This method requests the account associated with the signer and uses it to sign the message.

Import

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

Usage

1// Sign a simple text message
2const signature = await client.signMessage("Hello, world!");
3
4// Sign a raw hex message
5const signature = await client.signMessage({
6 raw: "0x48656c6c6f2c20776f726c6421",
7});

Parameters

client

InnerWalletApiClient

  • The wallet API client to use for the request

signer

SmartAccountSigner

  • The signer of the smart account

params

SignMessageParams

  • Parameters for signing the message

params.message

SignableMessage

  • The message to sign using EIP-191. Can be a string, or object with raw bytes.

params.account

Address

  • Optional account address to use for signing. If not provided, uses the client’s current account.

Returns

Promise<SignMessageResult> A Promise that resolves to the signed message as a hex string