Message handlers
The message handlers let a Live App ask the user to sign an arbitrary message (for example an EIP-191 personal sign or an EIP-712 typed-data message) using one of the wallet’s accounts.
To sign a transaction instead, use the transaction handlers.
Method IDs
| Method ID | Direction | Wallet handler required? | Purpose |
|---|---|---|---|
message.sign | Live App → Wallet | yes | Sign a message with the selected account’s key. |
message.sign
The Live App passes the message as a hex string. The server decodes it to a Buffer before forwarding to the wallet’s message.sign handler. The result is encoded back to hex on the wire.
Parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
accountId | string | yes | ID of the account whose key signs the message. |
hexMessage | string | yes | Hex-encoded message to sign. |
options | object | no | Wallet-specific options. Currently: hwAppId?: string, dependencies?: string[]. |
meta | object | no | Free-form metadata, typed as Record<string, unknown>. Forwarded as-is to the wallet handler; useful for context such as the dApp identity. |
Result
{
hexSignedMessage: string
}The signed message is hex-encoded.
Errors
| Condition | Error |
|---|---|
accountId or hexMessage missing or wrong type | RpcError with code INVALID_PARAMS (-32602). |
Wallet does not implement message.sign | RpcError with code SERVER_ERROR (-32000). |
| The user rejects the request on-device | The error thrown by the wallet handler is forwarded to the Live App. |
See also
- Transaction handlers: for signing transactions instead of arbitrary messages.
- Message module (client): the client-side counterpart.
message.signsource andMessageSignschema.