import { CWIStyleWalletManager, UMPTokenInteractor } from './CWIStyleWalletManager'; import { PrivilegedKeyManager } from './sdk/PrivilegedKeyManager'; import { WalletInterface, TelemetryConfig } from '@bsv/sdk'; import { WABClient } from './wab-client/WABClient'; import { AuthMethodInteractor, AuthPayload } from './wab-client/auth-method-interactors/AuthMethodInteractor'; export interface WalletAuthenticationManagerOptions { telemetry?: TelemetryConfig; /** Maximum lifetime of a temporary WAB presentation key. Defaults to 10 minutes. */ authSessionTtlMs?: number; /** Durable store for the unpublished encrypted UMP token, before faucet redemption. */ pendingRegistrationTokenSaver?: (token: number[]) => Promise; } export declare class WABAccountContinuityError extends Error { readonly code = "WERR_WAB_ACCOUNT_CONTINUITY"; constructor(message?: string); } /** * WalletAuthenticationManager * * A wallet manager that integrates * with a WABClient for user authentication flows (e.g. Twilio phone). */ export declare class WalletAuthenticationManager extends CWIStyleWalletManager { private readonly wabClient; private authMethod?; private authSession?; private phoneChangeSession?; private pendingRegistrationPresentationKey?; private pendingWABRegistrationResumed; private readonly authSessionTtlMs; constructor(...[adminOriginator, walletBuilder, interactor, recoveryKeySaver, passwordRetriever, wabClient, authMethod, stateSnapshot, options]: [ adminOriginator: string, walletBuilder: (primaryKey: number[], privilegedKeyManager: PrivilegedKeyManager) => Promise, interactor: UMPTokenInteractor | undefined, recoveryKeySaver: (key: number[]) => Promise, passwordRetriever: (reason: string, test: (passwordCandidate: string) => boolean | Promise) => Promise, wabClient: WABClient, authMethod?: AuthMethodInteractor, stateSnapshot?: number[], options?: WalletAuthenticationManagerOptions ]); /** * Sets (or switches) the chosen AuthMethodInteractor at runtime, * in case the user changes their mind or picks a new method in the UI. */ setAuthMethod(method: AuthMethodInteractor): void; /** * Initiate the WAB-based flow, e.g. sending an SMS code or starting an ID check, * using the chosen AuthMethodInteractor. */ startAuth(payload: AuthPayload): Promise; /** * Completes the WAB-based flow, retrieving the final presentationKey from WAB if successful. */ completeAuth(payload: AuthPayload): Promise; cancelAuth(): void; /** * Publishes a new UMP token before committing WAB's registration state. * Finalization is deliberately best-effort: if its response is lost, the * next verified login finds the UMP token and repairs WAB idempotently. */ providePassword(password: string): Promise; private readRegistrationStatus; private assertAccountContinuity; private reconcilePendingRegistration; private describeContinuity; private finalizePendingRegistration; private readPendingPhoneChange; private provideWABPresentationKey; private finalizePendingPhoneChange; /** * Starts OTP verification for a replacement phone number. The same number * is valid and intentionally produces a fresh presentation key/hash. */ startPhoneNumberChange(phoneNumber: string): Promise; /** * Completes phone verification and stages the WAB association before * publishing the UMP key rotation. WAB retains both the current and pending * presentation keys until finalization, so either side of an interrupted * transition remains recoverable on the next verified login. */ completePhoneNumberChange(otp: string): Promise<{ changeId: number; }>; cancelPhoneNumberChange(): void; destroy(): void; private phoneChange; private inferAccountStatus; private constantTimeHexEqual; private generateTemporaryPresentationKey; } //# sourceMappingURL=WalletAuthenticationManager.d.ts.map