Package com.xeiam.xchange.dto.trade

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


  public static Wallet adaptWallet(final JustcoinBalance justcoinBalance) {

    final String currency = justcoinBalance.getCurrency();
    final BigDecimal balance = justcoinBalance.getBalance();
    return new Wallet(currency, balance);
  }
View Full Code Here


    return new OrderBook(timeStamp, askOrders, bidOrders);
  }

  public static AccountInfo adaptAccountInfo(String username, CoinsetterAccount account) {

    return new AccountInfo(username, Arrays.asList(new Wallet(Currencies.BTC, account.getBtcBalance()), new Wallet(Currencies.USD, account.getUsdBalance())));
  }
View Full Code Here

  public static AccountInfo adaptAccountInfo(VosAccount account, String userName) {

    List<Wallet> wallets = new ArrayList<Wallet>();

    for (Entry<String, VosWallet> entry : account.getWallets().getVosMap().entrySet()) {
      wallets.add(new Wallet(entry.getKey(), entry.getValue().getBalance().getValue()));
    }

    return new AccountInfo("" + account.getAccount_id(), account.getTrade_fee().getVosMap().get("BTC").getValue(), wallets);
  }
View Full Code Here

  public static AccountInfo adaptBalance(Map<String, BigDecimal> krakenBalance, String username) {

    List<Wallet> wallets = new ArrayList<Wallet>();
    for (Entry<String, BigDecimal> balancePair : krakenBalance.entrySet()) {
      String currency = adaptCurrency(balancePair.getKey());
      Wallet wallet = new Wallet(currency, balancePair.getValue());
      wallets.add(wallet);
    }
    return new AccountInfo(username, wallets);
  }
View Full Code Here

    List<Wallet> wallets = new ArrayList<Wallet>(accountInfoRaw.length);

    for (int i = 0; i < accountInfoRaw.length; i++) {
      HitbtcBalance balance = accountInfoRaw[i];

      Wallet wallet = new Wallet(balance.getCurrencyCode(), balance.getCash().add(balance.getReserved()), balance.getCurrencyCode());
      wallets.add(wallet);

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

    List<Wallet> wallets = new ArrayList<Wallet>();

    // Adapt to XChange DTOs
    if (balance.getBalanceBTC() != null) {
      wallets.add(new Wallet(Currencies.BTC, balance.getBalanceBTC().getAvailable(), "available"));
      wallets.add(new Wallet(Currencies.BTC, balance.getBalanceBTC().getOrders(), "orders"));
    }
    if (balance.getBalanceLTC() != null) {
      wallets.add(new Wallet(Currencies.LTC, balance.getBalanceLTC().getAvailable(), "available"));
      wallets.add(new Wallet(Currencies.LTC, balance.getBalanceLTC().getOrders(), "orders"));
    }
    if (balance.getBalanceNMC() != null) {
      wallets.add(new Wallet(Currencies.NMC, balance.getBalanceNMC().getAvailable(), "available"));
      wallets.add(new Wallet(Currencies.NMC, balance.getBalanceNMC().getOrders(), "orders"));
    }
    if (balance.getBalanceIXC() != null) {
      wallets.add(new Wallet(Currencies.IXC, balance.getBalanceIXC().getAvailable(), "available"));
    }
    if (balance.getBalanceDVC() != null) {
      wallets.add(new Wallet(Currencies.DVC, balance.getBalanceDVC().getAvailable(), "available"));
    }
    if (balance.getBalanceGHS() != null) {
      wallets.add(new Wallet(Currencies.GHs, balance.getBalanceGHS().getAvailable(), "available"));
      wallets.add(new Wallet(Currencies.GHs, balance.getBalanceGHS().getOrders(), "orders"));
    }
    if (balance.getBalanceUSD() != null) {
      wallets.add(new Wallet(Currencies.USD, balance.getBalanceUSD().getAvailable(), "available"));
      wallets.add(new Wallet(Currencies.USD, balance.getBalanceUSD().getOrders(), "orders"));
    }
    if (balance.getBalanceDRK() != null) {
      wallets.add(new Wallet(Currencies.DRK, balance.getBalanceDRK().getAvailable(), "available"));
      wallets.add(new Wallet(Currencies.DRK, balance.getBalanceDRK().getOrders(), "orders"));
    }
    if (balance.getBalanceEUR() != null) {
      wallets.add(new Wallet(Currencies.EUR, balance.getBalanceEUR().getAvailable(), "available"));
    }
    if (balance.getBalanceDOGE() != null) {
      wallets.add(new Wallet(Currencies.DOGE, balance.getBalanceDOGE().getAvailable(), "available"));
    }
    if (balance.getBalanceFTC() != null) {
      wallets.add(new Wallet(Currencies.FTC, balance.getBalanceFTC().getAvailable(), "available"));
    }
    if (balance.getBalanceMEC() != null) {
      wallets.add(new Wallet(Currencies.MEC, balance.getBalanceMEC().getAvailable(), "available"));
    }
    if (balance.getBalanceWDC() != null) {
      wallets.add(new Wallet(Currencies.WDC, balance.getBalanceWDC().getAvailable(), "available"));
    }
    if (balance.getBalanceMYR() != null) {
      wallets.add(new Wallet(Currencies.MYR, balance.getBalanceMYR().getAvailable(), "available"));
    }
    if (balance.getBalanceAUR() != null) {
        wallets.add(new Wallet("AUR", balance.getBalanceAUR().getAvailable(), "available"));
    }
    if (balance.getBalancePOT() != null) {
        wallets.add(new Wallet("POT", balance.getBalancePOT().getAvailable(), "available"));
    }
    if (balance.getBalanceANC() != null) {
        wallets.add(new Wallet("ANC", balance.getBalanceANC().getAvailable(), "available"));
    }
    if (balance.getBalanceDGB() != null) {
        wallets.add(new Wallet("DGB", balance.getBalanceDGB().getAvailable(), "available"));
    }
    if (balance.getBalanceUSDE() != null) {
        wallets.add(new Wallet("USDE", balance.getBalanceUSDE().getAvailable(), "available"));
    }
   
    return new AccountInfo(userName, null, wallets);
  }
