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

getChainId produces malformatted rpc requests #2542

Closed
1 task done
tadad opened this issue Jul 26, 2024 · 3 comments
Closed
1 task done

getChainId produces malformatted rpc requests #2542

tadad opened this issue Jul 26, 2024 · 3 comments
Labels
needs reproduction Misc: Needs Reproduction

Comments

@tadad
Copy link

tadad commented Jul 26, 2024

Check existing issues

Viem Version

2.18.2

Current Behavior

when you call getChainId it formats the rpc request as

    {
      method: 'eth_chainId',
    },

which is incorrect and causes issues with most rpc providers I'm aware of

Expected Behavior

should succeed by adding jsonrpc: '2.0' to the request

Steps To Reproduce

I'm running this against alchemyplatform/rundler and it's failing

Link to Minimal Reproducible Example

No response

Anything else?

No response

@tadad tadad mentioned this issue Jul 26, 2024
@jxom
Copy link
Member

jxom commented Jul 26, 2024

We already do this https://github.com/wevm/viem/blob/main/src/utils/rpc/http.ts#L92.

Please provide a minimal reproducible example of the issue you are facing and I will reopen the issue.

@jxom jxom added the needs reproduction Misc: Needs Reproduction label Jul 26, 2024
Copy link
Contributor

Hello @tadad.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs reproduction Misc: Needs Reproduction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants