1.0.6 • Published 11 months ago

@samyan/gas-tracker v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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);
}
1.0.6

11 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago