2.0.9 • Published 2 years ago

block-checker v2.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Block tracker

Tracker for laster block number

How to use

const Checker = require("block-checker");
const web3 = require("web3");

const httpProvider = new web3.providers.HttpProvider(
  "https://bsc-dataseed3.binance.org/"
);

const HttpsWeb3 = new web3(httpProvider);

const check = new Checker(HttpsWeb3, 1000);
check.start();

check.on("latest", (blockNumber) => console.log("latest", blockNumber));
check.on("sync", ([prev, current]) => console.log("sync", { prev, current }));
check.on("run", (timestamp) =>  console.log("Run", timestamp));
check.on("error", (error) =>  console.log("error", error));

Don't wanna get newest block?

const delayBlock = 10;
const check = new Checker(HttpsWeb3, 1000, delayBlock);
2.0.9

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago