aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/coinbase_api.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-30 07:53:18 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-30 07:53:18 +0800
commit274e4b3bcd1633e8fe78a33528d63b7567355f9e (patch)
tree3f5dbc8e7af9ef5d57c915a8cb51b91b2e045451 /packages/instant/src/util/coinbase_api.ts
parenta49fc27042f9797f7a035e5471e572b148679456 (diff)
downloaddexon-0x-contracts-274e4b3bcd1633e8fe78a33528d63b7567355f9e.tar.gz
dexon-0x-contracts-274e4b3bcd1633e8fe78a33528d63b7567355f9e.tar.zst
dexon-0x-contracts-274e4b3bcd1633e8fe78a33528d63b7567355f9e.zip
Introduce constants for eth gas station and coinbase
Diffstat (limited to 'packages/instant/src/util/coinbase_api.ts')
-rw-r--r--packages/instant/src/util/coinbase_api.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/instant/src/util/coinbase_api.ts b/packages/instant/src/util/coinbase_api.ts
index 080421f98..32401e423 100644
--- a/packages/instant/src/util/coinbase_api.ts
+++ b/packages/instant/src/util/coinbase_api.ts
@@ -1,9 +1,10 @@
import { BigNumber } from '@0x/utils';
-const baseEndpoint = 'https://api.coinbase.com/v2';
+import { COINBASE_API_BASE_URL } from '../constants';
+
export const coinbaseApi = {
getEthUsdPrice: async (): Promise<BigNumber> => {
- const res = await fetch(`${baseEndpoint}/prices/ETH-USD/buy`);
+ const res = await fetch(`${COINBASE_API_BASE_URL}/prices/ETH-USD/buy`);
const resJson = await res.json();
return new BigNumber(resJson.data.amount);
},