-
Notifications
You must be signed in to change notification settings - Fork 559
[SDK] Preload wallet balances on pay embed #7034
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 📦
|
242a8f8
to
a9e3693
Compare
🦋 Changeset detectedLatest commit: f1a32d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (8.57%) 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 #7034 +/- ##
==========================================
- Coverage 54.90% 54.89% -0.02%
==========================================
Files 909 909
Lines 58374 58396 +22
Branches 4034 4035 +1
==========================================
+ Hits 32051 32056 +5
- Misses 26218 26235 +17
Partials 105 105
🚀 New features to boost your workflow:
|
a9e3693
to
f1a32d1
Compare
? !( | ||
mode === "fund_wallet" && account.address === accountAddress | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for including tokens has been modified when removing the tokenAmount
parameter. Previously, tokens were included if their balance exceeded the specified amount, but now they're included regardless of balance when not in fund_wallet mode or when addresses don't match. This change could result in displaying tokens with insufficient balances to users.
Consider whether this behavior change is intentional, as it might affect user experience by showing tokens that can't actually be used for the intended transaction. If this is intentional, perhaps add a comment explaining the rationale for this change.
? !( | |
mode === "fund_wallet" && account.address === accountAddress | |
) | |
? !( | |
(mode === "fund_wallet" && account.address === accountAddress) || | |
token.balance.lte(0) // Only include tokens with positive balances | |
) |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it's Worth the tradeoff to not have to reload the entire thing when you change the amount. That way every token has the same behavior: if you have any in your wallet, it shows
? !( | ||
mode === "fund_wallet" && account.address === accountAddress | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right?
Fixes TOOL-4477
PR-Codex overview
This PR focuses on preloading wallet balances in the
BuyScreen
component by introducing a new hook,useWalletsAndBalances
, which enhances the user experience by fetching wallet balances more efficiently.Detailed summary
useWalletsAndBalances
hook infetchBalancesForWallet.tsx
.TokenSelectorScreen.tsx
with the new hook.BuyScreenContent
usinguseWalletsAndBalances
.