Repository navigation
feat(keychain): disable unaffordable payment tokens + singlePurchaseOnly option - #2656
Merged
Merged
Conversation
…chaseOnly option Two bundle-purchase UX fixes: - The token selector listed every currency, including ones the paying wallet could not cover; picking one triggered the balance check and auto-switched to another funded currency. The selector now disables tokens whose balance cannot cover the purchase (via a new useTokenSufficiency hook mirroring the fallback pricing logic). The USD/credits option is never disabled so users can still top up. - New optional singlePurchaseOnly flag on BundleOptions and StarterpackOptions: when set, the +/- quantity buttons are hidden and the quantity is fixed to 1 (the Apple Pay minimum auto-bump is also skipped; its "Amount Too Low" gate takes over). Default behavior is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two bundle/starterpack purchase UX fixes:
useTokenSufficiencyhook reusing the fallback pricing logic — direct cost for the payment token / USDC variants, Ekubo quote otherwise). This removes the confusing flow where picking an unaffordable token triggered the balance check and silently auto-switched to another currency. The USD (credits) option is never disabled so users can always deposit funds. Unknown balances/quotes leave the token selectable (unknown ≠ insufficient).singlePurchaseOnlyoption onBundleOptionsandStarterpackOptions: when set, the +/- quantity buttons are hidden and quantity is fixed at 1; the Apple Pay minimum quantity auto-bump is skipped (its existing "Amount Too Low" gate takes over). Without the option, behavior is unchanged.Test plan
useTokenSufficiency(payment token, quantity scaling, swap-quoted tokens, credits pseudo-token, balance errors)tsc -band eslint clean on both packages🤖 Generated with Claude Code