Fetch block txs from mempool/electrs in bulk

This commit is contained in:
Mononaut
2023-07-24 16:58:30 +09:00
parent 81d1c0a4d5
commit 0ebfd6f017
5 changed files with 42 additions and 35 deletions

View File

@@ -81,6 +81,10 @@ class BitcoinApi implements AbstractBitcoinApi {
.then((rpcBlock: IBitcoinApi.Block) => rpcBlock.tx);
}
$getTxsForBlock(hash: string): Promise<IEsploraApi.Transaction[]> {
throw new Error('Method getTxsForBlock not supported by the Bitcoin RPC API.');
}
$getRawBlock(hash: string): Promise<Buffer> {
return this.bitcoindClient.getBlock(hash, 0)
.then((raw: string) => Buffer.from(raw, "hex"));