/** * The domain and URI a Money Account SIWE message is bound to. */ export type SiweMessageTemplate = { /** Host the message is addressed to, such as `money.api.cx.metamask.io`. */ domain: string; /** Origin the message is bound to, such as `https://money.api.cx.metamask.io`. */ uri: string; }; /** * Derives the SIWE domain and URI bound to a Money Account API base URL. * * @param baseUrl - The Money Account API base URL for the active environment. * @returns The domain and URI the API should embed in its challenges. */ export declare function getSiweMessageTemplate(baseUrl: string): SiweMessageTemplate; /** * Builds the exact SIWE message the Money Account API produces for a challenge. * * @param template - Domain and URI the message is bound to. * @param address - The account address being authenticated. * @param nonce - The challenge nonce, 64 lowercase hex characters. * @param issuedAtMs - Challenge issue time in milliseconds since the epoch. * @returns The expected message. */ export declare function buildSiweMessage(template: SiweMessageTemplate, address: string, nonce: string, issuedAtMs: number): string; /** * Validates a challenge message before it is handed to the keyring for signing. * * Only the message's `Issued At` value is trusted, and only to rebuild the * expected message. Every other field comes from the client's template, so a * message with an extra, missing, or reordered field fails the exact-equality * check. * * @param options - The challenge and the context it must match. * @param options.template - Domain and URI the message is bound to. * @param options.address - The lowercased account address being authenticated. * @param options.nonce - The challenge nonce from the challenge response. * @param options.message - The challenge message returned by the API. * @param options.now - Current time in milliseconds since the epoch. * @returns A short failure reason, or `null` when the message is valid. */ export declare function validateSiweChallengeMessage({ template, address, nonce, message, now, }: { template: SiweMessageTemplate; address: string; nonce: string; message: string; now: number; }): string | null; //# sourceMappingURL=siwe-message.d.ts.map