[pull] main from MetaMask:main#580
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? --> Releasing new `network-controller` major version and `controller-utils` minor version, along with all their peers ## 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** > Mostly version and dependency bumps across the monorepo, but it pulls in `@metamask/network-controller@32.0.0` (breaking default-network set changes) which can affect consumers’ network availability and initialization assumptions. > > **Overview** > Updates the monorepo release to `978.0.0` and publishes new package versions across many workspaces. > > Propagates dependency bumps for the `@metamask/network-controller@32.0.0` major and `@metamask/controller-utils@12.1.0` minor (plus related peer bumps like `@metamask/accounts-controller@38.1.1`, `@metamask/assets-controllers@108.0.0`, and `@metamask/signature-controller@39.2.2`), with corresponding `package.json` and `CHANGELOG.md` updates throughout. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7ef6440. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…t fiat order metadata (#8694) ## Explanation ### 1. Derive fiat order `sourceAmount` from on-chain tx data Currently, the fiat submit flow derives `sourceAmountRaw` from `order.cryptoAmount` - a human-readable value reported by the on-ramp provider. This value may not precisely reflect what was actually received on-chain. This PR reads the actual transferred amount from the completed on-chain transaction (`order.txHash`) instead. For native tokens, the amount is taken from `tx.value`. For ERC-20 tokens, the amount is decoded from the `transfer(address,uint256)` call data. If the on-chain read fails or the transaction hash is missing, the existing `order.cryptoAmount` derivation is used as a fallback. The implementation introduces: - **`getTransferredAmountFromTxHash`** - a generic utility in `utils/transaction-receipt.ts` that reads transferred amounts from any on-chain transaction (native or ERC-20). Takes explicit `chainId` and `tokenAddress` params for reusability. - **`resolveSourceAmountRaw`** - a fiat-strategy-specific function in `strategy/fiat/utils.ts` that orchestrates the on-chain read with `order.cryptoAmount` fallback. - **`getRawSourceAmountFromOrderCryptoAmount`** - the existing decimal-shift conversion, moved from `fiat-submit.ts` to `strategy/fiat/utils.ts` and renamed for clarity. ### 2. Persist fiat order metadata on `metamaskPay` The `TransactionPayController` state is cleaned up when a transaction is finalized (confirmed/failed/dropped). This means `fiatPayment.orderId` and the provider info are gone by the time the user opens the activity/transaction-details view. To enable the mobile activity view to show a fiat order status row (and query `RampsController:getOrder` for live status), this PR persists the fiat order ID and provider code on `transaction.metamaskPay` **before** polling begins in `submitFiatQuotes`. Changes: - **`MetamaskPayMetadata`** (`transaction-controller/types.ts`) — Added `fiatOrderId?: string` and `fiatProvider?: string` fields. - **`submitFiatQuotes`** (`fiat-submit.ts`) — Calls `updateTransaction` to persist `fiatOrderId` and `fiatProvider` on `tx.metamaskPay` before `waitForOrderCompletion` starts polling. This ensures data is available even while the order is still in-flight. - **Tests** — Two new tests verify metadata persistence and that existing `metamaskPay` fields are preserved. ## References - Related to the fiat strategy submit flow introduced in #8347 ## 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** > Updates fiat on-ramp submission to depend on on-chain receipt/trace parsing and persists new metadata onto `TransactionMeta`, which could affect payment execution and activity display if RPC methods/log parsing behave unexpectedly across networks. > > **Overview** > Fiat on-ramp submit flow now **persists order identifiers** onto `transaction.metamaskPay.fiat` (order ID + provider code) before polling, so downstream activity views can query order status even after controller state cleanup. > > The relay leg’s `sourceAmountRaw` is now **derived from the actual on-chain transfer** referenced by `order.txHash` via new utilities that parse ERC-20 `Transfer` logs or native transfers (using `debug_traceTransaction` with a `tx.value` fallback), falling back to `order.cryptoAmount` conversion when on-chain reads are unavailable. > > Adds `MetamaskPayMetadata.fiat` to the transaction-controller types and updates/extends unit tests around fiat submission, amount resolution, and receipt/trace parsing. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 46177a2. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…oved}` events (#8770) ## Explanation Now handles all group updates in case groups gets created/updated or removed. We still filter those events with the currently selected account group before forwarding this to the Snaps. ## References N/A ## 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** > Changes how selected accounts are forwarded into the legacy Snap keyring by adding new AccountTreeController lifecycle event handlers; bugs here could desync Snap-selected accounts from the UI-selected group. > > **Overview** > Extends `SnapAccountService` to listen for `AccountTreeController:accountGroupCreated`, `:accountGroupUpdated`, and `:accountGroupRemoved` and update the legacy Snap keyring’s selected accounts when (and only when) the affected group is currently selected. > > Refactors forwarding into `#forwardSelectedAccounts` with shared logging/error handling, adds helpers for fetching the selected group and group object, and updates mirrored types/tests/changelog to include group `id` and the new events. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 866a677. 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 : )