2023-12-21 16:20:31 +00:00
|
|
|
import { IBitcoinApi } from './bitcoin-api.interface';
|
2020-12-28 04:47:22 +07:00
|
|
|
import { IEsploraApi } from './esplora-api.interface';
|
2020-12-20 22:36:36 +07:00
|
|
|
|
|
|
|
export interface AbstractBitcoinApi {
|
2020-12-28 04:47:22 +07:00
|
|
|
$getRawMempool(): Promise<IEsploraApi.Transaction['txid'][]>;
|
2022-05-13 16:00:38 +04:00
|
|
|
$getRawTransaction(txId: string, skipConversion?: boolean, addPrevout?: boolean, lazyPrevouts?: boolean): Promise<IEsploraApi.Transaction>;
|
2023-08-05 16:08:54 +09:00
|
|
|
$getRawTransactions(txids: string[]): Promise<IEsploraApi.Transaction[]>;
|
2023-08-02 13:24:56 +09:00
|
|
|
$getMempoolTransactions(txids: string[]): Promise<IEsploraApi.Transaction[]>;
|
2023-11-15 06:57:31 +00:00
|
|
|
$getAllMempoolTransactions(lastTxid?: string, max_txs?: number);
|
2022-11-22 21:45:05 +09:00
|
|
|
$getTransactionHex(txId: string): Promise<string>;
|
2020-12-21 23:08:34 +07:00
|
|
|
$getBlockHeightTip(): Promise<number>;
|
2022-06-22 13:15:44 +02:00
|
|
|
$getBlockHashTip(): Promise<string>;
|
2020-12-21 23:08:34 +07:00
|
|
|
$getTxIdsForBlock(hash: string): Promise<string[]>;
|
2023-07-24 16:58:30 +09:00
|
|
|
$getTxsForBlock(hash: string): Promise<IEsploraApi.Transaction[]>;
|
2020-12-21 23:08:34 +07:00
|
|
|
$getBlockHash(height: number): Promise<string>;
|
2021-07-19 04:56:16 +05:30
|
|
|
$getBlockHeader(hash: string): Promise<string>;
|
2020-12-28 04:47:22 +07:00
|
|
|
$getBlock(hash: string): Promise<IEsploraApi.Block>;
|
2022-11-29 11:37:51 +09:00
|
|
|
$getRawBlock(hash: string): Promise<Buffer>;
|
2020-12-28 04:47:22 +07:00
|
|
|
$getAddress(address: string): Promise<IEsploraApi.Address>;
|
|
|
|
$getAddressTransactions(address: string, lastSeenTxId: string): Promise<IEsploraApi.Transaction[]>;
|
2021-01-11 01:51:57 +07:00
|
|
|
$getAddressPrefix(prefix: string): string[];
|
2023-07-22 17:51:45 +09:00
|
|
|
$getScriptHash(scripthash: string): Promise<IEsploraApi.ScriptHash>;
|
|
|
|
$getScriptHashTransactions(address: string, lastSeenTxId: string): Promise<IEsploraApi.Transaction[]>;
|
2021-09-26 22:18:44 +04:00
|
|
|
$sendRawTransaction(rawTransaction: string): Promise<string>;
|
2022-07-06 11:58:06 +02:00
|
|
|
$getOutspend(txId: string, vout: number): Promise<IEsploraApi.Outspend>;
|
2022-01-15 22:09:04 +04:00
|
|
|
$getOutspends(txId: string): Promise<IEsploraApi.Outspend[]>;
|
2022-06-22 23:34:44 +02:00
|
|
|
$getBatchedOutspends(txId: string[]): Promise<IEsploraApi.Outspend[][]>;
|
2023-08-17 02:42:59 +09:00
|
|
|
$getBatchedOutspendsInternal(txId: string[]): Promise<IEsploraApi.Outspend[][]>;
|
2023-08-18 02:47:32 +09:00
|
|
|
$getOutSpendsByOutpoint(outpoints: { txid: string, vout: number }[]): Promise<IEsploraApi.Outspend[]>;
|
2023-08-05 13:08:47 +09:00
|
|
|
|
|
|
|
startHealthChecks(): void;
|
2020-12-20 22:36:36 +07:00
|
|
|
}
|
2021-09-15 01:47:24 +04:00
|
|
|
export interface BitcoinRpcCredentials {
|
|
|
|
host: string;
|
|
|
|
port: number;
|
|
|
|
user: string;
|
|
|
|
pass: string;
|
|
|
|
timeout: number;
|
2023-03-26 16:39:45 +02:00
|
|
|
cookie?: string;
|
2021-09-15 01:47:24 +04:00
|
|
|
}
|