-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ChainId of TypedDataDomain not serializable during JsonRpcSigner.signTypedData() #3836
Comments
consistently getting this when signing:
should I download until a fix, or is there a current workaround? @ZirionNeft @ricmoo |
Same problem with
|
@Jovonni My workaround is just re-implementation of Signer class with true JSON.stringify with replacer callback. |
Thanks! I've confirmed it's a bug. Quick question @ZirionNeft, if the value is outside the safe integer range, do you encode it as a |
@insulineru Thanks! So, passing the chainId as a decimal string works then? The payload will look like: |
No. I tried passing "137" or "0x87" in the |
Oh, I meant when data is passed directly to MetaMask. Basically, your above fix works? I have a local copy working too. :) |
I tried Metamask and Rabby Wallet and my fix worked fine. Before that, with the exact same example, I signed all the messages in ethers@5.7.2, so yeah Thanks for the heads up, @ricmoo :) |
Ethers Version
6.0.8
Search Terms
bigint, chainId, JsonRpcSigner, signTypedData, json, serialize, stringify
Describe the Problem
When trying to jsonRpcSigner.signTypedData(...) I got an error:
After debugging I realize that
chainId
of Domain data type converts to bigInt duringTypedDataEncoder.getPayload(...)
, but after thatJSON.stringify()
don't know how to work with them without second argument function.Code Snippet
Contract ABI
No response
Errors
The text was updated successfully, but these errors were encountered: