-
Notifications
You must be signed in to change notification settings - Fork 275
Sam/fix sell ramps max #5790
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
Sam/fix sell ramps max #5790
Conversation
9bee394 to
527170d
Compare
|
This PR changed from using balance to using the max-spendable for a wallet for max sell feature. This is because the max amount that can be sold should account for fees. |
527170d to
80a820d
Compare
80a820d to
1af9658
Compare
| export type RampExchangeAmount = | ||
| | { | ||
| max: true | ||
| max: string | true |
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.
It would be nice to add a comment explaining the difference between the two.
1af9658 to
298cab0
Compare
298cab0 to
790fd1a
Compare
| amount = maxAmountLimit | ||
| } | ||
| } | ||
| } |
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.
Bug: Crypto Limits Applied Incorrectly to Fiat
The maxAmountLimit, which represents a crypto amount, is incorrectly applied to fiat amounts within the fetchQuotes function for both Moonpay and Paybis. This causes fiat transactions to be limited by crypto maximums, even when the amountType is 'fiat'.
Additional Locations (1)
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.
This is a corner-cut. We're assuming this API is only used for sell quotes for now (which it is). Maybe some TODO comments are warranted, but time is the constaint.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneRequirements
If you have made any visual changes to the GUI. Make sure you have:
Note
Implements proper sell Max by using wallet max spend and passes an optional max cap to providers; updates UI and quote handling to use this and simplifies input disabling.
Maxfor sell by computing wallet max spend (getMaxSpendExchangeAmount) and settingexchangeAmount.maxto a string cap; choose last-used input by direction. ReplacesortedQuoteswithallQuotesusages; simplify display logic and input disabling; support showing crypto amount fromexchangeAmount.maxwhen applicable.RampExchangeAmount.maxnow acceptsstring | truewith docs (optional upper bound for provider max).maxas a request flag and honor optional max cap; clamp computed max amounts to cap and adjust requests/quotes accordingly (including re-quoting for Revolut).Written by Cursor Bugbot for commit 790fd1a. This will update automatically on new commits. Configure here.