signTypedData

Signs the provided typed data using the inner signer.

Import

1import { SessionKeySigner } from "@account-kit/smart-contracts";

Usage

1import { SessionKeySigner } from "@account-kit/smart-contracts";
2
3const signer = new SessionKeySigner();
4console.log(
5 await signer.signTypedData({
6 types: {
7 Message: [{ name: "content", type: "string" }],
8 },
9 primaryType: "Message",
10 message: { content: "Hello" },
11 })
12);

Parameters

params

TypedDataDefinition<TTypedData, TPrimaryType> The parameters containing the typed data definition and primary type.

Returns

Promise<string> A promise that resolves to the signed typed data as a string.