import { SessionInfo } from "./mfa_pb.js"; import { Message } from "@bufbuild/protobuf"; import { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { Timestamp } from "@bufbuild/protobuf/wkt"; declare namespace auth_pb_d_exports { export { AcceptTermsRequest, AcceptTermsRequestSchema, AcceptTermsResponse, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetail, AuthErrorDetailSchema, AuthService, CreateWalletChallengeRequest, CreateWalletChallengeRequestSchema, CreateWalletChallengeResponse, CreateWalletChallengeResponseSchema, LoginWithWalletRequest, LoginWithWalletRequestSchema, LoginWithWalletResponse, LoginWithWalletResponseSchema, MeRequest, MeRequestSchema, MeResponse, MeResponseSchema, WalletChallengePurpose, WalletChallengePurposeSchema, file_auth_v1_auth }; } /** * Describes the file auth/v1/auth.proto. */ declare const file_auth_v1_auth: GenFile; /** * CreateWalletChallengeRequest requests a short-lived EIP-4361 message whose * exact UTF-8 bytes must be signed by the wallet. * * @generated from message auth.v1.CreateWalletChallengeRequest */ type CreateWalletChallengeRequest = Message<"auth.v1.CreateWalletChallengeRequest"> & { /** * Smart-account EVM address being authenticated, formatted as 0x plus 40 hex characters. * * @generated from field: string smart_account_address = 1; */ smartAccountAddress: string; /** * Address whose signature authorizes the challenge and that is written into * the EIP-4361 message. This must be an EOA that controls the target smart account. * * @generated from field: string signer_address = 2; */ signerAddress: string; /** * Browser origin URI requesting the signature, including scheme and optional * port but no path, query, fragment, or user information. * * @generated from field: string uri = 3; */ uri: string; /** * Operation for which the challenge may be consumed. Must be LOGIN. * * @generated from field: auth.v1.WalletChallengePurpose purpose = 4; */ purpose: WalletChallengePurpose; }; /** * Describes the message auth.v1.CreateWalletChallengeRequest. * Use `create(CreateWalletChallengeRequestSchema)` to create a new message. */ declare const CreateWalletChallengeRequestSchema: GenMessage; /** * CreateWalletChallengeResponse contains the canonical EIP-4361 message. * * @generated from message auth.v1.CreateWalletChallengeResponse */ type CreateWalletChallengeResponse = Message<"auth.v1.CreateWalletChallengeResponse"> & { /** * Canonical EIP-4361 message. Sign these UTF-8 bytes exactly once with * personal_sign; do not hash, alter, or reconstruct the message. * * @generated from field: string message = 1; */ message: string; /** * Time in UTC when the challenge expires. Wallet challenges expire after 5 minutes. * * @generated from field: google.protobuf.Timestamp expires_at = 2; */ expiresAt?: Timestamp | undefined; }; /** * Describes the message auth.v1.CreateWalletChallengeResponse. * Use `create(CreateWalletChallengeResponseSchema)` to create a new message. */ declare const CreateWalletChallengeResponseSchema: GenMessage; /** * LoginWithWalletRequest completes smart-account wallet login using the exact * server-issued EIP-4361 message and its signature. * * @generated from message auth.v1.LoginWithWalletRequest */ type LoginWithWalletRequest = Message<"auth.v1.LoginWithWalletRequest"> & { /** * Smart-account EVM address bound into the challenge resource, formatted as * 0x plus 40 hex characters. * * @generated from field: string smart_account_address = 1; */ smartAccountAddress: string; /** * EOA signature over message using EIP-191 personal_sign semantics. A valid * value is 65 bytes of hexadecimal with an optional 0x prefix. Requests are * limited to 8192 characters. * * @generated from field: string signature = 3; */ signature: string; /** * Optional user-agent string for account security and audit displays. Maximum * length is 512 characters. * * @generated from field: string user_agent = 4; */ userAgent: string; /** * Optional caller IP address for account security and audit displays. Maximum * length is 64 characters. * * @generated from field: string ip = 5; */ ip: string; /** * Optional provider hint for the signing wallet. Maximum length is 32 characters. * * @generated from field: string wallet_provider = 7; */ walletProvider: string; /** * Exact EIP-4361 message returned by CreateWalletChallenge. Maximum length is * 4096 UTF-8 bytes. * * @generated from field: string message = 8; */ message: string; }; /** * Describes the message auth.v1.LoginWithWalletRequest. * Use `create(LoginWithWalletRequestSchema)` to create a new message. */ declare const LoginWithWalletRequestSchema: GenMessage; /** * LoginWithWalletResponse returns a session token for the authenticated root * account. * * @generated from message auth.v1.LoginWithWalletResponse */ type LoginWithWalletResponse = Message<"auth.v1.LoginWithWalletResponse"> & { /** * Bearer access token for authenticated API calls. * * @generated from field: string access_token = 1; */ accessToken: string; /** * Time in UTC when access_token expires. * * @generated from field: google.protobuf.Timestamp expires_at = 2; */ expiresAt?: Timestamp | undefined; /** * Root account the token is bound to (opaque ID). * * @generated from field: fixed64 account_id = 10; */ accountId: bigint; /** * Optional current username for the root account (empty if not set). * * @generated from field: string username = 13; */ username: string; /** * Session assurance details for the issued access token. * * @generated from field: auth.v1.SessionInfo session = 20; */ session?: SessionInfo | undefined; }; /** * Describes the message auth.v1.LoginWithWalletResponse. * Use `create(LoginWithWalletResponseSchema)` to create a new message. */ declare const LoginWithWalletResponseSchema: GenMessage; /** * MeRequest introspects the authenticated caller from the presented access * token or API key. * * @generated from message auth.v1.MeRequest */ type MeRequest = Message<"auth.v1.MeRequest"> & {}; /** * Describes the message auth.v1.MeRequest. * Use `create(MeRequestSchema)` to create a new message. */ declare const MeRequestSchema: GenMessage; /** * MeResponse describes the authenticated caller and current session context. * * @generated from message auth.v1.MeResponse */ type MeResponse = Message<"auth.v1.MeResponse"> & { /** * Root account identifier (opaque ID). * * @generated from field: fixed64 account_id = 1; */ accountId: bigint; /** * Stable public identifier of the API key that authenticated this request, * formatted as "ak_" followed by 32 lowercase hexadecimal characters. * Absent when the request was not authenticated with an API key. * * @generated from field: optional string api_key_id = 10; */ apiKeyId?: string | undefined; /** * Optional current username for the root account (empty if not set). * * @generated from field: string username = 11; */ username: string; /** * Root smart-account EVM address, formatted as 0x plus 40 hex characters. * Empty if not set. * * @generated from field: string root_smart_account_address = 12; */ rootSmartAccountAddress: string; /** * Session assurance details for the presented access token, if any. * * @generated from field: auth.v1.SessionInfo session = 20; */ session?: SessionInfo | undefined; }; /** * Describes the message auth.v1.MeResponse. * Use `create(MeResponseSchema)` to create a new message. */ declare const MeResponseSchema: GenMessage; /** * AuthErrorDetail describes an authentication or account-domain failure. * * @generated from message auth.v1.AuthErrorDetail */ type AuthErrorDetail = Message<"auth.v1.AuthErrorDetail"> & { /** * Stable machine-readable auth error code. * * @generated from field: auth.v1.AuthErrorCode code = 1; */ code: AuthErrorCode; /** * Human-readable error message. * * @generated from field: string message = 2; */ message: string; }; /** * Describes the message auth.v1.AuthErrorDetail. * Use `create(AuthErrorDetailSchema)` to create a new message. */ declare const AuthErrorDetailSchema: GenMessage; /** * AcceptTermsRequest records explicit consent to the terms that apply to the caller's root account. * * @generated from message auth.v1.AcceptTermsRequest */ type AcceptTermsRequest = Message<"auth.v1.AcceptTermsRequest"> & {}; /** * Describes the message auth.v1.AcceptTermsRequest. * Use `create(AcceptTermsRequestSchema)` to create a new message. */ declare const AcceptTermsRequestSchema: GenMessage; /** * AcceptTermsResponse confirms acceptance. Repeated requests succeed and * preserve the first acceptance time. * * @generated from message auth.v1.AcceptTermsResponse */ type AcceptTermsResponse = Message<"auth.v1.AcceptTermsResponse"> & {}; /** * Describes the message auth.v1.AcceptTermsResponse. * Use `create(AcceptTermsResponseSchema)` to create a new message. */ declare const AcceptTermsResponseSchema: GenMessage; /** * Purpose for a server-issued wallet challenge. * * @generated from enum auth.v1.WalletChallengePurpose */ declare enum WalletChallengePurpose { /** * No wallet challenge purpose was specified. * * @generated from enum value: WALLET_PROOF_UNSPECIFIED = 0; */ WALLET_PROOF_UNSPECIFIED = 0, /** * Authenticate the wallet and create a Polyester session. * * @generated from enum value: LOGIN = 1; */ LOGIN = 1 } /** * Describes the enum auth.v1.WalletChallengePurpose. */ declare const WalletChallengePurposeSchema: GenEnum; /** * High-level error codes for authentication and account-domain failures. * * @generated from enum auth.v1.AuthErrorCode */ declare enum AuthErrorCode { /** * No auth error code specified. * * @generated from enum value: AUTH_UNSPECIFIED = 0; */ AUTH_UNSPECIFIED = 0, /** * Username format or characters are invalid. * * @generated from enum value: AUTH_USERNAME_INVALID = 1; */ AUTH_USERNAME_INVALID = 1, /** * Username is already used by another account. * * @generated from enum value: AUTH_USERNAME_TAKEN = 2; */ AUTH_USERNAME_TAKEN = 2, /** * Username was changed too recently. * * @generated from enum value: AUTH_USERNAME_COOLDOWN = 3; */ AUTH_USERNAME_COOLDOWN = 3, /** * Account is not currently eligible to claim or change a username. * * @generated from enum value: AUTH_USERNAME_FEATURE_LOCKED = 4; */ AUTH_USERNAME_FEATURE_LOCKED = 4, /** * Username is reserved and cannot be claimed by this account. * * @generated from enum value: AUTH_USERNAME_RESERVED = 5; */ AUTH_USERNAME_RESERVED = 5, /** * Request is malformed or missing required input. * * @generated from enum value: AUTH_INVALID_REQUEST = 6; */ AUTH_INVALID_REQUEST = 6, /** * Authentication is required for this operation. * * @generated from enum value: AUTH_AUTHENTICATION_REQUIRED = 7; */ AUTH_AUTHENTICATION_REQUIRED = 7, /** * Presented session type is not allowed for this operation. * * @generated from enum value: AUTH_SESSION_KIND_NOT_ALLOWED = 8; */ AUTH_SESSION_KIND_NOT_ALLOWED = 8, /** * Wallet login failed because the nonce or signature could not be verified. * * @generated from enum value: AUTH_WALLET_LOGIN_FAILED = 9; */ AUTH_WALLET_LOGIN_FAILED = 9, /** * Requested resource was not found. * * @generated from enum value: AUTH_RESOURCE_NOT_FOUND = 10; */ AUTH_RESOURCE_NOT_FOUND = 10, /** * Caller does not have access to the requested sub-account. * * @generated from enum value: AUTH_SUBACCOUNT_ACCESS_DENIED = 11; */ AUTH_SUBACCOUNT_ACCESS_DENIED = 11, /** * Caller does not have access to the requested API key. * * @generated from enum value: AUTH_API_KEY_ACCESS_DENIED = 12; */ AUTH_API_KEY_ACCESS_DENIED = 12, /** * Requested API key status transition is not allowed. * * @generated from enum value: AUTH_API_KEY_INVALID_STATUS_TRANSITION = 14; */ AUTH_API_KEY_INVALID_STATUS_TRANSITION = 14, /** * Policy definition or binding is invalid. * * @generated from enum value: AUTH_POLICY_INVALID = 15; */ AUTH_POLICY_INVALID = 15, /** * Smart-account address is already linked to another account. * * @generated from enum value: AUTH_SMART_ACCOUNT_ALREADY_LINKED = 16; */ AUTH_SMART_ACCOUNT_ALREADY_LINKED = 16, /** * Caller does not have access to the requested invite. * * @generated from enum value: AUTH_INVITE_ACCESS_DENIED = 17; */ AUTH_INVITE_ACCESS_DENIED = 17, /** * Invite cannot be used in its current state. * * @generated from enum value: AUTH_INVITE_INVALID_STATE = 18; */ AUTH_INVITE_INVALID_STATE = 18, /** * MFA is not available for this account. * * @generated from enum value: AUTH_MFA_DISABLED = 19; */ AUTH_MFA_DISABLED = 19, /** * Required MFA factor is not enrolled. * * @generated from enum value: AUTH_MFA_NOT_ENROLLED = 20; */ AUTH_MFA_NOT_ENROLLED = 20, /** * MFA session is missing, expired, or invalid. * * @generated from enum value: AUTH_MFA_SESSION_INVALID = 21; */ AUTH_MFA_SESSION_INVALID = 21, /** * MFA challenge was not found. * * @generated from enum value: AUTH_MFA_CHALLENGE_NOT_FOUND = 22; */ AUTH_MFA_CHALLENGE_NOT_FOUND = 22, /** * MFA challenge payload is invalid. * * @generated from enum value: AUTH_MFA_CHALLENGE_INVALID = 23; */ AUTH_MFA_CHALLENGE_INVALID = 23, /** * MFA challenge is locked after too many failed attempts. * * @generated from enum value: AUTH_MFA_CHALLENGE_LOCKED = 24; */ AUTH_MFA_CHALLENGE_LOCKED = 24, /** * One-time password is invalid. * * @generated from enum value: AUTH_MFA_OTP_INVALID = 25; */ AUTH_MFA_OTP_INVALID = 25, /** * Recovery code is invalid. * * @generated from enum value: AUTH_MFA_RECOVERY_INVALID = 26; */ AUTH_MFA_RECOVERY_INVALID = 26, /** * Passkey verification is not available for this challenge. * * @generated from enum value: AUTH_MFA_PASSKEY_NOT_AVAILABLE = 27; */ AUTH_MFA_PASSKEY_NOT_AVAILABLE = 27, /** * Passkey credential is invalid for this account or challenge. * * @generated from enum value: AUTH_MFA_PASSKEY_CREDENTIAL_INVALID = 28; */ AUTH_MFA_PASSKEY_CREDENTIAL_INVALID = 28, /** * Passkey verification failed. * * @generated from enum value: AUTH_MFA_PASSKEY_VERIFY_FAILED = 29; */ AUTH_MFA_PASSKEY_VERIFY_FAILED = 29, /** * MFA enrollment binding is invalid or expired. * * @generated from enum value: AUTH_MFA_ENROLLMENT_BINDING_INVALID = 30; */ AUTH_MFA_ENROLLMENT_BINDING_INVALID = 30, /** * A fresh step-up proof is required for this protected operation. * * @generated from enum value: AUTH_STEP_UP_REQUIRED = 31; */ AUTH_STEP_UP_REQUIRED = 31, /** * A requested step-up proof is unavailable. * * @generated from enum value: AUTH_STEP_UP_PROOF_UNAVAILABLE = 32; */ AUTH_STEP_UP_PROOF_UNAVAILABLE = 32, /** * The step-up proof has already been claimed. * * @generated from enum value: AUTH_STEP_UP_ALREADY_CLAIMED = 33; */ AUTH_STEP_UP_ALREADY_CLAIMED = 33, /** * The requested policy cannot be removed because it is still in use. * * @generated from enum value: AUTH_POLICY_IN_USE = 34; */ AUTH_POLICY_IN_USE = 34, /** * The requested policy is locked against this mutation. * * @generated from enum value: AUTH_POLICY_LOCKED = 35; */ AUTH_POLICY_LOCKED = 35, /** * The requested policy does not belong to the target account scope. * * @generated from enum value: AUTH_POLICY_SCOPE_MISMATCH = 36; */ AUTH_POLICY_SCOPE_MISMATCH = 36, /** * The resource changed after the caller read it. * * @generated from enum value: AUTH_REVISION_CONFLICT = 37; */ AUTH_REVISION_CONFLICT = 37, /** * A recently MFA-elevated interactive session is required. * * @generated from enum value: AUTH_MFA_ELEVATION_REQUIRED = 38; */ AUTH_MFA_ELEVATION_REQUIRED = 38, /** * At least one active MFA factor must remain enrolled. * * @generated from enum value: AUTH_MFA_LAST_FACTOR_REQUIRED = 39; */ AUTH_MFA_LAST_FACTOR_REQUIRED = 39, /** * An unexpected internal failure prevented the auth mutation from completing. * * @generated from enum value: AUTH_INTERNAL_ERROR = 40; */ AUTH_INTERNAL_ERROR = 40, /** * The caller has not accepted the terms required for this action. * * @generated from enum value: AUTH_TERMS_NOT_ACCEPTED = 41; */ AUTH_TERMS_NOT_ACCEPTED = 41, /** * Social verification challenge expired. Start a new verification, then mark it ready again. * * @generated from enum value: AUTH_SOCIAL_VERIFICATION_EXPIRED = 42; */ AUTH_SOCIAL_VERIFICATION_EXPIRED = 42, /** * Social verification cannot accept a ready mark in its current state. * * @generated from enum value: AUTH_SOCIAL_VERIFICATION_INVALID_STATE = 43; */ AUTH_SOCIAL_VERIFICATION_INVALID_STATE = 43, /** * Sub-account authorization is expired, replaced, replayed, or invalid. * * @generated from enum value: AUTH_SUBACCOUNT_CHALLENGE_INVALID = 44; */ AUTH_SUBACCOUNT_CHALLENGE_INVALID = 44, /** * Social account is already linked to another Polyester account. * * @generated from enum value: AUTH_SOCIAL_ACCOUNT_ALREADY_LINKED = 45; */ AUTH_SOCIAL_ACCOUNT_ALREADY_LINKED = 45 } /** * Describes the enum auth.v1.AuthErrorCode. */ declare const AuthErrorCodeSchema: GenEnum; /** * AuthService manages wallet login, explicit terms consent, and caller authentication context. * * @generated from service auth.v1.AuthService */ declare const AuthService: GenService<{ /** * Create a short-lived EIP-4361 wallet challenge. * * @generated from rpc auth.v1.AuthService.CreateWalletChallenge */ createWalletChallenge: { methodKind: "unary"; input: typeof CreateWalletChallengeRequestSchema; output: typeof CreateWalletChallengeResponseSchema; }; /** * Verify a signed EIP-4361 message and issue an access token. Login and account creation * do not accept terms; explicit consent is recorded only by AcceptTerms. * * @generated from rpc auth.v1.AuthService.LoginWithWallet */ loginWithWallet: { methodKind: "unary"; input: typeof LoginWithWalletRequestSchema; output: typeof LoginWithWalletResponseSchema; }; /** * Explicitly accept the terms that apply to the caller's root account. * Requires an interactive JWT session; API keys are not allowed. Login, trading, * reads, and use of existing resources remain available without acceptance. * Acceptance is required before creating a subaccount, API key, or deposit address. * * @generated from rpc auth.v1.AuthService.AcceptTerms */ acceptTerms: { methodKind: "unary"; input: typeof AcceptTermsRequestSchema; output: typeof AcceptTermsResponseSchema; }; /** * Return the caller's current auth context. * * @generated from rpc auth.v1.AuthService.Me */ me: { methodKind: "unary"; input: typeof MeRequestSchema; output: typeof MeResponseSchema; }; }>; //#endregion export { AcceptTermsRequest, AcceptTermsRequestSchema, AcceptTermsResponse, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetail, AuthErrorDetailSchema, AuthService, CreateWalletChallengeRequest, CreateWalletChallengeRequestSchema, CreateWalletChallengeResponse, CreateWalletChallengeResponseSchema, LoginWithWalletRequest, LoginWithWalletRequestSchema, LoginWithWalletResponse, LoginWithWalletResponseSchema, MeRequest, MeRequestSchema, MeResponse, MeResponseSchema, WalletChallengePurpose, WalletChallengePurposeSchema, auth_pb_d_exports, file_auth_v1_auth }; //# sourceMappingURL=auth_pb.d.ts.map