1.0.1 ā¢ Published 10 months ago
target-block v1.0.1
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
- Create your project:
mkdir project
- Enter your project folder:
cd project
- Download and install
target-block
package:npm i target-block
- Create new file in your project. for example:
index.js
5.Use thetarget-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.