BithumbAdapters { public static AccountInfo adaptAccountInfo(BithumbAccount account, BithumbBalance balance) { List<Balance> balances = new ArrayList<>(); balances.add( new Balance( Currency.KRW, balance.getTotalKrw(), balance.getAvailableKrw(), balance.getInUseKrw())); for (String currency : balance.getCurrencies()) { final Balance xchangeBalance = new Balance( Currency.getInstance(currency), balance.getTotal(currency), balance.getAvailable(currency), balance.getFrozen(currency)); balances.add(xchangeBalance); } return new AccountInfo(null, account.getTradeFee(), Wallet.Builder.from(balances).build()); } private  BithumbAdapters(); static OrderBook adaptOrderBook(BithumbOrderbook orderbook); static AccountInfo adaptAccountInfo(BithumbAccount account, BithumbBalance balance); static Ticker adaptTicker(BithumbTicker bithumbTicker, CurrencyPair currencyPair); static List<Ticker> adaptTickers(BithumbTickersReturn bithumbTickers); static Trades adaptTransactions(
      List<BithumbTransactionHistory> bithumbTrades, CurrencyPair currencyPair); static Trade adaptTransactionHistory(
      BithumbTransactionHistory trade, CurrencyPair currencyPair); static OpenOrders adaptOrders(List<BithumbOrder> bithumbOrders); static LimitOrder adaptOrder(BithumbOrder order); static UserTrades adaptUserTrades(
      List<BithumbUserTransaction> transactions, CurrencyPair currencyPair); static Order adaptOrderDetail(BithumbOrderDetail order, String id); static CurrencyPair adaptCurrencyPair(String orderCurrency, String paymentCurrency); static final String SEARCH_BUY; static final String SEARCH_SELL; }
@Test public void testAdaptAccountInfo() throws IOException { InputStream isAccount = BithumbAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/bithumb/dto/account/example-account.json"); InputStream isBalance = BithumbAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/bithumb/dto/account/example-balance.json"); final BithumbAccount bithumbAccount = mapper.readValue(isAccount, BithumbAccount.class); final BithumbBalance bithumbBalance = mapper.readValue(isBalance, BithumbBalance.class); final AccountInfo accountInfo = BithumbAdapters.adaptAccountInfo(bithumbAccount, bithumbBalance); final Wallet wallet = accountInfo.getWallet(); final Balance balance = wallet.getBalance(Currency.BTC); assertThat(accountInfo.getTradingFee()).isEqualTo(new BigDecimal("0.0015")); assertThat(wallet.getBalances()).containsKeys(Currency.BTC, Currency.ETH, Currency.XRP); assertThat(balance.getTotal()).isEqualTo(new BigDecimal("0.00001971")); assertThat(balance.getAvailable()).isEqualTo(new BigDecimal("0.00001971")); }