import { SendAndConfirmOptions } from '@rialo/ts-cdk'; export { ChainDefinition, ConfirmTransactionOptions, HttpTransportConfig, PublicKey, RIALO_DEVNET_CHAIN, RIALO_LOCALNET_CHAIN, RIALO_MAINNET_CHAIN, RIALO_TESTNET_CHAIN, RialoClient, RialoClientConfig, SendAndConfirmOptions, SendTransactionOptions, Signature, Transaction, TransactionBuilder, getDefaultRialoClientConfig } from '@rialo/ts-cdk'; import { F as FrostConfig, A as AccountEntity, C as ConnectionStatus, W as WalletEntity } from './config-CKQwL4wm.js'; export { b as CreateConfigOptions, a as FrostAppState, d as WalletEventBridge, e as WalletRegistry, c as createConfig, i as initializeConfig } from './config-CKQwL4wm.js'; import '@tanstack/store'; import '@wallet-standard/base'; /** * Gets all known accounts. * * @param config - Frost configuration * @returns Array of account entities */ declare function getAccounts(config: FrostConfig): AccountEntity[]; /** * Gets the currently active (connected) account. * * @param config - Frost configuration * @returns Active account or null if not connected */ declare function getActiveAccount(config: FrostConfig): AccountEntity | null; /** * Gets a specific account by address. * * @param config - Frost configuration * @param address - Account address to retrieve * @returns Account entity or undefined if not found */ declare function getAccount(config: FrostConfig, address: string): AccountEntity | undefined; interface ActiveConnection { /** Current connection status */ status: ConnectionStatus; /** Target chain ID */ chainId: string; /** Connected wallet name (null when disconnected) */ walletName: string | null; /** Connected account address (null when disconnected) */ accountAddress: string | null; /** Timestamp (epoch Date.now()) when connection was established */ connectedAt: number | null; /** Timestamp (epoch Date.now()) of last user activity */ lastUsedAt: number; } /** * Gets the current connection state synchronously. * * @param config - Frost configuration * @returns Current connection status, wallet, and account info */ declare function getActiveConnection(config: FrostConfig): ActiveConnection; interface ConnectOptions { /** Name of the wallet to connect */ walletName: string; /** Attempt silent connection (no popup) - for reconnection */ silent?: boolean; } interface ConnectResult { /** Name of the connected wallet */ walletName: string; /** Address of the connected account */ accountAddress: string; } /** * Connects to a wallet. * * @param config - Frost configuration * @param options - Connection options including wallet name * @returns Connected wallet name and account address * @throws {WalletNotFoundError} If wallet is not registered * @throws {UnsupportedFeatureError} If wallet doesn't support connect * @throws {ConnectionFailedError} If connection fails or no accounts returned */ declare function connect(config: FrostConfig, options: ConnectOptions): Promise; /** * Disconnects from the current wallet. * * Clears connection state and sets `userDisconnected` to prevent auto-reconnect. * * @param config - Frost configuration */ declare function disconnect(config: FrostConfig): Promise; /** * Attempts silent reconnection to previously connected wallet. * * @param config - Frost configuration * @returns Connection result if successful, null if reconnection not possible */ declare function reconnect(config: FrostConfig): Promise; interface SignMessageOptions { /** Message to sign (string will be UTF-8 encoded) */ message: string | Uint8Array; } interface SignMessageResult { /** Message signature */ signature: Uint8Array; /** Signed message bytes */ signedMessage: Uint8Array; } /** * Signs an arbitrary message. * * @param config - Frost configuration * @param options - Message to sign (string or bytes) * @returns Signature and signed message bytes * @throws {WalletDisconnectedError} If no wallet connected * @throws {UnsupportedFeatureError} If wallet doesn't support signing */ declare function signMessage(config: FrostConfig, options: SignMessageOptions): Promise; interface SignTransactionOptions { /** Transaction bytes or object with serialize method */ transaction: Uint8Array | { serialize(): Uint8Array; }; } interface SignTransactionResult { /** Fully signed transaction bytes */ signedTransaction: Uint8Array; } /** * Signs a transaction without submitting it. * * @param config - Frost configuration * @param options - Transaction to sign * @returns Signed transaction bytes * @throws {WalletDisconnectedError} If no wallet connected * @throws {UnsupportedFeatureError} If wallet doesn't support signing */ declare function signTransaction(config: FrostConfig, options: SignTransactionOptions): Promise; interface SendTransactionType { /** Transaction bytes or object with serialize method */ transaction: Uint8Array | { serialize(): Uint8Array; }; } interface SendTransactionResult { /** Transaction signature */ signature: Uint8Array; } /** * Signs and sends a transaction using the wallet's built-in send feature. * * @param config - Frost configuration * @param options - Transaction to sign and send * @returns Transaction signature * @throws {WalletDisconnectedError} If no wallet connected * @throws {UnsupportedFeatureError} If wallet doesn't support signAndSend */ declare function sendTransaction(config: FrostConfig, options: SendTransactionType): Promise; interface SignAndSendTransactionOptions { /** Transaction bytes or object with serialize method */ transaction: Uint8Array | { serialize(): Uint8Array; }; /** RPC send and confirm options (skipPreflight, maxRetries, confirmMaxRetries, confirmRetryDelayMs) */ sendOptions?: SendAndConfirmOptions; } interface SignAndSendTransactionResult { /** Transaction signature (base58 string) */ signature: string; } /** * Sign a transaction with the wallet, send it via Frost's RPC client, and wait for confirmation. * * This provides more control over transaction submission compared to sendTransaction, * as it uses Frost's own RPC client instead of the wallet's built-in send. * This is useful when you want to: * - Use a custom RPC URL (configured via ChainDefinition.rpcUrl) * - Have more control over retry logic and confirmation * - Not trust the wallet's send implementation * * @returns Confirmed transaction details including signature and execution status */ declare function signAndSendTransaction(config: FrostConfig, options: SignAndSendTransactionOptions): Promise; /** * Gets all discovered wallets. * * @param config - Frost configuration * @returns Array of wallet entities */ declare function getWallets(config: FrostConfig): WalletEntity[]; /** * Gets wallets sorted by priority (higher first), then by last connected time. * * @param config - Frost configuration * @returns Sorted array of wallet entities */ declare function getSortedWallets(config: FrostConfig): WalletEntity[]; /** * Gets a specific wallet by name. * * @param config - Frost configuration * @param walletName - Name of the wallet to retrieve * @returns Wallet entity or undefined if not found */ declare function getWallet(config: FrostConfig, walletName: string): WalletEntity | undefined; /** * Checks if a wallet supports a specific feature. * * @param config - Frost configuration * @param walletName - Name of the wallet * @param feature - Feature identifier (e.g., "rialo:signTransaction") * @returns True if the wallet supports the feature */ declare function hasFeature(config: FrostConfig, walletName: string, feature: string): boolean; /** * Checks if a wallet supports the currently configured chain. * * @param config - Frost configuration * @param walletName - Name of the wallet * @returns True if the wallet supports the current chain */ declare function supportsChain(config: FrostConfig, walletName: string): boolean; /** biome-ignore-all lint/complexity/noBannedTypes: V8-specific code */ /** * Base error class for all frost errors. * All errors thrown by frost extend this class. */ declare abstract class FrostError extends Error { abstract readonly code: string; readonly walletName?: string; constructor(message: string, walletName?: string, options?: ErrorOptions); } /** Type guard to check if an error is a FrostError */ declare function isFrostError(error: unknown): error is FrostError; /** * Thrown when attempting to use a wallet that hasn't been discovered. */ declare class WalletNotFoundError extends FrostError { readonly code: "WALLET_NOT_FOUND"; constructor(walletName: string); } /** * Thrown when attempting an operation that requires a connected wallet. */ declare class WalletDisconnectedError extends FrostError { readonly code: "WALLET_DISCONNECTED"; constructor(); } /** * Thrown when a wallet doesn't support the configured chain. */ declare class UnsupportedChainError extends FrostError { readonly code: "UNSUPPORTED_CHAIN"; readonly chainId: string; readonly supportedChains: readonly string[]; constructor(chainId: string, supportedChains: readonly string[], walletName: string); } /** * Thrown when a wallet doesn't support a required feature. */ declare class UnsupportedFeatureError extends FrostError { readonly code: "UNSUPPORTED_FEATURE"; readonly feature: string; constructor(feature: string, walletName: string); } /** * Thrown when wallet connection fails. */ declare class ConnectionFailedError extends FrostError { readonly code: "CONNECTION_FAILED"; readonly reason?: string; constructor(reason: string, walletName: string, cause?: Error); } /** * Thrown when the persisted session has expired. */ declare class SessionExpiredError extends FrostError { readonly code: "SESSION_EXPIRED"; readonly expiredAt: number; constructor(expiredAt: number); } /** * Wrapper for errors thrown by the wallet itself. * We don't try to interpret these - just preserve the original error. */ declare class WalletError extends FrostError { readonly code: "WALLET_ERROR"; readonly originalError: unknown; constructor(originalError: unknown, walletName?: string); } /** * Thrown when a transaction is confirmed but execution failed on-chain. */ declare class TransactionFailedError extends FrostError { readonly code: "TRANSACTION_FAILED"; readonly signature: string; readonly reason?: string; constructor(signature: string, reason?: string, walletName?: string); } export { AccountEntity, type ActiveConnection, type ConnectOptions, type ConnectResult, ConnectionFailedError, ConnectionStatus, FrostConfig, FrostError, type SendTransactionResult, type SendTransactionType, SessionExpiredError, type SignAndSendTransactionOptions, type SignAndSendTransactionResult, type SignMessageOptions, type SignMessageResult, type SignTransactionOptions, type SignTransactionResult, TransactionFailedError, UnsupportedChainError, UnsupportedFeatureError, WalletDisconnectedError, WalletEntity, WalletError, WalletNotFoundError, connect, disconnect, getAccount, getAccounts, getActiveAccount, getActiveConnection, getSortedWallets, getWallet, getWallets, hasFeature, isFrostError, reconnect, sendTransaction, signAndSendTransaction, signMessage, signTransaction, supportsChain };