signMessages method
Privileged Methods
The wallet endpoint should present the encoded messages (base-64 url
on mobile devices and
utf-8
on desktop browsers) for approval. If approved, the wallet endpoint should sign the
messages with the private key for the authorized account address, and return the signed
messages to the dApp endpoint. The signatures should be appended to the message, in the same
order as addresses.
Implementation
@override
Future<SignMessagesResult> signMessages(final SignMessagesParams params) async {
_checkSinglePayload(params.payloads, 'signMessage');
final Map<String, dynamic> response = await provider.signMessage(
utf8.encode(params.payloads.first),
);
return SignMessagesResult(
signedPayloads: [_encodeSignature(response)],
);
}