Feat/shielded balance#19
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 2 minutes and 34 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
WalkthroughThis PR introduces shielded (ephemeral) balance routing for SPL tokens and SOL transfers, adds a new Shield card component for shield/unshield workflows, extends PaymentCard to support balance location selection with authentication, adds Shield tab to TradeHub, disables swaps on devnet, and rebrands "Private" to "Shielded" throughout the UI and documentation. ChangesShielded & Ephemeral Payments Feature
Devnet Swap Disabling
🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
🚥 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 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c29c1c3a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
af40e16 to
4fc5d18
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fc5d18182
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/one/payment-card.tsx (1)
1282-1282:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove debug log statement.
This console.log appears to be a development artifact and should be removed before merging.
🧹 Suggested fix
- console.log("Res:\n%s", JSON.stringify(jsonResponse, null, 2));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/one/payment-card.tsx` at line 1282, Remove the development debug console.log call that prints the response—specifically the line console.log("Res:\n%s", JSON.stringify(jsonResponse, null, 2)); in the payment-card component; simply delete this statement (leaving any surrounding logic intact) so jsonResponse is no longer logged to the console in production.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/one/shield-card.tsx`:
- Around line 646-653: The amount validation currently compares rawAmount to
sourceBalanceRaw only when sourceBalanceRaw !== null, which lets shield
submissions bypass validation while the public balance is still loading; update
the submit-button disabled condition (the JSX prop that currently checks things
like amountError and other flags around the submit handler) to include
publicBalanceLoading so the button is disabled while public balance is loading,
ensuring the validation in the sourceBalanceRaw/BigInt(rawAmount) branch (and
setAmountError with mode) always runs before submit.
In `@lib/spl-private-balance.ts`:
- Around line 24-31: setStoredPrivateAuthToken and clearStoredPrivateAuthToken
perform localStorage.setItem/removeItem directly which can throw in
restricted-storage environments; wrap those calls in the same defensive
try/catch used by getStoredPrivateAuthToken so failures don't propagate and
still call dispatchPrivateAuthTokenEvent(pubkeyBase58). Specifically, in
setStoredPrivateAuthToken (function name) catch errors around
localStorage.setItem and swallow/log them, and in clearStoredPrivateAuthToken
(function name) catch errors around localStorage.removeItem and swallow/log
them, preserving existing behavior of
dispatchPrivateAuthTokenEvent(pubkeyBase58).
---
Outside diff comments:
In `@components/one/payment-card.tsx`:
- Line 1282: Remove the development debug console.log call that prints the
response—specifically the line console.log("Res:\n%s",
JSON.stringify(jsonResponse, null, 2)); in the payment-card component; simply
delete this statement (leaving any surrounding logic intact) so jsonResponse is
no longer logged to the console in production.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ec23c613-dcf6-4af4-9fcd-3aff248e7cee
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (19)
.snykapp/api/explorer/tx/route.tsapp/api/payments/shield/route.tsapp/api/payments/transaction/send/route.tsapp/api/payments/transfer/route.tsapp/api/swap/quote/route.tsapp/api/swap/route.tsapp/page.tsxcomponents/one/header.tsxcomponents/one/net-worth-panel.tsxcomponents/one/payment-card.tsxcomponents/one/private-routing-controls.tsxcomponents/one/shield-card.tsxcomponents/one/swap-card.tsxcomponents/one/trade-hub.tsxlib/payments.tslib/spl-private-balance.tsnext.config.mjspackage.json
4fc5d18 to
d79fc82
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d79fc82e65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f589999600
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary by CodeRabbit
New Features
Improvements
Bug Fixes