View Full Code Here

    List<Wallet> wallets = new ArrayList<Wallet>(response.length);

    for (BitfinexBalancesResponse balance : response) {
      if ("exchange".equals(balance.getType())) {
        wallets.add(new Wallet(balance.getCurrency().toUpperCase(), balance.getAmount()));
      }
    }

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

    return new Trade(type, trade.getAmount(), currencyPair, trade.getPrice(), time, null);
  }

  public static AccountInfo adaptAccountInfo(BitVcAccountInfo a) {

    Wallet cny = new Wallet(CNY, a.getAvailableCnyDisplay().add(a.getFrozenCnyDisplay()).subtract(a.getLoanCnyDisplay()), "available");
    Wallet btc = new Wallet(BTC, a.getAvailableBtcDisplay().add(a.getFrozenBtcDisplay()).subtract(a.getLoanBtcDisplay()), "available");
    Wallet ltc = new Wallet(LTC, a.getAvailableLtcDisplay().add(a.getFrozenLtcDisplay()).subtract(a.getLoanLtcDisplay()), "available");

    // loaned wallets
    Wallet cnyLoan = new Wallet(CNY, a.getLoanCnyDisplay(), "loan");
    Wallet btcLoan = new Wallet(BTC, a.getLoanBtcDisplay(), "loan");
    Wallet ltcLoan = new Wallet(LTC, a.getLoanLtcDisplay(), "loan");

    List<Wallet> wallets = Arrays.asList(cny, btc, ltc, cnyLoan, btcLoan, ltcLoan);
    return new AccountInfo(null, wallets);
  }
View Full Code Here

  public static AccountInfo adaptAccountInfo(String userName, CryptoTradeAccountInfo accountInfo) {

    List<Wallet> wallets = new ArrayList<Wallet>();
    for (Entry<String, BigDecimal> fundsEntry : accountInfo.getFunds().entrySet())
      wallets.add(new Wallet(fundsEntry.getKey().toUpperCase(), fundsEntry.getValue()));

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

    if (anxWallet == null) { // use the presence of a currency String to indicate existing wallet at ANX
      return null; // an account maybe doesn't contain a ANXWallet
    }
    else {
      return new Wallet(anxWallet.getBalance().getCurrency(), anxWallet.getBalance().getValue());
    }

  }
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.