Skip to content

signMessage

Signs the provided message using the inner signMessage function.

Import

import { LocalAccountSigner } from "@aa-sdk/core";

Usage

import { LocalAccountSigner } from "@aa-sdk/core";
import { generatePrivateKey } from "viem";
 
const signer = LocalAccountSigner.mnemonicToAccountSigner(generatePrivateKey());
const signature = await signer.signMessage("Hello, world!");

Parameters

message

string The message to be signed

Returns

Promise<any> A promise that resolves to the signed message