Open CapDev12 opened 6 years ago
This is a common problem (see https://github.com/knowm/XChange/issues/2394), and one for which we don't have a common solution for yet.
Personally I believe the existing Currency
class shouldn't have ticker symbols in in, but should just be a bunch of constants representing the abstract concept of the currency (i.e. BITCOIN or BITCOIN_CASH).
Then there could be a mapping that takes place inside each exchange implementation that translates the Currency
into t a ticker symbol. The mapping would be the same for 99% of the currencies, but where an exchange uses BCC v's BCH, or XBT v's BTC you could have per-exchange mappings.
Currently it's not done consistently, some exchanges explicitly do some mapping, others don't.
This idea is quite a bit of work, and would be a breaking change.
isn't XBT some kind of legacy thing in Livecoin and besides XBT they also use BTC in their responces / requests?
@npomfret another possible approach would be to maintain a standardized list of codes and do proper mapping it exchange API implementations, I think many applications that use this library to this in their code as they them self need ticker codes
@SunFrost @npomfret @timmolter does this commit accurately demonstrate the problem in the unit test and a desirable first pass at moving ahead in the same unit test?
https://github.com/knowm/XChange/pull/2534/commits/516c4ffc506e3eb7a922892578ecc00ff87b89df
I have XBT on the ballance
accountService.getAccountInfo().getWallets
BTC override XBT XBT lost
package org.knowm.xchange.currency; /**
public static final Currency BTC = createCurrency("BTC", "Bitcoin", null, "XBT");