Skip to content

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Oct 17, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

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.

  • UI/Scenes:
    • RampCreateScene: Implement async Max for sell by computing wallet max spend (getMaxSpendExchangeAmount) and setting exchangeAmount.max to a string cap; choose last-used input by direction. Replace sortedQuotes with allQuotes usages; simplify display logic and input disabling; support showing crypto amount from exchangeAmount.max when applicable.
  • Types:
    • RampExchangeAmount.max now accepts string | true with docs (optional upper bound for provider max).
  • Providers:
    • Banxa, Bity, Moonpay, Paybis, Revolut, Simplex: Treat max as 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.


@samholmes samholmes force-pushed the sam/fix-sell-ramps-max branch from 9bee394 to 527170d Compare October 21, 2025 22:36
@samholmes
Copy link
Contributor Author

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.

@samholmes samholmes force-pushed the sam/fix-sell-ramps-max branch from 527170d to 80a820d Compare October 21, 2025 22:37
cursor[bot]

This comment was marked as outdated.

@samholmes samholmes force-pushed the sam/fix-sell-ramps-max branch from 80a820d to 1af9658 Compare October 21, 2025 23:00
export type RampExchangeAmount =
| {
max: true
max: string | true
Copy link
Contributor

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.

@samholmes samholmes force-pushed the sam/fix-sell-ramps-max branch from 1af9658 to 298cab0 Compare October 21, 2025 23:48
@samholmes samholmes force-pushed the sam/fix-sell-ramps-max branch from 298cab0 to 790fd1a Compare October 21, 2025 23:48
@samholmes samholmes enabled auto-merge October 21, 2025 23:51
amount = maxAmountLimit
}
}
}
Copy link

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)

Fix in Cursor Fix in Web

Copy link
Contributor Author

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.

@samholmes samholmes merged commit e951e7d into develop Oct 22, 2025
3 checks passed
@samholmes samholmes deleted the sam/fix-sell-ramps-max branch October 22, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants