Signs data using a specific account. This method calculates an Ethereum specific signature with:
sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))).Parameters
The data to sign, in hexadecimal format.
The address of the account that should sign the data.
Returns
A signature string in hexadecimal format.
Example Usage
Error Handling
Error code indicating the type of error that occurred.
Human-readable error message describing what went wrong.
| Code | Message | Description |
|---|---|---|
| 4001 | User denied signature request | User rejected the signing request |
| 4100 | Requested method not supported | The method is not supported by the wallet |
| 4200 | Wallet not connected | No wallet connection available |
| 4300 | Invalid parameters | The provided parameters are invalid |
Always verify signatures on the server side before trusting them. Client-side signature verification should only be used for UX purposes.