> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_signTypedData_v4

> Sign EIP-712 structured data with the user's smart account.

Signs typed data per EIP-712. Use for orders, permits, and any signed payload that needs domain separation.

## Request

```ts theme={null}
const signature = await provider.request<`0x${string}`>({
  method: 'eth_signTypedData_v4',
  params: [
    address,
    JSON.stringify({
      domain: {
        name: 'My App',
        version: '1',
        chainId: 1868,
        verifyingContract: '0x...',
      },
      types: {
        EIP712Domain: [
          { name: 'name', type: 'string' },
          { name: 'version', type: 'string' },
          { name: 'chainId', type: 'uint256' },
          { name: 'verifyingContract', type: 'address' },
        ],
        Order: [
          { name: 'item', type: 'string' },
          { name: 'amount', type: 'uint256' },
        ],
      },
      primaryType: 'Order',
      message: { item: 'Pass', amount: '1' },
    }),
  ],
})
```

## Parameters

<ParamField path="params[0]" type="`0x${string}`" required>
  Smart-account address.
</ParamField>

<ParamField path="params[1]" type="string | object" required>
  EIP-712 typed data. Accepts a JSON-stringified string or the object directly; the SDK forwards the value verbatim.
</ParamField>

## Returns

`0x${string}`, the signature.

## Errors

| Code     | Cause                |
| -------- | -------------------- |
| `4001`   | User rejected        |
| `4100`   | Wallet not connected |
| `-32602` | Malformed typed data |

## Verification

```ts theme={null}
import { publicClient } from './viem'

const isValid = await publicClient.verifyTypedData({
  address,
  domain,
  types,
  primaryType: 'Order',
  message,
  signature,
})
```

## Related

* [`personal_sign`](/api-reference/rpc-methods/personal-sign), for plain strings.
* [Sign messages](/app-sdk/sign-messages)
