feat(swaps): track input primary denomination#9147
Conversation
|
@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.
|
@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.
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
1 similar comment
|
@metamaskbot publish-preview |
61cf50a to
40b61a6
Compare
|
@metamaskbot publish-preview |
|
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.
| * This is persisted as a user preference so returning to the flow restores | ||
| * the last selected fiat/token display mode. | ||
| */ | ||
| inputPrimaryDenomination: InputPrimaryDenomination; |
There was a problem hiding this comment.
The client tests will need to be updated to bump to this version so please publish it as a breaking change
| activeAbTests, | ||
| tokenSecurityTypeDestination, | ||
| undefined, | ||
| inputPrimaryDenomination, |
There was a problem hiding this comment.
Does this need to be added to submitBatchSell too? Since the toggle is not there, we could also use a hardcoded value

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
Low Risk
Mostly additive state, analytics, and optional submit parameters; no auth or transaction logic changes beyond persisting and emitting a new property.
Overview
Adds persisted
inputPrimaryDenomination(token_amount|fiat_value) on bridge controller state (defaulttoken_amount), exposed viasetInputPrimaryDenomination, and threadsinput_primary_denominationinto Unified SwapBridge analytics for page view, quotes requested/received, and related flows.Introduces
Unified SwapBridge Fiat Crypto Toggle Clickedwith client-supplied previous/new denomination and token/chain context (including cases before a quote exists). Bridge status accepts denomination atsubmitTx/submitIntent, stores it on bridge history, and attaches it to Submitted and Completed events. Bumps@metamask/bridge-controllerto 75.2.0 and@metamask/bridge-status-controllerto 72.2.0.Reviewed by Cursor Bugbot for commit 2a5ddbf. Bugbot is set up for automated code reviews on this repo. Configure here.