queryBonded method

Future<Map<String?, AccountBondedInfo>> queryBonded(
  1. List<String> pubKeys
)

query staking stash-controller relationship of a list of pubKeys, return list of pubKey, controllerAddress, stashAddress.

Implementation

Future<Map<String?, AccountBondedInfo>> queryBonded(
    List<String> pubKeys) async {
  if (pubKeys.length == 0) {
    return {};
  }
  final res = Map<String?, AccountBondedInfo>();
  final List data =
      await (service.queryBonded(pubKeys) as FutureOr<List<dynamic>>);
  data.forEach((e) {
    res[e[0]] = AccountBondedInfo(e[0], e[1], e[2]);
  });
  return res;
}