signAndSend method

Future<Map?> signAndSend(
  1. Map txInfo,
  2. String params,
  3. dynamic password,
  4. dynamic onStatusChange(
    1. String
    ),
)

Implementation

Future<Map?> signAndSend(Map txInfo, String params, password,
    Function(String) onStatusChange) async {
  final msgId =
      "onStatusChange${serviceRoot.webView!.getEvalJavascriptUID()}";
  serviceRoot.webView!.addMsgHandler(msgId, onStatusChange);
  final code =
      'keyring.sendTx(api, ${jsonEncode(txInfo)}, $params, "$password", "$msgId")';
  // print(code);
  final dynamic res = await serviceRoot.webView!.evalJavascript(code);
  serviceRoot.webView!.removeMsgHandler(msgId);

  return res;
}