Package com.xeiam.xchange.dto.account

Examples of com.xeiam.xchange.dto.account.AccountInfo


    final List<Wallet> wallets = new ArrayList<Wallet>();
    for (final JustcoinBalance balanceForCurrency : justcoinBalances) {
      wallets.add(adaptWallet(balanceForCurrency));
    }

    return new AccountInfo(username, wallets);
  }
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

    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

  @Override
  public AccountInfo getAccountInfo() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    List<Wallet> wallets = getWallets();
    return new AccountInfo(null, wallets);
  }
View Full Code Here

    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

    tradingFee = sourceObject.getCommission();
    List<AtlasPosition> positions = sourceObject.getPositions();
    for (AtlasPosition position : positions) {
      wallets.add(positionToWalletTranslator.translate(position));
    }
    AccountInfo accountInfo = new AccountInfo(username, tradingFee, wallets);
    return accountInfo;
  }
View Full Code Here

      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

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    KrakenBalanceResult krakenBalance = mapper.readValue(is, KrakenBalanceResult.class);

    AccountInfo info = KrakenAdapters.adaptBalance(krakenBalance.getResult(), null);

    assertThat(info.getBalance(Currencies.EUR)).isEqualTo(new BigDecimal("1.0539"));
    assertThat(info.getBalance(Currencies.BTC)).isEqualTo(new BigDecimal("0.4888583300"));

  }
View Full Code Here

    }
    if (balance.getBalanceUSDE() != null) {
        wallets.add(new Wallet("USDE", balance.getBalanceUSDE().getAvailable(), "available"));
    }
   
    return new AccountInfo(userName, null, wallets);
  }
View Full Code Here

  }

  @Test
  public void testGetAccountInfo() throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    AccountInfo accountInfo = accountService.getAccountInfo();
    assertNotNull(accountInfo);
    LOGGER.info("Account Info: " + accountInfo);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.account.AccountInfo

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.