chore(release): sync stable to main for version 7.75.1#29818
Merged
Conversation
- feat(perps): force unified account (#29492) ## **Description** HyperLiquid is deprecating DEX Abstraction mode (~May 9). This PR forces every Perps user onto **Unified Account** mode on app open and fixes the withdraw + balance-display flows that were broken in the target state. ### 1. Forced migration to Unified Account Migration paths by current abstraction mode: - `default` / `disabled` → silently migrated via `agentSetAbstraction({ abstraction: 'u' })` — no signing prompt - `dexAbstraction` → one-time EIP-712 prompt via `userSetAbstraction({ user, abstraction: 'unifiedAccount' })` — agent-key path is blocked by HL for this transition - `unifiedAccount` → no-op, cached immediately Key details: - Replaces deprecated `agentEnableDexAbstraction` / `userDexAbstraction` with `agentSetAbstraction` / `userSetAbstraction` / `userAbstraction` - Runs on perps section open (`#ensureReady()`) so users are set up before trading - `TradingReadinessCache` prevents repeated prompts (critical for hardware/QR wallets); `KEYRING_LOCKED` skips the cache so it retries on unlock - In-flight deduplication blocks concurrent signing attempts across provider instances - Segment analytics: `Perp Account Setup` event tracks mode distribution + outcome (`already_enabled` / `migration_required` / `success` / `failed`) ### 2. Withdraw + balance display fix (folded in from #29537) In Unified mode, USDC collateral lives in the spot clearinghouse, so `clearinghouseState.withdrawable` is $0 — pre-fix the withdraw screen showed $0 max with the button disabled, and the confirm-flow alert blocked submission. - `accountUtils.addSpotBalanceToAccountState` folds free spot USDC into `availableToTradeBalance` for Unified / Portfolio Margin; `dexAbstraction` / Standard keep spot separate (fold gated on resolved abstraction mode) - `HyperLiquidSubscriptionService.invalidateUserAbstractionCache(addr)` evicts stale pre-migration mode and re-aggregates immediately. Called by `HyperLiquidProvider` after both successful migration paths so the WS-driven aggregator doesn't serve a $0 balance for ~60s after migration completes. - Withdraw screen, withdraw validation, confirm-flow insufficient-balance alert, and percentage buttons all read `availableToTradeBalance ?? availableBalance` — fallback keeps Standard / legacy callers correct. ## **Changelog** CHANGELOG entry: Fixed Hyperliquid withdraw showing $0 and being blocked for users on Unified Account mode. ## **Related issues** Fixes: TAT-3112 (Unified Account migration), withdrawal break tracked in [TAT-3047](https://consensyssoftware.atlassian.net/browse/TAT-3047) ## **Manual testing steps** ```gherkin Feature: Unified Account migration + withdraw Scenario: First-time migration (default/disabled mode) Given the user has never used Perps When they open the Perps section Then migration runs silently (no prompt) And HIP-3 markets are visible Scenario: dexAbstraction → unifiedAccount migration Given the user has DEX Abstraction enabled When they open the Perps section Then a one-time EIP-712 signing prompt appears When they sign Then HIP-3 markets are visible and trades succeed And reopening Perps does not prompt again Scenario: Unified Account user withdraws spot-funded balance Given the user is in Unified Mode with $0 perps withdrawable and >$0 spot USDC When they open the Withdraw screen Then "Available Perps balance" shows the unified value (perps + free spot USDC) And Max enables and submission proceeds via withdraw3 And spot USDC drops by amount + fee ``` ### Live validation evidence Validated on dev1 mainnet (`0x8dc6…9003`) in the exact bug-class state: - HL mode: `unifiedAccount` / perps `withdrawable`: $0 / spot USDC free: $26.41 - App: `availableBalance` = $0 / `availableToTradeBalance` = $26.41 - Withdraw screen renders **"Available Perps balance: $26.41"** + Max enabled (pre-fix would show $0 / disabled) ## **Screenshots/Recordings** ### **Before** <!-- $0 max + disabled Max button on dev1 mainnet pre-fix --> ### **After** <!-- $26.41 max + Max enabled + successful withdraw on dev1 mainnet --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). #### Performance checks (if applicable) - [ ] I've tested on Android - [ ] I've tested with a power user scenario - [ ] I've instrumented key operations with Sentry traces for production performance metrics ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. [TAT-3047]: https://consensyssoftware.atlassian.net/browse/TAT-3047?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **High Risk** > High risk because it changes Perps account-mode migration/signing flow (including hardware-wallet behavior) and alters withdraw/payment balance calculations that gate user funds and transaction validation. > > **Overview** > Forces Perps users onto HyperLiquid **Unified Account** by replacing deprecated DEX-abstraction checks/calls with `userAbstraction` + `agentSetAbstraction`/`userSetAbstraction`, adding global in-flight/cached gating, retry semantics, and new `Perp Account Setup` analytics. > > Updates withdraw, confirmation, and pay-with flows to prefer `availableToTradeBalance ?? availableBalance`, and changes spot→perps folding to be **mode-gated** (fail-closed when abstraction mode is unknown) so Unified/Portfolio Margin users see spendable USDC while Standard/dexAbstraction users don’t over-report withdrawable funds. > > Renames cache-clearing APIs from DEX abstraction to Unified Account, adds hardware-wallet detection to defer user-sign prompts on browse, and expands tests/docs to cover unified-mode folding, migration paths, and race conditions in spot/account aggregation. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e5495f9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: geositta <matthew.denton@consensys.net> Co-authored-by: Nick Gambino <nicholas.gambino@consensys.net> Co-authored-by: Arthur Breton <arthur.breton@consensys.net> Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com> [cc44460](cc44460) [TAT-3047]: https://consensyssoftware.atlassian.net/browse/TAT-3047?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: Alejandro Garcia Anglada <aganglada@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
## **Description** Pre-emptively syncs `stable` (now containing the 7.75.0 release) into `release/7.75.1` so that PR #29674 (release/7.75.1 → stable) is conflict-free when ready to merge. ## **Changelog** CHANGELOG entry: N/A — release sync only ## **Related issues** - Unblocks #29674 ## **Resolution notes** - **Native version files** (`android/app/build.gradle`, `bitrise.yml`, `ios/MetaMask.xcodeproj/project.pbxproj`): kept release/7.75.1's values (`7.75.1` / `versionCode 4788`) — stable's `7.75.0` / `4784` is older and should not overwrite the release branch. - **CHANGELOG.md**: auto-merged cleanly. `[7.75.0]` and `[7.74.x]` sections from stable now appear in proper descending semver order alongside any `[Unreleased]` content from release/7.75.1. - **`tests/smoke/predict/predict-open-position.spec.ts`**: auto-merged; `describe.skip` preserved. ## **Manual testing steps** N/A — merge-only PR. ## **Pre-merge author checklist** - [x] Merge commit (not squash) so `release/7.75.1` history matches the standard release-sync workflow. Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes are limited to documentation/release notes and skipping a single smoke test, with no production code modifications. > > **Overview** > Merges in the `7.75.0` changelog entry (Added/Changed/Fixed lists) and updates the compare links so `[Unreleased]` now points to `v7.75.0...HEAD`. > > Temporarily disables the Predictions e2e smoke test by changing `describe` to `describe.skip` in `tests/smoke/predict/predict-open-position.spec.ts` (with a link to the tracking discussion). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ca1db7d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Co-authored-by: Cursor <cursoragent@cursor.com>
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.
In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->
## **Description**
Bump axios to 1.15.1
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.
Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
#### Performance checks (if applicable)
- [ ] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **Pre-merge reviewer checklist**
<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk dependency bump limited to `axios` via Yarn
resolutions/lockfile, with potential for minor runtime behavior changes
in HTTP requests.
>
> **Overview**
> Updates the Yarn `resolutions` override to `axios@^1.15.1` and
refreshes `yarn.lock` to pull in `axios@1.15.2`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c6c6073. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until this PR meets the canonical
Definition of Ready For Review in `docs/readme/ready-for-review.md`.
In short: the template must be materially complete (not just section
titles
present), all status checks must be currently passing, and the only
expected
follow-up commits must be reviewer-driven.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
<!--
Every checklist item must be consciously assessed before marking this PR
as
"Ready for review". A checked box means you deliberately considered that
responsibility, not that you literally performed every action listed.
Unchecked boxes are ambiguous: they are not an implicit "N/A" and they
are not
a silent "skip". See `docs/readme/ready-for-review.md` for the full
checklist
semantics.
-->
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
#### Performance checks (if applicable)
- [ ] I've tested on Android
- Ideally on a mid-range device; emulator is acceptable
- [ ] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [ ] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example
For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
## **Pre-merge reviewer checklist**
<!--
Reviewer checklist items follow the same semantics as the author
checklist: an
unchecked box is ambiguous, a checked box means the reviewer consciously
assessed that responsibility. See `docs/readme/ready-for-review.md`.
-->
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **High Risk**
> High risk because it changes perps balance/withdraw validation and
introduces an automatic Unified Account migration flow that can trigger
signing/caching behavior and affect how collateral is computed from spot
+ perps balances.
>
> **Overview**
> **Fixes Unified Account perps withdrawals and balance display.**
Withdrawal UI/validation, confirmations, pay-with token selection, and
insufficient-balance alerts now prefer `availableToTradeBalance`
(falling back to `availableBalance`) so Unified Account users no longer
see `$0`/blocked withdrawals.
>
> **Adds Unified Account migration + spot-fold gating in the perps
provider stack.** `HyperLiquidProvider` replaces the deprecated
DEX-abstraction enablement with a cached/in-flight
`userAbstraction`-based migration to Unified Account (silent agent path
for `default/disabled`, user-signed path for `dexAbstraction`, deferred
on hardware wallets), and
`HyperLiquidSubscriptionService`/`addSpotBalanceToAccountState` now fold
spot USDC into `availableToTradeBalance` only when the resolved
abstraction mode indicates it’s valid.
>
> **Release plumbing + telemetry.** Bumps app version to `7.75.1`
(Android/Bitrise/Changelog), adds `PERPS_ACCOUNT_SETUP` event +
abstraction-mode properties/statuses, adds `formatPerpsBalance`, and
updates/expands tests around unified mode, cache clearing, and spot-fold
race conditions.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c0b1d1c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
Contributor
|
Merge my PR |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



This PR syncs the stable branch to main for version 7.75.1.
Synchronization Process:
File Preservation:
Preserves specific files from the stable branch:
Indicates the next version candidate of main to 7.75.1