org.knowm.xchange.currency.Currency.toString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.knowm.xchange.currency.Currency.toString()方法的一些代码示例,展示了Currency.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Currency.toString()方法的具体详情如下:
包路径:org.knowm.xchange.currency.Currency
类名称:Currency
方法名:toString

Currency.toString介绍

暂无

代码示例

代码示例来源:origin: knowm/XChange

public static String adaptXchangeCurrency(Currency xchangeSymbol) {
 if (xchangeSymbol == null) {
  return null;
 }
 return xchangeSymbol.toString().toLowerCase();
}

代码示例来源:origin: knowm/XChange

public CCEXPriceResponse getTicker(CurrencyPair pair) throws IOException {
 CCEXTickerResponse response =
   ccex.getTicker(pair.base.toString().toLowerCase(), pair.counter.toString().toLowerCase());
 return response.getTicker();
}

代码示例来源:origin: knowm/XChange

@Override
public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException {
 IndependentReserveTicker t =
   getIndependentReserveTicker(currencyPair.base.toString(), currencyPair.counter.toString());
 return IndependentReserveAdapters.adaptTicker(t, currencyPair);
}

代码示例来源:origin: knowm/XChange

public List<Map> getBitbayTransactions(CurrencyPair currencyPair)
  throws IOException, ExchangeException {
 return bitbayAuthenticated.transactions(
   apiKey,
   sign,
   exchange.getNonceFactory(),
   currencyPair == null
     ? null
     : currencyPair.base.toString() + "-" + currencyPair.counter.toString());
}

代码示例来源:origin: knowm/XChange

@Override
 public String requestDepositAddress(Currency currency, String... strings) throws IOException {
  return getDepositAddress(currency.toString());
 }
}

代码示例来源:origin: knowm/XChange

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 + "'");
}

代码示例来源:origin: knowm/XChange

public ZaifFullBook getZaifFullBook(CurrencyPair currencyPair) throws IOException {
 try {
  return this.zaif.getDepth(
    currencyPair.base.toString().toLowerCase(),
    currencyPair.counter.toString().toLowerCase());
 } catch (ZaifException e) {
  throw new ExchangeException(e.getMessage());
 }
}

代码示例来源:origin: knowm/XChange

@Override
public String requestDepositAddress(Currency currency, String... strings) throws IOException {
 BitMarketDepositResponse response = depositToBitMarket(currency.toString());
 return response.getData();
}

代码示例来源:origin: knowm/XChange

public CryptoFacilitiesTicker getCryptoFacilitiesTicker(CurrencyPair currencyPair)
  throws IOException {
 CryptoFacilitiesTicker ticker =
   getCryptoFacilitiesTickers().getTicker(currencyPair.base.toString());
 return ticker;
}

代码示例来源:origin: knowm/XChange

/**
 * 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();
}

代码示例来源:origin: knowm/XChange

@Override
public String withdrawFunds(Currency currency, BigDecimal amount, String address)
  throws IOException {
 return withdraw(null, currency.toString(), address, amount).getRefid();
}

代码示例来源:origin: knowm/XChange

@Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
 try {
  return getBittrexDepositAddress(currency.toString());
 } catch (BittrexException e) {
  throw BittrexErrorAdapter.adapt(e);
 }
}

代码示例来源:origin: knowm/XChange

@Override
public String requestDepositAddress(Currency currency, String... args) throws IOException {
 try {
  return getDepositAddress(currency.toString());
 } catch (PoloniexException e) {
  throw PoloniexErrorAdapter.adapt(e);
 }
}

代码示例来源:origin: knowm/XChange

@Override
public String withdrawFunds(Currency currency, BigDecimal amount, String address)
  throws IOException {
 BitMarketWithdrawResponse response =
   withdrawFromBitMarket(currency.toString(), amount, address);
 return response.getData();
}

代码示例来源:origin: knowm/XChange

public List<CoinMarketCapTicker> getCoinMarketCapTickers(int start, int limit, Currency convert)
   throws IOException {

  return coinmarketcap.getTickers(start, limit, convert.toString(), "array").getData();
 }
}

代码示例来源:origin: knowm/XChange

@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);
}

代码示例来源:origin: knowm/XChange

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());
  }
 }
}

代码示例来源:origin: knowm/XChange

@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();
 }
}

代码示例来源:origin: knowm/XChange

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());
  }
 }
}

代码示例来源:origin: knowm/XChange

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());
 }
}

相关文章