import { t as InferOptionSchema } from "./plugins-DLdyc73z.mjs"; import * as z from "zod"; import * as better_call65 from "better-call"; //#region src/plugins/siwe/schema.d.ts declare const schema: { walletAddress: { fields: { userId: { type: "string"; references: { model: string; field: string; }; required: true; index: true; }; address: { type: "string"; required: true; }; chainId: { type: "number"; required: true; }; isPrimary: { type: "boolean"; defaultValue: false; }; createdAt: { type: "date"; required: true; }; }; }; }; //#endregion //#region src/plugins/siwe/types.d.ts interface CacaoHeader { t: "caip122"; } interface CacaoPayload { domain: string; aud: string; nonce: string; iss: string; version?: string | undefined; iat?: string | undefined; nbf?: string | undefined; exp?: string | undefined; statement?: string | undefined; requestId?: string | undefined; resources?: string[] | undefined; type?: string | undefined; } interface Cacao { h: CacaoHeader; p: CacaoPayload; s: { t: "eip191" | "eip1271"; s: string; m?: string | undefined; }; } interface SIWEVerifyMessageArgs { message: string; signature: string; address: string; chainId: number; cacao?: Cacao | undefined; } interface ENSLookupArgs { walletAddress: string; } interface ENSLookupResult { name: string; avatar: string; } //#endregion //#region src/plugins/siwe/index.d.ts interface SIWEPluginOptions { domain: string; emailDomainName?: string | undefined; anonymous?: boolean | undefined; getNonce: () => Promise; verifyMessage: (args: SIWEVerifyMessageArgs) => Promise; ensLookup?: ((args: ENSLookupArgs) => Promise) | undefined; schema?: InferOptionSchema | undefined; } declare const siwe: (options: SIWEPluginOptions) => { id: "siwe"; schema: { walletAddress: { fields: { userId: { type: "string"; references: { model: string; field: string; }; required: true; index: true; }; address: { type: "string"; required: true; }; chainId: { type: "number"; required: true; }; isPrimary: { type: "boolean"; defaultValue: false; }; createdAt: { type: "date"; required: true; }; }; }; }; endpoints: { getSiweNonce: better_call65.StrictEndpoint<"/siwe/nonce", { method: "POST"; body: z.ZodObject<{ walletAddress: z.ZodString; chainId: z.ZodDefault>; }, z.core.$strip>; } & { use: any[]; }, { nonce: string; }>; verifySiweMessage: better_call65.StrictEndpoint<"/siwe/verify", { method: "POST"; body: z.ZodObject<{ message: z.ZodString; signature: z.ZodString; walletAddress: z.ZodString; chainId: z.ZodDefault>; email: z.ZodOptional; }, z.core.$strip>; requireRequest: true; } & { use: any[]; }, { token: string; success: boolean; user: { id: string; walletAddress: string; chainId: number; }; }>; }; }; //#endregion export { siwe as n, SIWEPluginOptions as t };