public static AccountInfo adaptAccountInfo ( CryptonitBalance cryptonitBalance , String userName ) { // Adapt to XChange DTOs List < Balance > balances = new ArrayList <> ( ) ; for ( CryptonitBalance . Balance b : cryptonitBalance . getBalances ( ) ) { Balance xchangeBalance = new Balance ( Currency . getInstance ( b . getCurrency ( ) . toUpperCase ( ) ) , b . getBalance ( ) , b . getAvailable ( ) , b . getReserved ( ) , ZERO , ZERO , b . getBalance ( ) . subtract ( b . getAvailable ( ) ) . subtract ( b . getReserved ( ) ) , ZERO ) ; balances . add ( xchangeBalance ) ; } return new AccountInfo ( userName , cryptonitBalance . getFee ( ) , new Wallet ( balances ) ) ; }
Adapts a CryptonitBalance to an AccountInfo