asyncGetAddressFromPublicKey function
Implementation
Future<dynamic> asyncGetAddressFromPublicKey(
String pubKey,
) async {
final response = new ReceivePort();
await Isolate.spawn(
_isolate_getAddressFromPublicKey,
response.sendPort,
);
final sendPort = await response.first as SendPort;
final receivePort = new ReceivePort();
sendPort.send([pubKey, receivePort.sendPort]);
try {
final result = await receivePort.first;
var resultString = result.toString();
if (resultString.startsWith('@@LaksaError@@')) {
throw resultString.substring(14);
}
response.close();
return result;
} catch (e) {
rethrow;
}
}