diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/app/network.js | 13 | ||||
-rw-r--r-- | ui/app/ducks/app/app.js | 4 | ||||
-rw-r--r-- | ui/app/ducks/gas/gas.duck.js | 33 | ||||
-rw-r--r-- | ui/app/pages/create-account/connect-hardware/account-list.js | 4 | ||||
-rw-r--r-- | ui/app/selectors/custom-gas.js | 40 |
5 files changed, 68 insertions, 26 deletions
diff --git a/ui/app/components/app/network.js b/ui/app/components/app/network.js index e778700cd..178710bd1 100644 --- a/ui/app/components/app/network.js +++ b/ui/app/components/app/network.js @@ -50,6 +50,9 @@ Network.prototype.render = function () { } else if (providerName === 'goerli') { hoverText = context.t('goerli') iconName = 'goerli-test-network' + } else if (providerName === 'tangerine_testnet') { + hoverText = context.t('tangerine_testnet') + iconName = 'tangerine_testnet' } else { hoverText = providerId iconName = 'private-network' @@ -74,6 +77,16 @@ Network.prototype.render = function () { }, [ (function () { switch (iconName) { + case 'tangerine_testnet': + return h('.network-indicator', [ + h(NetworkDropdownIcon, { + backgroundColor: '#ff4a8d', // $wild-strawberry + nonSelectBackgroundColor: '#15afb2', + loading: networkNumber === 'loading', + }), + h('.network-name', context.t('tangerine_testnet')), + h('.network-indicator__down-arrow'), + ]) case 'ethereum-network': return h('.network-indicator', [ h(NetworkDropdownIcon, { diff --git a/ui/app/ducks/app/app.js b/ui/app/ducks/app/app.js index 04c8c7422..643051b59 100644 --- a/ui/app/ducks/app/app.js +++ b/ui/app/ducks/app/app.js @@ -73,8 +73,8 @@ function reduceApp (state, action) { gasIsLoading: false, networkNonce: null, defaultHdPaths: { - trezor: `m/44'/60'/0'/0`, - ledger: `m/44'/60'/0'/0/0`, + trezor: `m/44'/373'/0'/0`, + ledger: `m/44'/373'/0'/0/0`, }, lastSelectedProvider: null, networksTabSelectedRpcUrl: '', 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': {}, diff --git a/ui/app/pages/create-account/connect-hardware/account-list.js b/ui/app/pages/create-account/connect-hardware/account-list.js index 247c27a5d..1c75b0838 100644 --- a/ui/app/pages/create-account/connect-hardware/account-list.js +++ b/ui/app/pages/create-account/connect-hardware/account-list.js @@ -10,11 +10,11 @@ class AccountList extends Component { return [ { label: `Ledger Live`, - value: `m/44'/60'/0'/0/0`, + value: `m/44'/373'/0'/0/0`, }, { label: `Legacy (MEW / MyCrypto)`, - value: `m/44'/60'/0'`, + value: `m/44'/373'/0'`, }, ] } diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js index 1f7ee8f9f..a1df738f6 100644 --- a/ui/app/selectors/custom-gas.js +++ b/ui/app/selectors/custom-gas.js @@ -238,10 +238,10 @@ function getRenderableBasicEstimateData (state, gasLimit) { const { gas: { basicEstimates: { - safeLow, + // safeLow, fast, fastest, - safeLowWait, + // safeLowWait, fastestWait, fastWait, }, @@ -249,15 +249,15 @@ function getRenderableBasicEstimateData (state, gasLimit) { } = state return [ - { - labelKey: 'slow', - feeInPrimaryCurrency: getRenderableEthFee(safeLow, gasLimit), - feeInSecondaryCurrency: showFiat - ? getRenderableConvertedCurrencyFee(safeLow, gasLimit, currentCurrency, conversionRate) - : '', - timeEstimate: safeLowWait && getRenderableTimeEstimate(safeLowWait), - priceInHexWei: getGasPriceInHexWei(safeLow), - }, + // { + // labelKey: 'slow', + // feeInPrimaryCurrency: getRenderableEthFee(safeLow, gasLimit), + // feeInSecondaryCurrency: showFiat + // ? getRenderableConvertedCurrencyFee(safeLow, gasLimit, currentCurrency, conversionRate) + // : '', + // timeEstimate: safeLowWait && getRenderableTimeEstimate(safeLowWait), + // priceInHexWei: getGasPriceInHexWei(safeLow), + // }, { labelKey: 'average', feeInPrimaryCurrency: getRenderableEthFee(fast, gasLimit), @@ -293,7 +293,7 @@ function getRenderableEstimateDataForSmallButtonsFromGWEI (state) { const { gas: { basicEstimates: { - safeLow, + // safeLow, fast, fastest, }, @@ -301,14 +301,14 @@ function getRenderableEstimateDataForSmallButtonsFromGWEI (state) { } = state return [ - { - labelKey: 'slow', - feeInSecondaryCurrency: showFiat - ? getRenderableConvertedCurrencyFee(safeLow, gasLimit, currentCurrency, conversionRate) - : '', - feeInPrimaryCurrency: getRenderableEthFee(safeLow, gasLimit, NUMBER_OF_DECIMALS_SM_BTNS, true), - priceInHexWei: getGasPriceInHexWei(safeLow, true), - }, + // { + // labelKey: 'slow', + // feeInSecondaryCurrency: showFiat + // ? getRenderableConvertedCurrencyFee(safeLow, gasLimit, currentCurrency, conversionRate) + // : '', + // feeInPrimaryCurrency: getRenderableEthFee(safeLow, gasLimit, NUMBER_OF_DECIMALS_SM_BTNS, true), + // priceInHexWei: getGasPriceInHexWei(safeLow, true), + // }, { labelKey: 'average', feeInSecondaryCurrency: showFiat |