getAddData
Prepares the data required for signing an Add message according to EIP-712.
const message: AddMessage = { owner: "0xYourAddress", keyType: 1, key: "0xYourPublicKey", metadataType: 1, metadata: "0xYourMetadata", nonce: BigInt("YourNonce"), deadline: BigInt("YourDeadline"),}; const data = getAddData(message);
domain: { readonly chainId: 10; readonly name: "Farcaster KeyGateway"; readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; readonly version: "1"; }; primaryType: "Add"; types: { readonly Add: readonly [ { readonly name: "owner"; readonly type: "address" }, { readonly name: "keyType"; readonly type: "uint32" }, { readonly name: "key"; readonly type: "bytes" }, { readonly name: "metadataType"; readonly type: "uint8" }, { readonly name: "metadata"; readonly type: "bytes" }, { readonly name: "nonce"; readonly type: "uint256" }, { readonly name: "deadline"; readonly type: "uint256" }, ]; };};
let returnType: { domain: { readonly chainId: 10; readonly name: "Farcaster KeyGateway"; readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; readonly version: "1"; }; primaryType: "Add"; types: { readonly Add: readonly [ { readonly name: "owner"; readonly type: "address" }, { readonly name: "keyType"; readonly type: "uint32" }, { readonly name: "key"; readonly type: "bytes" }, { readonly name: "metadataType"; readonly type: "uint8" }, { readonly name: "metadata"; readonly type: "bytes" }, { readonly name: "nonce"; readonly type: "uint256" }, { readonly name: "deadline"; readonly type: "uint256" }, ]; };};
The data object structured according to EIP-712, ready for signing.