/** * Interface for Bitcoin provider * * Gives read only access to the mempool */ export interface IBitcoinProvider { broadcast(tx: string): Promise; getUTXOs(address: string, balance?: number): Promise; getBalance(address: string): Promise; getTransaction(txId: string): Promise; getTransactionHex(txId: string): Promise; getFeeRates(): Promise; getTransactions(address: string, type: BitcoinTxType): Promise; getNetwork(): BitcoinNetwork; getLatestTip(): Promise; getConfirmations(txHash: string): Promise; getTxIndex(txId: string, address: string): Promise; getTransactionTimes(txIds: string[]): Promise; suggestFee(account: string, amount: number, urgency: Urgency): Promise; } export declare enum BitcoinNetwork { Mainnet = "Mainnet", Testnet = "Testnet", Regtest = "Regtest" } type BaseUTXO = { txid: string; vout: number; value: number; }; export type BitcoinUTXO = ({ status: { confirmed: true; block_height: number; }; } | { status: { confirmed: false; }; }) & BaseUTXO; export type FeeRates = { fastestFee: number; halfHourFee: number; hourFee: number; economyFee: number; minimumFee: number; }; export declare enum BitcoinTxType { ALL = "ALL", IN = "IN", OUT = "OUT" } export type BitcoinTx = { txid: string; fee: number; vin: { txid: string; vout: number; scriptsig?: string; scriptsig_asm?: string; is_coinbase: boolean; witness?: string[]; sequence: number; prevout: { scriptpubkey: string; scriptpubkey_asm: string; scriptpubkey_type: string; scriptpubkey_address: string; value: number; }; }[]; vout: { scriptpubkey: string; scriptpubkey_asm: string; scriptpubkey_type: string; scriptpubkey_address: string; value: number; }[]; status: { confirmed: boolean; block_height?: number; block_hash?: string; block_time?: number; }; }; /** * Enum for fee rates * @enum {string} */ export declare enum Urgency { SLOW = "SLOW", MEDIUM = "MEDIUM", FAST = "FAST" } export type FeeRateKeys = keyof FeeRates; export declare const UrgencyToFeeRateKey: { [urgency in Urgency]: FeeRateKeys; }; export {};