Work around for EIP712 on React Naitve #5052
Unanswered
Elvin-Skaria
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently working on a React native project that requires me to implement EIP712 typed hashing and signing.
I have implemented the code on React with Metamask, where the both web3.currentProvider.sendAsync() or web3.currentProvider.send() returned the required a signed hash. The method used for signing is eth_signTypedData_v4.
But when trying the similar code on react native it returns an error that looks something like this:
ERROR {"error": {"code": -32700, "message": "err:[]*jsonrpc.Request: decode slice: expect [ or n, but found {, error found in #1 byte of ...|{\"signMetho|..., bigger context ...|{\"signMethod\":\"eth_signTypedData_v4\",\"params\":[\"0x5|... when unmarshal request"}, "id": "", "jsonrpc": "2.0"}
I even tried using web3.eth.sign() and web3.eth.personal.sign(), but the hash returned isn't the one as required, as it fails in getting the verification in the smart contract.
Following is the Code that I have implement on my React naitve project:
Following are the version of the packages that are being used:
"web3": "^1.7.0" "react-native": "0.67.2",
Please do let me know if any workaround is possible for this. Thank you
Beta Was this translation helpful? Give feedback.
All reactions