1.0.4 • Published 4 years ago

@ostdotcom/ost-dynamic-gas-price v1.0.4

Weekly downloads
9
License
Apache-2.0
Repository
-
Last release
4 years ago

OST Dynamic Gas Price

This service fetches an estimated gas price for which transaction could get mined in less than 5 minutes.

Two services are used for this purpose. 1. Eth Gas Station
This service is used primarily. An API call is made to the below URL and gasPrices are parsed for usage.
(Source: 'https://ethgasstation.info/json/predictTable.json'). 2. Ether Chain
In case EthGasStation returns gasPrice as 0 or a price greater than the threshold, price is fetched from EtherChain.
(Source: 'https://www.etherchain.org/tools/gasPriceOracle').

Usage:

dynamicGasPriceProvider = require('@ostdotcom/ost-dynamic-gas-price');
chainId = 1; //main Ethereum Network
dynamicGasPriceProvider.dynamicGasPrice.get(chainId).then(function(val){
console.log("Gas Price In GWei", val);
});
1.0.4

4 years ago

1.0.4-beta.2

5 years ago

1.0.4-beta.1

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago

0.9.1-beta.1

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago