signTypedData

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

Import

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

Usage

1import { AlchemyWebSigner } from "@account-kit/signer";
2
3const signer = new AlchemyWebSigner({
4 client: {
5 connection: {
6 rpcUrl: "/api/rpc",
7 },
8 iframeConfig: {
9 iframeContainerId: "alchemy-signer-iframe-container",
10 },
11 },
12});
13
14const signature = await signer.signTypedData({
15 domain: {},
16 types: {},
17 primaryType: "",
18 message: {},
19});

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