# TypedData.encodeType

Encodes [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) schema for the provided primaryType.

## Imports

:::code-group
```ts [Named]
import { TypedData } from 'ox'
```

```ts [Entrypoint]
import * as TypedData from 'ox/TypedData'
```
:::

## Examples

```ts twoslash
import { TypedData } from 'ox'

TypedData.encodeType({
  types: {
    Foo: [
      { name: 'address', type: 'address' },
      { name: 'name', type: 'string' },
      { name: 'foo', type: 'string' }
    ]
  },
  primaryType: 'Foo'
})
// @log: 'Foo(address address,string name,string foo)'
```

## Definition

```ts
function encodeType(
  value: encodeType.Value,
): string
```

**Source:** [src/core/TypedData.ts](https://github.com/wevm/ox/blob/main/src/core/TypedData.ts#L1040)

## Parameters

### value

* **Type:** `encodeType.Value`

The Typed Data schema.

#### value.primaryType

* **Type:** `string`

#### value.types

* **Type:** `abitype.TypedData`

## Return Type

The encoded type.

`string`
