-
Notifications
You must be signed in to change notification settings - Fork 567
[SDK] Fix TransactionWidget when wallet has enough currency #7656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] Fix TransactionWidget when wallet has enough currency #7656
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis change updates the transaction payment logic to more accurately handle wallet balance checks in the TransactionWidget. The update removes a hardcoded transaction amount in one component and refines the calculation of the required funding amount based on the user's actual balance, ensuring correct behavior when proceeding with transactions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TransactionWidget
participant TransactionPayment
User->>TransactionWidget: Initiate transaction
TransactionWidget->>TransactionPayment: Request to proceed
TransactionPayment->>TransactionWidget: Check userBalance vs. totalCost
alt userBalance < totalCost
TransactionPayment->>TransactionWidget: onContinue(shortfall amount)
else userBalance >= totalCost or undefined
TransactionPayment->>TransactionWidget: onContinue(totalCost)
end
TransactionWidget->>User: Proceed with transaction or request funding
Estimated code review effort2 (10–30 minutes) Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}Instructions used from: Sources:
**/*.{ts,tsx,js,jsx}Instructions used from: Sources:
🧠 Learnings (3)📓 Common learnings
.changeset/lucky-ravens-hope.md (5)Learnt from: CR Learnt from: CR Learnt from: CR Learnt from: CR Learnt from: MananTank packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx (4)Learnt from: gregfromstl Learnt from: CR Learnt from: jnsdls Learnt from: MananTank ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
size-limit report 📦
|
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #7656 +/- ##
==========================================
- Coverage 56.41% 56.40% -0.01%
==========================================
Files 908 908
Lines 58218 58228 +10
Branches 4226 4226
==========================================
Hits 32844 32844
- Misses 25264 25274 +10
Partials 110 110
🚀 New features to boost your workflow:
|
PR-Codex overview
This PR focuses on fixing the
TransactionWidget
to handle scenarios where a user's wallet has insufficient funds for a transaction, ensuring they are prompted to fund their wallet with the necessary amount.Detailed summary
TransactionWidget
intransaction-button.tsx
to reflect the correct amount.TransactionPayment.tsx
to check if theuserBalance
is less than thetotalCost
.onContinue
function to handle both cases: insufficient funds and sufficient funds.Summary by CodeRabbit
Bug Fixes
Chores