trustwallet / trust-web3-provider

Web3 javascript wrapper provider for iOS and Android platforms.
https://trustwallet.com
760 stars 423 forks source link

"eth_signTypedData_v4" Unknown method(s) requested #489

Open TheJuze opened 9 months ago

TheJuze commented 9 months ago

Hi, I'm using ethers + WalletConnect2 + wagmi + mobile TrustWallet app. While trying to send signer.signTypedData it throws error

"error": {
  "code": 5201,
  "message": "Unknown method(s) requested"
},
"payload": {
  "method": "eth_signTypedData_v4",
  "params": [...]
  "id": 10,
  "jsonrpc": "2.0"
}

Version of each library:

frankfka commented 8 months ago

We're getting this at Vertex as well. Users (specifically mobile) run into:

could not coalesce error (error={ "code": -32000, "message": "The operation couldn’t be completed. (TrustWalletConnect.WCError error 1.)" }, payload={ "id": 7, "jsonrpc": "2.0", "method": "eth_signTypedData_v4", "params": [ "...", "{"types":{"WithdrawCollateral":[{"name":"sender","type":"bytes32"},{"name":"productId","type":"uint32"},{"name":"amount","type":"uint128"},{"name":"nonce","type":"uint64"}],"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}]},"domain":{"name":"Vertex","version":"0.0.1","chainId":"0xa4b1","verifyingContract":"0xbbee07b3e8121227afcfe1e2b82772246226128e"},"primaryType":"WithdrawCollateral","message":{"sender":"...","productId":"31","amount":"99004594","nonce":"0"}}" ] }, code=UNKNOWN_ERROR, version=6.8.1)
ManavPanchal commented 7 months ago

We're getting this at Vertex as well. Users (specifically mobile) run into:

could not coalesce error (error={ "code": -32000, "message": "The operation couldn’t be completed. (TrustWalletConnect.WCError error 1.)" }, payload={ "id": 7, "jsonrpc": "2.0", "method": "eth_signTypedData_v4", "params": [ "...", "{"types":{"WithdrawCollateral":[{"name":"sender","type":"bytes32"},{"name":"productId","type":"uint32"},{"name":"amount","type":"uint128"},{"name":"nonce","type":"uint64"}],"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}]},"domain":{"name":"Vertex","version":"0.0.1","chainId":"0xa4b1","verifyingContract":"0xbbee07b3e8121227afcfe1e2b82772246226128e"},"primaryType":"WithdrawCollateral","message":{"sender":"...","productId":"31","amount":"99004594","nonce":"0"}}" ] }, code=UNKNOWN_ERROR, version=6.8.1)

My implementation is also encountering the same error. I've tried various methods suggested in this GitHub discussion #2240 , but the issue persists.