> ## 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

**params\[0]** `0x$\{string\}` *required*

Smart-account address.

**params\[1]** `string | object` *required*

EIP-712 typed data. Accepts a JSON-stringified string or the object directly; the SDK forwards the value verbatim.

## 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`](https://docs.startale.com/api-reference/rpc-methods/personal-sign), for plain strings.
* [Sign messages](https://docs.startale.com/app-sdk/sign-messages.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.