aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-13 00:55:33 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-13 00:55:33 +0800
commit09c5ae4e65f8fddd4504be041f27f9107d12df7d (patch)
tree2ea933f00101bc4e075d705155cb59d1618abc01 /packages/instant/src/redux
parent03b235bb428e8a61934ff603f22f057d8394b56a (diff)
downloaddexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.tar
dexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.tar.gz
dexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.tar.bz2
dexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.tar.lz
dexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.tar.xz
dexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.tar.zst
dexon-sol-tools-09c5ae4e65f8fddd4504be041f27f9107d12df7d.zip
feat: have coinbase API return BigNumber for eth-usd price endpoint
Diffstat (limited to 'packages/instant/src/redux')
-rw-r--r--packages/instant/src/redux/async_data.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/instant/src/redux/async_data.ts b/packages/instant/src/redux/async_data.ts
index 3fde2d2e5..b368491f0 100644
--- a/packages/instant/src/redux/async_data.ts
+++ b/packages/instant/src/redux/async_data.ts
@@ -1,5 +1,6 @@
import { BigNumber } from '@0xproject/utils';
+import { BIG_NUMBER_ZERO } from '../constants';
import { ActionTypes } from '../types';
import { coinbaseApi } from '../util/coinbase_api';
@@ -7,15 +8,15 @@ import { store } from './store';
export const asyncData = {
fetchAndDispatchToStore: async () => {
- let ethUsdPriceStr = '0';
+ let ethUsdPrice = BIG_NUMBER_ZERO;
try {
- ethUsdPriceStr = await coinbaseApi.getEthUsdPrice();
+ ethUsdPrice = await coinbaseApi.getEthUsdPrice();
} catch (e) {
// ignore
} finally {
store.dispatch({
type: ActionTypes.UPDATE_ETH_USD_PRICE,
- data: new BigNumber(ethUsdPriceStr),
+ data: ethUsdPrice,
});
}
},