Refactored transaction handling.

This commit is contained in:
softsimon
2020-12-21 23:08:34 +07:00
parent 5dbf6789a7
commit ecc0f316cc
12 changed files with 331 additions and 145 deletions

View File

@@ -1,16 +1,17 @@
import { MempoolInfo, Transaction, Block, MempoolEntries, MempoolEntry } from '../../interfaces';
import { MempoolInfo, Transaction, Block, MempoolEntries, MempoolEntry, Address } from '../../interfaces';
export interface AbstractBitcoinApi {
getMempoolInfo(): Promise<MempoolInfo>;
getRawMempool(): Promise<Transaction['txid'][]>;
getRawTransaction(txId: string): Promise<Transaction>;
getBlockHeightTip(): Promise<number>;
getTxIdsForBlock(hash: string): Promise<string[]>;
getBlockHash(height: number): Promise<string>;
getBlock(hash: string): Promise<Block>;
getMempoolEntry(txid: string): Promise<MempoolEntry>;
$getMempoolInfo(): Promise<MempoolInfo>;
$getRawMempool(): Promise<Transaction['txid'][]>;
$getRawTransaction(txId: string): Promise<Transaction>;
$getBlockHeightTip(): Promise<number>;
$getTxIdsForBlock(hash: string): Promise<string[]>;
$getBlockHash(height: number): Promise<string>;
$getBlock(hash: string): Promise<Block>;
$getMempoolEntry(txid: string): Promise<MempoolEntry>;
$getAddress(address: string): Promise<Address>;
// Custom
getRawMempoolVerbose(): Promise<MempoolEntries>;
getRawTransactionBitcond(txId: string): Promise<Transaction>;
$getRawMempoolVerbose(): Promise<MempoolEntries>;
$getRawTransactionBitcond(txId: string): Promise<Transaction>;
}