org.knowm.xchange.dto.account.Balance.getAvailable()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(204)

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

Balance.getAvailable介绍

[英]Returns the amount of the currency in this balance that is available to trade.
[中]返回此余额中可用于交易的currency金额。

代码示例

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

  1. /**
  2. * Returns the amount of the <code>currency</code> in this balance that may be withdrawn. Equal to
  3. * <code>available - borrowed</code>.
  4. *
  5. * @return the amount that is available to withdraw.
  6. */
  7. public BigDecimal getAvailableForWithdrawal() {
  8. return getAvailable().subtract(getBorrowed());
  9. }

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

  1. private static void generic(AccountService accountService) throws IOException {
  2. // Get the account information
  3. AccountInfo accountInfo = accountService.getAccountInfo();
  4. System.out.println("Account balances: (available / available for withdrawal / total)");
  5. Wallet wallet = accountInfo.getWallet();
  6. Map<Currency, Balance> balances = wallet.getBalances();
  7. for (Map.Entry<Currency, Balance> entry : balances.entrySet()) {
  8. Balance balance = entry.getValue();
  9. System.out.format(
  10. "%s balance: %s / %s / %s\n",
  11. entry.getKey().getCurrencyCode(),
  12. balance.getAvailable(),
  13. balance.getAvailableForWithdrawal(),
  14. balance.getTotal());
  15. }
  16. }

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

  1. private static void generic(AccountService accountService) throws IOException {
  2. AccountInfo accountInfo = accountService.getAccountInfo();
  3. System.out.println("Wallet: " + accountInfo);
  4. System.out.println(
  5. "ETH balance: " + accountInfo.getWallet().getBalance(Currency.ETH).getAvailable());
  6. }

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

  1. private static void generic(AccountService accountService) throws IOException {
  2. // Get the account information
  3. AccountInfo accountInfo = accountService.getAccountInfo();
  4. System.out.println("Wallet: " + accountInfo);
  5. System.out.println(
  6. "BTC balance: " + accountInfo.getWallet().getBalance(Currency.BTC).getAvailable());
  7. }

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

  1. private static void generic(AccountService accountService) throws IOException {
  2. AccountInfo accountInfo = accountService.getAccountInfo();
  3. System.out.println("Wallet: " + accountInfo);
  4. System.out.println(
  5. "ETH balance: " + accountInfo.getWallet().getBalance(Currency.ETH).getAvailable());
  6. }

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

  1. public static Builder from(Balance balance) {
  2. return new Builder()
  3. .currency(balance.getCurrency())
  4. .total(balance.getTotal())
  5. .available(balance.getAvailable())
  6. .frozen(balance.getFrozen())
  7. .borrowed(balance.getBorrowed())
  8. .loaned(balance.getLoaned())
  9. .withdrawing(balance.getWithdrawing())
  10. .depositing(balance.getDepositing());
  11. }

代码示例来源:origin: org.knowm.xchange/xchange-core

  1. /**
  2. * Returns the amount of the <code>currency</code> in this balance that may be withdrawn. Equal to
  3. * <code>available - borrowed</code>.
  4. *
  5. * @return the amount that is available to withdraw.
  6. */
  7. public BigDecimal getAvailableForWithdrawal() {
  8. return getAvailable().subtract(getBorrowed());
  9. }

代码示例来源:origin: org.knowm.xchange/xchange-core

  1. public static Builder from(Balance balance) {
  2. return new Builder()
  3. .currency(balance.getCurrency())
  4. .total(balance.getTotal())
  5. .available(balance.getAvailable())
  6. .frozen(balance.getFrozen())
  7. .borrowed(balance.getBorrowed())
  8. .loaned(balance.getLoaned())
  9. .withdrawing(balance.getWithdrawing())
  10. .depositing(balance.getDepositing());
  11. }

相关文章