private static Wallet adaptWallet(List<BiboxCoin> coins) { List<Balance> balances = coins.stream().map(BiboxAdapters::adaptBalance).collect(Collectors.toList()); return new Wallet(balances); }
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()); }
private static void generic(AccountService accountService) throws IOException { System.out.println("----------GENERIC---------"); Map<Currency, Balance> balances = accountService.getAccountInfo().getWallet().getBalances(); System.out.println(balances); }
public AccountInfo mapAccountInfo(AcxAccountInfo accountInfo) { return new AccountInfo( accountInfo.name, new Wallet( accountInfo.accounts.stream().map(this::mapBalance).collect(Collectors.toList()))); }
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)); }
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()); }
public static AccountInfo adaptAccountInfo(List<KucoinCoinBalance> balances) { return new AccountInfo( new Wallet( balances.stream().map(KucoinAdapters::adaptBalance).collect(Collectors.toList()))); }
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)); }
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()); }
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)); }
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)); }
@Override public AccountInfo getAccountInfo() throws IOException { List<Balance> balances = getWallets(); return new AccountInfo(new Wallet(balances)); }
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)); }
@Override public AccountInfo getAccountInfo() throws IOException { return new AccountInfo(new Wallet(balances())); }
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()); } }
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); }
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()); } }
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); }
/** * 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); }
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)); }