@rainbow-me/rainbow-common
Advanced tools
Comparing version 0.8.3 to 0.8.4
{ | ||
"name": "@rainbow-me/rainbow-common", | ||
"description": "Common library for web and mobile", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"author": "Jin Chung <jin@rainbow.me>", | ||
@@ -22,2 +22,3 @@ "license": "GPL-3.0", | ||
"i18next": "^11.3.2", | ||
"immer": "^3.1.2", | ||
"jsonp": "^0.2.1", | ||
@@ -24,0 +25,0 @@ "lodash": "^4.17.10", |
@@ -69,2 +69,4 @@ import { omit, pickBy } from 'lodash'; | ||
const getUniswapKey = (accountAddress, network) => `uniswap-${accountAddress.toLowerCase()}-${network.toLowerCase()}`; | ||
/** | ||
@@ -105,2 +107,36 @@ * @desc get prices | ||
/** | ||
* @desc get Uniswap | ||
* @param {String} [address] | ||
* @param {String} [network] | ||
* @return {Object} | ||
*/ | ||
export const getUniswap = async (accountAddress, network) => { | ||
const uniswap = await getLocal(getUniswapKey(accountAddress, network)); | ||
return uniswap ? uniswap.data : {}; | ||
}; | ||
/** | ||
* @desc save Uniswap | ||
* @param {String} [address] | ||
* @param {String} [network] | ||
*/ | ||
export const saveUniswap = async (accountAddress, uniswap, network) => { | ||
await saveLocal( | ||
getUniswapKey(accountAddress, network), | ||
{ data: uniswap }, | ||
); | ||
}; | ||
/** | ||
* @desc remove Uniswap | ||
* @param {String} [address] | ||
* @param {String} [network] | ||
* @return {Object} | ||
*/ | ||
export const removeUniswap = (accountAddress, network) => { | ||
const key = getUniswapKey(accountAddress, network); | ||
removeLocal(key); | ||
}; | ||
/** | ||
* @desc get assets | ||
@@ -107,0 +143,0 @@ * @param {String} [address] |
@@ -69,3 +69,3 @@ import { ethers } from 'ethers'; | ||
*/ | ||
export const estimateGas = async (estimateGasData) => { | ||
export const estimateGas = async (estimateGasData) => { | ||
const gasLimit = await web3Provider.estimateGas(estimateGasData); | ||
@@ -79,3 +79,3 @@ return gasLimit.toNumber(); | ||
*/ | ||
export const getGasPrice = async () => { | ||
export const getGasPrice = async () => { | ||
const gasPrice = await web3Provider.getGasPrice(); | ||
@@ -82,0 +82,0 @@ return gasPrice.toString(); |
@@ -1,12 +0,8 @@ | ||
import "@babel/polyfill"; | ||
import '@babel/polyfill'; | ||
import supportedNativeCurrencies from './references/native-currencies.json'; | ||
import lang, { resources, supportedLanguages } from './languages'; | ||
import { withSendComponentWithData } from './components/SendComponentWithData'; | ||
import { withAccountAssets } from './hoc'; | ||
import { | ||
withSendComponentWithData | ||
} from './components/SendComponentWithData'; | ||
import { | ||
withAccountAssets | ||
} from './hoc'; | ||
import { | ||
accountClearState, | ||
@@ -38,2 +34,3 @@ accountLoadState, | ||
transactionsAddNewTransaction, | ||
uniswap, | ||
} from './reducers'; | ||
@@ -171,5 +168,6 @@ import { | ||
transactions, | ||
transactionsAddNewTransaction, | ||
transactionsRefreshState, | ||
transactionsUpdateHasPendingTransaction, | ||
transactionsAddNewTransaction, | ||
uniswap, | ||
web3Provider, | ||
@@ -176,0 +174,0 @@ withAccountAssets, |
@@ -15,2 +15,3 @@ import { isEmpty } from 'lodash'; | ||
import { transactionsClearState, transactionsLoadState } from './_transactions'; | ||
import { uniswapClearState, uniswapLoadState, uniswapUpdateState } from './_uniswap'; | ||
import { | ||
@@ -62,2 +63,3 @@ getNativePrices, | ||
dispatch(transactionsClearState()); | ||
dispatch(uniswapClearState()); | ||
removeWalletConnect(); | ||
@@ -70,2 +72,3 @@ }; | ||
dispatch(transactionsLoadState()); | ||
dispatch(uniswapLoadState()); | ||
}; | ||
@@ -112,3 +115,4 @@ | ||
const getUniqueTokens = dispatch(assetsGetUniqueTokens()); | ||
return Promise.all([getBalances, getUniqueTokens]); | ||
const getUniswap = dispatch(uniswapUpdateState()); | ||
return Promise.all([getBalances, getUniswap, getUniqueTokens]); | ||
}; | ||
@@ -124,5 +128,6 @@ | ||
dispatch({ | ||
payload: assets, | ||
type: ASSETS_UPDATE_BALANCES_SUCCESS, | ||
payload: assets, | ||
}); | ||
dispatch(uniswapUpdateState()); | ||
dispatch(getNativePrices()).then(() => { | ||
@@ -129,0 +134,0 @@ resolve(true); |
@@ -6,2 +6,3 @@ import assets from './_assets'; | ||
import transactions from './_transactions'; | ||
import uniswap from './_uniswap'; | ||
import { | ||
@@ -63,2 +64,3 @@ accountClearState, | ||
transactionsAddNewTransaction, | ||
uniswap, | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1303676
65
11204
15
+ Addedimmer@^3.1.2
+ Addedimmer@3.3.0(transitive)