DTO representing a Wallet
This is simply defined by an amount of money in a given currency, contained in the cash object.
This class is immutable.
3536373839404142434445
public class CoinbaseAdapterTest { @Test public void testAdaptAccountInfo() throws IOException { Wallet wallet = new Wallet("BTC", new BigDecimal("7.10770000")); List<Wallet> wallets = new ArrayList<Wallet>(); wallets.add(wallet); AccountInfo expectedAccountInfo = new AccountInfo("demo@demo.com", wallets); // Read in the JSON from the example resources
150151152153154155156157158
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); }
144145146147148149150151152
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); }