aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/coinbase_api.ts
blob: 63c8077da4d1dcca852ddb83167eb0ea308c4db0 (plain) (blame)
1
2
3
4
5
6
7
8
const baseEndpoint = 'https://api.coinbase.com/v2';
export const coinbaseApi = {
    getEthUsdPrice: async (): Promise<string> => {
        const res = await fetch(`${baseEndpoint}/prices/ETH-USD/buy`);
        const resJson = await res.json();
        return resJson.data.amount;
    },
};