@metamask/bridge-controller 75.2.1 → 76.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/dist/bridge-controller-method-action-types.cjs.map +1 -1
  3. package/dist/bridge-controller-method-action-types.d.cts +13 -5
  4. package/dist/bridge-controller-method-action-types.d.cts.map +1 -1
  5. package/dist/bridge-controller-method-action-types.d.mts +13 -5
  6. package/dist/bridge-controller-method-action-types.d.mts.map +1 -1
  7. package/dist/bridge-controller-method-action-types.mjs.map +1 -1
  8. package/dist/bridge-controller.cjs +34 -1
  9. package/dist/bridge-controller.cjs.map +1 -1
  10. package/dist/bridge-controller.d.cts +8 -1
  11. package/dist/bridge-controller.d.cts.map +1 -1
  12. package/dist/bridge-controller.d.mts +8 -1
  13. package/dist/bridge-controller.d.mts.map +1 -1
  14. package/dist/bridge-controller.mjs +34 -1
  15. package/dist/bridge-controller.mjs.map +1 -1
  16. package/dist/constants/bridge.cjs +1 -0
  17. package/dist/constants/bridge.cjs.map +1 -1
  18. package/dist/constants/bridge.d.cts.map +1 -1
  19. package/dist/constants/bridge.d.mts.map +1 -1
  20. package/dist/constants/bridge.mjs +1 -0
  21. package/dist/constants/bridge.mjs.map +1 -1
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +3 -3
  24. package/dist/index.d.cts.map +1 -1
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.mts.map +1 -1
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/types.cjs +1 -0
  29. package/dist/types.cjs.map +1 -1
  30. package/dist/types.d.cts +8 -0
  31. package/dist/types.d.cts.map +1 -1
  32. package/dist/types.d.mts +8 -0
  33. package/dist/types.d.mts.map +1 -1
  34. package/dist/types.mjs +1 -0
  35. package/dist/types.mjs.map +1 -1
  36. package/dist/utils/metrics/constants.cjs +6 -0
  37. package/dist/utils/metrics/constants.cjs.map +1 -1
  38. package/dist/utils/metrics/constants.d.cts +7 -1
  39. package/dist/utils/metrics/constants.d.cts.map +1 -1
  40. package/dist/utils/metrics/constants.d.mts +7 -1
  41. package/dist/utils/metrics/constants.d.mts.map +1 -1
  42. package/dist/utils/metrics/constants.mjs +6 -0
  43. package/dist/utils/metrics/constants.mjs.map +1 -1
  44. package/dist/utils/metrics/types.cjs.map +1 -1
  45. package/dist/utils/metrics/types.d.cts +26 -10
  46. package/dist/utils/metrics/types.d.cts.map +1 -1
  47. package/dist/utils/metrics/types.d.mts +26 -10
  48. package/dist/utils/metrics/types.d.mts.map +1 -1
  49. package/dist/utils/metrics/types.mjs.map +1 -1
  50. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Added `getLocation()` method to `BridgeController` for reading the current swap/bridge entry point ([#9243](https://github.com/MetaMask/core/pull/9243))
13
+ - Added `Unknown` value to `MetaMetricsSwapsEventSource` enum for unattributed swap and bridge flows ([#9243](https://github.com/MetaMask/core/pull/9243))
14
+ - Added `ActivityTabEmptyState`, `TransactionShield`, `TransactionDetails`, and `DeepLink` values to `MetaMetricsSwapsEventSource` enum for attributing swap and bridge flows to additional entry points ([#9241](https://github.com/MetaMask/core/pull/9241))
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING:** Default `location` fallback for Unified SwapBridge events now uses `Unknown` instead of `Main View` when no entry point is set ([#9243](https://github.com/MetaMask/core/pull/9243))
19
+
20
+ ## [76.1.0]
21
+
22
+ ### Added
23
+
24
+ - Add `quick_buy_explore` to the `FeatureId` enum ([#9222](https://github.com/MetaMask/core/pull/9222))
25
+
26
+ ### Changed
27
+
28
+ - Bump `@metamask/assets-controllers` from `^109.2.1` to `^109.2.2` ([#9231](https://github.com/MetaMask/core/pull/9231))
29
+ - Bump `@metamask/accounts-controller` from `^39.0.2` to `^39.0.3` ([#9231](https://github.com/MetaMask/core/pull/9231))
30
+
31
+ ## [76.0.0]
32
+
33
+ ### Added
34
+
35
+ - **BREAKING**: Add persisted input primary denomination state and `Unified SwapBridge Fiat Crypto Toggle Clicked` analytics event support ([#9147](https://github.com/MetaMask/core/pull/9147))
36
+
10
37
  ## [75.2.1]
11
38
 
12
39
  ### Changed
@@ -1633,7 +1660,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1633
1660
 
1634
1661
  - Initial release ([#5317](https://github.com/MetaMask/core/pull/5317))
1635
1662
 
1636
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@75.2.1...HEAD
1663
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@76.1.0...HEAD
1664
+ [76.1.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@76.0.0...@metamask/bridge-controller@76.1.0
1665
+ [76.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@75.2.1...@metamask/bridge-controller@76.0.0
1637
1666
  [75.2.1]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@75.2.0...@metamask/bridge-controller@75.2.1
1638
1667
  [75.2.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@75.1.1...@metamask/bridge-controller@75.2.0
1639
1668
  [75.1.1]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@75.1.0...@metamask/bridge-controller@75.1.1
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-controller-method-action-types.cjs","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { BridgeController } from './bridge-controller';\n\nexport type BridgeControllerUpdateBridgeQuoteRequestParamsAction = {\n type: `BridgeController:updateBridgeQuoteRequestParams`;\n handler: BridgeController['updateBridgeQuoteRequestParams'];\n};\n\nexport type BridgeControllerFetchQuotesAction = {\n type: `BridgeController:fetchQuotes`;\n handler: BridgeController['fetchQuotes'];\n};\n\nexport type BridgeControllerStopPollingForQuotesAction = {\n type: `BridgeController:stopPollingForQuotes`;\n handler: BridgeController['stopPollingForQuotes'];\n};\n\nexport type BridgeControllerSetLocationAction = {\n type: `BridgeController:setLocation`;\n handler: BridgeController['setLocation'];\n};\n\nexport type BridgeControllerResetStateAction = {\n type: `BridgeController:resetState`;\n handler: BridgeController['resetState'];\n};\n\nexport type BridgeControllerSetChainIntervalLengthAction = {\n type: `BridgeController:setChainIntervalLength`;\n handler: BridgeController['setChainIntervalLength'];\n};\n\nexport type BridgeControllerTrackUnifiedSwapBridgeEventAction = {\n type: `BridgeController:trackUnifiedSwapBridgeEvent`;\n handler: BridgeController['trackUnifiedSwapBridgeEvent'];\n};\n\nexport type BridgeControllerUpdateBatchSellTradesAction = {\n type: `BridgeController:updateBatchSellTrades`;\n handler: BridgeController['updateBatchSellTrades'];\n};\n\n/**\n * Union of all BridgeController action types.\n */\nexport type BridgeControllerMethodActions =\n | BridgeControllerUpdateBridgeQuoteRequestParamsAction\n | BridgeControllerFetchQuotesAction\n | BridgeControllerStopPollingForQuotesAction\n | BridgeControllerSetLocationAction\n | BridgeControllerResetStateAction\n | BridgeControllerSetChainIntervalLengthAction\n | BridgeControllerTrackUnifiedSwapBridgeEventAction\n | BridgeControllerUpdateBatchSellTradesAction;\n"]}
1
+ {"version":3,"file":"bridge-controller-method-action-types.cjs","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { BridgeController } from './bridge-controller';\n\nexport type BridgeControllerUpdateBridgeQuoteRequestParamsAction = {\n type: `BridgeController:updateBridgeQuoteRequestParams`;\n handler: BridgeController['updateBridgeQuoteRequestParams'];\n};\n\nexport type BridgeControllerFetchQuotesAction = {\n type: `BridgeController:fetchQuotes`;\n handler: BridgeController['fetchQuotes'];\n};\n\nexport type BridgeControllerUpdateBatchSellTradesAction = {\n type: `BridgeController:updateBatchSellTrades`;\n handler: BridgeController['updateBatchSellTrades'];\n};\n\nexport type BridgeControllerStopPollingForQuotesAction = {\n type: `BridgeController:stopPollingForQuotes`;\n handler: BridgeController['stopPollingForQuotes'];\n};\n\nexport type BridgeControllerSetLocationAction = {\n type: `BridgeController:setLocation`;\n handler: BridgeController['setLocation'];\n};\n\nexport type BridgeControllerGetLocationAction = {\n type: `BridgeController:getLocation`;\n handler: BridgeController['getLocation'];\n};\n\nexport type BridgeControllerSetInputPrimaryDenominationAction = {\n type: `BridgeController:setInputPrimaryDenomination`;\n handler: BridgeController['setInputPrimaryDenomination'];\n};\n\nexport type BridgeControllerResetStateAction = {\n type: `BridgeController:resetState`;\n handler: BridgeController['resetState'];\n};\n\nexport type BridgeControllerSetChainIntervalLengthAction = {\n type: `BridgeController:setChainIntervalLength`;\n handler: BridgeController['setChainIntervalLength'];\n};\n\nexport type BridgeControllerTrackUnifiedSwapBridgeEventAction = {\n type: `BridgeController:trackUnifiedSwapBridgeEvent`;\n handler: BridgeController['trackUnifiedSwapBridgeEvent'];\n};\n\n/**\n * Union of all BridgeController action types.\n */\nexport type BridgeControllerMethodActions =\n | BridgeControllerUpdateBridgeQuoteRequestParamsAction\n | BridgeControllerFetchQuotesAction\n | BridgeControllerUpdateBatchSellTradesAction\n | BridgeControllerStopPollingForQuotesAction\n | BridgeControllerSetLocationAction\n | BridgeControllerGetLocationAction\n | BridgeControllerSetInputPrimaryDenominationAction\n | BridgeControllerResetStateAction\n | BridgeControllerSetChainIntervalLengthAction\n | BridgeControllerTrackUnifiedSwapBridgeEventAction;\n"]}
@@ -11,6 +11,10 @@ export type BridgeControllerFetchQuotesAction = {
11
11
  type: `BridgeController:fetchQuotes`;
12
12
  handler: BridgeController['fetchQuotes'];
13
13
  };
14
+ export type BridgeControllerUpdateBatchSellTradesAction = {
15
+ type: `BridgeController:updateBatchSellTrades`;
16
+ handler: BridgeController['updateBatchSellTrades'];
17
+ };
14
18
  export type BridgeControllerStopPollingForQuotesAction = {
15
19
  type: `BridgeController:stopPollingForQuotes`;
16
20
  handler: BridgeController['stopPollingForQuotes'];
@@ -19,6 +23,14 @@ export type BridgeControllerSetLocationAction = {
19
23
  type: `BridgeController:setLocation`;
20
24
  handler: BridgeController['setLocation'];
21
25
  };
26
+ export type BridgeControllerGetLocationAction = {
27
+ type: `BridgeController:getLocation`;
28
+ handler: BridgeController['getLocation'];
29
+ };
30
+ export type BridgeControllerSetInputPrimaryDenominationAction = {
31
+ type: `BridgeController:setInputPrimaryDenomination`;
32
+ handler: BridgeController['setInputPrimaryDenomination'];
33
+ };
22
34
  export type BridgeControllerResetStateAction = {
23
35
  type: `BridgeController:resetState`;
24
36
  handler: BridgeController['resetState'];
@@ -31,12 +43,8 @@ export type BridgeControllerTrackUnifiedSwapBridgeEventAction = {
31
43
  type: `BridgeController:trackUnifiedSwapBridgeEvent`;
32
44
  handler: BridgeController['trackUnifiedSwapBridgeEvent'];
33
45
  };
34
- export type BridgeControllerUpdateBatchSellTradesAction = {
35
- type: `BridgeController:updateBatchSellTrades`;
36
- handler: BridgeController['updateBatchSellTrades'];
37
- };
38
46
  /**
39
47
  * Union of all BridgeController action types.
40
48
  */
41
- export type BridgeControllerMethodActions = BridgeControllerUpdateBridgeQuoteRequestParamsAction | BridgeControllerFetchQuotesAction | BridgeControllerStopPollingForQuotesAction | BridgeControllerSetLocationAction | BridgeControllerResetStateAction | BridgeControllerSetChainIntervalLengthAction | BridgeControllerTrackUnifiedSwapBridgeEventAction | BridgeControllerUpdateBatchSellTradesAction;
49
+ export type BridgeControllerMethodActions = BridgeControllerUpdateBridgeQuoteRequestParamsAction | BridgeControllerFetchQuotesAction | BridgeControllerUpdateBatchSellTradesAction | BridgeControllerStopPollingForQuotesAction | BridgeControllerSetLocationAction | BridgeControllerGetLocationAction | BridgeControllerSetInputPrimaryDenominationAction | BridgeControllerResetStateAction | BridgeControllerSetChainIntervalLengthAction | BridgeControllerTrackUnifiedSwapBridgeEventAction;
42
50
  //# sourceMappingURL=bridge-controller-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-controller-method-action-types.d.cts","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACrC,oDAAoD,GACpD,iCAAiC,GACjC,0CAA0C,GAC1C,iCAAiC,GACjC,gCAAgC,GAChC,4CAA4C,GAC5C,iDAAiD,GACjD,2CAA2C,CAAC"}
1
+ {"version":3,"file":"bridge-controller-method-action-types.d.cts","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;CAC1D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACrC,oDAAoD,GACpD,iCAAiC,GACjC,2CAA2C,GAC3C,0CAA0C,GAC1C,iCAAiC,GACjC,iCAAiC,GACjC,iDAAiD,GACjD,gCAAgC,GAChC,4CAA4C,GAC5C,iDAAiD,CAAC"}
@@ -11,6 +11,10 @@ export type BridgeControllerFetchQuotesAction = {
11
11
  type: `BridgeController:fetchQuotes`;
12
12
  handler: BridgeController['fetchQuotes'];
13
13
  };
14
+ export type BridgeControllerUpdateBatchSellTradesAction = {
15
+ type: `BridgeController:updateBatchSellTrades`;
16
+ handler: BridgeController['updateBatchSellTrades'];
17
+ };
14
18
  export type BridgeControllerStopPollingForQuotesAction = {
15
19
  type: `BridgeController:stopPollingForQuotes`;
16
20
  handler: BridgeController['stopPollingForQuotes'];
@@ -19,6 +23,14 @@ export type BridgeControllerSetLocationAction = {
19
23
  type: `BridgeController:setLocation`;
20
24
  handler: BridgeController['setLocation'];
21
25
  };
26
+ export type BridgeControllerGetLocationAction = {
27
+ type: `BridgeController:getLocation`;
28
+ handler: BridgeController['getLocation'];
29
+ };
30
+ export type BridgeControllerSetInputPrimaryDenominationAction = {
31
+ type: `BridgeController:setInputPrimaryDenomination`;
32
+ handler: BridgeController['setInputPrimaryDenomination'];
33
+ };
22
34
  export type BridgeControllerResetStateAction = {
23
35
  type: `BridgeController:resetState`;
24
36
  handler: BridgeController['resetState'];
@@ -31,12 +43,8 @@ export type BridgeControllerTrackUnifiedSwapBridgeEventAction = {
31
43
  type: `BridgeController:trackUnifiedSwapBridgeEvent`;
32
44
  handler: BridgeController['trackUnifiedSwapBridgeEvent'];
33
45
  };
34
- export type BridgeControllerUpdateBatchSellTradesAction = {
35
- type: `BridgeController:updateBatchSellTrades`;
36
- handler: BridgeController['updateBatchSellTrades'];
37
- };
38
46
  /**
39
47
  * Union of all BridgeController action types.
40
48
  */
41
- export type BridgeControllerMethodActions = BridgeControllerUpdateBridgeQuoteRequestParamsAction | BridgeControllerFetchQuotesAction | BridgeControllerStopPollingForQuotesAction | BridgeControllerSetLocationAction | BridgeControllerResetStateAction | BridgeControllerSetChainIntervalLengthAction | BridgeControllerTrackUnifiedSwapBridgeEventAction | BridgeControllerUpdateBatchSellTradesAction;
49
+ export type BridgeControllerMethodActions = BridgeControllerUpdateBridgeQuoteRequestParamsAction | BridgeControllerFetchQuotesAction | BridgeControllerUpdateBatchSellTradesAction | BridgeControllerStopPollingForQuotesAction | BridgeControllerSetLocationAction | BridgeControllerGetLocationAction | BridgeControllerSetInputPrimaryDenominationAction | BridgeControllerResetStateAction | BridgeControllerSetChainIntervalLengthAction | BridgeControllerTrackUnifiedSwapBridgeEventAction;
42
50
  //# sourceMappingURL=bridge-controller-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-controller-method-action-types.d.mts","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACrC,oDAAoD,GACpD,iCAAiC,GACjC,0CAA0C,GAC1C,iCAAiC,GACjC,gCAAgC,GAChC,4CAA4C,GAC5C,iDAAiD,GACjD,2CAA2C,CAAC"}
1
+ {"version":3,"file":"bridge-controller-method-action-types.d.mts","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;CAC1D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACrC,oDAAoD,GACpD,iCAAiC,GACjC,2CAA2C,GAC3C,0CAA0C,GAC1C,iCAAiC,GACjC,iCAAiC,GACjC,iDAAiD,GACjD,gCAAgC,GAChC,4CAA4C,GAC5C,iDAAiD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-controller-method-action-types.mjs","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { BridgeController } from './bridge-controller';\n\nexport type BridgeControllerUpdateBridgeQuoteRequestParamsAction = {\n type: `BridgeController:updateBridgeQuoteRequestParams`;\n handler: BridgeController['updateBridgeQuoteRequestParams'];\n};\n\nexport type BridgeControllerFetchQuotesAction = {\n type: `BridgeController:fetchQuotes`;\n handler: BridgeController['fetchQuotes'];\n};\n\nexport type BridgeControllerStopPollingForQuotesAction = {\n type: `BridgeController:stopPollingForQuotes`;\n handler: BridgeController['stopPollingForQuotes'];\n};\n\nexport type BridgeControllerSetLocationAction = {\n type: `BridgeController:setLocation`;\n handler: BridgeController['setLocation'];\n};\n\nexport type BridgeControllerResetStateAction = {\n type: `BridgeController:resetState`;\n handler: BridgeController['resetState'];\n};\n\nexport type BridgeControllerSetChainIntervalLengthAction = {\n type: `BridgeController:setChainIntervalLength`;\n handler: BridgeController['setChainIntervalLength'];\n};\n\nexport type BridgeControllerTrackUnifiedSwapBridgeEventAction = {\n type: `BridgeController:trackUnifiedSwapBridgeEvent`;\n handler: BridgeController['trackUnifiedSwapBridgeEvent'];\n};\n\nexport type BridgeControllerUpdateBatchSellTradesAction = {\n type: `BridgeController:updateBatchSellTrades`;\n handler: BridgeController['updateBatchSellTrades'];\n};\n\n/**\n * Union of all BridgeController action types.\n */\nexport type BridgeControllerMethodActions =\n | BridgeControllerUpdateBridgeQuoteRequestParamsAction\n | BridgeControllerFetchQuotesAction\n | BridgeControllerStopPollingForQuotesAction\n | BridgeControllerSetLocationAction\n | BridgeControllerResetStateAction\n | BridgeControllerSetChainIntervalLengthAction\n | BridgeControllerTrackUnifiedSwapBridgeEventAction\n | BridgeControllerUpdateBatchSellTradesAction;\n"]}
1
+ {"version":3,"file":"bridge-controller-method-action-types.mjs","sourceRoot":"","sources":["../src/bridge-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { BridgeController } from './bridge-controller';\n\nexport type BridgeControllerUpdateBridgeQuoteRequestParamsAction = {\n type: `BridgeController:updateBridgeQuoteRequestParams`;\n handler: BridgeController['updateBridgeQuoteRequestParams'];\n};\n\nexport type BridgeControllerFetchQuotesAction = {\n type: `BridgeController:fetchQuotes`;\n handler: BridgeController['fetchQuotes'];\n};\n\nexport type BridgeControllerUpdateBatchSellTradesAction = {\n type: `BridgeController:updateBatchSellTrades`;\n handler: BridgeController['updateBatchSellTrades'];\n};\n\nexport type BridgeControllerStopPollingForQuotesAction = {\n type: `BridgeController:stopPollingForQuotes`;\n handler: BridgeController['stopPollingForQuotes'];\n};\n\nexport type BridgeControllerSetLocationAction = {\n type: `BridgeController:setLocation`;\n handler: BridgeController['setLocation'];\n};\n\nexport type BridgeControllerGetLocationAction = {\n type: `BridgeController:getLocation`;\n handler: BridgeController['getLocation'];\n};\n\nexport type BridgeControllerSetInputPrimaryDenominationAction = {\n type: `BridgeController:setInputPrimaryDenomination`;\n handler: BridgeController['setInputPrimaryDenomination'];\n};\n\nexport type BridgeControllerResetStateAction = {\n type: `BridgeController:resetState`;\n handler: BridgeController['resetState'];\n};\n\nexport type BridgeControllerSetChainIntervalLengthAction = {\n type: `BridgeController:setChainIntervalLength`;\n handler: BridgeController['setChainIntervalLength'];\n};\n\nexport type BridgeControllerTrackUnifiedSwapBridgeEventAction = {\n type: `BridgeController:trackUnifiedSwapBridgeEvent`;\n handler: BridgeController['trackUnifiedSwapBridgeEvent'];\n};\n\n/**\n * Union of all BridgeController action types.\n */\nexport type BridgeControllerMethodActions =\n | BridgeControllerUpdateBridgeQuoteRequestParamsAction\n | BridgeControllerFetchQuotesAction\n | BridgeControllerUpdateBatchSellTradesAction\n | BridgeControllerStopPollingForQuotesAction\n | BridgeControllerSetLocationAction\n | BridgeControllerGetLocationAction\n | BridgeControllerSetInputPrimaryDenominationAction\n | BridgeControllerResetStateAction\n | BridgeControllerSetChainIntervalLengthAction\n | BridgeControllerTrackUnifiedSwapBridgeEventAction;\n"]}
@@ -103,6 +103,12 @@ const metadata = {
103
103
  includeInDebugSnapshot: false,
104
104
  usedInUi: true,
105
105
  },
106
+ inputPrimaryDenomination: {
107
+ includeInStateLogs: true,
108
+ persist: true,
109
+ includeInDebugSnapshot: false,
110
+ usedInUi: true,
111
+ },
106
112
  quoteStreamComplete: {
107
113
  includeInStateLogs: true,
108
114
  persist: false,
@@ -128,6 +134,8 @@ const MESSENGER_EXPOSED_METHODS = [
128
134
  'updateBatchSellTrades',
129
135
  'stopPollingForQuotes',
130
136
  'setLocation',
137
+ 'getLocation',
138
+ 'setInputPrimaryDenomination',
131
139
  'resetState',
132
140
  'setChainIntervalLength',
133
141
  'trackUnifiedSwapBridgeEvent',
@@ -152,7 +160,7 @@ class BridgeController extends (0, polling_controller_1.StaticIntervalPollingCon
152
160
  * Set via setLocation() before navigating to the swap/bridge flow.
153
161
  * Used as default for all subsequent internal events.
154
162
  */
155
- _BridgeController_location.set(this, constants_1.MetaMetricsSwapsEventSource.MainView);
163
+ _BridgeController_location.set(this, constants_1.MetaMetricsSwapsEventSource.Unknown);
156
164
  _BridgeController_clientId.set(this, void 0);
157
165
  _BridgeController_clientVersion.set(this, void 0);
158
166
  _BridgeController_getLayer1GasFee.set(this, void 0);
@@ -438,6 +446,19 @@ class BridgeController extends (0, polling_controller_1.StaticIntervalPollingCon
438
446
  this.setLocation = (location) => {
439
447
  __classPrivateFieldSet(this, _BridgeController_location, location, "f");
440
448
  };
449
+ /**
450
+ * Returns the location/entry point for the current swap or bridge flow.
451
+ *
452
+ * @returns The entry point from which the user initiated the flow
453
+ */
454
+ this.getLocation = () => {
455
+ return __classPrivateFieldGet(this, _BridgeController_location, "f");
456
+ };
457
+ this.setInputPrimaryDenomination = (inputPrimaryDenomination) => {
458
+ this.update((state) => {
459
+ state.inputPrimaryDenomination = inputPrimaryDenomination;
460
+ });
461
+ };
441
462
  this.resetState = (reason = constants_1.AbortReason.ResetState, quoteRequestIndex = null, context) => {
442
463
  this.stopPollingForQuotes(reason, context);
443
464
  this.update((state) => {
@@ -733,6 +754,9 @@ class BridgeController extends (0, polling_controller_1.StaticIntervalPollingCon
733
754
  location: clientProps?.location ?? __classPrivateFieldGet(this, _BridgeController_location, "f"),
734
755
  action_type: constants_1.MetricsActionType.SWAPBRIDGE_V1,
735
756
  };
757
+ const inputPrimaryDenominationProperties = {
758
+ input_primary_denomination: this.state.inputPrimaryDenomination,
759
+ };
736
760
  const quoteRequest = this.state.quoteRequest[quoteRequestIndex];
737
761
  switch (eventName) {
738
762
  case constants_1.UnifiedSwapBridgeEventName.ButtonClicked:
@@ -744,6 +768,13 @@ class BridgeController extends (0, polling_controller_1.StaticIntervalPollingCon
744
768
  return {
745
769
  ...(0, properties_1.getRequestParams)(quoteRequest, this.state.tokenSecurityTypeDestination),
746
770
  ...__classPrivateFieldGet(this, _BridgeController_getRequestMetadata, "f").call(this),
771
+ ...inputPrimaryDenominationProperties,
772
+ ...baseProperties,
773
+ };
774
+ case constants_1.UnifiedSwapBridgeEventName.FiatCryptoToggleClicked:
775
+ return {
776
+ ...(0, properties_1.getRequestParams)(quoteRequest, this.state.tokenSecurityTypeDestination),
777
+ swap_type: (0, properties_1.getSwapTypeFromQuote)(quoteRequest),
747
778
  ...baseProperties,
748
779
  };
749
780
  case constants_1.UnifiedSwapBridgeEventName.QuotesValidationFailed:
@@ -758,6 +789,7 @@ class BridgeController extends (0, polling_controller_1.StaticIntervalPollingCon
758
789
  ...__classPrivateFieldGet(this, _BridgeController_getRequestMetadata, "f").call(this),
759
790
  ...__classPrivateFieldGet(this, _BridgeController_getQuoteFetchData, "f").call(this),
760
791
  refresh_count: this.state.quotesRefreshCount,
792
+ ...inputPrimaryDenominationProperties,
761
793
  ...baseProperties,
762
794
  };
763
795
  case constants_1.UnifiedSwapBridgeEventName.QuotesRequested:
@@ -765,6 +797,7 @@ class BridgeController extends (0, polling_controller_1.StaticIntervalPollingCon
765
797
  ...(0, properties_1.getRequestParams)(quoteRequest, this.state.tokenSecurityTypeDestination),
766
798
  ...__classPrivateFieldGet(this, _BridgeController_getRequestMetadata, "f").call(this),
767
799
  has_sufficient_funds: !quoteRequest.insufficientBal,
800
+ ...inputPrimaryDenominationProperties,
768
801
  ...baseProperties,
769
802
  };
770
803
  case constants_1.UnifiedSwapBridgeEventName.QuotesError: