[pull] main from MetaMask:main#786
Merged
Merged
Conversation
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Primarily release metadata and dependency version bumps; the main risk is downstream breakage for consumers that haven’t yet adapted to the `@metamask/authenticated-user-storage@2.0.0` breaking type changes. > > **Overview** > Bumps the monorepo release version to `982.0.0` and publishes new versions for `@metamask/authenticated-user-storage` (`2.0.0`), `@metamask/notification-services-controller` (`24.0.0`), and `@metamask/money-account-upgrade-controller` (`2.0.2`). > > Updates `money-account-upgrade-controller` and `notification-services-controller` to depend on `@metamask/authenticated-user-storage@^2.0.0`, with corresponding changelog entries and `yarn.lock` updates. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a465788. 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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…8754) ## Explanation Polymarket users hold pUSD inside a deposit wallet — a deterministic, EOA-owned batch contract on Polygon, not the EOA itself — so the existing Relay strategy cannot move funds out of it directly (Relay submits source-chain transactions from the EOA). This PR adds support for the deposit-wallet `predictWithdraw` flow by folding it into the existing `RelayStrategy` as a source-leg variant, mirroring how Hyperliquid is integrated today. The Polymarket-relayer protocol itself (EIP-712 typed data signing, HTTP transport, polling, busy-retry, error shapes) is delegated to the consuming client through two new optional callbacks supplied at controller construction. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a new Polymarket-specific source flow to the Relay strategy (new callbacks, quote request overrides, and altered submit/poll behavior) and changes live balance reads to use the `pending` block tag, which can affect transaction execution paths and balance-based decisions. > > **Overview** > Adds **Polymarket deposit-wallet support** to the Relay strategy, gated by `isPolymarketDepositWallet` on `TransactionConfig`/`QuoteRequest`, including quote-body overrides (`user`/`refundTo`/`originCurrency` and `useDepositAddress`/`strict`) and skipping embedded transaction processing for that path. > > Introduces `PolymarketCallbacks` (deposit-wallet address derivation + batch submission) exposed via new `TransactionPayController` messenger actions, plus a new Polymarket withdraw implementation that submits an `approve`+`unwrap` batch to Relay and then optionally sweeps refunded/leftover USDC.e back into pUSD with retry/timing logic. > > Refactors Relay submission polling to return a structured completion outcome and, for Polymarket flows, *tolerate* Relay failure/timeout long enough to run the sweep before surfacing an error. Updates balance reads in `getLiveTokenBalance` to query at `blockTag: 'pending'` to avoid cached/stale balances. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cce1b30. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches trading readiness/signing flows and the rewards discount integration (including a DI signature change), which could affect when users are prompted to sign and how fees/discounts are computed. Most changes are additive guards/logging but in a user-critical trading path. > > **Overview** > Improves HyperLiquid unified-account migration behavior by deferring *signing-backed* setup for hardware wallets across more abstraction modes, and expanding hardware keyring detection (Ledger/Trezor/OneKey/Lattice/QR) to reduce repeated signing prompts while browsing. > > Hardens error classification by adding `isKeyringLockedError` (walks `cause` chain) and using it to treat SDK-wrapped keyring-lock failures as retryable for unified-account setup, builder-fee approval, and referral setup. > > Updates rewards discount resolution to pass the perps builder base fee (in bips) into `getPerpsDiscountForAccount`, and treats `null` (unhydrated subscription state) as “unavailable” rather than a definitive no-discount result. Adds additional error logging for failed cancel/close/TP-SL operations (including batch failure summaries). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 84a5bb6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )