0

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".

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();

So how can I using this code in my project? It is really urgent one. Anyone please help me.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.