You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7f451d8
Browse filesBrowse the repository at this point in the historyBrowse files
Ports the Convert half of iOS #604. The Convert tile on the v2 currency
screen now opens a real conversion flow instead of re-routing to Buy:
- `SwapPurpose.Convert(mint, destinationMint)` — a `BalanceDecrease`, so
amount entry, max-amount, limits and balance checks reuse Sell semantics.
`mint` is the currency being spent; `destinationMint` is what lands.
- Amount entry grows an optional `accessory` slot (threaded through
`AmountWithKeypad` / `AmountEntryScreen` / `SwapEntryScreenContent`) that
renders the "Convert to <currency>" picker between the amount and keypad.
- Destination picking is a flow step (`SwapStep.ConvertDestinationSelection`)
backed by `TokenPurpose.ConvertDestination`, which lists every currency
except the source — including ones the user doesn't hold yet — and
check-marks the in-flight destination rather than the globally selected
token.
- New confirmation step (`SwapStep.ConvertReceipt`) mirroring the Sell
receipt: you convert / amount / conversion fee / you receive.
Fee handling follows the direction of the trade. Converting *out of*
Dollars has no launchpad sale to skim from, so the 1% fee is charged on
top of the entered amount (debit = entered + fee, receive = entered);
every other direction takes the source token's `sellFeeBps` out of the
entered amount (debit = entered, receive = entered - fee). Submission
picks the matching leg: destination USDF -> sell, source USDF -> buy with
an explicit fee, otherwise a direct swap.
`OnPurposeChanged` now preserves an in-flight Convert destination when the
source still matches — the entry step re-dispatches its route purpose on
every re-entry, which otherwise reset the destination on returning from
the picker.
0 commit comments