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 853e2fcb8f
commit 2e54f4ca94
8 changed files with 54 additions and 1 deletions

View File

@@ -506,6 +506,15 @@ class Routes {
}
}
public async getBlockHeader(req: Request, res: Response) {
try {
const blockHeader = await bitcoinApi.$getBlockHeader(req.params.hash);
res.send(blockHeader);
} catch (e) {
res.status(500).send(e.message || e);
}
}
public async getBlocks(req: Request, res: Response) {
try {
loadingIndicators.setProgress('blocks', 0);