Skip to content

signMessage

Signs a raw message after hashing it.

Import

import { BaseAlchemySigner } from "@account-kit/signer";

Usage

import { AlchemyWebSigner } from "@account-kit/signer";
 
const signer = new AlchemyWebSigner({
  client: {
    connection: {
      rpcUrl: "/api/rpc",
    },
    iframeConfig: {
      iframeContainerId: "alchemy-signer-iframe-container",
    },
  },
});
 
const signature = await signer.signMessage("Hello, world!");

Parameters

msg

string the message to be hashed and then signed

Returns

Promise<string> a promise that resolves to the signed message