com.xeiam.xchange.dto.account.AccountInfo类的使用及代码示例

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

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

AccountInfo介绍

暂无

代码示例

代码示例来源:origin: com.xeiam.xchange/xchange-poloniex

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

代码示例来源:origin: aido/AidoATP

private void updateBooks() {
  wallets = accountInfo.getWallets();
  for(Wallet wallet : wallets){
    CurrencyUnit currency = wallet.getBalance().getCurrencyUnit();
    //Do we have a new currency in our wallet?
    if(!books.containsKey(currency)){
      //Make some space for it.
      books.put(currency,new ArrayList<BigMoney>());
    }
    ArrayList<BigMoney> ledger = books.get(currency);
    ledger.add(wallet.getBalance());
  }
}

代码示例来源:origin: com.xeiam.xchange/xchange-coinfloor

List<Wallet> oldWallets = cachedAccountInfo.getWallets();
 for (Wallet wallet : oldWallets) {
  if (wallet.getCurrency().equals(rawRetObj.getAsset())) {
accountInfo = new AccountInfo(null, newWallets);
cachedAccountInfo = accountInfo;

代码示例来源:origin: aido/AidoATP

log.info("{} AccountInfo as String: {}",exchangeName,accountInfo.toString());
refreshAccounts();
startTickers();

代码示例来源:origin: aido/AidoATP

log.info(AccountManager.getInstance(exchangeName).getAccountInfo().toString());
  ProfitLossAgent.getInstance().calcProfitLoss();
}else{

代码示例来源:origin: com.xeiam.xchange/xchange-justcoin

public static AccountInfo adaptAccountInfo(final String username, final JustcoinBalance[] justcoinBalances) {
 final List<Wallet> wallets = new ArrayList<Wallet>();
 for (final JustcoinBalance balanceForCurrency : justcoinBalances) {
  wallets.add(adaptWallet(balanceForCurrency));
 }
 return new AccountInfo(username, wallets);
}

代码示例来源:origin: aido/AidoATP

public synchronized void refreshAccounts() {
  accountInfo = accountService.getAccountInfo();
  updateBooks();
  ProfitLossAgent.getInstance().updateBalances(accountInfo.getWallets());
}

代码示例来源:origin: aido/AidoATP

log.info("Arbitrage bought "+qtyTo.withScale(8,RoundingMode.HALF_EVEN).toString() +" for "+ qtyToBTC.withScale(8,RoundingMode.HALF_EVEN).toString()+" on "+exchangeName);
  log.info("Arbitrage successfully traded "+qtyFrom.toString()+" for "+qtyTo.toString()+" on "+exchangeName);
  log.info(AccountManager.getInstance(exchangeName).getAccountInfo().toString());	
  ProfitLossAgent.getInstance().calcProfitLoss();        
} else {

代码示例来源:origin: com.xeiam.xchange/xchange-cryptotrade

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);
}

代码示例来源:origin: aido/AidoATP

public BigMoney getBalance(CurrencyUnit currency) throws WalletNotFoundException{
  refreshAccounts();
  wallets = accountInfo.getWallets();
  for(Wallet wallet : wallets){
    BigMoney balance = wallet.getBalance();
    CurrencyUnit unit = balance.getCurrencyUnit();
    if(unit.equals(currency)){
      return balance;
    }
  }
  log.error("ERROR: Could not find a {} wallet for the currency {}. Exiting now!",exchangeName,currency);
  throw new WalletNotFoundException();
}

代码示例来源:origin: com.xeiam.xchange/xchange-btce

public static AccountInfo adaptAccountInfo(BTCEAccountInfo btceAccountInfo) {
 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);
}

代码示例来源:origin: com.xeiam.xchange/xchange-kraken

public static AccountInfo adaptBalance(Map<String, BigDecimal> krakenBalance, String username) {
 Map<String, Wallet> wallets = new ConcurrentHashMap<String, Wallet>();
 for (Entry<String, BigDecimal> balancePair : krakenBalance.entrySet()) {
  String currency = adaptCurrency(balancePair.getKey());
  Wallet wallet = new Wallet(currency, balancePair.getValue());
  wallets.put(currency, wallet);
 }
 return new AccountInfo(username, wallets);
}

代码示例来源:origin: com.xeiam.xchange/xchange-cointrader

