export declare const WebRPCVersion = "v1"; export declare const WebRPCSchemaVersion = "v0.1.0"; export declare const WebRPCSchemaHash = "562a7e7a15dc77925b3f241a08d83c8c548ba5c3"; export declare enum IntentName { initiateAuth = "initiateAuth", openSession = "openSession", closeSession = "closeSession", validateSession = "validateSession", finishValidateSession = "finishValidateSession", listSessions = "listSessions", getSession = "getSession", sessionAuthProof = "sessionAuthProof", feeOptions = "feeOptions", signMessage = "signMessage", signTypedData = "signTypedData", sendTransaction = "sendTransaction", getTransactionReceipt = "getTransactionReceipt", federateAccount = "federateAccount", removeAccount = "removeAccount", listAccounts = "listAccounts", getIdToken = "getIdToken", adoptChildWallet = "adoptChildWallet", getAdopter = "getAdopter", confirmIntent = "confirmIntent", getConfirmationStatus = "getConfirmationStatus" } export declare enum IntentResponseCode { authInitiated = "authInitiated", sessionOpened = "sessionOpened", sessionClosed = "sessionClosed", sessionList = "sessionList", validationRequired = "validationRequired", validationStarted = "validationStarted", validationFinished = "validationFinished", sessionAuthProof = "sessionAuthProof", signedMessage = "signedMessage", signedTypedData = "signedTypedData", feeOptions = "feeOptions", transactionReceipt = "transactionReceipt", transactionFailed = "transactionFailed", getSessionResponse = "getSessionResponse", accountList = "accountList", accountFederated = "accountFederated", accountRemoved = "accountRemoved", idToken = "idToken", adopter = "adopter", childWalletAdopted = "childWalletAdopted", confirmationRequired = "confirmationRequired" } export declare enum IdentityType { None = "None", Guest = "Guest", OIDC = "OIDC", Email = "Email", PlayFab = "PlayFab", Stytch = "Stytch" } export interface Intent { version: string; name: IntentName; expiresAt: number; issuedAt: number; data: any; signatures: Array; } export interface Signature { sessionId: string; signature: string; } export interface IntentResponse { code: IntentResponseCode; data: any; } export declare enum Migration { OIDCToStytch = "OIDCToStytch", OIDCToEmail = "OIDCToEmail" } export interface Version { webrpcVersion: string; schemaVersion: string; schemaHash: string; appVersion: string; } export interface RuntimeStatus { healthOK: boolean; startTime: string; uptime: number; ver: string; pcr0: string; } export interface Chain { id: number; name: string; isEnabled: boolean; } export interface Identity { type: IdentityType; iss: string; sub: string; email: string; } export interface OpenIdProvider { iss: string; aud: Array; } export interface AuthEmailConfig { enabled: boolean; } export interface AuthGuestConfig { enabled: boolean; } export interface AuthPlayfabConfig { enabled: boolean; titleId?: string; } export interface AuthStytchConfig { enabled: boolean; projectId?: string; } export interface AuthConfig { email?: AuthEmailConfig; guest?: AuthGuestConfig; playfab?: AuthPlayfabConfig; stytch?: AuthStytchConfig; } export interface Tenant { projectId: number; version: number; oidcProviders: Array; allowedOrigins: Array; authConfig: AuthConfig; updatedAt: string; } export interface TenantData { projectId: number; privateKey: string; parentAddress: string; userSalt: string; sequenceContext: MiniSequenceContext; upgradeCode: string; waasAccessToken: string; authConfig: AuthConfig; oidcProviders: Array; kmsKeys: Array; allowedOrigins: Array; } export interface MiniSequenceContext { factory: string; mainModule: string; } export interface AccountData { projectId: number; userId: string; identity: string; createdAt: string; } export interface Session { id: string; projectId: number; userId: string; identity: Identity; friendlyName: string; createdAt: string; refreshedAt: string; expiresAt: string; } export interface SessionData { id: string; projectId: number; userId: string; identity: string; createdAt: string; expiresAt: string; } export interface VerificationContext { projectId: number; sessionId: string; identityType: IdentityType; verifier: string; challenge?: string; answer?: string; attempts: number; lastAttemptAt?: string; expiresAt: string; } export interface Page { limit?: number; after?: string; } export interface WaasAuthenticator { registerSession(args: RegisterSessionArgs, headers?: object, signal?: AbortSignal): Promise; sendIntent(args: SendIntentArgs, headers?: object, signal?: AbortSignal): Promise; chainList(headers?: object, signal?: AbortSignal): Promise; } export interface RegisterSessionArgs { intent: Intent; friendlyName: string; } export interface RegisterSessionReturn { session: Session; response: IntentResponse; } export interface SendIntentArgs { intent: Intent; } export interface SendIntentReturn { response: IntentResponse; } export interface ChainListArgs { } export interface ChainListReturn { chains: Array; } export interface WaasAuthenticatorAdmin { version(headers?: object, signal?: AbortSignal): Promise; runtimeStatus(headers?: object, signal?: AbortSignal): Promise; clock(headers?: object, signal?: AbortSignal): Promise; getTenant(args: GetTenantArgs, headers?: object, signal?: AbortSignal): Promise; createTenant(args: CreateTenantArgs, headers?: object, signal?: AbortSignal): Promise; updateTenant(args: UpdateTenantArgs, headers?: object, signal?: AbortSignal): Promise; nextMigrationBatch(args: NextMigrationBatchArgs, headers?: object, signal?: AbortSignal): Promise; processMigrationBatch(args: ProcessMigrationBatchArgs, headers?: object, signal?: AbortSignal): Promise; } export interface VersionArgs { } export interface VersionReturn { version: Version; } export interface RuntimeStatusArgs { } export interface RuntimeStatusReturn { status: RuntimeStatus; } export interface ClockArgs { } export interface ClockReturn { serverTime: string; } export interface GetTenantArgs { projectId: number; } export interface GetTenantReturn { tenant: Tenant; } export interface CreateTenantArgs { projectId: number; waasAccessToken: string; authConfig: AuthConfig; oidcProviders: Array; allowedOrigins: Array; password?: string; } export interface CreateTenantReturn { tenant: Tenant; upgradeCode: string; } export interface UpdateTenantArgs { projectId: number; upgradeCode: string; authConfig: AuthConfig; oidcProviders: Array; allowedOrigins: Array; } export interface UpdateTenantReturn { tenant: Tenant; } export interface NextMigrationBatchArgs { migration: Migration; projectId: number; page: Page; } export interface NextMigrationBatchReturn { page: Page; items: Array; } export interface ProcessMigrationBatchArgs { migration: Migration; projectId: number; items: Array; } export interface ProcessMigrationBatchReturn { logs: { [key: string]: Array; }; errors: { [key: string]: string; }; } export declare class WaasAuthenticator implements WaasAuthenticator { protected hostname: string; protected fetch: Fetch; protected path: string; constructor(hostname: string, fetch: Fetch); private url; registerSession: (args: RegisterSessionArgs, headers?: object, signal?: AbortSignal) => Promise; sendIntent: (args: SendIntentArgs, headers?: object, signal?: AbortSignal) => Promise; chainList: (headers?: object, signal?: AbortSignal) => Promise; } export declare class WaasAuthenticatorAdmin implements WaasAuthenticatorAdmin { protected hostname: string; protected fetch: Fetch; protected path: string; constructor(hostname: string, fetch: Fetch); private url; version: (headers?: object, signal?: AbortSignal) => Promise; runtimeStatus: (headers?: object, signal?: AbortSignal) => Promise; clock: (headers?: object, signal?: AbortSignal) => Promise; getTenant: (args: GetTenantArgs, headers?: object, signal?: AbortSignal) => Promise; createTenant: (args: CreateTenantArgs, headers?: object, signal?: AbortSignal) => Promise; updateTenant: (args: UpdateTenantArgs, headers?: object, signal?: AbortSignal) => Promise; nextMigrationBatch: (args: NextMigrationBatchArgs, headers?: object, signal?: AbortSignal) => Promise; processMigrationBatch: (args: ProcessMigrationBatchArgs, headers?: object, signal?: AbortSignal) => Promise; } export declare class WebrpcError extends Error { name: string; code: number; message: string; status: number; cause?: string; /** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */ msg: string; constructor(name: string, code: number, message: string, status: number, cause?: string); static new(payload: any): WebrpcError; } export declare class WebrpcEndpointError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcRequestFailedError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcBadRouteError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcBadMethodError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcBadRequestError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcBadResponseError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcServerPanicError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcInternalErrorError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcClientDisconnectedError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcStreamLostError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class WebrpcStreamFinishedError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class UnauthorizedError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class TenantNotFoundError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class EmailAlreadyInUseError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class AccountAlreadyLinkedError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class ProofVerificationFailedError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class AnswerIncorrectError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class ChallengeExpiredError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare class TooManyAttemptsError extends WebrpcError { constructor(name?: string, code?: number, message?: string, status?: number, cause?: string); } export declare enum errors { WebrpcEndpoint = "WebrpcEndpoint", WebrpcRequestFailed = "WebrpcRequestFailed", WebrpcBadRoute = "WebrpcBadRoute", WebrpcBadMethod = "WebrpcBadMethod", WebrpcBadRequest = "WebrpcBadRequest", WebrpcBadResponse = "WebrpcBadResponse", WebrpcServerPanic = "WebrpcServerPanic", WebrpcInternalError = "WebrpcInternalError", WebrpcClientDisconnected = "WebrpcClientDisconnected", WebrpcStreamLost = "WebrpcStreamLost", WebrpcStreamFinished = "WebrpcStreamFinished", Unauthorized = "Unauthorized", TenantNotFound = "TenantNotFound", EmailAlreadyInUse = "EmailAlreadyInUse", AccountAlreadyLinked = "AccountAlreadyLinked", ProofVerificationFailed = "ProofVerificationFailed", AnswerIncorrect = "AnswerIncorrect", ChallengeExpired = "ChallengeExpired", TooManyAttempts = "TooManyAttempts" } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise;