feat(networks): Scroll and Celo support, token API alignment, and SEO updates#446
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRemoved wallet-type-based network filtering across UI and balance logic, added Scroll and Celo support (configs, RPC, mocks), updated token fallback data and removed Base USDT injection, replaced DAI with cNGN in SEO/content, and standardized “on-chain” → “onchain” wording. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/utils.ts (1)
163-177:⚠️ Potential issue | 🟠 MajorFail fast when RPC key is missing
Line 164 reads
NEXT_PUBLIC_RPC_URL_KEY, but Line 167–181 build URLs with${rpcUrlKey ?? ""}. That always returns a string, so callers can’t detect misconfiguration and public fallbacks won’t trigger (downstream impact inapp/lib/privy-config.tsfor Celo/Scroll).Suggested fix
export function getRpcUrl(network: string) { - const rpcUrlKey = process.env.NEXT_PUBLIC_RPC_URL_KEY; + const rpcUrlKey = process.env.NEXT_PUBLIC_RPC_URL_KEY?.trim(); + if (!rpcUrlKey) { + return undefined; + } switch (network) { case "Polygon": - return `https://api-polygon-mainnet-full.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-polygon-mainnet-full.n.dwellir.com/${rpcUrlKey}`; case "BNB Smart Chain": - return `https://api-bsc-mainnet-full.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-bsc-mainnet-full.n.dwellir.com/${rpcUrlKey}`; case "Base": - return `https://api-base-mainnet-archive.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-base-mainnet-archive.n.dwellir.com/${rpcUrlKey}`; case "Arbitrum One": - return `https://api-arbitrum-mainnet-archive.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-arbitrum-mainnet-archive.n.dwellir.com/${rpcUrlKey}`; case "Celo": - return `https://api-celo-mainnet-archive.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-celo-mainnet-archive.n.dwellir.com/${rpcUrlKey}`; case "Scroll": - return `https://api-scroll-mainnet.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-scroll-mainnet.n.dwellir.com/${rpcUrlKey}`; case "Lisk": - return `https://api-lisk-mainnet.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-lisk-mainnet.n.dwellir.com/${rpcUrlKey}`; case "Ethereum": - return `https://api-ethereum-mainnet.n.dwellir.com/${rpcUrlKey ?? ""}`; + return `https://api-ethereum-mainnet.n.dwellir.com/${rpcUrlKey}`; default: return undefined; } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/utils.ts` around lines 163 - 177, getRpcUrl currently masks a missing NEXT_PUBLIC_RPC_URL_KEY by substituting an empty string, preventing callers from detecting misconfiguration; change getRpcUrl to read process.env.NEXT_PUBLIC_RPC_URL_KEY into rpcUrlKey, immediately throw a clear Error (including the env var name) if rpcUrlKey is null/undefined, and remove the `${rpcUrlKey ?? ""}` fallbacks in each switch case so the templates use rpcUrlKey directly; this makes misconfiguration fail fast and lets callers (like privy-config) react appropriately.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@app/utils.ts`:
- Around line 163-177: getRpcUrl currently masks a missing
NEXT_PUBLIC_RPC_URL_KEY by substituting an empty string, preventing callers from
detecting misconfiguration; change getRpcUrl to read
process.env.NEXT_PUBLIC_RPC_URL_KEY into rpcUrlKey, immediately throw a clear
Error (including the env var name) if rpcUrlKey is null/undefined, and remove
the `${rpcUrlKey ?? ""}` fallbacks in each switch case so the templates use
rpcUrlKey directly; this makes misconfiguration fail fast and lets callers (like
privy-config) react appropriately.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2aaf5547-7298-4a02-90f2-b707acf1dcf7
📒 Files selected for processing (21)
.github/workflows/create-release.ymlapp/blog/layout.tsxapp/blog/page.tsxapp/components/CopyAddressWarningModal.tsxapp/components/FundWalletForm.tsxapp/components/MigrationZeroBalanceModal.tsxapp/components/NetworkSelectionModal.tsxapp/components/NetworksDropdown.tsxapp/components/TransferForm.tsxapp/components/WalletMigrationBanner.tsxapp/components/WalletMigrationModal.tsxapp/components/wallet-mobile-modal/WalletView.tsxapp/context/BalanceContext.tsxapp/context/TokensContext.tsxapp/layout.tsxapp/lib/bundler/chains.tsapp/lib/privy-config.tsapp/mocks.tsapp/pages/TransactionPreview.tsxapp/utils.tsllms.txt
💤 Files with no reviewable changes (1)
- app/context/TokensContext.tsx
* fix: update migration modal visibility logic * refactor: enhance SUPPORTED_CHAINS structure and improve RPC URL handling * Updated the SUPPORTED_CHAINS object to include network names for better clarity. * Refactored the parseRpcUrl function to utilize the new networkName property for retrieving RPC URLs, improving error handling for unsupported chains. * feat(settings): add theme switch to desktop dropdown Add the existing theme switch to the desktop settings dropdown so users can change theme without relying on the footer. The new section keeps the footer control as a secondary entry point and aligns the dropdown styling with the existing menu items. * refactor: build time enhancements (#414) * refactor: build time enhancements * refactor: optimize JWT verification and enhance user ID fetching with timeout handling * fixes * feat: add audience parameter to JWT verification for enhanced security * change variable --------- Co-authored-by: chibie <chibuotu@gmail.com> Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com> * chore: update pnpm-lock.yaml to restore cypress dependency and adjust package versions * Reintroduced cypress dependency with version 15.7.1. * Minor adjustments to package versions and dependencies for consistency. * Merge pull request #432 from jeremy0x/main feat: default balance view to highest-value network after login * refactor: enhance error handling across components (#426) * refactor: enhance error handling across components * fix: improve error handling in TransactionPreview component * fix * refactor: remove liquidity error handling from errorMessages and TransactionForm * fix: enhance error handling for network switching in MobileDropdown and NetworksDropdown components * feat: integrate Sentry for client error reporting --------- Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com> * fix: users can use external wallet as main wallet through privy (#428) * fix: users can use external wallet as main wallet through privy * fixes --------- Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com> * feat(networks): Scroll and Celo support, token API alignment, and SEO updates (#446) * feat(networks): add Scroll and Celo, align tokens and docs * feat(currency): enable MWK receive currency --------- Co-authored-by: Isaac Onyemaechi <amaechiisaac450@gmail.com> Co-authored-by: jeremy0x <aworetanjeremiah@gmail.com> Co-authored-by: chibie <chibuotu@gmail.com> Co-authored-by: Francis Ocholi <5raan6@gmail.com>
Description
This pull request enables Scroll and Celo across Privy, the in-app network list, balance fetching, and the server bundler (
SUPPORTED_CHAINSwithnetworkNamefor RPC resolution viagetRpcUrl, including Scroll). Celo is no longer hidden for embedded/smart-wallet users so network pickers and cross-chain balances match injected-wallet behavior. Redundant client-side token merges for Base USDT and Lisk cNGN were removed because the Paycrest tokens API already returns them.Fallback token data and Scroll RPC configuration were updated (Dwellir Scroll host without
-archive). cNGN entries inFALLBACK_TOKENSuse the display name Compliant Naira while keeping symbolcNGN. SEO and LLM-oriented copy (layout, blog metadata,llms.txt) were aligned with actually supported assets and networks (no DAI/Optimism claims; Scroll listed). The diff also includes small updates to the release workflow, migration modals/banner, andTransactionPreviewthat were part of the staged set.References
closes #447
Testing
Manually switch networks in the app (embedded and injected where applicable) and confirm tokens load from the API and balances refresh.
Smoke the bundler-related flows that pass
chainIdfor supported chains, including Scroll if applicable.Rely on GitHub CI after push for automated checks.
This change adds test coverage for new/changed/fixed functionality
Checklist
mainBy submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.
Summary by CodeRabbit
New Features
Improvements