use of wannabit.io.cosmostaion.network.res.ResOkAccountToken in project cosmostation-android by cosmostation.
the class WUtil method getBalancesFromOkLcd.
public static ArrayList<Balance> getBalancesFromOkLcd(long accountId, ResOkAccountToken lcd) {
long time = System.currentTimeMillis();
ArrayList<Balance> result = new ArrayList<>();
if (lcd.data != null && lcd.data.currencies != null && lcd.data.currencies.size() > 0) {
for (ResOkAccountToken.OkCurrency currency : lcd.data.currencies) {
Balance temp = new Balance();
temp.accountId = accountId;
temp.symbol = currency.symbol;
temp.balance = new BigDecimal(currency.available);
temp.locked = new BigDecimal(currency.locked);
temp.fetchTime = time;
result.add(temp);
}
}
return result;
}
Aggregations