UNPKG

@roochnetwork/rooch-sdk-kit

Version:
49 lines (48 loc) 1.99 kB
import { Authenticator, Bytes, ThirdPartyAddress, Transaction } from '@roochnetwork/rooch-sdk'; import { BitcoinWallet } from '../wallet/index.js'; import { WalletNetworkType } from './types.js'; export declare const LocalKey = "local-wallet-key"; export declare const LocalActiveAddress = "local-wallet-active-address"; export type LocalAccountType = { mnemonic: string; keys: string[]; }; export declare class LocalWallet extends BitcoinWallet { private keypair?; private onNetworkChange?; private onAccountsChange?; static getAccounts(): Map<string, LocalAccountType>; static removeAddress(accountName: string, key: string): Map<string, LocalAccountType>; static removeAccount(accountName: string): Map<string, LocalAccountType>; static createAddress(accountName: string): Map<string, LocalAccountType>; static createAccount(): Map<string, LocalAccountType>; static importAccount(mnemonic: string): Map<string, LocalAccountType>; getName(): string; getIcon(_?: 'dark' | 'light'): string; getDescription(): string; getInstallUrl(): string; signTransaction(input: Transaction): Promise<Authenticator>; sign(msg: Bytes): Promise<Bytes>; getTarget(): any; connect(): Promise<ThirdPartyAddress[]>; switchNetwork(network: WalletNetworkType): Promise<void>; getNetwork(): Promise<WalletNetworkType>; getSupportNetworks(): WalletNetworkType[]; onAccountsChanged(callback: (account: string[]) => void): void; removeAccountsChanged(_: (account: string[]) => void): void; onNetworkChanged(callback: (network: string) => void): void; removeNetworkChanged(_: (network: string) => void): void; sendBtc(_: { toAddress: string; satoshis: number; options?: { feeRate: number; }; }): Promise<string>; getBalance(): Promise<{ confirmed: number; unconfirmed: number; total: string; }>; private formatNetwork; }