getRegisterData

Constructs the data required for signing a register message in the Farcaster ID Gateway. This includes the EIP-712 domain, types, and the message to be signed.

Example

import { getRegisterData } from "thirdweb/extensions/farcaster";
const data = getRegisterData(message);
function getRegisterData(message: RegisterMessage): {
domain: {
readonly chainId: 10;
readonly name: "Farcaster IdGateway";
readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69";
readonly version: "1";
};
message: RegisterMessage;
primaryType: "Register";
types: {
readonly Register: readonly [
{ readonly name: "to"; readonly type: "address" },
{ readonly name: "recovery"; readonly type: "address" },
{ readonly name: "nonce"; readonly type: "uint256" },
{ readonly name: "deadline"; readonly type: "uint256" },
];
};
};

Parameters

The register message containing the necessary information for the signature.

Type

let message: {
deadline: bigint;
nonce: bigint;
recovery: Address;
to: Address;
};

Returns

let returnType: {
domain: {
readonly chainId: 10;
readonly name: "Farcaster IdGateway";
readonly verifyingContract: "0x00000000Fc25870C6eD6b6c7E41Fb078b7656f69";
readonly version: "1";
};
message: RegisterMessage;
primaryType: "Register";
types: {
readonly Register: readonly [
{ readonly name: "to"; readonly type: "address" },
{ readonly name: "recovery"; readonly type: "address" },
{ readonly name: "nonce"; readonly type: "uint256" },
{ readonly name: "deadline"; readonly type: "uint256" },
];
};
};

An object containing the EIP-712 domain, types, and the message, ready to be signed.