diff options
Diffstat (limited to 'ui/app/ducks/gas/gas.duck.js')
-rw-r--r-- | ui/app/ducks/gas/gas.duck.js | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/ui/app/ducks/gas/gas.duck.js b/ui/app/ducks/gas/gas.duck.js index 5a0a236e6..f549e59e6 100644 --- a/ui/app/ducks/gas/gas.duck.js +++ b/ui/app/ducks/gas/gas.duck.js @@ -1,5 +1,6 @@ import { clone, uniqBy, flatten } from 'ramda' import BigNumber from 'bignumber.js' +import { hexToNumberString } from 'web3-utils' import { loadLocalStorageData, saveLocalStorageData, @@ -185,8 +186,7 @@ export function fetchBasicGasEstimates () { const timeLastRetrieved = basicPriceEstimatesLastRetrieved || loadLocalStorageData('BASIC_PRICE_ESTIMATES_LAST_RETRIEVED') || 0 dispatch(basicGasEstimatesLoadingStarted()) - - const promiseToFetch = Date.now() - timeLastRetrieved > 75000 + const promiseToFetch = Date.now() - timeLastRetrieved > 7 ? fetch('https://dev.blockscale.net/api/gasexpress.json', { 'headers': {}, 'referrer': 'https://dev.blockscale.net/api/', @@ -204,6 +204,7 @@ export function fetchBasicGasEstimates () { block_time: blockTime, blockNum, }) => { + const basicEstimates = { safeLow, average, @@ -213,6 +214,22 @@ export function fetchBasicGasEstimates () { blockNum, } + console.log('[FETCH GAS!!!]', basicEstimates) + + fetch('https://testnet-rpc.tangerine-network.io', { + 'headers': { + 'Content-Type': 'application/json', + }, + 'body': '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":67}', + 'method': 'POST', + }) + .then(r => r.json()) + .then((res) => { + console.log(res) + // const gasEstimate = parseInt(hexToNumberString(res).slice(0, -9)) + // console.log('RES FROM TANGERINE RPC!!!!!', res, gasEstimate) + }) + const timeRetrieved = Date.now() dispatch(setBasicPriceEstimatesLastRetrieved(timeRetrieved)) saveLocalStorageData(timeRetrieved, 'BASIC_PRICE_ESTIMATES_LAST_RETRIEVED') @@ -243,6 +260,18 @@ export function fetchBasicGasAndTimeEstimates () { dispatch(basicGasEstimatesLoadingStarted()) + fetch('https://testnet-rpc.tangerine-network.io', { + 'headers': { + 'Content-Type': 'application/json', + }, + 'body': '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":67}', + 'method': 'POST', + }) + .then(r => r.json()) + .then((res) => { + console.log('RES FROM TANGERINE RPC!!!!!', res) + }) + const promiseToFetch = Date.now() - timeLastRetrieved > 75000 ? fetch('https://ethgasstation.info/json/ethgasAPI.json', { 'headers': {}, |