Package com.xeiam.xchange.dto.trade

Examples of com.xeiam.xchange.dto.trade.Wallet


   * @return The account info
   */
  public static AccountInfo adaptAccountInfo(BitstampBalance bitstampBalance, String userName) {

    // Adapt to XChange DTOs
    Wallet usdWallet = new Wallet(Currencies.USD, bitstampBalance.getUsdBalance());
    Wallet btcWallet = new Wallet(Currencies.BTC, bitstampBalance.getBtcBalance());

    return new AccountInfo(userName, bitstampBalance.getFee(), Arrays.asList(usdWallet, btcWallet));
  }
View Full Code Here


      userId = itBitAccountInfoReturn.getUserId();

      for (int j = 0; j < balances.length; j++) {
        ItBitAccountBalance itBitAccountBalance = balances[j];

        Wallet wallet = new Wallet(itBitAccountBalance.getCurrency(), itBitAccountBalance.getAvailableBalance(), itBitAccountInfoReturn.getName());
        wallets.add(wallet);
      }
    }

    return new AccountInfo(userId, wallets);
View Full Code Here

   */
  public static AccountInfo adaptAccountInfo(BitcurexFunds funds, String userName) {

    // Adapt to XChange DTOs
    List<Wallet> wallets = new ArrayList<Wallet>(2);
    wallets.add(new Wallet(Currencies.BTC, funds.getBtcs()));

    BigDecimal eur = funds.getEurs();
    if (eur != null)
      wallets.add(new Wallet(Currencies.EUR, eur));

    BigDecimal pln = funds.getPlns();
    if (pln != null)
      wallets.add(new Wallet(Currencies.PLN, pln));

    return new AccountInfo(userName, null, wallets);
  }
View Full Code Here

  public static AccountInfo adaptAccountInfo(List<BittrexBalance> balances) {

    List<Wallet> wallets = new ArrayList<Wallet>(balances.size());

    for (BittrexBalance balance : balances) {
      wallets.add(new Wallet(balance.getCurrency().toUpperCase(), balance.getAvailable()));
    }

    return new AccountInfo(null, wallets);
  }
View Full Code Here

  public static AccountInfo adaptAccountInfo(BTCTradeBalance balance) {

    checkException(balance);

    List<Wallet> wallets = new ArrayList<Wallet>(4);
    wallets.add(new Wallet(Currencies.BTC, balance.getBtcBalance().add(balance.getBtcReserved())));
    wallets.add(new Wallet(Currencies.LTC, balance.getLtcBalance().add(balance.getLtcReserved())));
    wallets.add(new Wallet(Currencies.DOGE, balance.getDogeBalance().add(balance.getDogeReserved())));
    wallets.add(new Wallet("YBC", balance.getYbcBalance().add(balance.getYbcReserved())));
    wallets.add(new Wallet(Currencies.CNY, balance.getCnyBalance().add(balance.getCnyReserved())));
    return new AccountInfo(null, wallets);
  }
View Full Code Here

  public static AccountInfo adaptAccountInfo(final CoinbaseUser user) {

    final String username = user.getEmail();
    final CoinbaseMoney balance = user.getBalance();
    final Wallet wallet = new Wallet(balance.getCurrency(), balance.getAmount());
    final List<Wallet> wallets = new ArrayList<Wallet>();
    wallets.add(wallet);

    final AccountInfo accountInfo = new AccountInfo(username, wallets);
    return accountInfo;
View Full Code Here

    Map<String, BigDecimal> funds = cryptsyAccountInfo.getAvailableFunds();

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();

      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

    List<Wallet> wallets = new ArrayList<Wallet>();
    Map<String, Map<String, BigDecimal>> funds = vircurexAccountInfo.getAvailableFunds();

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();
      wallets.add(new Wallet(currency, funds.get(lcCurrency).get("availablebalance")));
    }
    return new AccountInfo(vircurexAccountInfo.getAccount(), wallets);
  }
View Full Code Here

    List<Wallet> wallets = new ArrayList<Wallet>();
    Map<String, BigDecimal> funds = btceAccountInfo.getFunds();

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();
      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

    Map<String, BigDecimal> funds = btceAccountInfo.getFunds();

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();

      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.trade.Wallet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.