Skip to content

refactor: enhance SUPPORTED_CHAINS structure and RPC URL handling#430

Merged
onahprosper merged 1 commit into
stablefrom
fix-rpc
Mar 25, 2026
Merged

refactor: enhance SUPPORTED_CHAINS structure and RPC URL handling#430
onahprosper merged 1 commit into
stablefrom
fix-rpc

Conversation

@onahprosper
Copy link
Copy Markdown
Collaborator

@onahprosper onahprosper commented Mar 25, 2026

  • Updated the SUPPORTED_CHAINS object to include network names for better clarity.
  • Refactored the parseRpcUrl function to utilize dynamic RPC URLs based on the network name, improving configurability and error handling.

Description

Describe the purpose of this PR along with any background information and the impacts of the proposed change. For the benefit of the community, please do not assume prior context.

Provide details that support your chosen implementation, including: breaking changes, alternatives considered, changes to the API, contracts etc.

References

Include any links supporting this change such as a:

If there are no references, simply delete this section.

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this project has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

Also include details of the environment this PR was developed in (language/platform/browser version).

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

Summary by CodeRabbit

  • Refactor
    • Enhanced RPC URL resolution mechanism for improved reliability and performance.
    • Streamlined chain configuration by removing reliance on external service dependencies.

* Updated the SUPPORTED_CHAINS object to include network names for better clarity.
* Refactored the parseRpcUrl function to utilize dynamic RPC URLs based on the network name, improving configurability and error handling.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 25, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d105140a-467e-4505-997d-367d1fd1527f

📥 Commits

Reviewing files that changed from the base of the PR and between c7dfdae and 904f35a.

📒 Files selected for processing (1)
  • app/lib/bundler/chains.ts

📝 Walkthrough

Walkthrough

Updated SUPPORTED_CHAINS entries to include networkName alongside existing fields and refactored parseRpcUrl(chainId) to derive RPC URLs via getRpcUrl(entry.networkName) instead of relying on thirdweb's client ID and URL template mechanism.

Changes

Cohort / File(s) Summary
Chain Configuration Refactor
app/lib/bundler/chains.ts
Extended SUPPORTED_CHAINS record structure to include networkName property. Modified parseRpcUrl() to resolve RPC URLs through getRpcUrl(networkName) instead of thirdweb's client ID template, with updated error handling for missing RPC configurations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop hop, the chains now wear new names,
NetworkNames unlock the RPC games,
No thirdweb client IDs in sight,
Our bundler hops to a new height!
Configuration dancing, clean and bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes to app/lib/bundler/chains.ts are completely unrelated to issue #407, which concerns recipient name verification and UI alerts in a form component. Verify the correct linked issue for this chains.ts refactor, or remove the unrelated issue #407 from this PR's links.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description includes a brief summary of changes but lacks detailed information in the References and Testing sections required by the template. Add GitHub issue references, describe specific testing steps, and clarify if this is a breaking change or includes API modifications.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes to SUPPORTED_CHAINS structure and RPC URL handling in the bundler/chains.ts file.
Out of Scope Changes check ✅ Passed The PR modifies only app/lib/bundler/chains.ts to enhance SUPPORTED_CHAINS and RPC URL handling, which is narrowly scoped and appropriate.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-rpc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

5ran6
5ran6 previously approved these changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@5ran6 5ran6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@onahprosper onahprosper changed the base branch from main to stable March 25, 2026 06:09
@onahprosper onahprosper dismissed 5ran6’s stale review March 25, 2026 06:09

The base branch was changed.

Copy link
Copy Markdown
Contributor

@5ran6 5ran6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@onahprosper onahprosper merged commit fb167d4 into stable Mar 25, 2026
1 check was pending
@onahprosper onahprosper deleted the fix-rpc branch March 25, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants