Added missing block header API (#630)

* header API frontend

* Block Header API endpoint added to Node.js backend

* updated package-lock.json

Co-authored-by: Rishabh <rishabh@Rajeshs-MacBook-Pro.local>
This commit is contained in:
Rishabh
2021-07-19 04:56:16 +05:30
committed by GitHub
parent dfae95a020
commit ecee484359
8 changed files with 54 additions and 1 deletions

View File

@@ -60,6 +60,10 @@ class BitcoinApi implements AbstractBitcoinApi {
return this.bitcoindClient.getBlockHash(height);
}
$getBlockHeader(hash: string): Promise<string> {
return this.bitcoindClient.getBlockHeader(hash,false);
}
async $getBlock(hash: string): Promise<IEsploraApi.Block> {
const foundBlock = blocks.getBlocks().find((block) => block.id === hash);
if (foundBlock) {