> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# TypedData.getSignPayload

:::info
`TypedData.getSignPayload` is a re-export of ox's [`TypedData.getSignPayload`](https://oxlib.sh/api/TypedData/getSignPayload). Refer to the ox documentation for the full reference.
:::

Gets the payload to use for signing typed data in [EIP-712 format](https://eips.ethereum.org/EIPS/eip-712).

## Imports

```ts
import { TypedData } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Secp256k1, TypedData, Hash } from 'viem/utils'

const payload = TypedData.getSignPayload({
  // [!code focus:99]
  domain: {
    name: 'Ether Mail',
    version: '1',
    chainId: 1,
    verifyingContract:
      '0x0000000000000000000000000000000000000000'
  },
  types: {
    Person: [
      { name: 'name', type: 'string' },
      { name: 'wallet', type: 'address' }
    ],
    Mail: [
      { name: 'from', type: 'Person' },
      { name: 'to', type: 'Person' },
      { name: 'contents', type: 'string' }
    ]
  },
  primaryType: 'Mail',
  message: {
    from: {
      name: 'Cow',
      wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826'
    },
    to: {
      name: 'Bob',
      wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB'
    },
    contents: 'Hello, Bob!'
  }
})

const signature = Secp256k1.sign({
  payload,
  privateKey: '0x...'
})
```

## Definition

```ts
function getSignPayload<typedData, primaryType>(
  value: encode.Value<typedData, primaryType>,
): Hex.Hex
```

## Parameters

### value

* **Type:** `encode.Value<typedData, primaryType>`

The typed data to get the sign payload for.

## Return Type

The payload to use for signing.

`Hex.Hex`
