import { OpenfortError, type OpenfortErrorOptions } from './base.js'; /** The chain family a wallet error happened on, used to build its message. */ export type WalletChain = 'Ethereum' | 'Solana'; /** * An embedded or external wallet operation failed. * * @example * ```ts * import { WalletError } from '@openfort/react' * * const error = new WalletError('The wallet request failed.') * console.log(error.shortMessage) * ``` */ export declare class WalletError extends OpenfortError { name: string; constructor(shortMessage: string, options?: OpenfortErrorOptions); } /** * Creating an embedded wallet failed. * * @example * ```ts * import { WalletCreationError } from '@openfort/react' * * const error = new WalletCreationError({ chain: 'Ethereum' }) * console.log(error.shortMessage) * ``` */ export declare class WalletCreationError extends WalletError { name: string; constructor({ chain, ...options }: OpenfortErrorOptions & { chain: WalletChain; }); } /** * Importing an existing key into an embedded wallet failed. * * @example * ```ts * import { WalletImportError } from '@openfort/react' * * const error = new WalletImportError({ chain: 'Solana' }) * console.log(error.shortMessage) * ``` */ export declare class WalletImportError extends WalletError { name: string; constructor({ chain, ...options }: OpenfortErrorOptions & { chain: WalletChain; }); } /** * Switching the active embedded wallet failed. * * @example * ```ts * import { SetActiveWalletError } from '@openfort/react' * * const error = new SetActiveWalletError({ chain: 'Ethereum' }) * console.log(error.shortMessage) * ``` */ export declare class SetActiveWalletError extends WalletError { name: string; constructor({ chain, ...options }: OpenfortErrorOptions & { chain: WalletChain; }); } /** * No wallet is available for the requested operation. * * @example * ```ts * import { WalletNotFoundError } from '@openfort/react' * * const error = new WalletNotFoundError() * console.log(error.name) * ``` */ export declare class WalletNotFoundError extends WalletError { name: string; constructor(shortMessage?: string, options?: OpenfortErrorOptions); } /** * A wallet exists but is not connected, so it cannot sign or read accounts. * * @example * ```ts * import { WalletNotConnectedError } from '@openfort/react' * * const error = new WalletNotConnectedError() * console.log(error.name) * ``` */ export declare class WalletNotConnectedError extends WalletError { name: string; constructor(shortMessage?: string, options?: OpenfortErrorOptions); } /** * The embedded wallet provider has not finished booting. * * @example * ```ts * import { ProviderNotReadyError } from '@openfort/react' * * const error = new ProviderNotReadyError() * console.log(error.name) * ``` */ export declare class ProviderNotReadyError extends WalletError { name: string; constructor(shortMessage?: string, options?: OpenfortErrorOptions); } /** * Configuring or running embedded wallet recovery failed. * * @example * ```ts * import { RecoveryError } from '@openfort/react' * * const error = new RecoveryError('Automatic recovery failed.') * console.log(error.shortMessage) * ``` */ export declare class RecoveryError extends WalletError { name: string; constructor(shortMessage: string, options?: OpenfortErrorOptions); } /** * Recovery cannot proceed until the user supplies a one-time code. * * `canRequestOtp` reflects whether the app configured a way to send that code; * when it did not, the message says which option to set. * * @example * ```ts * import { OtpRequiredError } from '@openfort/react' * * const error = new OtpRequiredError({ canRequestOtp: true }) * console.log(error.shortMessage) * ``` */ export declare class OtpRequiredError extends RecoveryError { name: string; constructor({ canRequestOtp, ...options }: OpenfortErrorOptions & { canRequestOtp: boolean; }); }