public static Wallet adaptWallet ( GatecoinBalance [ ] gatecoinBalances ) { ArrayList < Balance > balances = new ArrayList <> ( ) ; for ( GatecoinBalance balance : gatecoinBalances ) { Currency ccy = Currency . getInstance ( balance . getCurrency ( ) ) ; balances . add ( new Balance . Builder ( ) . currency ( ccy ) . total ( balance . getBalance ( ) ) . available ( balance . getAvailableBalance ( ) ) . frozen ( balance . getOpenOrder ( ) . negate ( ) ) . withdrawing ( balance . getPendingOutgoing ( ) . negate ( ) ) . depositing ( balance . getPendingIncoming ( ) . negate ( ) ) . build ( ) ) ; } return new Wallet ( balances ) ; }
Adapts a GatecoinBalance to a Wallet