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)
Message (required)
string
Data to sign. This can be an arbitrary length string, or hexadecimal beginning with 0x.
β
Account Index
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. |
For any additional questions, please view our other knowledge base articles or contact a Product Support team member via the chat button. Examples are for illustrative purposes only.