import { SecureWalletSender } from 'Sender'; import { LoginWidget } from './LoginWidget'; /** * This class represents the Bitcoin Wallets SDK which provides methods * for interacting with the bitcoin network like sending transactions, * fetching account balance and details, etc. * * @constructor * @param {SecureWalletSender} sender - Secure wallet sender object to perform network operations * @param {LoginWidget} loginWidget - Login widget to facilitate authentication */ declare class BitcoinWalletsSDK { private sender; private autoLogin; private loginWidget; constructor(sender: SecureWalletSender, loginWidget: LoginWidget, autoLogin?: boolean); /** * Handles errors by accepting a function as a parameter and executing it within a try-catch block. * @param {() => Promise} fn - The function to be executed. * @throws Will throw an error if the function execution fails. * @returns {Promise} Returns a promise that resolves to the result of the function execution. */ private handleError; /** * Send a transaction to the bitcoin network. * * @async * @param {any} transaction - The transaction data. * @param {number} feeInSatoshis - The custom fee in satoshis. * @returns {Promise} Returns a promise that resolves to the transaction id. * @throws Will throw an error if the login process fails or the send request fails. */ sendTransaction(transaction: any): Promise; /** * Initiate a sell transaction from you wallet * Available to MoonPay properties only * * @async * @param {any} transaction - The transaction data. * @param {number} receivingFiatAmount - How much fiat will be received from this sell * @param {number} receivingFiatCurrencyCode - Currenct code of fiat * @param {number} receivingFiatTo - Where the fiat will be delivered * @returns {Promise} Returns a promise that resolves to the transaction id. * @throws Will throw an error if the login process fails or the send request fails. */ sellTransaction(transaction: any, receivingFiatAmount?: string, receivingFiatCurrencyCode?: string, receivingFiatTo?: string): Promise; /** * Retrieves the balance of the authenticated wallet in satoshis. * * @async * @returns {Promise} Returns a promise that resolves to the balance in satoshis. * @throws Will throw an error if the login process fails or the balance fetch fails. */ balance(): Promise; /** * Retrieves the wallet addresses for the currently authenticated customer. * * @async * @returns {Promise} Returns a promise that resolves to an array of wallet addresses. * @throws Will throw an error if the login process fails or the accounts fetch fails. */ accounts(): Promise; /** * Retrieves the latest block in the blockchain. * * @async * @returns {Promise} Returns a promise that resolves to the latest block number. * @throws Will throw an error if the login process fails or the block fetch fails. */ getLatestBlock(): Promise; /** * Retrieves the chain ID of the bitcoin network the wallet is interacting with. * * @async * @returns {Promise} Returns a promise that resolves to the chain ID. * @throws Will throw an error if the login process fails or the chain ID fetch fails. */ chainId(): Promise; /** * Switches the chain ID the wallet is interacting with. * * @async * @param {string} chainId - The new chain ID to switch to. * @throws Will throw an error if the login process fails or the chain switch request fails. * @returns {Promise} Returns a promise that resolves to void. */ switchChainId(chainId: string): Promise; private loginViaWidget; } export default BitcoinWalletsSDK;