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

@@ -89,6 +89,10 @@ class ElectrsApi implements AbstractBitcoinApi {
return this.$queryWrapper<string[]>(config.ESPLORA.REST_API_URL + '/block/' + hash + '/txids');
}
$getTxsForBlock(hash: string): Promise<IEsploraApi.Transaction[]> {
return this.$queryWrapper<IEsploraApi.Transaction[]>(config.ESPLORA.REST_API_URL + '/block/' + hash + '/txs');
}
$getBlockHash(height: number): Promise<string> {
return this.$queryWrapper<string>(config.ESPLORA.REST_API_URL + '/block-height/' + height);
}