Signing messages
Last updated
Last updated
You can request a user to sign a message with a private key of his connected account. This can be achieved in two ways.
You can call the signMessage
on the fuel
object providing the account address (in ) you want to sign message with, and the message itself:
Or you can get an instance of the wallet first and then call the signMessage
method on it:
After calling any of the methods, the app will prompt the user to authorize the request. The following screen will appear:
Once the user approves the request, the promise is finalized with a string - the signature. If anything goes wrong, e.g. the user cancels the request, the method call will result in an exception.