1.0.1 ā€¢ Published 10 months ago

target-block v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

target-block

A module to check for a specific block height to reach

Just need to define your RPC node(provider) and number of confirmations you wish to wait for. :smirk:

Get started

  1. Create your project: mkdir project
  2. Enter your project folder: cd project
  3. Download and install target-block package: npm i target-block
  4. Create new file in your project. for example: index.js 5.Use the target-block package into your codes like this:
const waitForTargetBlock = require('target-block');
const RPC_URL = "https://singapore.rpc.blxrbdn.com";
const howManyConfirmations = 5;

waitForTargetBlock(howManyConfirmations, RPC_URL)
.then((result) => {
    console.log("Target block reached:", result);
})
.catch((error) => {
    console.log("Error:", error);
})

šŸ•Šļø Helping to getting even better

If you found any issues, or have any recommendation on this package, I would be more than happy to see your comments. Also pull requests are very welcomed.

1.0.1

10 months ago

1.0.0

10 months ago