XRPL-Labs/XRPL-Persist-Price-Oracle

Support for Multiple Currencies

tequdev opened this issue · 1 comments

Currently, only USD is supported.
Can we add support for other currencies such as JPY?

example

const Providers = {
  class: {
    usd: {Cryptowatch, Bitstamp, Kraken, Bitfinex, Hitbtc, Binance},
    jpy: {Bitbank, GMOCoin, DeCurret, HuobiJapan}
  },
  instances: {}
}
export default (async (currency='usd') => {  
  Object.assign(Providers.instances, Object.keys(Providers.class[currency]).reduce((a, providerKey) => {
    Object.assign(a, {
      [providerKey]: new Providers.class[currency][providerKey]
    })
    return a
  }, {}))

when taking this action,

const data = await aggregator

will be

  const data = await aggregator(currency)

What do you think about this?

Sorry, wrong repository.