import { BitcoinNetwork, BitcoinTx, BitcoinTxType, BitcoinUTXO, FeeRates, IBitcoinProvider, Urgency } from './provider.interface'; export declare class BitcoinProvider implements IBitcoinProvider { private readonly network; private readonly APIs; private cacheTimeout; private readonly utxosCache; constructor(network: BitcoinNetwork, API?: string); /** * Gets the output index of the UTXO * * @param {string} txId - Transaction ID * @param {string} address - Address of the UTXO * * @returns {Promise} Output index * * @throws If the UTXO is not found */ getTxIndex(txId: string, address: string): Promise; /** * Broadcasts the transaction. Retries upto 5 times. * * @param {string} tx - Hex representation of the transaction * @returns {Promise} Transaction ID * * @throws If the it fails to broadcast */ broadcast(tx: string): Promise; /** * Gets the balance of an address * * @param {string} address - Bitcoin address * @returns {Promise} The balance in satoshies */ getBalance(address: string): Promise; /** * Sets the timeout for the cache * * After the timeout, the cache will be invalidated and the next call will not use the cache * @param timeout - Time in milliseconds */ setTimeoutForCache(timeout: number): void; /** * Returns all UTXOs that can be unlocked by the given address. If the balance field is provided * then the returned UTXOs are sorted in descending order. * * @param {string} address - Bitcoin address * @param {number} [balance] - The upper cap for the summation of the returned UTXOs. */ getUTXOs(address: string, balance?: number | undefined): Promise; /** * Transaction Hex for the given transaction ID * * @param {string} txId - Transaction ID * @returns {Promise} Transaction Hex */ getTransactionHex(txId: string): Promise; /** * Transaction for the given transaction ID * * @param {string} txId - Transaction ID * @returns {Promise} */ getTransaction(txId: string): Promise; /** * Confirmations for the given transaction ID * * @param {string} txHash - Transaction ID * @returns {Promise} The number of confirmation */ getConfirmations(txHash: string): Promise; /** * Get fee rates * * @returns {Promise} */ getFeeRates(): Promise; /** * Transactions for the given address and type. Limits to the latest 50 transactions. * * @param {string} address - Bitcoin address * @param {BitcoinTxType} type - Transaction type * * @returns {Promise} */ getTransactions(address: string, type: BitcoinTxType): Promise; /** * Returns the network of the provider * * @returns {BitcoinNetwork} */ getNetwork(): BitcoinNetwork; /** * Returns the latest block height * * @returns {Promise} Block height */ getLatestTip(): Promise; /** * Suggests fee for sending a transaction with a given amount. Must only be used for segwit inputs and outputs * * * only for segwit inputs and outputs * @param {string} account - Bitcoin address * @param {number} amount - in satoshis * @param {Urgency} urgency - urgency of the transaction * * @returns {Promise} Recommended Fee */ suggestFee(account: string, amount: number, urgency: Urgency): Promise; /** * Returns the timestamps when a list of unconfirmed transactions was initially observed in the mempool. * If a transaction is not found in the mempool or has been mined, the timestamp will be 0. * @param txIds * @returns List of time stamps in milliseconds */ getTransactionTimes(txIds: string[]): Promise; }