public static AccountInfo adaptAccountInfo(Map<String, CointraderBalance> balances, String userName) {
 HashMap<String, Wallet> wallets = new HashMap<String, Wallet>();
 for (String currency : balances.keySet()) {
  CointraderBalance blc = balances.get(currency);
  wallets.put(currency, new Wallet(currency, blc.getTotal(), blc.getAvailable()));
 }
 return new AccountInfo(userName, wallets);
}

代码示例来源:origin: com.xeiam.xchange/xchange-cryptsy

/**
 * Adapts CryptsyAccountInfoReturn DTO to XChange standard AccountInfo DTO
 *
 * @param cryptsyAccountInfoReturn Raw returned data from Cryptsy, CryptsyAccountInfoReturn DTO
 * @return Standard XChange AccountInfo DTO
 */
public static AccountInfo adaptAccountInfo(CryptsyAccountInfoReturn cryptsyAccountInfoReturn) {
 CryptsyAccountInfo cryptsyAccountInfo = cryptsyAccountInfoReturn.getReturnValue();
 List<Wallet> wallets = new ArrayList<Wallet>();
 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);
}

代码示例来源:origin: com.xeiam.xchange/xchange-bittrex

public static AccountInfo adaptAccountInfo(List<BittrexBalance> balances) {
 List<Wallet> wallets = new ArrayList<Wallet>(balances.size());
 for (BittrexBalance balance : balances) {
  // FIXME: the second parameter should be balance.getBalance(),
  // keep it balance.getAvailable() for safe reason,
  // will be fixed in XChange 4.0.0.
  wallets.add(new Wallet(balance.getCurrency().toUpperCase(), balance.getAvailable(), balance.getAvailable()));
 }
 return new AccountInfo(null, wallets);
}

代码示例来源:origin: com.xeiam.xchange/xchange-bitfinex

public static AccountInfo adaptAccountInfo(BitfinexBalancesResponse[] response) {
 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(), balance.getAvailable()));
  }
 }
 return new AccountInfo(null, wallets);
}

代码示例来源:origin: com.xeiam.xchange/xchange-bleutrade

public static AccountInfo adaptBleutradeBalances(List<BleutradeBalance> bleutradeBalances) {
 List<Wallet> wallets = new ArrayList<Wallet>();
 for (BleutradeBalance bleutradeBalance : bleutradeBalances) {
  // FIXME: the second parameter should be balance.getBalance(),
  // keep it balance.getAvailable() for safe reason,
  // will be fixed in XChange 4.0.0.
  wallets.add(new Wallet(bleutradeBalance.getCurrency(), bleutradeBalance.getAvailable(), bleutradeBalance.getAvailable()));
 }
 return new AccountInfo(null, wallets);
}

代码示例来源:origin: com.xeiam.xchange/xchange-mtgox

/**
 * Adapts a MtGoxAccountInfo to a AccountInfo
 * 
 * @param mtGoxAccountInfo
 * @return
 */
public static AccountInfo adaptAccountInfo(MtGoxAccountInfo mtGoxAccountInfo) {
 // Adapt to XChange DTOs
 AccountInfo accountInfo = new AccountInfo(mtGoxAccountInfo.getLogin(), MtGoxAdapters.adaptWallets(mtGoxAccountInfo.getWallets()));
 return accountInfo;
}

代码示例来源:origin: com.xeiam.xchange/xchange-mtgox

/**
 * Adapts a MtGoxAccountInfo to a AccountInfo
 * 
 * @param mtGoxAccountInfo
 * @return
 */
public static AccountInfo adaptAccountInfo(MtGoxAccountInfo mtGoxAccountInfo) {
 // Adapt to XChange DTOs
 AccountInfo accountInfo = new AccountInfo(mtGoxAccountInfo.getLogin(), MtGoxAdapters.adaptWallets(mtGoxAccountInfo.getWallets()));
 return accountInfo;
}

代码示例来源:origin: com.xeiam.xchange/xchange-therock

public static AccountInfo adaptAccountInfo(List<TheRockBalance> balances, String userName) {
 Map<String, Wallet> wallets = new HashMap<>();
 for (TheRockBalance blc : balances) {
  wallets.put(blc.getCurrency(), new Wallet(blc.getCurrency(), blc.getBalance(), blc.getTradingBalance()));
 }
 return new AccountInfo(userName, wallets);
}

相关文章

微信公众号

最新文章

更多