public static String adaptXchangeCurrency(Currency xchangeSymbol) { if (xchangeSymbol == null) { return null; } return xchangeSymbol.toString().toLowerCase(); }
@Override public String requestDepositAddress(Currency currency, String... strings) throws IOException { return getDepositAddress(currency.toString()); } }
public static CurrencyPair convert(String symbol) { // Iterate by base currency priority at binance. for (Currency base : Arrays.asList(Currency.BTC, Currency.ETH, Currency.BNB, Currency.USDT)) { if (symbol.contains(base.toString())) { String counter = symbol.replace(base.toString(), ""); return new CurrencyPair(base, new Currency(counter)); } } throw new IllegalArgumentException("Could not parse currency pair from '" + symbol + "'"); }
@Override public String requestDepositAddress(Currency currency, String... strings) throws IOException { BitMarketDepositResponse response = depositToBitMarket(currency.toString()); return response.getData(); }
public CryptoFacilitiesTicker getCryptoFacilitiesTicker(CurrencyPair currencyPair) throws IOException { CryptoFacilitiesTicker ticker = getCryptoFacilitiesTickers().getTicker(currencyPair.base.toString()); return ticker; }
/** * Retrieves limited amount of tickers from CoinMarketCap * * @param limit count of tickers to be retrieved * @param convert currency to get price converted to */ public List<CoinMarketCapTicker> getCoinMarketCapTickers(final int limit, Currency convert) throws IOException { return coinmarketcap.getTickers(limit, convert.toString(), "array").getData(); }
@Override public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException { return withdraw(null, currency.toString(), address, amount).getRefid(); }
@Override public String requestDepositAddress(Currency currency, String... arguments) throws IOException { try { return getBittrexDepositAddress(currency.toString()); } catch (BittrexException e) { throw BittrexErrorAdapter.adapt(e); } }
@Override public String requestDepositAddress(Currency currency, String... args) throws IOException { try { return getDepositAddress(currency.toString()); } catch (PoloniexException e) { throw PoloniexErrorAdapter.adapt(e); } }
@Override public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException { BitMarketWithdrawResponse response = withdrawFromBitMarket(currency.toString(), amount, address); return response.getData(); }
public List<CoinMarketCapTicker> getCoinMarketCapTickers(int start, int limit, Currency convert) throws IOException { return coinmarketcap.getTickers(start, limit, convert.toString(), "array").getData(); } }
@Override public String requestDepositAddress(Currency currency, String... args) throws IOException { KrakenDepositAddress[] depositAddresses; if (Currency.BTC.equals(currency)) { depositAddresses = getDepositAddresses(currency.toString(), "Bitcoin", false); } else if (Currency.LTC.equals(currency)) { depositAddresses = getDepositAddresses(currency.toString(), "Litecoin", false); } else { throw new RuntimeException("Not implemented yet, Kraken works only for BTC and LTC"); } return KrakenAdapters.adaptKrakenDepositAddress(depositAddresses); }
public BitfinexPublicFundingTrade[] getBitfinexPublicFundingTrades( Currency currency, int limitTrades, long startTimestamp, long endTimestamp, int sort) throws IOException { try { return bitfinex.getPublicFundingTrades( "f" + currency.toString(), limitTrades, startTimestamp, endTimestamp, sort); } catch (HttpStatusIOException e) { throw new BitfinexException(e.getHttpBody()); } } }
@Override public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException { GatecoinWithdrawResult result = withdrawGatecoinFunds(currency.toString(), amount, address); if (result.getResponseStatus().getMessage().equalsIgnoreCase("ok")) { return "Ok"; } else { return result.getResponseStatus().getMessage(); } }
public CryptoFacilitiesPublicFills getCryptoFacilitiesHistory(CurrencyPair currencyPair) throws IOException { CryptoFacilitiesPublicFills publicFills = cryptoFacilities.getHistory(currencyPair.base.toString()); if (publicFills.isSuccess()) { publicFills.setCurrencyPair(currencyPair); return publicFills; } else { throw new ExchangeException("Error getting CF public fills: " + publicFills.getError()); } } }
public CryptoFacilitiesOrderBook getCryptoFacilitiesOrderBook(CurrencyPair currencyPair) throws IOException { CryptoFacilitiesOrderBook orderBook = cryptoFacilities.getOrderBook(currencyPair.base.toString()); if (orderBook.isSuccess()) { orderBook.setCurrencyPair(currencyPair); return orderBook; } else { throw new ExchangeException("Error getting CF order book: " + orderBook.getError()); } }