Open monsterbitar opened 5 years ago
While a workaround exists doing two conversions from BCH -> BTC -> fiat, it complicates implementation and may introduce unforseen latency/slippage; better provide the rates for BCH directly as a first-class citizen.
We have a quick fix that allows calling bitpayBCH
as a provider, can submit as PR if maintainers are interested.
In https://github.com/bitpay/bitcore/blob/master/packages/bitcore-wallet-service/src/lib/fiatrateproviders/bitpay.ts a provider for the bitpay fiat exchange rate for their default cryptocurrency is provided.
This lets users get the BTC rate at a later time through BWS, but there is no way to get BCH rates right now.
I assume the proper solution is to copy that file, and amend the name and url to match the BCH version and let the BWC request that specific provider, for example:
Provider named
BitPayBCH
using thehttps://bitpay.com/api/rates/BCH
url.