EIP712 TypedData is expected to be a JSON object, not a string #2638
Replies: 4 comments
-
The JSON.stringify is there because MetaMask did not work without it. Has that changed? |
Beta Was this translation helpful? Give feedback.
-
Hmmm... I will have to try with metamask. I have initially encountered this issue when trying to call _signedTypedData while using ganache. I get a 'cannot sign data; string sent, expected object' so I cannot even generate a signature |
Beta Was this translation helpful? Give feedback.
-
I would favour working in MM and the other wallets before Ganache (it’s easy enough to get ganache updated), but would love to do what the spec says, as long as it works. :) |
Beta Was this translation helpful? Give feedback.
-
Confirmed, unfortunately MM does expect a string :( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
EIP 712 specifies that TypedData should be a JSON object.
https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc
However, it seems as ethers is providing a string as a result of this code here:
https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/json-rpc-provider.ts#L273
It seems like the JSON.stringify() should be removed.
Is there a reason for the stringify call that I am not understanding?
Beta Was this translation helpful? Give feedback.
All reactions