Skip to content

Update chain configuration to automatically detect and respect the user's active wallet network#105

Merged
DengreSarthak merged 7 commits intoStabilityNexus:mainfrom
aniket866:auto-selecting-network
Mar 23, 2026
Merged

Update chain configuration to automatically detect and respect the user's active wallet network#105
DengreSarthak merged 7 commits intoStabilityNexus:mainfrom
aniket866:auto-selecting-network

Conversation

@aniket866
Copy link
Copy Markdown
Contributor

@aniket866 aniket866 commented Feb 2, 2026

screen-capture.16.webm
  • Auto select the network selected in user's wallet

  • Added Added the Citrea Testnet configuration to the active chains list in the main application file to register it as a supported network.

Closes #53
@kumawatkaran523 Please review

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Citrea Testnet with network entry, RPC endpoint, and a dedicated icon for users to connect to the test network.
  • Bug Fixes

    • Re-enabled the BatchPayment module to restore batch payment processing functionality.
  • Chores

    • Minor formatting and documentation tweaks.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 54349e41-38e5-4b11-8ec8-4a4390cdbeda

📥 Commits

Reviewing files that changed from the base of the PR and between d74661c and 9a0a293.

📒 Files selected for processing (1)
  • contracts/test/Chainvoice.t.sol

Walkthrough

Adds Citrea Testnet (chain ID 5115) to frontend chain configuration and UI, updates public RPC mapping, enables the BatchPayment import, and fixes a trailing newline in a Solidity test file. No contract logic or exported signatures changed.

Changes

Cohort / File(s) Summary
Test File
contracts/test/Chainvoice.t.sol
Added trailing newline at EOF; purely formatting, no functional change.
Chain Configuration
frontend/src/utils/chainConfig.js, frontend/src/page/CreateInvoice.jsx
Imported/added citreaTestnet to chainConfig and added CHAIN_ID_TO_PUBLIC_RPC[5115] → https://rpc.testnet.citrea.xyz.
UI Components & App Setup
frontend/src/App.jsx, frontend/src/components/NetworkSwitcher.jsx
Appended citreaTestnet/chain ID 5115 to AllChains, enabled BatchPayment import, and added a FaBitcoin icon mapping (orange) for chain 5115.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Typescript Lang, Solidity Lang

Poem

🐰 I hopped in code with joyful feet,
Citrea joins the chains we meet,
A tiny newline, icons bright,
RPCs and routes now take flight,
Hooray — invoices leap to light ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope contract changes (Chainvoice.t.sol) unrelated to network selection; these should be separated into a dedicated PR as noted in reviewer comments. Move contract test changes (Chainvoice.t.sol) to a separate PR focused on contract maintenance, keeping this PR solely on frontend network-selection functionality.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references automatic network detection and respecting user's active wallet network, which aligns with the main objective of issue #53 and the frontend changes in the PR.
Linked Issues check ✅ Passed The PR successfully implements automatic network detection by adding citreaTestnet support and enabling wallet network auto-selection in frontend files (App.jsx, chainConfig.js, NetworkSwitcher.jsx, CreateInvoice.jsx), addressing issue #53.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@SIDDHANTCOOKIE
Copy link
Copy Markdown
Contributor

Hey @kumawatkaran523 @DengreSarthak The Citrea frontend wiring looks good (App.jsx, chainConfig.js, NetworkSwitcher.jsx, CreateInvoice.jsx) and is the right direction.
One concern: this PR also includes unrelated contract/test changes (Chainvoice.sol, Chainvoice.t.sol from custom-error refactor). That is out of scope for this issue and should be split into a separate PR according to me.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@contracts/test/Chainvoice.t.sol`:
- Line 116: Revert the unrelated end-of-file newline/formatting change in
Chainvoice.t.sol so the PR only contains network-detection and Citrea Testnet
config changes; specifically undo the solitary EOF newline adjustment (the lone
closing brace or trailing whitespace change in Chainvoice.t.sol) or move that
formatting change into its own separate commit/PR so contract/test files remain
decoupled from frontend network-selection work.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b46ba15 and d74661c.

📒 Files selected for processing (1)
  • contracts/test/Chainvoice.t.sol

Comment thread contracts/test/Chainvoice.t.sol
Comment thread contracts/test/Chainvoice.t.sol
@aniket866 aniket866 requested a review from DengreSarthak March 22, 2026 14:40
@DengreSarthak DengreSarthak merged commit 292fc83 into StabilityNexus:main Mar 23, 2026
1 check passed
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.

Would it be possible to choose the network in a better way?

3 participants