SetProtocol/set.js

Internationalize trade quote currency values

Opened this issue · 0 comments

At the moment prices are returned in USD and there are no other currency options. From #60 review

It's interesting seeing this kind of code here, I know it's a direct mapping of what's happening in the service right now, but it feels like we'd want a separation of generating the data and formatting the data.

We previously followed a "dumb" client type of approach where the client only needed to display strings and not worry about formatting but its weird seeing that now in a library.

Also note, in #60 there's an open question whether the vs_currencies parameter of the CoinGecko coin prices req needs to be paired one-for-one with the addresses lists:

const coinPrices = await coinGecko.fetchCoinPrices({
contractAddresses: [this.chainCurrencyAddress(chainId), fromTokenAddress, toTokenAddress],
vsCurrencies: [ USD_CURRENCY_CODE, USD_CURRENCY_CODE, USD_CURRENCY_CODE ],
});