signMessage
Function Signature
Description
Signs a personal message using thepersonal_sign RPC method, which prepends the standard Ethereum message prefix before signing.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | String | Yes | The chain ID in CAIP-2 format |
message | String | Yes | The message to sign (plain text or hex) |
Returns
String - The signature as a hex string.
Example
signTypedData
Function Signature
Description
Signs typed data according to the EIP-712 standard using theeth_signTypedData_v4 RPC method.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | String | Yes | The chain ID in CAIP-2 format |
typedData | String | Yes | The typed data as a JSON string |
Returns
String - The signature as a hex string.
Example
Errors
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
SIGNING_FAILED | The signing operation failed |
INVALID_TYPED_DATA | The typed data JSON is invalid |