FhenixProtocol / fhenix.js

The JavaScript SDK for Fhenix
https://fhenixjs.fhenix.zone/
Other
2 stars 1 forks source link

When calling generatePermit using hardhat the function fails #9

Closed Cashmaney closed 6 months ago

Cashmaney commented 6 months ago

With the error TypeError: signer._signTypedData is not a function

Replacing the line const msgSig = await signer._signTypedData( with const msgSig = await signer.signTypedData( solves it, but obviously not the best solution.

To replicate:

Open a new hardhat project, and try to do this:

export async function createFheInstance(hre: HardhatRuntimeEnvironment, contractAddress: string): Promise<FheContract> {
  const { ethers } = hre;

  const instance = await createInstance({ provider: hre.ethers.provider });

  const permit = await generatePermit(contractAddress, hre.ethers.provider);

  return {instance, permit};
}