chore(runway): cherry-pick feat: cp-7.58.0 max button in perps deposit #21362
+159
−22
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.
Description
Add a
Max
button to the Perps deposit confirmation, whichautomatically subtracts the appropriate buffers from the token amount
based on the MetaMask Pay feature flags and if the token is native.
Changelog
CHANGELOG entry: Add max button to Perps deposit
Related issues
Fixes:
#5947
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Replaces the 90% button with a Max (100%) option and updates custom amount logic to apply buffer-based reductions (and native-token buffer) with round-down, adding tests and bumping transaction-controller.
90%
button withMax
(100%
) inapp/components/Views/confirmations/components/deposit-keyboard/deposit-keyboard.tsx
.useTransactionCustomAmount
):useMaxPercentage
to adjust100%
by buffers from feature flags and required tokens; adds extra buffer if pay token is native.100%
scenarios (required tokens, native token, skipIfBalance) and updated pay token mocks.@metamask/transaction-controller
to^60.9.0
.Written by Cursor Bugbot for commit fc919ae. This will update automatically on new commits. Configure here.
0fad96b