fetchTxsAsync method
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>>;
}