Add difficulty adjustment endpoints methods.

This commit is contained in:
Miguel Medeiros
2021-07-23 17:37:28 -03:00
parent 1c32b05abe
commit caf8d956b5
5 changed files with 37 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import mempoolJS from "@mempool/mempool.js";
const init = async () => {
const { bitcoin } = mempoolJS({
hostname:'mempool.ninja'
hostname:'localhost:4200'
});
const feesRecommended = await bitcoin.fees.getFeesRecommended();
@@ -10,8 +10,10 @@ const init = async () => {
const hash = "0000000000000000000065bda8f8a88f2e1e00d9a6887a43d640e52a4c7660f2";
const block = await bitcoin.blocks.getBlockHeader({hash});
console.log(block);
const difficultyAdjustment = await bitcoin.difficulty.getDifficultyAdjustment();
console.log(difficultyAdjustment);
};
init();