Skip to content

Stable#445

Merged
5ran6 merged 4 commits into
mainfrom
stable
Apr 6, 2026
Merged

Stable#445
5ran6 merged 4 commits into
mainfrom
stable

Conversation

@Dprof-in-tech
Copy link
Copy Markdown
Collaborator

@Dprof-in-tech Dprof-in-tech commented Apr 6, 2026

Description

References

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

  • Bug Fixes

    • Enhanced balance handling for new embedded wallet users to properly support account initialization.
  • Refactor

    • Improved RPC endpoint resolution mechanism for better network compatibility across supported chains.

onahprosper and others added 4 commits March 25, 2026 06:04
* 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.
refactor: enhance SUPPORTED_CHAINS structure and RPC URL handling
…w-users

fix-faulty-balance-fetch-for-new-users
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 057dd618-ba21-4e1a-b852-de6e74eaacf5

📥 Commits

Reviewing files that changed from the base of the PR and between 447a769 and 502e949.

📒 Files selected for processing (2)
  • app/context/BalanceContext.tsx
  • app/lib/bundler/chains.ts

📝 Walkthrough

Walkthrough

The changes add support for embedded wallet users without prior smart contract wallet migration by introducing a new logic path in BalanceContext's fetchBalances, and refactor RPC URL resolution in chains.ts to use a networkName-based approach via the getRpcUrl utility instead of thirdweb's RPC template.

Changes

Cohort / File(s) Summary
Balance Context Embedded Wallet Handling
app/context/BalanceContext.tsx
Added new else if (embeddedWalletAccount) branch to handle "new user" state without SCW migration, setting primaryIsEOA = true, fetching cross-chain entries, applying CNGN correction, and deriving externalWalletBalance from either selected network entry or direct wallet fetch.
RPC Configuration Refactoring
app/lib/bundler/chains.ts
Extended SUPPORTED_CHAINS with networkName field per chain and reworked parseRpcUrl(chainId) to resolve RPC URLs via getRpcUrl(networkName) instead of thirdweb template, throwing error when no RPC URL configured.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • chibie
  • onahprosper

Poem

🐰 Hoppy networks dance in the light,
New embedded wallets join the flight,
With networkNames and getRpcUrl's cheer,
The balance of code grows crystal clear!

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely empty with only template sections remaining. The Description, References, and Testing sections lack any actual content from the author. Provide a detailed description of the purpose, motivation, and impacts of these changes. Include information about the embedded wallet handling and RPC URL refactoring, and describe testing performed.
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.
Title check ❓ Inconclusive The title 'Stable' is vague and generic, providing no meaningful information about the changeset. It does not clearly summarize or relate to the primary changes in the pull request. Use a more descriptive title that reflects the main changes, such as 'Add embedded wallet balance fetching for new users and refactor RPC URL handling' or similar.

✏️ 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 stable

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 force-pushed the stable branch 2 times, most recently from 5d62119 to 502e949 Compare April 6, 2026 15:08
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

@5ran6 5ran6 merged commit 435ce79 into main Apr 6, 2026
1 check passed
@5ran6 5ran6 deleted the stable branch April 6, 2026 15:12
@5ran6 5ran6 restored the stable branch April 6, 2026 15:14
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.

3 participants