Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: signTypedData using Coinbase Wallet not working #1451

Open
ceduarte25 opened this issue Nov 30, 2024 · 3 comments
Open

Bug: signTypedData using Coinbase Wallet not working #1451

ceduarte25 opened this issue Nov 30, 2024 · 3 comments
Labels
type: bug Something isn't working

Comments

@ceduarte25
Copy link

ceduarte25 commented Nov 30, 2024

Describe the bug

I am doing signing of EIP 712 message using Metamask and Coinbase wallet. I connected both using wagmi connectors as well. The signTypedData is working fine when I am on Metamask so I was expecting it will work on Coinbase as well. But when I am trying to sign on Coinbase, its given me this error:

UnknownRpcError: An unknown RPC error occurred.
Details: hashFuncMap[method] is not a function

Steps

Link to Minimal Reproducible Example

https://stackblitz.com/edit/new-wagmi-hys7ma?file=src%2Fwagmi.ts,src%2FApp.tsx,src%2Fmain.tsx

Steps To Reproduce

  1. Click connect with metamask
  2. Click sign once connected, the metamask popup will show up with correct message data
  3. Disconnect with metamask and connect with coinbase
  4. Click sign once connected again, it will show the error

Expected behavior

It should work and show the signing message just like the metamask.

Version

No response

Additional info

No response

Desktop

No response

Smartphone

No response

@ceduarte25 ceduarte25 added the type: bug Something isn't working label Nov 30, 2024
@ceduarte25
Copy link
Author

I am using the latest wagmi version to integrate coinbase wallet. Open the issue here wevm/wagmi#4414 and they mentioned that

This is likely a Coinbase Wallet SDK bug

@hieronymus777
Copy link
Contributor

hieronymus777 commented Dec 3, 2024

Thanks for reporting this issue.

When we used the reproducible steps, we noticed that making this change to the sample:

App.tsx
...
-   const { signTypedData } = useSignTypedData();
+   const { signTypedData, data } = useSignTypedData();

...
+  <div>Signature:{data}</div>
...

Results in

To clarify - was that just an issue in the reproduction steps or was that the source of the original bug as well?

@ceduarte25
Copy link
Author

Thanks for the reply @hieronymus777

However, this doesn't work on my side.

App.tsx
...
-   const { signTypedData } = useSignTypedData();
+   const { signTypedData, data } = useSignTypedData();

...
+  <div>Signature:{data}</div>
...

And also to clarify, this is the source of original bug, wagmi dev said it has something to do with this

hashFuncMap[method as keyof typeof hashFuncMap]({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

2 participants