Apollyon
Coder
I want to fetch last month's block and transactions from mempool using typescript. And then persist this to MongoDb. In mempool API-REST there is a code of "GET_Block".
So how can I using this code in my project? It is really urgent one. Anyone please help me.
JavaScript:
import mempoolJS from "@mempool/mempool.js";
const init = async() => {
const {
bitcoin: {
blocks
}
} = mempoolJS({
hostname: 'mempool.space'
});
const hash = '000000000000000015dc777b3ff2611091336355d3f0ee9766a2cf3be8e4b1ce';
const block = await blocks.getBlock({
hash
});
console.log(block);
};
init();