@metamask/bridge-controller 67.1.0 → 67.2.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.
- package/CHANGELOG.md +24 -1
- package/dist/utils/metrics/constants.cjs +1 -0
- package/dist/utils/metrics/constants.cjs.map +1 -1
- package/dist/utils/metrics/constants.d.cts +1 -0
- package/dist/utils/metrics/constants.d.cts.map +1 -1
- package/dist/utils/metrics/constants.d.mts +1 -0
- package/dist/utils/metrics/constants.d.mts.map +1 -1
- package/dist/utils/metrics/constants.mjs +1 -0
- package/dist/utils/metrics/constants.mjs.map +1 -1
- package/dist/utils/metrics/types.cjs.map +1 -1
- package/dist/utils/metrics/types.d.cts +3 -2
- package/dist/utils/metrics/types.d.cts.map +1 -1
- package/dist/utils/metrics/types.d.mts +3 -2
- package/dist/utils/metrics/types.d.mts.map +1 -1
- package/dist/utils/metrics/types.mjs.map +1 -1
- package/package.json +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [67.2.0]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bump `@metamask/transaction-controller` from `^62.17.1` to `^62.18.0` ([#8005](https://github.com/MetaMask/core/pull/8005))
|
|
15
|
+
- Bump `@metamask/assets-controllers` from `^100.0.1` to `^100.0.2` ([#8004](https://github.com/MetaMask/core/pull/8004))
|
|
16
|
+
- Replace `PERCENT_90` with `PERCENT_75` in `InputAmountPreset` enum ([#7997](https://github.com/MetaMask/core/pull/7997))
|
|
17
|
+
- Add `PERCENT_90` in `InputAmountPreset` enum ([#8008](https://github.com/MetaMask/core/pull/8008))
|
|
18
|
+
|
|
19
|
+
## [67.1.1]
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Bump `@metamask/accounts-controller` from `^36.0.0` to `^36.0.1` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
24
|
+
- Bump `@metamask/assets-controllers` from `^100.0.0` to `^100.0.1` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
25
|
+
- Bump `@metamask/gas-fee-controller` from `^26.0.2` to `^26.0.3` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
26
|
+
- Bump `@metamask/multichain-network-controller` from `^3.0.3` to `^3.0.4` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
27
|
+
- Bump `@metamask/network-controller` from `^29.0.0` to `^30.0.0` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
28
|
+
- Bump `@metamask/polling-controller` from `^16.0.2` to `^16.0.3` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
29
|
+
- Bump `@metamask/transaction-controller` from `^62.17.0` to `^62.17.1` ([#7996](https://github.com/MetaMask/core/pull/7996))
|
|
30
|
+
|
|
10
31
|
## [67.1.0]
|
|
11
32
|
|
|
12
33
|
### Added
|
|
@@ -1166,7 +1187,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1166
1187
|
|
|
1167
1188
|
- Initial release ([#5317](https://github.com/MetaMask/core/pull/5317))
|
|
1168
1189
|
|
|
1169
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@67.
|
|
1190
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@67.2.0...HEAD
|
|
1191
|
+
[67.2.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@67.1.1...@metamask/bridge-controller@67.2.0
|
|
1192
|
+
[67.1.1]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@67.1.0...@metamask/bridge-controller@67.1.1
|
|
1170
1193
|
[67.1.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@67.0.0...@metamask/bridge-controller@67.1.0
|
|
1171
1194
|
[67.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@66.2.0...@metamask/bridge-controller@67.0.0
|
|
1172
1195
|
[66.2.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@66.1.1...@metamask/bridge-controller@66.2.0
|
|
@@ -54,6 +54,7 @@ var InputAmountPreset;
|
|
|
54
54
|
(function (InputAmountPreset) {
|
|
55
55
|
InputAmountPreset["PERCENT_25"] = "25%";
|
|
56
56
|
InputAmountPreset["PERCENT_50"] = "50%";
|
|
57
|
+
InputAmountPreset["PERCENT_75"] = "75%";
|
|
57
58
|
InputAmountPreset["PERCENT_90"] = "90%";
|
|
58
59
|
// "Max" may not equal 100% of balance (e.g. gas reserves are withheld)
|
|
59
60
|
InputAmountPreset["MAX"] = "MAX";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AAC5C,QAAA,kCAAkC,GAAG,oBAAoB,CAAC;AAEvE;;GAEG;AACH,IAAY,0BAkBX;AAlBD,WAAY,0BAA0B;IACpC,iFAAsE,CAAA;IACtE,2EAAgE,CAAA;IAChE,+EAAoE,CAAA;IACpE,+GAAoG,CAAA;IACpG,qFAA0E,CAAA;IAC1E,mFAAwE,CAAA;IACxE,6EAAkE,CAAA;IAClE,wEAA6D,CAAA;IAC7D,wEAA6D,CAAA;IAC7D,kEAAuD,CAAA;IACvD,sFAA2E,CAAA;IAC3E,sFAA2E,CAAA;IAC3E,iFAAsE,CAAA;IACtE,2GAAgG,CAAA;IAChG,oGAAyF,CAAA;IACzF,oGAAyF,CAAA;IACzF,gGAAqF,CAAA;AACvF,CAAC,EAlBW,0BAA0B,0CAA1B,0BAA0B,QAkBrC;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,0DAAyC,CAAA;IACzC,yDAAwC,CAAA;AAC1C,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oDAAqC,CAAA;IACrC,4DAA6C,CAAA;IAC7C,oDAAqC,CAAA;IACrC,6DAA8C,CAAA;AAChD,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED;;;;GAIG;AACH,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACrC,qDAAsB,CAAA;IACtB,uDAAwB,CAAA;IACxB,mEAAoC,CAAA;IACpC,kDAAmB,CAAA;AACrB,CAAC,EALW,2BAA2B,2CAA3B,2BAA2B,QAKtC;AAED,IAAY,
|
|
1
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AAC5C,QAAA,kCAAkC,GAAG,oBAAoB,CAAC;AAEvE;;GAEG;AACH,IAAY,0BAkBX;AAlBD,WAAY,0BAA0B;IACpC,iFAAsE,CAAA;IACtE,2EAAgE,CAAA;IAChE,+EAAoE,CAAA;IACpE,+GAAoG,CAAA;IACpG,qFAA0E,CAAA;IAC1E,mFAAwE,CAAA;IACxE,6EAAkE,CAAA;IAClE,wEAA6D,CAAA;IAC7D,wEAA6D,CAAA;IAC7D,kEAAuD,CAAA;IACvD,sFAA2E,CAAA;IAC3E,sFAA2E,CAAA;IAC3E,iFAAsE,CAAA;IACtE,2GAAgG,CAAA;IAChG,oGAAyF,CAAA;IACzF,oGAAyF,CAAA;IACzF,gGAAqF,CAAA;AACvF,CAAC,EAlBW,0BAA0B,0CAA1B,0BAA0B,QAkBrC;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,0DAAyC,CAAA;IACzC,yDAAwC,CAAA;AAC1C,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oDAAqC,CAAA;IACrC,4DAA6C,CAAA;IAC7C,oDAAqC,CAAA;IACrC,6DAA8C,CAAA;AAChD,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED;;;;GAIG;AACH,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACrC,qDAAsB,CAAA;IACtB,uDAAwB,CAAA;IACxB,mEAAoC,CAAA;IACpC,kDAAmB,CAAA;AACrB,CAAC,EALW,2BAA2B,2CAA3B,2BAA2B,QAKtC;AAED,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,uCAAkB,CAAA;IAClB,uCAAkB,CAAA;IAClB,uCAAkB,CAAA;IAClB,uCAAkB,CAAA;IAClB,uEAAuE;IACvE,gCAAW,CAAA;AACb,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B;AAED,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B;;OAEG;IACH,oDAA+B,CAAA;IAC/B,oDAA+B,CAAA;AACjC,CAAC,EANW,iBAAiB,iCAAjB,iBAAiB,QAM5B;AAED,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;AAC3B,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nexport const UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY = 'Unified SwapBridge';\n\n/**\n * These event names map to events defined in the segment-schema: https://github.com/Consensys/segment-schema/tree/main/libraries/events/metamask-cross-chain-swaps\n */\nexport enum UnifiedSwapBridgeEventName {\n ButtonClicked = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Button Clicked`,\n PageViewed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Page Viewed`,\n InputChanged = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Input Changed`,\n InputSourceDestinationSwitched = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Source Destination Switched`,\n QuotesRequested = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Requested`,\n QuotesReceived = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Received`,\n QuotesError = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Error`,\n Submitted = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Submitted`,\n Completed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Completed`,\n Failed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Failed`,\n AllQuotesOpened = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} All Quotes Opened`,\n AllQuotesSorted = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} All Quotes Sorted`,\n QuoteSelected = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quote Selected`,\n AssetDetailTooltipClicked = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Detail Tooltip Clicked`,\n QuotesValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Failed Validation`,\n StatusValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Status Failed Validation`,\n PollingStatusUpdated = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Polling Status Updated`,\n}\n\nexport enum PollingStatus {\n MaxPollingReached = 'max_polling_reached',\n ManuallyRestarted = 'manually_restarted',\n}\n\nexport enum AbortReason {\n NewQuoteRequest = 'New Quote Request',\n QuoteRequestUpdated = 'Quote Request Updated',\n ResetState = 'Reset controller state',\n TransactionSubmitted = 'Transaction submitted',\n}\n\n/**\n * Identifies the entry point from which the user initiated a swap or bridge flow.\n * Included as the `location` property on every Unified SwapBridge event so\n * analytics can trace the user's origin regardless of where they are in the flow.\n */\nexport enum MetaMetricsSwapsEventSource {\n MainView = 'Main View',\n TokenView = 'Token View',\n TrendingExplore = 'Trending Explore',\n Rewards = 'Rewards',\n}\n\nexport enum InputAmountPreset {\n PERCENT_25 = '25%',\n PERCENT_50 = '50%',\n PERCENT_75 = '75%',\n PERCENT_90 = '90%',\n // \"Max\" may not equal 100% of balance (e.g. gas reserves are withheld)\n MAX = 'MAX',\n}\n\nexport enum MetricsActionType {\n /**\n * @deprecated new events should use SWAPBRIDGE_V1 instead\n */\n CROSSCHAIN_V1 = 'crosschain-v1',\n SWAPBRIDGE_V1 = 'swapbridge-v1',\n}\n\nexport enum MetricsSwapType {\n SINGLE = 'single_chain',\n CROSSCHAIN = 'crosschain',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AAEvE;;GAEG;AACH,oBAAY,0BAA0B;IACpC,aAAa,sCAAyD;IACtE,UAAU,mCAAsD;IAChE,YAAY,qCAAwD;IACpE,8BAA8B,mDAAsE;IACpG,eAAe,wCAA2D;IAC1E,cAAc,uCAA0D;IACxE,WAAW,oCAAuD;IAClE,SAAS,iCAAoD;IAC7D,SAAS,iCAAoD;IAC7D,MAAM,8BAAiD;IACvD,eAAe,yCAA4D;IAC3E,eAAe,yCAA4D;IAC3E,aAAa,sCAAyD;IACtE,yBAAyB,oDAAuE;IAChG,sBAAsB,gDAAmE;IACzF,sBAAsB,gDAAmE;IACzF,oBAAoB,8CAAiE;CACtF;AAED,oBAAY,aAAa;IACvB,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,WAAW;IACrB,eAAe,sBAAsB;IACrC,mBAAmB,0BAA0B;IAC7C,UAAU,2BAA2B;IACrC,oBAAoB,0BAA0B;CAC/C;AAED;;;;GAIG;AACH,oBAAY,2BAA2B;IACrC,QAAQ,cAAc;IACtB,SAAS,eAAe;IACxB,eAAe,qBAAqB;IACpC,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAElB,GAAG,QAAQ;CACZ;AAED,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,oBAAY,eAAe;IACzB,MAAM,iBAAiB;IACvB,UAAU,eAAe;CAC1B"}
|
|
1
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AAEvE;;GAEG;AACH,oBAAY,0BAA0B;IACpC,aAAa,sCAAyD;IACtE,UAAU,mCAAsD;IAChE,YAAY,qCAAwD;IACpE,8BAA8B,mDAAsE;IACpG,eAAe,wCAA2D;IAC1E,cAAc,uCAA0D;IACxE,WAAW,oCAAuD;IAClE,SAAS,iCAAoD;IAC7D,SAAS,iCAAoD;IAC7D,MAAM,8BAAiD;IACvD,eAAe,yCAA4D;IAC3E,eAAe,yCAA4D;IAC3E,aAAa,sCAAyD;IACtE,yBAAyB,oDAAuE;IAChG,sBAAsB,gDAAmE;IACzF,sBAAsB,gDAAmE;IACzF,oBAAoB,8CAAiE;CACtF;AAED,oBAAY,aAAa;IACvB,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,WAAW;IACrB,eAAe,sBAAsB;IACrC,mBAAmB,0BAA0B;IAC7C,UAAU,2BAA2B;IACrC,oBAAoB,0BAA0B;CAC/C;AAED;;;;GAIG;AACH,oBAAY,2BAA2B;IACrC,QAAQ,cAAc;IACtB,SAAS,eAAe;IACxB,eAAe,qBAAqB;IACpC,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAElB,GAAG,QAAQ;CACZ;AAED,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,oBAAY,eAAe;IACzB,MAAM,iBAAiB;IACvB,UAAU,eAAe;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AAEvE;;GAEG;AACH,oBAAY,0BAA0B;IACpC,aAAa,sCAAyD;IACtE,UAAU,mCAAsD;IAChE,YAAY,qCAAwD;IACpE,8BAA8B,mDAAsE;IACpG,eAAe,wCAA2D;IAC1E,cAAc,uCAA0D;IACxE,WAAW,oCAAuD;IAClE,SAAS,iCAAoD;IAC7D,SAAS,iCAAoD;IAC7D,MAAM,8BAAiD;IACvD,eAAe,yCAA4D;IAC3E,eAAe,yCAA4D;IAC3E,aAAa,sCAAyD;IACtE,yBAAyB,oDAAuE;IAChG,sBAAsB,gDAAmE;IACzF,sBAAsB,gDAAmE;IACzF,oBAAoB,8CAAiE;CACtF;AAED,oBAAY,aAAa;IACvB,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,WAAW;IACrB,eAAe,sBAAsB;IACrC,mBAAmB,0BAA0B;IAC7C,UAAU,2BAA2B;IACrC,oBAAoB,0BAA0B;CAC/C;AAED;;;;GAIG;AACH,oBAAY,2BAA2B;IACrC,QAAQ,cAAc;IACtB,SAAS,eAAe;IACxB,eAAe,qBAAqB;IACpC,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAElB,GAAG,QAAQ;CACZ;AAED,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,oBAAY,eAAe;IACzB,MAAM,iBAAiB;IACvB,UAAU,eAAe;CAC1B"}
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AAEvE;;GAEG;AACH,oBAAY,0BAA0B;IACpC,aAAa,sCAAyD;IACtE,UAAU,mCAAsD;IAChE,YAAY,qCAAwD;IACpE,8BAA8B,mDAAsE;IACpG,eAAe,wCAA2D;IAC1E,cAAc,uCAA0D;IACxE,WAAW,oCAAuD;IAClE,SAAS,iCAAoD;IAC7D,SAAS,iCAAoD;IAC7D,MAAM,8BAAiD;IACvD,eAAe,yCAA4D;IAC3E,eAAe,yCAA4D;IAC3E,aAAa,sCAAyD;IACtE,yBAAyB,oDAAuE;IAChG,sBAAsB,gDAAmE;IACzF,sBAAsB,gDAAmE;IACzF,oBAAoB,8CAAiE;CACtF;AAED,oBAAY,aAAa;IACvB,iBAAiB,wBAAwB;IACzC,iBAAiB,uBAAuB;CACzC;AAED,oBAAY,WAAW;IACrB,eAAe,sBAAsB;IACrC,mBAAmB,0BAA0B;IAC7C,UAAU,2BAA2B;IACrC,oBAAoB,0BAA0B;CAC/C;AAED;;;;GAIG;AACH,oBAAY,2BAA2B;IACrC,QAAQ,cAAc;IACtB,SAAS,eAAe;IACxB,eAAe,qBAAqB;IACpC,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAClB,UAAU,QAAQ;IAElB,GAAG,QAAQ;CACZ;AAED,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,oBAAY,eAAe;IACzB,MAAM,iBAAiB;IACvB,UAAU,eAAe;CAC1B"}
|
|
@@ -51,6 +51,7 @@ export var InputAmountPreset;
|
|
|
51
51
|
(function (InputAmountPreset) {
|
|
52
52
|
InputAmountPreset["PERCENT_25"] = "25%";
|
|
53
53
|
InputAmountPreset["PERCENT_50"] = "50%";
|
|
54
|
+
InputAmountPreset["PERCENT_75"] = "75%";
|
|
54
55
|
InputAmountPreset["PERCENT_90"] = "90%";
|
|
55
56
|
// "Max" may not equal 100% of balance (e.g. gas reserves are withheld)
|
|
56
57
|
InputAmountPreset["MAX"] = "MAX";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/constants.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,CAAC,MAAM,kCAAkC,GAAG,oBAAoB,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAN,IAAY,0BAkBX;AAlBD,WAAY,0BAA0B;IACpC,iFAAsE,CAAA;IACtE,2EAAgE,CAAA;IAChE,+EAAoE,CAAA;IACpE,+GAAoG,CAAA;IACpG,qFAA0E,CAAA;IAC1E,mFAAwE,CAAA;IACxE,6EAAkE,CAAA;IAClE,wEAA6D,CAAA;IAC7D,wEAA6D,CAAA;IAC7D,kEAAuD,CAAA;IACvD,sFAA2E,CAAA;IAC3E,sFAA2E,CAAA;IAC3E,iFAAsE,CAAA;IACtE,2GAAgG,CAAA;IAChG,oGAAyF,CAAA;IACzF,oGAAyF,CAAA;IACzF,gGAAqF,CAAA;AACvF,CAAC,EAlBW,0BAA0B,KAA1B,0BAA0B,QAkBrC;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,0DAAyC,CAAA;IACzC,yDAAwC,CAAA;AAC1C,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oDAAqC,CAAA;IACrC,4DAA6C,CAAA;IAC7C,oDAAqC,CAAA;IACrC,6DAA8C,CAAA;AAChD,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACrC,qDAAsB,CAAA;IACtB,uDAAwB,CAAA;IACxB,mEAAoC,CAAA;IACpC,kDAAmB,CAAA;AACrB,CAAC,EALW,2BAA2B,KAA3B,2BAA2B,QAKtC;AAED,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../../src/utils/metr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,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B;;OAEG;IACH,oDAA+B,CAAA;IAC/B,oDAA+B,CAAA;AACjC,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,QAM5B;AAED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;AAC3B,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nexport const UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY = 'Unified SwapBridge';\n\n/**\n * These event names map to events defined in the segment-schema: https://github.com/Consensys/segment-schema/tree/main/libraries/events/metamask-cross-chain-swaps\n */\nexport enum UnifiedSwapBridgeEventName {\n ButtonClicked = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Button Clicked`,\n PageViewed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Page Viewed`,\n InputChanged = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Input Changed`,\n InputSourceDestinationSwitched = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Source Destination Switched`,\n QuotesRequested = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Requested`,\n QuotesReceived = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Received`,\n QuotesError = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Error`,\n Submitted = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Submitted`,\n Completed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Completed`,\n Failed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Failed`,\n AllQuotesOpened = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} All Quotes Opened`,\n AllQuotesSorted = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} All Quotes Sorted`,\n QuoteSelected = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quote Selected`,\n AssetDetailTooltipClicked = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Asset Detail Tooltip Clicked`,\n QuotesValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Quotes Failed Validation`,\n StatusValidationFailed = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Status Failed Validation`,\n PollingStatusUpdated = `${UNIFIED_SWAP_BRIDGE_EVENT_CATEGORY} Polling Status Updated`,\n}\n\nexport enum PollingStatus {\n MaxPollingReached = 'max_polling_reached',\n ManuallyRestarted = 'manually_restarted',\n}\n\nexport enum AbortReason {\n NewQuoteRequest = 'New Quote Request',\n QuoteRequestUpdated = 'Quote Request Updated',\n ResetState = 'Reset controller state',\n TransactionSubmitted = 'Transaction submitted',\n}\n\n/**\n * Identifies the entry point from which the user initiated a swap or bridge flow.\n * Included as the `location` property on every Unified SwapBridge event so\n * analytics can trace the user's origin regardless of where they are in the flow.\n */\nexport enum MetaMetricsSwapsEventSource {\n MainView = 'Main View',\n TokenView = 'Token View',\n TrendingExplore = 'Trending Explore',\n Rewards = 'Rewards',\n}\n\nexport enum InputAmountPreset {\n PERCENT_25 = '25%',\n PERCENT_50 = '50%',\n PERCENT_75 = '75%',\n PERCENT_90 = '90%',\n // \"Max\" may not equal 100% of balance (e.g. gas reserves are withheld)\n MAX = 'MAX',\n}\n\nexport enum MetricsActionType {\n /**\n * @deprecated new events should use SWAPBRIDGE_V1 instead\n */\n CROSSCHAIN_V1 = 'crosschain-v1',\n SWAPBRIDGE_V1 = 'swapbridge-v1',\n}\n\nexport enum MetricsSwapType {\n SINGLE = 'single_chain',\n CROSSCHAIN = 'crosschain',\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n InputAmountPreset,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'price_impact'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n >;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: InputAmountPreset;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\n actual_time_minutes: number;\n usd_actual_return: number;\n usd_actual_gas: number;\n quote_vs_execution_ratio: number;\n quoted_vs_used_gas_ratio: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Failed]:\n | // Tx failed before confirmation\n (TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'is_hardware_wallet'\n > &\n Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { error_message: string }) // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n Pick<QuoteFetchData, 'price_impact'> &\n TxStatusData &\n TradeData & {\n actual_time_minutes: number;\n error_message?: string;\n });\n // Emitted by clients\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n sort_order: SortOrder;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.QuoteSelected]: TradeData & {\n is_best_quote: boolean;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n };\n};\n\n/**\n * Properties that can be derived from the bridge controller state\n */\nexport type EventPropertiesFromControllerState = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;\n [UnifiedSwapBridgeEventName.PageViewed]: RequestParams;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n };\n [UnifiedSwapBridgeEventName.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\n [UnifiedSwapBridgeEventName.Completed]: null;\n [UnifiedSwapBridgeEventName.Failed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n actual_time_minutes: number;\n };\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData;\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: null;\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n InputAmountPreset,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage'\n | 'token_amount_source';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n token_amount_source: string;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'price_impact'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n >;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage'\n | 'token_amount_source';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: InputAmountPreset;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\n actual_time_minutes: number;\n usd_actual_return: number;\n usd_actual_gas: number;\n quote_vs_execution_ratio: number;\n quoted_vs_used_gas_ratio: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Failed]:\n | // Tx failed before confirmation\n (TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'is_hardware_wallet'\n > &\n Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { error_message: string }) // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n Pick<QuoteFetchData, 'price_impact'> &\n TxStatusData &\n TradeData & {\n actual_time_minutes: number;\n error_message?: string;\n });\n // Emitted by clients\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n sort_order: SortOrder;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.QuoteSelected]: TradeData & {\n is_best_quote: boolean;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n };\n};\n\n/**\n * Properties that can be derived from the bridge controller state\n */\nexport type EventPropertiesFromControllerState = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;\n [UnifiedSwapBridgeEventName.PageViewed]: RequestParams;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n };\n [UnifiedSwapBridgeEventName.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\n [UnifiedSwapBridgeEventName.Completed]: null;\n [UnifiedSwapBridgeEventName.Failed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n actual_time_minutes: number;\n };\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData;\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: null;\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
@@ -44,13 +44,14 @@ export type TxStatusData = {
|
|
|
44
44
|
source_transaction?: StatusTypes;
|
|
45
45
|
destination_transaction?: StatusTypes;
|
|
46
46
|
};
|
|
47
|
-
export type InputKeys = 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage';
|
|
47
|
+
export type InputKeys = 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage' | 'token_amount_source';
|
|
48
48
|
export type InputValues = {
|
|
49
49
|
token_source: CaipAssetType;
|
|
50
50
|
token_destination: CaipAssetType;
|
|
51
51
|
chain_source: CaipChainId;
|
|
52
52
|
chain_destination: CaipChainId;
|
|
53
53
|
slippage: number;
|
|
54
|
+
token_amount_source: string;
|
|
54
55
|
};
|
|
55
56
|
export type QuoteWarning = 'low_return' | 'no_quotes' | 'insufficient_gas_balance' | 'insufficient_gas_for_selected_quote' | 'insufficient_balance' | 'price_impact' | 'tx_alert';
|
|
56
57
|
/**
|
|
@@ -62,7 +63,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
62
63
|
[UnifiedSwapBridgeEventName.ButtonClicked]: Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;
|
|
63
64
|
[UnifiedSwapBridgeEventName.PageViewed]: object;
|
|
64
65
|
[UnifiedSwapBridgeEventName.InputChanged]: {
|
|
65
|
-
input: 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage';
|
|
66
|
+
input: 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage' | 'token_amount_source';
|
|
66
67
|
input_value: InputValues[keyof InputValues];
|
|
67
68
|
input_amount_preset?: InputAmountPreset;
|
|
68
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,wBAAoB;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAoB;AAE1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,WAAW,CAAC;IAC7B,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAC;IACzC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,oBAAoB,EAAE,aAAa,CAAC;IACpC,yBAAyB,EAAE,aAAa,GAAG,IAAI,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,MAAM,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C,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,aAAa,GAChD,eAAe,GACf,YAAY,GACZ,SAAS,GACT,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG;QACrC,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;IACJ,CAAC,0BAA0B,CAAC,eAAe,CAAC,EAAE,aAAa,GACzD,eAAe,GACf,SAAS,GACT,cAAc,CAAC;IACjB,CAAC,0BAA0B,CAAC,eAAe,CAAC,EAAE,aAAa,GACzD,eAAe,GACf,SAAS,GACT,cAAc,CAAC;IACjB,CAAC,0BAA0B,CAAC,aAAa,CAAC,EAAE,aAAa,GACvD,eAAe,GACf,cAAc,GACd,SAAS,CAAC;IACZ,CAAC,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,IAAI,CAAC;IAC7D,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,EAAE,aAAa,GAAG;QACnE,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC;IACnE,CAAC,0BAA0B,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;CACzD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,0BAA0B,IAElC;IACE,WAAW,EAAE,iBAAiB,CAAC;IAC/B,QAAQ,EAAE,2BAA2B,CAAC;CACvC,GACD,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -44,13 +44,14 @@ export type TxStatusData = {
|
|
|
44
44
|
source_transaction?: StatusTypes;
|
|
45
45
|
destination_transaction?: StatusTypes;
|
|
46
46
|
};
|
|
47
|
-
export type InputKeys = 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage';
|
|
47
|
+
export type InputKeys = 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage' | 'token_amount_source';
|
|
48
48
|
export type InputValues = {
|
|
49
49
|
token_source: CaipAssetType;
|
|
50
50
|
token_destination: CaipAssetType;
|
|
51
51
|
chain_source: CaipChainId;
|
|
52
52
|
chain_destination: CaipChainId;
|
|
53
53
|
slippage: number;
|
|
54
|
+
token_amount_source: string;
|
|
54
55
|
};
|
|
55
56
|
export type QuoteWarning = 'low_return' | 'no_quotes' | 'insufficient_gas_balance' | 'insufficient_gas_for_selected_quote' | 'insufficient_balance' | 'price_impact' | 'tx_alert';
|
|
56
57
|
/**
|
|
@@ -62,7 +63,7 @@ type RequiredEventContextFromClientBase = {
|
|
|
62
63
|
[UnifiedSwapBridgeEventName.ButtonClicked]: Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'>;
|
|
63
64
|
[UnifiedSwapBridgeEventName.PageViewed]: object;
|
|
64
65
|
[UnifiedSwapBridgeEventName.InputChanged]: {
|
|
65
|
-
input: 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage';
|
|
66
|
+
input: 'token_source' | 'token_destination' | 'chain_source' | 'chain_destination' | 'slippage' | 'token_amount_source';
|
|
66
67
|
input_value: InputValues[keyof InputValues];
|
|
67
68
|
input_amount_preset?: InputAmountPreset;
|
|
68
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB;AAElE,OAAO,KAAK,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,wBAAoB;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,wBAAoB;AAE1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,WAAW,CAAC;IAC7B,oBAAoB,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CAAC,CAAC,CAAC,CAAC,CAAC,GAC9C,IAAI,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n InputAmountPreset,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'price_impact'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n >;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: InputAmountPreset;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\n actual_time_minutes: number;\n usd_actual_return: number;\n usd_actual_gas: number;\n quote_vs_execution_ratio: number;\n quoted_vs_used_gas_ratio: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Failed]:\n | // Tx failed before confirmation\n (TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'is_hardware_wallet'\n > &\n Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { error_message: string }) // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n Pick<QuoteFetchData, 'price_impact'> &\n TxStatusData &\n TradeData & {\n actual_time_minutes: number;\n error_message?: string;\n });\n // Emitted by clients\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n sort_order: SortOrder;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.QuoteSelected]: TradeData & {\n is_best_quote: boolean;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n };\n};\n\n/**\n * Properties that can be derived from the bridge controller state\n */\nexport type EventPropertiesFromControllerState = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;\n [UnifiedSwapBridgeEventName.PageViewed]: RequestParams;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n };\n [UnifiedSwapBridgeEventName.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\n [UnifiedSwapBridgeEventName.Completed]: null;\n [UnifiedSwapBridgeEventName.Failed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n actual_time_minutes: number;\n };\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData;\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: null;\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/utils/metrics/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CaipAssetType, CaipChainId } from '@metamask/utils';\n\nimport type {\n UnifiedSwapBridgeEventName,\n InputAmountPreset,\n MetaMetricsSwapsEventSource,\n MetricsActionType,\n MetricsSwapType,\n PollingStatus,\n} from './constants';\nimport type { SortOrder, StatusTypes } from '../../types';\n\n/**\n * These properties map to properties required by the segment-schema. For example: https://github.com/Consensys/segment-schema/blob/main/libraries/properties/cross-chain-swaps-action.yaml\n */\nexport type RequestParams = {\n chain_id_source: CaipChainId;\n chain_id_destination: CaipChainId | null;\n token_symbol_source: string;\n token_symbol_destination: string | null;\n token_address_source: CaipAssetType;\n token_address_destination: CaipAssetType | null;\n};\n\nexport type RequestMetadata = {\n slippage_limit?: number; // undefined === auto\n custom_slippage: boolean;\n usd_amount_source: number; // Use quoteResponse when available\n stx_enabled: boolean;\n is_hardware_wallet: boolean;\n swap_type: MetricsSwapType;\n security_warnings: string[];\n};\n\nexport type QuoteFetchData = {\n can_submit: boolean;\n best_quote_provider?: `${string}_${string}`;\n quotes_count: number;\n quotes_list: `${string}_${string}`[];\n initial_load_time_all_quotes: number;\n price_impact: number;\n has_gas_included_quote: boolean;\n};\n\nexport type TradeData = {\n usd_quoted_gas: number;\n gas_included: boolean;\n gas_included_7702: boolean;\n quoted_time_minutes: number;\n usd_quoted_return: number;\n provider: `${string}_${string}`;\n};\n\nexport type TxStatusData = {\n allowance_reset_transaction?: StatusTypes;\n approval_transaction?: StatusTypes;\n source_transaction?: StatusTypes;\n destination_transaction?: StatusTypes;\n};\n\nexport type InputKeys =\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage'\n | 'token_amount_source';\n\nexport type InputValues = {\n token_source: CaipAssetType;\n token_destination: CaipAssetType;\n chain_source: CaipChainId;\n chain_destination: CaipChainId;\n slippage: number;\n token_amount_source: string;\n};\n\nexport type QuoteWarning =\n | 'low_return'\n | 'no_quotes'\n | 'insufficient_gas_balance'\n | 'insufficient_gas_for_selected_quote'\n | 'insufficient_balance'\n | 'price_impact'\n | 'tx_alert';\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This is the base type without the `location` property which is added to all events\n * via the RequiredEventContextFromClient mapped type.\n */\ntype RequiredEventContextFromClientBase = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n >;\n // When type is object, the payload can be anything\n [UnifiedSwapBridgeEventName.PageViewed]: object;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input:\n | 'token_source'\n | 'token_destination'\n | 'chain_source'\n | 'chain_destination'\n | 'slippage'\n | 'token_amount_source';\n input_value: InputValues[keyof InputValues];\n input_amount_preset?: InputAmountPreset;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n token_address_source: RequestParams['token_address_source'];\n token_address_destination: RequestParams['token_address_destination'];\n chain_id_source: RequestParams['chain_id_source'];\n chain_id_destination: RequestParams['chain_id_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n [UnifiedSwapBridgeEventName.QuotesRequested]: Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: TradeData & {\n warnings: QuoteWarning[];\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n usd_balance_source?: number;\n };\n [UnifiedSwapBridgeEventName.QuotesError]: Pick<\n RequestMetadata,\n 'stx_enabled'\n > & {\n token_symbol_source: RequestParams['token_symbol_source'];\n token_symbol_destination: RequestParams['token_symbol_destination'];\n } & Pick<RequestMetadata, 'security_warnings'>;\n // Emitted by BridgeStatusController\n [UnifiedSwapBridgeEventName.Submitted]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Completed]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n TxStatusData &\n RequestParams & {\n actual_time_minutes: number;\n usd_actual_return: number;\n usd_actual_gas: number;\n quote_vs_execution_ratio: number;\n quoted_vs_used_gas_ratio: number;\n action_type: MetricsActionType;\n };\n [UnifiedSwapBridgeEventName.Failed]:\n | // Tx failed before confirmation\n (TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<\n RequestMetadata,\n 'stx_enabled' | 'usd_amount_source' | 'is_hardware_wallet'\n > &\n Pick<\n RequestParams,\n 'token_symbol_source' | 'token_symbol_destination'\n > & { error_message: string }) // Tx failed after confirmation\n | (RequestParams &\n RequestMetadata &\n Pick<QuoteFetchData, 'price_impact'> &\n TxStatusData &\n TradeData & {\n actual_time_minutes: number;\n error_message?: string;\n });\n // Emitted by clients\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: Pick<\n TradeData,\n 'gas_included'\n > &\n Pick<QuoteFetchData, 'price_impact'> &\n Pick<RequestParams, 'token_symbol_source' | 'token_symbol_destination'> & {\n stx_enabled: RequestMetadata['stx_enabled'];\n sort_order: SortOrder;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.QuoteSelected]: TradeData & {\n is_best_quote: boolean;\n best_quote_provider: QuoteFetchData['best_quote_provider'];\n price_impact: QuoteFetchData['price_impact'];\n can_submit: QuoteFetchData['can_submit'];\n };\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: {\n token_name: string;\n token_symbol: string;\n token_contract: string;\n chain_name: string;\n chain_id: string;\n };\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: {\n failures: string[];\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: {\n failures: string[];\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: TradeData &\n Pick<QuoteFetchData, 'price_impact'> &\n Omit<RequestMetadata, 'security_warnings'> &\n Pick<\n RequestParams,\n | 'token_symbol_source'\n | 'token_symbol_destination'\n | 'chain_id_source'\n | 'chain_id_destination'\n > & {\n action_type: MetricsActionType;\n polling_status: PollingStatus;\n retry_attempts: number;\n };\n};\n\n/**\n * Properties that are required to be provided when trackUnifiedSwapBridgeEvent is called.\n * This combines the event-specific properties from RequiredEventContextFromClientBase\n * with an optional `location` property. When `location` is omitted, the controller\n * falls back to the value stored via `setLocation()` (defaults to MainView).\n */\nexport type RequiredEventContextFromClient = {\n [K in keyof RequiredEventContextFromClientBase]: RequiredEventContextFromClientBase[K] & {\n location?: MetaMetricsSwapsEventSource;\n };\n};\n\n/**\n * Properties that can be derived from the bridge controller state\n */\nexport type EventPropertiesFromControllerState = {\n [UnifiedSwapBridgeEventName.ButtonClicked]: RequestParams;\n [UnifiedSwapBridgeEventName.PageViewed]: RequestParams;\n [UnifiedSwapBridgeEventName.InputChanged]: {\n input: InputKeys;\n input_value: string;\n };\n [UnifiedSwapBridgeEventName.InputSourceDestinationSwitched]: RequestParams;\n [UnifiedSwapBridgeEventName.QuotesRequested]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n };\n [UnifiedSwapBridgeEventName.QuotesReceived]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData & {\n refresh_count: number; // starts from 0\n };\n [UnifiedSwapBridgeEventName.QuotesError]: RequestParams &\n RequestMetadata & {\n has_sufficient_funds: boolean;\n error_message: string;\n };\n [UnifiedSwapBridgeEventName.Submitted]: null;\n [UnifiedSwapBridgeEventName.Completed]: null;\n [UnifiedSwapBridgeEventName.Failed]: RequestParams &\n RequestMetadata &\n TxStatusData &\n TradeData &\n Pick<QuoteFetchData, 'price_impact'> & {\n actual_time_minutes: number;\n };\n [UnifiedSwapBridgeEventName.AllQuotesOpened]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.AllQuotesSorted]: RequestParams &\n RequestMetadata &\n TradeData &\n QuoteFetchData;\n [UnifiedSwapBridgeEventName.QuoteSelected]: RequestParams &\n RequestMetadata &\n QuoteFetchData &\n TradeData;\n [UnifiedSwapBridgeEventName.AssetDetailTooltipClicked]: null;\n [UnifiedSwapBridgeEventName.QuotesValidationFailed]: RequestParams & {\n refresh_count: number;\n };\n [UnifiedSwapBridgeEventName.StatusValidationFailed]: RequestParams;\n [UnifiedSwapBridgeEventName.PollingStatusUpdated]: null;\n};\n\n/**\n * trackUnifiedSwapBridgeEvent payload properties consist of required properties from the client\n * and properties from the bridge controller\n */\nexport type CrossChainSwapsEventProperties<\n T extends UnifiedSwapBridgeEventName,\n> =\n | {\n action_type: MetricsActionType;\n location: MetaMetricsSwapsEventSource;\n }\n | Pick<EventPropertiesFromControllerState, T>[T]\n | Pick<RequiredEventContextFromClient, T>[T];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/bridge-controller",
|
|
3
|
-
"version": "67.
|
|
3
|
+
"version": "67.2.0",
|
|
4
4
|
"description": "Manages bridge-related quote fetching functionality for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"build:docs": "typedoc",
|
|
41
41
|
"changelog:update": "../../scripts/update-changelog.sh @metamask/bridge-controller",
|
|
42
42
|
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/bridge-controller",
|
|
43
|
-
"publish:preview": "yarn npm publish --tag preview",
|
|
44
43
|
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
45
44
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
|
|
46
45
|
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
|
|
@@ -53,21 +52,21 @@
|
|
|
53
52
|
"@ethersproject/constants": "^5.7.0",
|
|
54
53
|
"@ethersproject/contracts": "^5.7.0",
|
|
55
54
|
"@ethersproject/providers": "^5.7.0",
|
|
56
|
-
"@metamask/accounts-controller": "^36.0.
|
|
57
|
-
"@metamask/assets-controllers": "^100.0.
|
|
55
|
+
"@metamask/accounts-controller": "^36.0.1",
|
|
56
|
+
"@metamask/assets-controllers": "^100.0.2",
|
|
58
57
|
"@metamask/base-controller": "^9.0.0",
|
|
59
58
|
"@metamask/controller-utils": "^11.19.0",
|
|
60
|
-
"@metamask/gas-fee-controller": "^26.0.
|
|
59
|
+
"@metamask/gas-fee-controller": "^26.0.3",
|
|
61
60
|
"@metamask/keyring-api": "^21.5.0",
|
|
62
61
|
"@metamask/messenger": "^0.3.0",
|
|
63
62
|
"@metamask/metamask-eth-abis": "^3.1.1",
|
|
64
|
-
"@metamask/multichain-network-controller": "^3.0.
|
|
65
|
-
"@metamask/network-controller": "^
|
|
66
|
-
"@metamask/polling-controller": "^16.0.
|
|
63
|
+
"@metamask/multichain-network-controller": "^3.0.4",
|
|
64
|
+
"@metamask/network-controller": "^30.0.0",
|
|
65
|
+
"@metamask/polling-controller": "^16.0.3",
|
|
67
66
|
"@metamask/profile-sync-controller": "^27.1.0",
|
|
68
67
|
"@metamask/remote-feature-flag-controller": "^4.0.0",
|
|
69
68
|
"@metamask/snaps-controllers": "^17.2.0",
|
|
70
|
-
"@metamask/transaction-controller": "^62.
|
|
69
|
+
"@metamask/transaction-controller": "^62.18.0",
|
|
71
70
|
"@metamask/utils": "^11.9.0",
|
|
72
71
|
"bignumber.js": "^9.1.2",
|
|
73
72
|
"reselect": "^5.1.1",
|