wallet_sign
Unified signing method supporting multiple message formats (ERC-7871). Delegates to personal_sign or eth_signTypedData_v4 based on the request type.
Authentication Required: Yes
Request
await jaw.provider.request({
method: 'wallet_sign',
params: [{
request: {
type: '0x45', // or '0x01'
data: { message: 'Hello World' } // or TypedData object for 0x01
},
}],
});Parameters
| Name | Type | Required | Description |
|---|---|---|---|
request.type | string | Yes | Signature type: "0x45" (personal_sign) or "0x01" (signTypedData_v4) |
request.data | object | Yes | For 0x45: { message: string }. For 0x01: TypedData object (EIP-712) |
Supported Types
| Type | EIP Standard | Description | Data Format |
|---|---|---|---|
0x45 | EIP-191 | Personal message signing | { message: string } - UTF-8 message string |
0x01 | EIP-712 | Structured typed data signing | TypedData object with types, domain, primaryType, message |
Response
Returns the signature as a hexadecimal string.
Type: 0x${string}
Example
"0x1234567890abcdef..."Behavior
- Type 0x45: Delegates to
personal_sign- adds EIP-191 prefix and signs the UTF-8 message - Type 0x01: Delegates to
eth_signTypedData_v4- signs structured EIP-712 data - Opens popup for user approval
- Returns signature in same format as the underlying method
Errors
| Code | Description |
|---|---|
| 4001 | User rejected the request |
| 4100 | Unauthorized (not authenticated) |
| -32602 | Invalid params (unsupported type or malformed data) |
Example
Personal Message (Type 0x45)
const message = 'Hello World';
const signature = await jaw.provider.request({
method: 'wallet_sign',
params: [{
request: {
type: '0x45',
data: {
message: message, // UTF-8 message string
},
},
}],
});Typed Data (Type 0x01)
const typedData = {
types: {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'wallet', type: 'address' },
],
},
primaryType: 'Person',
domain: {
name: 'My DApp',
version: '1',
chainId: 1,
},
message: {
name: 'Alice',
wallet: '0x...',
},
};
const signature = await jaw.provider.request({
method: 'wallet_sign',
params: [{
request: {
type: '0x01',
data: typedData, // TypedData object directly
},
}],
});SIWE (Sign-In With Ethereum)
const siweMessage = `example.com wants you to sign in with your Ethereum account:
0x1234...
Sign in to Example DApp
URI: https://example.com
Version: 1
Chain ID: 1
Nonce: ${crypto.randomUUID()}
Issued At: ${new Date().toISOString()}`;
const signature = await jaw.provider.request({
method: 'wallet_sign',
params: [{
request: {
type: '0x45',
data: {
message: siweMessage, // UTF-8 message string
},
},
}],
});Related Methods
- personal_sign - Direct EIP-191 message signing (type 0x45)
- eth_signTypedData_v4 - Direct EIP-712 typed data signing (type 0x01)