org.knowm.xchange.dto.account.Wallet类的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(75)

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

Wallet介绍

[英]DTO representing a wallet

A wallet has a set of current balances in various currencies held on the exchange.
[中]代表钱包的DTO
钱包中有一组在交易所持有的各种货币的当前余额。

代码示例

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

private static Wallet adaptWallet(List<BiboxCoin> coins) {
 List<Balance> balances =
   coins.stream().map(BiboxAdapters::adaptBalance).collect(Collectors.toList());
 return new Wallet(balances);
}

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

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

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

private static void generic(AccountService accountService) throws IOException {
 System.out.println("----------GENERIC---------");
 Map<Currency, Balance> balances = accountService.getAccountInfo().getWallet().getBalances();
 System.out.println(balances);
}

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

public AccountInfo mapAccountInfo(AcxAccountInfo accountInfo) {
 return new AccountInfo(
   accountInfo.name,
   new Wallet(
     accountInfo.accounts.stream().map(this::mapBalance).collect(Collectors.toList())));
}

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

private static void generic(AccountService accountService)
  throws IOException, InterruptedException {
 System.out.println("----------GENERIC---------");
 Map<Currency, Balance> balances = accountService.getAccountInfo().getWallet().getBalances();
 System.out.println(balances);
 TimeUnit.SECONDS.sleep(1);
 System.out.println(accountService.requestDepositAddress(Currency.BTC));
}

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

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

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

public static AccountInfo adaptAccountInfo(List<KucoinCoinBalance> balances) {
 return new AccountInfo(
   new Wallet(
     balances.stream().map(KucoinAdapters::adaptBalance).collect(Collectors.toList())));
}

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

private static void generic(AccountService accountService) throws IOException {
 Map<Currency, Balance> balances = accountService.getAccountInfo().getWallet().getBalances();
 System.out.println(balances.toString());
 System.out.println(accountService.requestDepositAddress(Currency.BTC));
}

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

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

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

public static AccountInfo adaptVaultoroBalances(List<VaultoroBalance> vaultoroBalances) {
 List<Balance> balances = new ArrayList<>();
 for (VaultoroBalance vaultoroBalance : vaultoroBalances) {
  balances.add(adaptVaultoroBalance(vaultoroBalance));
 }
 return new AccountInfo(new Wallet(balances));
}

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

private static void generic(AccountService accountService) throws IOException {
 System.out.println("----------GENERIC---------");
 Map<Currency, Balance> balances = accountService.getAccountInfo().getWallet().getBalances();
 System.out.println(balances);
 System.out.println(accountService.requestDepositAddress(Currency.BTC));
}

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

@Override
public AccountInfo getAccountInfo() throws IOException {
 List<Balance> balances = getWallets();
 return new AccountInfo(new Wallet(balances));
}

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

private static void generic(AccountService accountService) throws IOException {
 System.out.println("----------GENERIC---------");
 Map<Currency, Balance> balances = accountService.getAccountInfo().getWallet().getBalances();
 System.out.println(balances);
 System.out.println(accountService.requestDepositAddress(Currency.BTC));
}

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

@Override
public AccountInfo getAccountInfo() throws IOException {
 return new AccountInfo(new Wallet(balances()));
}

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

private static void generic(AccountService accountService) throws IOException {
 // Get the account information
 AccountInfo accountInfo = accountService.getAccountInfo();
 System.out.println("Account balances: (available / available for withdrawal / total)");
 Wallet wallet = accountInfo.getWallet();
 Map<Currency, Balance> balances = wallet.getBalances();
 for (Map.Entry<Currency, Balance> entry : balances.entrySet()) {
  Balance balance = entry.getValue();
  System.out.format(
    "%s balance: %s / %s / %s\n",
    entry.getKey().getCurrencyCode(),
    balance.getAvailable(),
    balance.getAvailableForWithdrawal(),
    balance.getTotal());
 }
}

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

public static Wallet adaptWallet(Map<String, BigDecimal> krakenWallet) {
 List<Balance> balances = new ArrayList<>(krakenWallet.size());
 for (Entry<String, BigDecimal> balancePair : krakenWallet.entrySet()) {
  Currency currency = adaptCurrency(balancePair.getKey());
  Balance balance = new Balance(currency, balancePair.getValue());
  balances.add(balance);
 }
 return new Wallet(balances);
}

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

public static void main(String[] args) throws IOException {
  Exchange coingi = CoingiDemoUtils.createExchange();

  AccountInfo accountInfo = coingi.getAccountService().getAccountInfo();
  System.out.printf("Wallet balances: %s\n", accountInfo.getWallet().getBalances());
 }
}

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

public static Wallet adaptWallet(Map<String, BigDecimal> bitmexWallet) {
 List<Balance> balances = new ArrayList<>(bitmexWallet.size());
 for (Entry<String, BigDecimal> balancePair : bitmexWallet.entrySet()) {
  Currency currency = adaptCurrency(balancePair.getKey());
  Balance balance = new Balance(currency, balancePair.getValue());
  balances.add(balance);
 }
 return new Wallet(balances);
}

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

/**
 * Adapts a List of ANX Wallets to an XChange Wallet
 *
 * @param anxWallets
 * @return
 */
public static Wallet adaptWallet(Map<String, ANXWallet> anxWallets) {
 List<Balance> balances = new ArrayList<>();
 for (ANXWallet anxWallet : anxWallets.values()) {
  Balance balance = adaptBalance(anxWallet);
  if (balance != null) {
   balances.add(balance);
  }
 }
 return new Wallet(balances);
}

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

public static AccountInfo adaptAccountInfo(VircurexAccountInfoReturn vircurexAccountInfo) {
 List<Balance> balances = new ArrayList<>();
 Map<String, Map<String, BigDecimal>> funds = vircurexAccountInfo.getAvailableFunds();
 for (String lcCurrency : funds.keySet()) {
  Currency currency = Currency.getInstance(lcCurrency.toUpperCase());
  // TODO does vircurex offer total balance as well? the api page lists two output keys
  balances.add(new Balance(currency, null, funds.get(lcCurrency).get("availablebalance")));
 }
 return new AccountInfo(new Wallet(balances));
}

相关文章

微信公众号

最新文章

更多

Wallet类方法