transfer method
Implementation
Future<Map> transfer(
{required String token,
required double amount,
required String to,
required String sender,
required String pass,
required Map gasOptions,
required Function(Map) onStatusChange}) async {
final code =
'eth.keyring.transfer("$token", $amount, "$to", "$sender", "$pass", ${jsonEncode(gasOptions)})';
print('send evm transfer:');
print(code);
final res = await serviceRoot.webView!.evalJavascript(code);
if (res != null && res['hash'] != null) {
serviceRoot.webView!.addMsgHandler(res['hash'], (Map res) {
onStatusChange(res);
if ((res['confirmNumber'] ?? -1) > 1) {
serviceRoot.webView!.removeMsgHandler(res['hash']);
}
});
}
return res;
}