@samyan/gas-tracker
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

GasTracker Version License

Library for get gas price from different sources. The currently supported blockchains:


Install

npm i @samyan/gas-tracker

Usage

Example 1

const gasTracker = new GasTracker();

gasTracker
    .getBlockchain(BlockchainType.BITCOIN)
    .getPrices()
    .then((result: BitcoinResult) => {
        console.log(result.getRegularPrice());
    })
    .catch((error: any) => {
        console.log(error.message);
    });

Example 2

try {
    const gasTracker = new GasTracker('YOUR_API_TOKEN');

    const result = (await gasTracker
        .getBlockchain(BlockchainType.ETHEREUM)
        .getPrices()
    ) as EthereumResult;

    console.log(result.getFastPrice());
} catch (error) {
    console.log(error.message);
}

Package Sidebar

Install

npm i @samyan/gas-tracker

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

81.5 kB

Total Files

47

Last publish

Collaborators

  • samyan