aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-05-01 07:36:42 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-05-01 07:40:02 +0800
commit1131d66b3db2bde04b5108d710801fab7eaf0ede (patch)
tree636c2640f1e01f607e75841ba1de26bdae2f87ca /packages/website/ts/utils
parent2403323463be66166dae9f8ca7903caab2546717 (diff)
downloaddexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.tar
dexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.tar.gz
dexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.tar.bz2
dexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.tar.lz
dexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.tar.xz
dexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.tar.zst
dexon-sol-tools-1131d66b3db2bde04b5108d710801fab7eaf0ede.zip
Hit website backend for price information
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r--packages/website/ts/utils/backend_client.ts10
-rw-r--r--packages/website/ts/utils/configs.ts2
2 files changed, 5 insertions, 7 deletions
diff --git a/packages/website/ts/utils/backend_client.ts b/packages/website/ts/utils/backend_client.ts
index ab0fb4f32..63e06fda7 100644
--- a/packages/website/ts/utils/backend_client.ts
+++ b/packages/website/ts/utils/backend_client.ts
@@ -14,13 +14,13 @@ export const backendClient = {
const result = await fetchUtils.requestAsync(configs.BACKEND_BASE_URL, ETH_GAS_STATION_ENDPOINT);
return result;
},
- async getPriceInfosAsync(tokenAddresses: string[]): Promise<WebsiteBackendPriceInfo[]> {
- if (_.isEmpty(tokenAddresses)) {
- return [];
+ async getPriceInfoAsync(tokenSymbols: string[]): Promise<WebsiteBackendPriceInfo> {
+ if (_.isEmpty(tokenSymbols)) {
+ return {};
}
- const joinedTokenAddresses = tokenAddresses.join(',');
+ const joinedTokenSymbols = tokenSymbols.join(',');
const queryParams = {
- tokens: joinedTokenAddresses,
+ tokens: joinedTokenSymbols,
};
const result = await fetchUtils.requestAsync(configs.BACKEND_BASE_URL, PRICES_ENDPOINT, queryParams);
return result;
diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts
index a214593d4..a54fc56a8 100644
--- a/packages/website/ts/utils/configs.ts
+++ b/packages/website/ts/utils/configs.ts
@@ -13,8 +13,6 @@ export const configs = {
BACKEND_BASE_URL: 'https://website-api.0xproject.com',
BASE_URL,
BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208',
- CRYPTO_COMPARE_BASE_URL: 'https://min-api.cryptocompare.com/data',
- FIAT_QUOTE_CURRENCY_SYMBOL: 'USD',
DEFAULT_DERIVATION_PATH: `44'/60'/0'`,
// WARNING: ZRX & WETH MUST always be default trackedTokens
DEFAULT_TRACKED_TOKEN_SYMBOLS: ['WETH', 'ZRX'],