import type { Address } from "abitype"; import type { Hex } from "../../../utils/encoding/hex.js"; import type { Account } from "../../../wallets/interfaces/wallet.js"; /** * @extension FARCASTER */ export type AddMessage = { /** FID owner address */ owner: Address; /** Key type. The only currently supported key type is 1, for EdDSA signers. */ keyType: number; /** Public key to register onchain */ key: Hex; /** Metadata type. The only currently supported metadata type is 1. */ metadataType: number; /** ABI-encoded SignedKeyRequestMetadata struct */ metadata: Hex; /** KeyGateway nonce for signer address */ nonce: bigint; /** Unix timestamp when this message expires */ deadline: bigint; }; /** * @extension FARCASTER */ export type SignAddOptions = { account: Account; message: AddMessage; }; /** * Prepares the data required for signing an Add message according to EIP-712. * @param message - The AddMessage object containing the message to be signed. * @returns The data object structured according to EIP-712, ready for signing. * @extension FARCASTER * @example * ```typescript * const message: AddMessage = { * owner: "0xYourAddress", * keyType: 1, * key: "0xYourPublicKey", * metadataType: 1, * metadata: "0xYourMetadata", * nonce: BigInt("YourNonce"), * deadline: BigInt("YourDeadline"), * }; * * const data = getAddData(message); * ``` */ export declare function getAddData(message: AddMessage): { message: AddMessage; primaryType: "Add"; domain: { readonly chainId: 10; readonly name: "Farcaster KeyGateway"; readonly verifyingContract: "0x00000000fC56947c7E7183f8Ca4B62398CaAdf0B"; readonly version: "1"; }; 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"; }]; }; }; /** * Signs an Add message using the account's signTypedData method. * @param options - The options for signing the Add message. * @returns A promise that resolves to the signature of the Add message. * @extension FARCASTER * @example * ```typescript * const signedMessage = await signAdd({ * account: yourAccount, * message: yourAddMessage, * }); * ``` */ export declare function signAdd(options: SignAddOptions): Promise; //# sourceMappingURL=addSignature.d.ts.map