diff options
Diffstat (limited to 'packages/instant/src/util')
-rw-r--r-- | packages/instant/src/util/coinbase_api.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/instant/src/util/coinbase_api.ts b/packages/instant/src/util/coinbase_api.ts index 63c8077da..94a5d3c80 100644 --- a/packages/instant/src/util/coinbase_api.ts +++ b/packages/instant/src/util/coinbase_api.ts @@ -1,8 +1,10 @@ +import { BigNumber } from '@0xproject/utils'; + const baseEndpoint = 'https://api.coinbase.com/v2'; export const coinbaseApi = { - getEthUsdPrice: async (): Promise<string> => { + getEthUsdPrice: async (): Promise<BigNumber> => { const res = await fetch(`${baseEndpoint}/prices/ETH-USD/buy`); const resJson = await res.json(); - return resJson.data.amount; + return new BigNumber(resJson.data.amount); }, }; |