import { Account } from './account'; import type { AccountId, WalletOptions, CreateAccountPayload, WalletEventType, GenerateAddressOptions, SyncOptions, WalletEvent, Event } from '../types/wallet'; import { IAuth, IClientOptions, LedgerNanoStatus } from '../types/client'; import { Client } from '../client'; import { SecretManager } from '../secret_manager'; /** The Wallet class. */ export declare class Wallet { private methodHandler; /** * @param options Wallet options. */ constructor(options: WalletOptions); /** * Backup the data to a Stronghold snapshot. */ backup(destination: string, password: string): Promise; /** * Change the Stronghold password. */ changeStrongholdPassword(currentPassword: string, newPassword: string): Promise; /** * Clear the Stronghold password from memory. */ clearStrongholdPassword(): Promise; /** * Create a new account. */ createAccount(data: CreateAccountPayload): Promise; /** * Destroy the Wallet and drop its database connection. */ destroy(): Promise; /** * Emit a provided event for testing of the event system. */ emitTestEvent(event: WalletEvent): Promise; /** * Get an account by its alias or index. */ getAccount(accountId: AccountId): Promise; /** * Get all account indexes. */ getAccountIndexes(): Promise; /** * Get all accounts. */ getAccounts(): Promise; /** * Get client. */ getClient(): Promise; /** * Get chrysalis data. */ getChrysalisData(): Promise>; /** * Get secret manager. */ getSecretManager(): Promise; /** * Generate an address without storing it. */ generateEd25519Address(accountIndex: number, addressIndex: number, options?: GenerateAddressOptions, bech32Hrp?: string): Promise; /** * Get the status for a Ledger Nano. */ getLedgerNanoStatus(): Promise; /** * Check if the Stronghold password has been set. */ isStrongholdPasswordAvailable(): Promise; /** * Listen to wallet events with a callback. An empty array will listen to all possible events. */ listen(eventTypes: WalletEventType[], callback: (error: Error, event: Event) => void): Promise; /** * Clear the callbacks for provided events. An empty array will clear all listeners. */ clearListeners(eventTypes: WalletEventType[]): Promise; /** * Find accounts with unspent outputs. */ recoverAccounts(accountStartIndex: number, accountGapLimit: number, addressGapLimit: number, syncOptions: SyncOptions): Promise; /** * Delete the latest account. */ removeLatestAccount(): Promise; /** * Restore a backup from a Stronghold file * Replaces client_options, coin_type, secret_manager and accounts. Returns an error if accounts were already created * If Stronghold is used as secret_manager, the existing Stronghold file will be overwritten. If a mnemonic was * stored, it will be gone. * if ignore_if_coin_type_mismatch is provided client options will not be restored * if ignore_if_coin_type_mismatch == true, client options coin type and accounts will not be restored if the cointype doesn't match * if ignore_if_bech32_hrp_mismatch == Some("rms"), but addresses have something different like "smr", no accounts * will be restored. */ restoreBackup(source: string, password: string, ignoreIfCoinTypeMismatch?: boolean, ignoreIfBech32Mismatch?: string): Promise; /** * Set ClientOptions. */ setClientOptions(clientOptions: IClientOptions): Promise; /** * Set the Stronghold password. */ setStrongholdPassword(password: string): Promise; /** * Set the interval after which the Stronghold password gets cleared from memory. */ setStrongholdPasswordClearInterval(intervalInMilliseconds?: number): Promise; /** * Start the background syncing process for all accounts. */ startBackgroundSync(options?: SyncOptions, intervalInMilliseconds?: number): Promise; /** * Stop the background syncing process for all accounts. */ stopBackgroundSync(): Promise; /** * Store a mnemonic in the Stronghold snapshot. */ storeMnemonic(mnemonic: string): Promise; /** * Update the authentication for the provided node. */ updateNodeAuth(url: string, auth?: IAuth): Promise; }