getBalanceBatch method

Future<List<CoinBalance>> getBalanceBatch(
  1. List<String> owner, {
  2. String coinType = "0x2::sui::SUI",
})

Implementation

Future<List<CoinBalance>> getBalanceBatch(List<String> owner,
    {String coinType = "0x2::sui::SUI"}) async {
  final requests = owner.map((d) => ({
    'method': 'suix_getBalance',
    'args': [d, coinType],
  }));

  var result = await client.batchRequest(requests);
  List<CoinBalance> coins = [];
  for(var coin in result) {
    coins.add(CoinBalance.fromJson(coin));
  }
  return coins;
}