signMessage method

Future<ExtensionSignResult?> signMessage(
  1. String password,
  2. String message,
  3. String address
)

Open a new webView for a DApp, sign extrinsic or msg for the DApp.

Implementation

Future<ExtensionSignResult?> signMessage(
  String password,
  String message,
  String address,
) async {
  final signature = await service.signMessage(
      address: address, message: message, pass: password);
  if (signature == null) {
    return null;
  }
  if (signature['error'] != null) {
    throw Exception(signature['error']);
  }
  final ExtensionSignResult res = ExtensionSignResult();
  res.signature = signature['signature'];
  return res;
}