Skip to content

signTypedData

Signs a typed message by first hashing it and then signing the hashed message using the signRawMessage method.

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.signTypedData({
  domain: {},
  types: {},
  primaryType: "",
  message: {},
});

Parameters

params

TypedDataDefinition<TTypedData, TPrimaryType> The parameters for the typed message to be hashed and signed

Returns

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