# Calling eth\_signTypedData\_v4 using @openzeppelin/test-environment

**URL:** <https://forum.openzeppelin.com/t/calling-eth-signtypeddata-v4-using-openzeppelin-test-environment/29309>\
**Category:** Support\
**Tags:** test-environment, etherscan-verify\
**Created:** [June 2, 2022, 4:16pm UTC](https://forum.openzeppelin.com/t/calling-eth-signtypeddata-v4-using-openzeppelin-test-environment/29309 "2022-06-02T16:16:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mario.christopher](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mario.christopher](https://forum.openzeppelin.com/u/mario.christopher)\
**Post date:** [June 2, 2022, 4:16pm UTC](https://forum.openzeppelin.com/t/calling-eth-signtypeddata-v4-using-openzeppelin-test-environment/29309/1 "2022-06-02T16:16:08Z")

</div>

Hi  
I am trying to write Unit Tests for testing Signing and Verification of data payloads using `eth_signTypedData_v4 `.

In my unit test i write Typescript code to sign the data, and then pass that signature to the SmartContract wherein I attempt to verify it. But I am unable to sign the data in the first place using the `web3` provided by `@openzeppelin/test-environment`.

Here is my code inside my Unit test to try and sign it.

```auto
import { accounts, contract, web3 } from "@openzeppelin/test-environment";
...
...
  async function signVoucher(payload: any, signerAddress: string) {
    return new Promise((resolve, reject) => {
      (web3.currentProvider as any).send(
        {
          method: "eth_signTypedData_v4",
          params: [signerAddress, payload],
        },
        (err: any, res: any) => {
          if (err) {
            reject(err);
          } else {
            console.log("Signature :", res);
            resolve(res);
          }
        }
      );
    });
  }

```

This is the error I get:

```auto
error: {
        message: 'Method eth_signTypedData_v4 not supported.',
        code: -32000,
        data: {
          stack: 'Error: Method eth_signTypedData_v4 not supported.\n' +
          :
          :
          name: 'Error'
        }

```

This is the version of my modules:

```auto
    "@openzeppelin/test-environment": "0.1.9",
    "@openzeppelin/test-helpers": "0.5.15",

```

How do I call `eth_signTypedData_v4` from within my Unit Tests ?

Thanks.

---

<div class="post-metadata">

**Author:** ![JulissaDantes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/julissadantes/32/15410_2.png) [@JulissaDantes](https://forum.openzeppelin.com/u/JulissaDantes)\
**Post date:** [June 3, 2022, 12:26pm UTC](https://forum.openzeppelin.com/t/calling-eth-signtypeddata-v4-using-openzeppelin-test-environment/29309/2 "2022-06-03T12:26:34Z")

</div>

Does this answers your question?

> [@ProviderError: The method eth\_signTypedData\_v4 does not exist/is not available](https://forum.openzeppelin.com/t/providererror-the-method-eth-signtypeddata-v4-does-not-exist-is-not-available/16929):
>
> Hi @here, I was wrking on on workshop nft-drop by openzeppline. There the repository using --network localhost, For this it working fine. Here I want to use Kovan testnet for deploying, sign and redeem scripts for my usecase. When I use kova testnet for ( npx hardhat run scripts/2-sign.js --network kovan ) It gives me an error -\> ProviderError: The method eth\_signTypedData\_v4 does not exist/is not available. How to handle this. Repository link : [https://github.com/OpenZeppelin/workshops/tree/m…](https://github.com/OpenZeppelin/workshops/tree/master/06-nft-merkle-drop)

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [June 8, 2022, 8:35pm UTC](https://forum.openzeppelin.com/t/calling-eth-signtypeddata-v4-using-openzeppelin-test-environment/29309/3 "2022-06-08T20:35:29Z")

</div>

`@openzeppelin/test-environment` has been deprecated a long time ago. It is no longer maintained, and you should not be using it.
