fetchRewardTxsAsync method

Future<Map> fetchRewardTxsAsync({
  1. int page = 0,
  2. int size = tx_list_page_size,
  3. String? sender,
  4. String network = 'kusama',
})

Implementation

Future<Map> fetchRewardTxsAsync({
  int page = 0,
  int size = tx_list_page_size,
  String? sender,
  String network = 'kusama',
}) async {
  Completer completer = new Completer<Map>();

  ReceivePort receivePort = ReceivePort();
  Isolate isolateIns = await Isolate.spawn(
      SubScanApi.fetchRewardTxs,
      SubScanRequestParams(
        sendPort: receivePort.sendPort,
        network: network,
        address: sender,
        page: page,
        row: size,
      ));
  receivePort.listen((msg) {
    receivePort.close();
    isolateIns.kill(priority: Isolate.immediate);
    completer.complete(msg);
  });
  return completer.future as FutureOr<Map<dynamic, dynamic>>;
}