# eth\_signTypedData\_v4

Presents a data message for the user to sign in a structured and readable format and returns the signed response. Introduced by [EIP-712](https://eips.ethereum.org/EIPS/eip-712). This method requires that the user has granted permission to interact with their account first, so make sure to call `eth_requestAccounts` first.

## Params

#### 1. Address *(required)*

The address of the requested signing account.

string

Match pattern:^0x\[0-9a-fA-F]{40}$

#### 2. TypedData *(required)*

```typescript
type TypedDataParameters = {
    types: MessageTypes;
    primaryType: keyof MessageTypes;
    domain: {
        name?: string;
        version?: string;
        chainId?: number;
        verifyingContract?: string;
        salt?: ArrayBuffer;
    };
    message: Record<string, unknown>; // The message you're proposing the user to sign.
};

type MessageTypes = {
    EIP712Domain: MessageTypeProperty[];
    [additionalProperties: string]: MessageTypeProperty[];
};

type MessageTypeProperty = {
    name: string;
    type: string;
};
```

## Result

string

Match pattern: ^0x\[0-9a-f]\*$

## Example

### Request

```typescript
await window.NEOLineNeoX.request({
  "method": "eth_signTypedData_v4",
  "params": [
    "0xE45e9AdC2B51514849ea5B38dF37d1a65e6D52f5",
    {
      "types": {
        "EIP712Domain": [
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "version",
            "type": "string"
          },
          {
            "name": "chainId",
            "type": "uint256"
          },
          {
            "name": "verifyingContract",
            "type": "address"
          }
        ],
        "Person": [
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "wallet",
            "type": "address"
          }
        ],
        "Mail": [
          {
            "name": "from",
            "type": "Person"
          },
          {
            "name": "to",
            "type": "Person"
          },
          {
            "name": "contents",
            "type": "string"
          }
        ]
      },
      "primaryType": "Mail",
      "domain": {
        "name": "Ether Mail",
        "version": "1",
        "chainId": 1,
        "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"
      },
      "message": {
        "from": {
          "name": "Cow",
          "wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"
        },
        "to": {
          "name": "Bob",
          "wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"
        },
        "contents": "Hello, Bob!"
      }
    }
  ]
});
```

### Result

```typescript
"0x429ccb1fa34f8bd8f367e60f035dc7dd530335644617da8dff3cbfb3ef10ed90731c305676e229c2e30f8c1b910095ca2bcde77215dabe995932d5da87b42ee81c"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.neoline.io/reference/json-rpc-api/eth_signtypeddata_v4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
