import { AuthAndPublicApiTransports } from "../../shared/transports.js"; import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js"; import { PolyesterRealtime } from "../../realtime/types.js"; import "../../realtime/index.js"; import { ProfileService } from "./profile/profile.js"; import * as v from "valibot"; //#region src/services/auth/auth.d.ts declare const CreateWalletChallengeInputSchema: v.StrictObjectSchema<{ readonly smartAccountAddress: v.SchemaWithPipe, v.CheckAction]>; readonly signerAddress: v.SchemaWithPipe, v.CheckAction]>; readonly uri: v.SchemaWithPipe, v.MaxLengthAction, v.CheckAction]>; }, undefined>; type CreateWalletChallengeInput = v.InferInput; declare const LoginWithWalletInputSchema: v.StrictObjectSchema<{ readonly smartAccountAddress: v.SchemaWithPipe, v.CheckAction]>; readonly message: v.SchemaWithPipe, v.MinLengthAction, v.CheckAction]>; readonly signature: v.SchemaWithPipe, v.RegexAction]>; readonly userAgent: v.OptionalSchema, "">; readonly ip: v.OptionalSchema, "">; readonly walletProvider: v.OptionalSchema, "">; }, undefined>; type LoginWithWalletInput = v.InferInput; declare const MeSchema: v.ObjectSchema<{ readonly accountId: v.SchemaWithPipe, v.TransformAction]>; readonly apiKeyId: v.OptionalSchema, undefined>; readonly username: v.StringSchema; readonly session: v.OptionalSchema; readonly sessionLevel: v.SchemaWithPipe, v.TransformAction]>; readonly authenticationMethods: v.OptionalSchema, undefined>, readonly []>; readonly authTime: v.SchemaWithPipe; readonly nanos: v.OptionalSchema, 0>; }, undefined>, undefined>, v.TransformAction<{ seconds: bigint; nanos: number; } | undefined, number | undefined>]>; }, undefined>, v.TransformAction<{ sessionId: string; sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp"; authenticationMethods: string[]; authTime?: number | undefined; }, { sessionId: string; sessionLevel: "unspecified" | "primaryAuthenticated" | "mfaElevated" | "freshStepUp"; authenticationMethods: string[]; authTimeMs: number | undefined; }>]>, undefined>; }, undefined>; type Me = v.InferOutput; declare const LoginWithWalletResponseSchema: v.ObjectSchema<{ readonly accessToken: v.StringSchema; readonly expiresAt: v.OptionalSchema; readonly nanos: v.OptionalSchema, 0>; }, undefined>, undefined>; readonly accountId: v.SchemaWithPipe, v.TransformAction]>; readonly username: v.StringSchema; }, undefined>; type LoginWithWalletResponse = v.InferOutput; declare const WalletChallengeSchema: v.ObjectSchema<{ readonly message: v.SchemaWithPipe, v.MinLengthAction, v.CheckAction]>; readonly expiresAt: v.SchemaWithPipe; readonly nanos: v.OptionalSchema, 0>; }, undefined>, undefined>, v.TransformAction<{ seconds: bigint; nanos: number; } | undefined, number | undefined>]>; }, undefined>; type WalletChallenge = v.InferOutput; /** * Handles wallet-based authentication, caller introspection, and authenticated profile operations. */ declare class AuthService { #private; profile: ProfileService; constructor(transports: AuthAndPublicApiTransports, realtime: PolyesterRealtime); /** * Returns the authenticated caller's account context, including account ID, optional API key ID, username, and session assurance details from the presented token or API key. */ me(options?: PolyesterRequestOptions): Promise; /** * Records explicit consent to the current terms for the caller's root account. * Call only after the user consents. Requires an interactive JWT session; * API keys are not allowed. Repeated acceptance succeeds without changing * the first acceptance time. No MFA is required. */ acceptTerms(options?: PolyesterMutationOptions): Promise; /** * Requests a server-issued SIWE login message. Sign its exact UTF-8 bytes with * personal_sign; do not hash or reconstruct it. Expiry is epoch milliseconds. * The backend sets SIWE Chain ID to Ethereum mainnet (1) and binds the * Polyester chain in Resources. Do not send a chain ID or rewrite either binding. * Wallet adapters must select Ethereum mainnet before signing if required by the wallet. * Subaccount creation uses `subaccounts.createChallenge` instead. */ createWalletChallenge(input: CreateWalletChallengeInput, options?: PolyesterRequestOptions): Promise; /** * Exchanges a signed SIWE message for an authenticated session token and account identity returned by the auth API. */ protected loginWithWallet(input: LoginWithWalletInput, options?: PolyesterMutationOptions): Promise; } //#endregion export { AuthService, CreateWalletChallengeInput, CreateWalletChallengeInputSchema, LoginWithWalletInput, LoginWithWalletInputSchema, LoginWithWalletResponse, Me, WalletChallenge }; //# sourceMappingURL=auth.d.ts.map