feat(swaps): track input primary denomination#9147
Open
bfullam wants to merge 30 commits into
Open
Conversation
Contributor
Author
|
@metamaskbot publish-preview |
Required when package versions are bumped so the release check passes.
Update downstream bridge-controller dependencies, add coverage for setInputPrimaryDenomination and FiatCryptoToggleClicked, and align batch sell submitted-event expectations with input_primary_denomination.
Fold setInputPrimaryDenomination coverage into the toggle event test and drop the redundant history omit assertion while keeping thresholds green.
Add 75.2.0 and 72.2.0 version sections, link feature entries to the PR, and document downstream bridge package dependency bumps.
The github-tools changelog check validates Unreleased when package.json only has a version bump; keep the 75.2.0 section for auto-changelog too.
Merge main, bump root to 1047.0.0, fix changelog footer links and keep transaction-pay bridge dependency bumps in Unreleased, and format types.ts.
Contributor
Author
|
@metamaskbot publish-preview |
Preview publish runs yarn install with immutable lockfile validation, which failed because package.json dependency ranges were bumped without updating yarn.lock.
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Contributor
Author
|
@metamaskbot publish-preview |
1 similar comment
Contributor
Author
|
@metamaskbot publish-preview |
61cf50a to
40b61a6
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…on-analytics # Conflicts: # package.json # packages/transaction-pay-controller/CHANGELOG.md
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4e6f05e. Configure here.
micaelae
reviewed
Jun 19, 2026
micaelae
reviewed
Jun 19, 2026
GeorgeGkas
approved these changes
Jun 22, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
token_amountorfiat_value) and expose it throughsetInputPrimaryDenomination.input_primary_denominationon Unified SwapBridge page/quote/submission/completion analytics.Unified SwapBridge Fiat Crypto Toggle Clickedevent and allow clients to provide selected source/destination chain, token, security, and swap type metadata before a quote request exists.Test plan
yarn workspace @metamask/bridge-controller jest src/bridge-controller.test.ts --coverage=falseyarn jest src/bridge-controller.sse.test.ts src/bridge-controller.sse.batch.test.ts --updateSnapshot --coverage=falseyarn jest src/bridge-status-controller.test.ts src/bridge-status-controller.intent.test.ts src/utils/history.test.ts src/utils/metrics.test.ts --updateSnapshot --coverage=falseNODE_OPTIONS=--experimental-vm-modules yarn jest bridge-controller.test.ts -t "updateBridgeQuoteRequestParams" --runInBand --collectCoverage=falseNote
Medium Risk
Breaking persisted state and new required client wiring for submit APIs; changes are mostly analytics and UX preference with no swap execution logic changes.
Overview
Adds persisted
inputPrimaryDenomination(token_amount|fiat_value) on bridge-controller, defaulting totoken_amount, withsetInputPrimaryDenominationexposed via messenger actions and public exports.Analytics:
input_primary_denominationis attached from controller state on Page Viewed, Quotes Requested/Received, and related quote flows. A newUnified SwapBridge Fiat Crypto Toggle Clickedevent is typed and wired; clients can pass previous/new denomination plus token/chain metadata (including before a quote exists).Post-submit:
bridge-status-controlleraccepts optionalinputPrimaryDenominationonsubmitTx/submitIntent, stores it on bridge history, includes it on Submitted, and on Completed when present in history. Dependent packages bump to bridge-controller ^76.0.0 (marked BREAKING in changelog).Reviewed by Cursor Bugbot for commit ed97b40. Bugbot is set up for automated code reviews on this repo. Configure here.