feat(add-money): offramp migration deposit entry#2333
Conversation
offramp.xyz is shutting down and migrating users to peanut. give offramp migrants a de-cluttered arbitrum deposit surface instead of the full multi-chain crypto picker: same rhino EVM SDA (funds land on the peanut arbitrum wallet), but stripped to a single arbitrum + usdc view with offramp copy. - gate a 'migrate from offramp' entry on the offramp badge (placeholder code, wired to the real badge once that PR lands) - deep-link /add-money/crypto?network=EVM&source=offramp drives a new 'offramp' variant of the crypto deposit view - tag completions as offramp_migration for the growth dashboard reuses the existing SDA creation, polling and success screen unchanged.
badge PRs (peanut-api-ts#1105, peanut-ui#2331) landed the link-granted OFFRAMP_USER badge; wire the deposit-entry gate to it.
?campaign=offramp (and any UTM-mapped vanity tag passed via the explicit campaign/campaignTag param) reached /badge/award raw and 400'd, since the backend matches the badge code. Resolve it through the UTM map first so the offramp migration link grants OFFRAMP_USER regardless of link shape. depends on peanut-ui#2331 (adds the offramp UTM map entry) reaching this base.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Comment |
Code-analysis diffPainscore total: 5854.51 → 5859.57 (+5.06) 🆕 New findings (17)
✅ Resolved (14)
📈 Painscore deltas (top movers)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
|
@coderabbitai review in depth. Evaluate:
Also, write a very concise testing guide for QA |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
gh pr view 2333 --repo peanutprotocol/peanut-ui --json title,body,additions,deletions,changedFiles,files -q '.'
echo "---FILES---"
gh pr diff 2333 --repo peanutprotocol/peanut-ui > /tmp/pr2333.diff
wc -l /tmp/pr2333.diff
echo "---FILE LIST---"
gh pr view 2333 --repo peanutprotocol/peanut-ui --json files -q '.files[].path'Length of output: 3522 🏁 Script executed: #!/bin/bash
cat /tmp/pr2333.diffLength of output: 16825 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== rhino.consts CHAIN_LOGOS/TOKEN_LOGOS =="
rg -n "CHAIN_LOGOS|TOKEN_LOGOS|ARBITRUM" src/constants/rhino.consts.ts | head -50
echo "== BADGE_CODES / OFFRAMP_USER usages =="
rg -n "OFFRAMP_USER|BADGE_CODES" -g '!node_modules' -S
echo "== UTM_CAMPAIGN_TO_BADGE_MAP def =="
rg -n "UTM_CAMPAIGN_TO_BADGE_MAP|INVITE_CODE_TO_CAMPAIGN_MAP" -S | head -30
echo "== full page.tsx =="
cat -n "src/app/(mobile-ui)/add-money/crypto/page.tsx"
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
echo "== user.user.badges type =="
rg -n "badges" src/context/authContext.tsx src/interfaces -S | head -30Length of output: 2086 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== BADGE_CODES / OFFRAMP_USER / badges usages =="
rg -n "OFFRAMP_USER|BADGE_CODES|badges" src -S | head -60
echo "== UTM_CAMPAIGN_TO_BADGE_MAP def =="
rg -n "UTM_CAMPAIGN_TO_BADGE_MAP|INVITE_CODE_TO_CAMPAIGN_MAP" src -S
echo "== full page.tsx =="
cat -n "src/app/(mobile-ui)/add-money/crypto/page.tsx"
echo "== ChooseNetworkDrawer usage in AddMoneyMethodSelection =="
sed -n '1,80p' src/components/AddMoney/views/AddMoneyMethodSelection.view.tsxLength of output: 18387 🏁 Script executed: #!/bin/bash
set -euo pipefail
cat -n src/components/Invites/campaign-maps.ts
echo "== users.ts badges type =="
sed -n '1,60p' src/services/users.ts
echo "== interfaces.ts badges type =="
sed -n '190,220p' src/interfaces/interfaces.ts
echo "== TOKEN_LOGOS full =="
sed -n '1,50p' src/constants/rhino.consts.tsLength of output: 10544
Risk of new bugs / breaking existing functionality — Low
Performance / latency — No impact
Code quality / DRY — Good, minor nit
Concise QA testing guide
|
…ted campaign resolution Code-review + UX pass findings: - pin network to EVM when source=offramp: a shared ?network=SOL&source=offramp link previously created a Solana deposit address rendered under Arbitrum-only labels — funds-confusion class - migration-aware terminal states: success header 'Migration Complete', receipt fallbacks USDC/Arbitrum (was USDT + Ethereum icon when Rhino omits token/chain), failed-state copy points migrants back to their Offramp account instead of 'market moved / back to your wallet' - retryable error state when deposit-address creation fails (was: screen instructs 'send USDC' with no address rendered at all — applies to the default crypto flow too) - offramp-specific How to Migrate steps (generic modal said 'select one of the supported networks' — contradicting the single-network migration screen) - 'Migration deposit address' + reuse-warning tooltip (was 'Your Arbitrum address', teaching users to save a constrained bridge endpoint as their wallet), per-transfer limit labels + split-into-parts hint - post-claim routing: logged-in offramp claimants land on the migration screen, not /home - campaign resolution extracted to resolveCampaign() in campaign-maps.ts with unit tests — encodes ?campaign= ≡ ?utm_campaign= deliberately; shared OFFRAMP_BADGE_CODE so the entry gate can't drift from the maps
|
Pushed review fixes in 8407e0a (code-review + UX pass, full context in Hugo's session): Correctness
Migration-aware UX
Code health
Local gate: typecheck ✅, jest 106/106 suites (1649 tests) ✅. cc @kushagrasarathe |
Rebased-to-main successor of #2330 (repo blocks force-push, so a fresh branch off
mainwas the only way to re-base cleanly without dragging dev-only commits into main). Now that Konrad's badge PRs (peanut-api-ts#1105, peanut-ui#2331) are merged tomain, this sits on top of them and is testable end-to-end on preview.Why
offramp.xyz is shutting down and migrating its users to Peanut. This gives offramp migrants a dedicated, de-cluttered Arbitrum deposit surface. Offramp users hold funds in ZeroDev smart accounts on Arbitrum, so the existing crypto deposit already works functionally (Rhino EVM SDA → funds land on the Peanut Arbitrum wallet); this is a thin, branded, tracked wrapper. FE-only, no backend changes.
What
OFFRAMP_USERbadge. Routes to/add-money/crypto?network=EVM&source=offramp.offrampvariant ofCryptoDeposit.view— same Rhino SDA / QR / address / polling / success screen, stripped to a single Arbitrum + USDC surface with offramp copy (no network drawer, no supported-networks modal, no multi-chain tooltip).method_type: 'offramp_migration'.InvitesPage.tsx) — an explicit?campaign=<tag>is now resolved through the UTM map, so?campaign=offrampgrantsOFFRAMP_USERinstead of 400ing at/badge/award. Fixes the footgun found reviewing feat(badges): wire Offramp User badge (art + campaign maps) #2331/[TASK-13864] fix: dates in receipts #1105.Depends on (merged to main ✅)
OFFRAMP_USERlink-grant badgeofframp → OFFRAMP_USER)Test plan (preview)
offrampor?utm_campaign=offrampor?campaign=offramp) → user getsOFFRAMP_USERbadge/add-money/crypto?...&source=offrampshows stripped Arbitrum + USDC surfaceCloses #2330.