avalanche_signMessage
Calculates an Avalanche specific signature by signing a message with a given private key. Before using this method, ensure that the user has granted permission to access their account by invoking eth_requestAccounts
.
Params
(2)1. Message (required)
The message to be signed.
string
Data to sign. This can be an arbitrary length string, or hexadecimal beginning with 0x.
2. Account Index
The index whose private key to be used to sign the message. If not provided the currently active account is used.
number
Account index to sign with.
Result
(SignMessageResult)string
The signature of the message.
Errors
Code | Message |
---|---|
-32602 | Missing mandatory param(s) |
-32602 | Invalid account index provided |
-32603 | Failed to sign message |
4001 | User rejected the request. |