public static Currency translateHuobiCurrencyCode(String currencyIn) { Currency currencyOut = assetMap.get(currencyIn); if (currencyOut == null) { logger.error("Huobi does not support the currency code " + currencyIn); return null; } return currencyOut.getCommonlyUsedCurrency(); }
public static String toLunoCurrency(Currency c) { String in = c.getCommonlyUsedCurrency().getCurrencyCode(); switch (in) { case "BTC": return "XBT"; default: return in; } }
public static Currency translateKrakenCurrencyCode(String currencyIn) { Currency currencyOut = assetsMap.get(currencyIn); if (currencyOut == null) { throw new ExchangeException("Kraken does not support the currency code " + currencyIn); } return currencyOut.getCommonlyUsedCurrency(); }
public static CurrencyPair translateHuobiCurrencyPair(String currencyPairIn) { CurrencyPair pair = assetPairMap.get(currencyPairIn); if (pair == null) { if (currencyPairIn.length() == 6) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 3)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(3, 6)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } else if (currencyPairIn.length() == 7) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 4)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(4, 7)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } } return pair; } }
public static CurrencyPair translateKrakenCurrencyPair(String currencyPairIn) { CurrencyPair pair = assetPairMap.get(currencyPairIn); if (pair == null) { // kraken can give short pairs back from open orders ? if (currencyPairIn.length() == 6) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 3)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(3, 6)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } else if (currencyPairIn.length() == 7) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 4)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(4, 7)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } } return pair; }
public static CurrencyPair translateBitmexCurrencyPair(String currencyPairIn) { CurrencyPair pair = assetPairMap.get(currencyPairIn); if (pair == null) { // bitmex can give short pairs back from open orders ? if (currencyPairIn.length() == 6) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 3)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(3, 6)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } else if (currencyPairIn.length() == 7) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 4)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(4, 7)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } } return pair; }
public static Currency translateBitmexCurrencyCode(String currencyIn) { Currency currencyOut = assetsMap.get(currencyIn); if (currencyOut == null) { throw new ExchangeException("Bitmex does not support the currency code " + currencyIn); } return currencyOut.getCommonlyUsedCurrency(); }
public static Wallet adaptWallet(IndependentReserveBalance independentReserveBalance) { List<Balance> balances = new ArrayList<>(); for (IndependentReserveAccount balanceAccount : independentReserveBalance.getIndependentReserveAccounts()) { Currency currency = Currency.getInstance(balanceAccount.getCurrencyCode().toUpperCase()); balances.add( new Balance( currency.getCommonlyUsedCurrency(), balanceAccount.getTotalBalance(), balanceAccount.getAvailableBalance())); } return new Wallet(balances); }
public static Currency translateKrakenCurrencyCode(String currencyIn) { Currency currencyOut = assetsMap.get(currencyIn); if (currencyOut == null) { throw new ExchangeException("Kraken does not support the currency code " + currencyIn); } return currencyOut.getCommonlyUsedCurrency(); }
public static CurrencyPair translateKrakenCurrencyPair(String currencyPairIn) { CurrencyPair pair = assetPairMap.get(currencyPairIn); if (pair == null) { // kraken can give short pairs back from open orders ? if (currencyPairIn.length() == 6) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 3)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(3, 6)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } else if (currencyPairIn.length() == 7) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 4)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(4, 7)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } } return pair; }
public static CurrencyPair translateBitmexCurrencyPair(String currencyPairIn) { CurrencyPair pair = assetPairMap.get(currencyPairIn); if (pair == null) { // bitmex can give short pairs back from open orders ? if (currencyPairIn.length() == 6) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 3)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(3, 6)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } else if (currencyPairIn.length() == 7) { Currency base = Currency.getInstance(currencyPairIn.substring(0, 4)); if (base.getCommonlyUsedCurrency() != null) { base = base.getCommonlyUsedCurrency(); } Currency counter = Currency.getInstance(currencyPairIn.substring(4, 7)); if (counter.getCommonlyUsedCurrency() != null) { counter = counter.getCommonlyUsedCurrency(); } pair = new CurrencyPair(base, counter); } } return pair; }
public static Currency translateBitmexCurrencyCode(String currencyIn) { Currency currencyOut = assetsMap.get(currencyIn); if (currencyOut == null) { throw new ExchangeException("Bitmex does not support the currency code " + currencyIn); } return currencyOut.getCommonlyUsedCurrency(); }