Skip to content

samyan/gas-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Library for get gas price from different sources.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published