queryReferendums method

Future<ReferendumData> queryReferendums(
  1. String address
)

Implementation

Future<ReferendumData> queryReferendums(String address) async {
  final Map res = await service.queryReferendums(address);
  final ongoing = List<ReferendumGroup>.from(
      res['ongoing'].map((e) => ReferendumGroup.fromJson(e)));
  final userVotes = List<ReferendumVote>.from(
      res['userVotes'].map((e) => ReferendumVote.fromJson(e)));
  return ReferendumData(ongoing: ongoing, userVotes: userVotes);
}