public static String toPairString(CurrencyPair currencyPair) { return currencyPair.counter.getCurrencyCode().toLowerCase() + "-" + currencyPair.base.getCurrencyCode().toLowerCase(); }
/** * Adapts a currency pair to the keys returned by the tickers map. * * @param currencyPair The currency pair to convert to LakeBTCs ticker keys * @return A string suitable for looking up ticker information. */ public static String adaptCurrencyPair(CurrencyPair currencyPair) { return currencyPair.base.getCurrencyCode().toLowerCase() + currencyPair.counter.getCurrencyCode().toLowerCase(); } }
public static String getAcxMarket(CurrencyPair currencyPair) { return currencyPair.base.getCurrencyCode().toLowerCase() + currencyPair.counter.getCurrencyCode().toLowerCase(); } }
public static String createBitcoindePair(CurrencyPair currencyPair) { return currencyPair.base.getCurrencyCode().toLowerCase() + currencyPair.counter.getCurrencyCode().toLowerCase(); } }
@Override public String toString() { return pair == null ? "" : String.format( "%s%s", pair.base.getCurrencyCode().toLowerCase(), pair.counter.getCurrencyCode().toLowerCase()); } }
public CexIODepth getCexIOOrderBook(CurrencyPair currencyPair) throws IOException { CexIODepth cexIODepth = cexio.getDepth(currencyPair.base.getCurrencyCode(), currencyPair.counter.getCurrencyCode()); return cexIODepth; }
/** * @param pair * @return */ public static String toSymbol(CurrencyPair pair) { if (pair.equals(CurrencyPair.IOTA_BTC)) { return "IOTABTC"; } return pair.base.getCurrencyCode() + pair.counter.getCurrencyCode(); }
public static String toSymbol(CurrencyPair pair) { if (pair.equals(CurrencyPair.IOTA_BTC)) { return "IOTABTC"; } return pair.base.getCurrencyCode() + pair.counter.getCurrencyCode(); }
private static String getMarketNameFromPair(CurrencyPair pair) { return pair == null ? null : new StringBuilder() .append(pair.base.getCurrencyCode()) .append("-") .append(pair.counter.getCurrencyCode()) .toString(); } }
public CexIOCancelAllOrdersResponse cancelCexIOOrders(CurrencyPair currencyPair) throws IOException { return cexIOAuthenticated.cancelAllOrders( signatureCreator, currencyPair.base.getCurrencyCode(), currencyPair.counter.getCurrencyCode(), new CexIORequest()); }
@Override public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException { // Request data BitcoinAverageTicker bitcoinAverageTicker = getBitcoinAverageTicker( currencyPair.base.getCurrencyCode(), currencyPair.counter.getCurrencyCode()); // Adapt to XChange DTOs return BitcoinAverageAdapters.adaptTicker(bitcoinAverageTicker, currencyPair); }
public BitcoindeIdResponse bitcoindeCancelOrders(String order_id, CurrencyPair currencyPair) throws IOException { try { String currPair = currencyPair.base.getCurrencyCode() + currencyPair.counter.getCurrencyCode(); return bitcoinde.deleteOrder(apiKey, nonceFactory, signatureCreator, order_id, currPair); } catch (BitcoindeException e) { throw handleError(e); } }
@Override public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException { return CoinEggAdapters.adaptOrders( getCoinEggOrders(currencyPair.base.getCurrencyCode().toLowerCase()), currencyPair); }
public BTCMarketsTradeHistory getBTCMarketsUserTransactions( CurrencyPair currencyPair, Integer limit, Long since) throws IOException { BTCMarketsOpenOrdersAndTradeHistoryRequest request = new BTCMarketsOpenOrdersAndTradeHistoryRequest( currencyPair.counter.getCurrencyCode(), currencyPair.base.getCurrencyCode(), limit, since); return btcm.getTradeHistory( exchange.getExchangeSpecification().getApiKey(), nonceFactory, signer, request); }
private static void generic(Exchange bitcoinAverageExchange) throws IOException { // Interested in the public market data feed (no authentication) MarketDataService marketDataService = bitcoinAverageExchange.getMarketDataService(); // Get the latest ticker data showing BTC to EUR Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_EUR); double value = ticker.getLast().doubleValue(); System.out.println("Last: " + ticker.getCurrencyPair().counter.getCurrencyCode() + "-" + value); System.out.println("Last: " + ticker.getLast().toString()); System.out.println("Volume: " + ticker.getVolume().toString()); }
public String submitWithdraw( Currency currency, BigDecimal amount, String address, String paymentId) throws IOException { CryptopiaBaseResponse<Long> response = cryptopia.submitWithdraw( signatureCreator, new Cryptopia.SubmitWithdrawRequest( currency.getCurrencyCode(), address, paymentId, amount)); return String.valueOf(response.getData()); }
@Override public String requestDepositAddress(Currency currency, String... args) throws IOException { List<BitflyerAddress> addresses = getAddresses(); for (BitflyerAddress address : addresses) { if (address.getCurrencyCode().equals(currency.getCurrencyCode())) return address.getAddress(); } throw new NotAvailableFromExchangeException(); }
@Override public String requestDepositAddress(Currency currency, String... args) throws IOException { Bl3pNewDepositAddress newDepositAddress = this.bl3p.createNewDepositAddress( apiKey, signatureCreator, nonceFactory, currency.getCurrencyCode()); return newDepositAddress.getData().getAddress(); }
@Override public String requestDepositAddress(Currency currency, String... arguments) throws IOException { try { final BitfinexDepositAddressResponse response = super.requestDepositAddressRaw(currency.getCurrencyCode()); return response.getAddress(); } catch (BitfinexException e) { throw BitfinexErrorAdapter.adapt(e); } }
/** @return transfer fee for the base leg of the order in the base currency */ public BigDecimal getExpectedBaseTransferFee(final RippleLimitOrder order) throws IOException { final ITransferFeeSource transferFeeSource = (ITransferFeeSource) exchange.getAccountService(); final String counterparty = order.getBaseCounterparty(); final String currency = order.getCurrencyPair().base.getCurrencyCode(); final BigDecimal quantity = order.getOriginalAmount(); final OrderType type = order.getType(); return getExpectedTransferFee(transferFeeSource, counterparty, currency, quantity, type); }