fetchTxsAsync method

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

Implementation

Future<Map> fetchTxsAsync(
  String module, {
  String? call,
  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.fetchTxs,
      SubScanRequestParams(
        sendPort: receivePort.sendPort,
        network: network,
        module: module,
        call: call,
        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>>;
}