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

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

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

Currency.getCurrencyCode介绍

[英]Gets the currency code originally used to acquire this object.
[中]获取最初用于获取此对象的货币代码。

代码示例

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

public static String toPairString(CurrencyPair currencyPair) {
 return currencyPair.counter.getCurrencyCode().toLowerCase()
   + "-"
   + currencyPair.base.getCurrencyCode().toLowerCase();
}

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

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

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

public static String getAcxMarket(CurrencyPair currencyPair) {
  return currencyPair.base.getCurrencyCode().toLowerCase()
    + currencyPair.counter.getCurrencyCode().toLowerCase();
 }
}

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

public static String createBitcoindePair(CurrencyPair currencyPair) {

  return currencyPair.base.getCurrencyCode().toLowerCase()
    + currencyPair.counter.getCurrencyCode().toLowerCase();
 }
}

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

@Override
 public String toString() {
  return pair == null
    ? ""
    : String.format(
      "%s%s",
      pair.base.getCurrencyCode().toLowerCase(),
      pair.counter.getCurrencyCode().toLowerCase());
 }
}

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

public CexIODepth getCexIOOrderBook(CurrencyPair currencyPair) throws IOException {
 CexIODepth cexIODepth =
   cexio.getDepth(currencyPair.base.getCurrencyCode(), currencyPair.counter.getCurrencyCode());
 return cexIODepth;
}

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

/**
 * @param pair
 * @return
 */
public static String toSymbol(CurrencyPair pair) {
 if (pair.equals(CurrencyPair.IOTA_BTC)) {
  return "IOTABTC";
 }
 return pair.base.getCurrencyCode() + pair.counter.getCurrencyCode();
}

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

public static String toSymbol(CurrencyPair pair) {
 if (pair.equals(CurrencyPair.IOTA_BTC)) {
  return "IOTABTC";
 }
 return pair.base.getCurrencyCode() + pair.counter.getCurrencyCode();
}

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

private static String getMarketNameFromPair(CurrencyPair pair) {

  return pair == null
    ? null
    : new StringBuilder()
      .append(pair.base.getCurrencyCode())
      .append("-")
      .append(pair.counter.getCurrencyCode())
      .toString();
 }
}

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

public CexIOCancelAllOrdersResponse cancelCexIOOrders(CurrencyPair currencyPair)
  throws IOException {
 return cexIOAuthenticated.cancelAllOrders(
   signatureCreator,
   currencyPair.base.getCurrencyCode(),
   currencyPair.counter.getCurrencyCode(),
   new CexIORequest());
}

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

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

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

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

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

@Override
public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {
 return CoinEggAdapters.adaptOrders(
   getCoinEggOrders(currencyPair.base.getCurrencyCode().toLowerCase()), currencyPair);
}

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

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

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

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

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

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

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

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

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

@Override
public String requestDepositAddress(Currency currency, String... args) throws IOException {
 Bl3pNewDepositAddress newDepositAddress =
   this.bl3p.createNewDepositAddress(
     apiKey, signatureCreator, nonceFactory, currency.getCurrencyCode());
 return newDepositAddress.getData().getAddress();
}

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

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

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

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

相关文章