@metamask-previews/smart-transactions-controller 25.1.1-preview-3e34650c2 → 25.1.1-preview-4f4c98e

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 (103) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/{SmartTransactionsController-method-action-types.d.mts → SmartTransactionsController-method-action-types.d.ts} +2 -2
  3. package/dist/SmartTransactionsController-method-action-types.d.ts.map +1 -0
  4. package/dist/{SmartTransactionsController-method-action-types.mjs → SmartTransactionsController-method-action-types.js} +1 -1
  5. package/dist/SmartTransactionsController-method-action-types.js.map +1 -0
  6. package/dist/{SmartTransactionsController.d.cts → SmartTransactionsController.d.ts} +22 -22
  7. package/dist/SmartTransactionsController.d.ts.map +1 -0
  8. package/dist/{SmartTransactionsController.mjs → SmartTransactionsController.js} +12 -20
  9. package/dist/SmartTransactionsController.js.map +1 -0
  10. package/dist/{constants.d.cts → constants.d.ts} +1 -1
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/{constants.mjs → constants.js} +1 -1
  13. package/dist/constants.js.map +1 -0
  14. package/dist/featureFlags/{feature-flags.d.mts → feature-flags.d.ts} +4 -4
  15. package/dist/featureFlags/feature-flags.d.ts.map +1 -0
  16. package/dist/featureFlags/{feature-flags.mjs → feature-flags.js} +4 -4
  17. package/dist/featureFlags/feature-flags.js.map +1 -0
  18. package/dist/featureFlags/{index.d.cts → index.d.ts} +3 -3
  19. package/dist/featureFlags/index.d.ts.map +1 -0
  20. package/dist/featureFlags/{index.mjs → index.js} +3 -3
  21. package/dist/featureFlags/index.js.map +1 -0
  22. package/dist/featureFlags/{validators.d.mts → validators.d.ts} +2 -2
  23. package/dist/featureFlags/validators.d.ts.map +1 -0
  24. package/dist/featureFlags/{validators.mjs → validators.js} +3 -3
  25. package/dist/featureFlags/validators.js.map +1 -0
  26. package/dist/{index.d.cts → index.d.ts} +8 -8
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +7 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/{selectors.d.cts → selectors.d.ts} +3 -3
  31. package/dist/selectors.d.ts.map +1 -0
  32. package/dist/{selectors.mjs → selectors.js} +3 -3
  33. package/dist/selectors.js.map +1 -0
  34. package/dist/{types.d.cts → types.d.ts} +5 -5
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/{types.mjs → types.js} +1 -1
  37. package/dist/types.js.map +1 -0
  38. package/dist/{utils.d.cts → utils.d.ts} +6 -6
  39. package/dist/utils.d.ts.map +1 -0
  40. package/dist/{utils.mjs → utils.js} +15 -22
  41. package/dist/utils.js.map +1 -0
  42. package/package.json +14 -18
  43. package/dist/SmartTransactionsController-method-action-types.cjs +0 -7
  44. package/dist/SmartTransactionsController-method-action-types.cjs.map +0 -1
  45. package/dist/SmartTransactionsController-method-action-types.d.cts +0 -94
  46. package/dist/SmartTransactionsController-method-action-types.d.cts.map +0 -1
  47. package/dist/SmartTransactionsController-method-action-types.d.mts.map +0 -1
  48. package/dist/SmartTransactionsController-method-action-types.mjs.map +0 -1
  49. package/dist/SmartTransactionsController.cjs +0 -738
  50. package/dist/SmartTransactionsController.cjs.map +0 -1
  51. package/dist/SmartTransactionsController.d.cts.map +0 -1
  52. package/dist/SmartTransactionsController.d.mts +0 -169
  53. package/dist/SmartTransactionsController.d.mts.map +0 -1
  54. package/dist/SmartTransactionsController.mjs.map +0 -1
  55. package/dist/constants.cjs +0 -56
  56. package/dist/constants.cjs.map +0 -1
  57. package/dist/constants.d.cts.map +0 -1
  58. package/dist/constants.d.mts +0 -44
  59. package/dist/constants.d.mts.map +0 -1
  60. package/dist/constants.mjs.map +0 -1
  61. package/dist/featureFlags/feature-flags.cjs +0 -121
  62. package/dist/featureFlags/feature-flags.cjs.map +0 -1
  63. package/dist/featureFlags/feature-flags.d.cts +0 -76
  64. package/dist/featureFlags/feature-flags.d.cts.map +0 -1
  65. package/dist/featureFlags/feature-flags.d.mts.map +0 -1
  66. package/dist/featureFlags/feature-flags.mjs.map +0 -1
  67. package/dist/featureFlags/index.cjs +0 -14
  68. package/dist/featureFlags/index.cjs.map +0 -1
  69. package/dist/featureFlags/index.d.cts.map +0 -1
  70. package/dist/featureFlags/index.d.mts +0 -3
  71. package/dist/featureFlags/index.d.mts.map +0 -1
  72. package/dist/featureFlags/index.mjs.map +0 -1
  73. package/dist/featureFlags/validators.cjs +0 -128
  74. package/dist/featureFlags/validators.cjs.map +0 -1
  75. package/dist/featureFlags/validators.d.cts +0 -148
  76. package/dist/featureFlags/validators.d.cts.map +0 -1
  77. package/dist/featureFlags/validators.d.mts.map +0 -1
  78. package/dist/featureFlags/validators.mjs.map +0 -1
  79. package/dist/index.cjs +0 -24
  80. package/dist/index.cjs.map +0 -1
  81. package/dist/index.d.cts.map +0 -1
  82. package/dist/index.d.mts +0 -8
  83. package/dist/index.d.mts.map +0 -1
  84. package/dist/index.mjs +0 -7
  85. package/dist/index.mjs.map +0 -1
  86. package/dist/selectors.cjs +0 -66
  87. package/dist/selectors.cjs.map +0 -1
  88. package/dist/selectors.d.cts.map +0 -1
  89. package/dist/selectors.d.mts +0 -181
  90. package/dist/selectors.d.mts.map +0 -1
  91. package/dist/selectors.mjs.map +0 -1
  92. package/dist/types.cjs +0 -94
  93. package/dist/types.cjs.map +0 -1
  94. package/dist/types.d.cts.map +0 -1
  95. package/dist/types.d.mts +0 -192
  96. package/dist/types.d.mts.map +0 -1
  97. package/dist/types.mjs.map +0 -1
  98. package/dist/utils.cjs +0 -260
  99. package/dist/utils.cjs.map +0 -1
  100. package/dist/utils.d.cts.map +0 -1
  101. package/dist/utils.d.mts +0 -69
  102. package/dist/utils.d.mts.map +0 -1
  103. package/dist/utils.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
13
+ - Bump `@metamask/remote-feature-flag-controller` from `^6.0.0` to `^6.1.0` ([#9980](https://github.com/MetaMask/core/pull/9980))
14
+
10
15
  ## [25.1.1]
11
16
 
12
17
  ### Changed
@@ -2,7 +2,7 @@
2
2
  * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
- import type { SmartTransactionsController } from "./SmartTransactionsController.mjs";
5
+ import type { SmartTransactionsController } from './SmartTransactionsController.js';
6
6
  export type SmartTransactionsControllerCheckPollAction = {
7
7
  type: `SmartTransactionsController:checkPoll`;
8
8
  handler: SmartTransactionsController['checkPoll'];
@@ -91,4 +91,4 @@ export type SmartTransactionsControllerWipeSmartTransactionsAction = {
91
91
  * Union of all SmartTransactionsController action types.
92
92
  */
93
93
  export type SmartTransactionsControllerMethodActions = SmartTransactionsControllerCheckPollAction | SmartTransactionsControllerInitializeSmartTransactionsForChainIdAction | SmartTransactionsControllerPollAction | SmartTransactionsControllerStopAction | SmartTransactionsControllerSetOptInStateAction | SmartTransactionsControllerTrackStxStatusChangeAction | SmartTransactionsControllerIsNewSmartTransactionAction | SmartTransactionsControllerUpdateSmartTransactionAction | SmartTransactionsControllerUpdateSmartTransactionsAction | SmartTransactionsControllerFetchSmartTransactionsStatusAction | SmartTransactionsControllerClearFeesAction | SmartTransactionsControllerGetFeesAction | SmartTransactionsControllerSubmitSignedTransactionsAction | SmartTransactionsControllerCancelSmartTransactionAction | SmartTransactionsControllerFetchLivenessAction | SmartTransactionsControllerSetStatusRefreshIntervalAction | SmartTransactionsControllerGetTransactionsAction | SmartTransactionsControllerGetSmartTransactionByMinedTxHashAction | SmartTransactionsControllerWipeSmartTransactionsAction;
94
- //# sourceMappingURL=SmartTransactionsController-method-action-types.d.mts.map
94
+ //# sourceMappingURL=SmartTransactionsController-method-action-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartTransactionsController-method-action-types.d.ts","sourceRoot":"","sources":["../src/SmartTransactionsController-method-action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J,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAChD,0CAA0C,GAC1C,sEAAsE,GACtE,qCAAqC,GACrC,qCAAqC,GACrC,8CAA8C,GAC9C,qDAAqD,GACrD,sDAAsD,GACtD,uDAAuD,GACvD,wDAAwD,GACxD,6DAA6D,GAC7D,0CAA0C,GAC1C,wCAAwC,GACxC,yDAAyD,GACzD,uDAAuD,GACvD,8CAA8C,GAC9C,yDAAyD,GACzD,gDAAgD,GAChD,iEAAiE,GACjE,sDAAsD,CAAC"}
@@ -3,4 +3,4 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=SmartTransactionsController-method-action-types.mjs.map
6
+ //# sourceMappingURL=SmartTransactionsController-method-action-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartTransactionsController-method-action-types.js","sourceRoot":"","sources":["../src/SmartTransactionsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SmartTransactionsController } from './SmartTransactionsController.js';\n\nexport type SmartTransactionsControllerCheckPollAction = {\n type: `SmartTransactionsController:checkPoll`;\n handler: SmartTransactionsController['checkPoll'];\n};\n\nexport type SmartTransactionsControllerInitializeSmartTransactionsForChainIdAction =\n {\n type: `SmartTransactionsController:initializeSmartTransactionsForChainId`;\n handler: SmartTransactionsController['initializeSmartTransactionsForChainId'];\n };\n\nexport type SmartTransactionsControllerPollAction = {\n type: `SmartTransactionsController:poll`;\n handler: SmartTransactionsController['poll'];\n};\n\nexport type SmartTransactionsControllerStopAction = {\n type: `SmartTransactionsController:stop`;\n handler: SmartTransactionsController['stop'];\n};\n\nexport type SmartTransactionsControllerSetOptInStateAction = {\n type: `SmartTransactionsController:setOptInState`;\n handler: SmartTransactionsController['setOptInState'];\n};\n\nexport type SmartTransactionsControllerTrackStxStatusChangeAction = {\n type: `SmartTransactionsController:trackStxStatusChange`;\n handler: SmartTransactionsController['trackStxStatusChange'];\n};\n\nexport type SmartTransactionsControllerIsNewSmartTransactionAction = {\n type: `SmartTransactionsController:isNewSmartTransaction`;\n handler: SmartTransactionsController['isNewSmartTransaction'];\n};\n\nexport type SmartTransactionsControllerUpdateSmartTransactionAction = {\n type: `SmartTransactionsController:updateSmartTransaction`;\n handler: SmartTransactionsController['updateSmartTransaction'];\n};\n\nexport type SmartTransactionsControllerUpdateSmartTransactionsAction = {\n type: `SmartTransactionsController:updateSmartTransactions`;\n handler: SmartTransactionsController['updateSmartTransactions'];\n};\n\nexport type SmartTransactionsControllerFetchSmartTransactionsStatusAction = {\n type: `SmartTransactionsController:fetchSmartTransactionsStatus`;\n handler: SmartTransactionsController['fetchSmartTransactionsStatus'];\n};\n\nexport type SmartTransactionsControllerClearFeesAction = {\n type: `SmartTransactionsController:clearFees`;\n handler: SmartTransactionsController['clearFees'];\n};\n\nexport type SmartTransactionsControllerGetFeesAction = {\n type: `SmartTransactionsController:getFees`;\n handler: SmartTransactionsController['getFees'];\n};\n\nexport type SmartTransactionsControllerSubmitSignedTransactionsAction = {\n type: `SmartTransactionsController:submitSignedTransactions`;\n handler: SmartTransactionsController['submitSignedTransactions'];\n};\n\nexport type SmartTransactionsControllerCancelSmartTransactionAction = {\n type: `SmartTransactionsController:cancelSmartTransaction`;\n handler: SmartTransactionsController['cancelSmartTransaction'];\n};\n\n/**\n * Fetches the liveness status of Smart Transactions for a given chain.\n *\n * @param options - The options object.\n * @param options.chainId - The chain ID to fetch liveness for. Preferred over networkClientId.\n * @param options.networkClientId - The network client ID to derive chain ID from.\n * @returns A promise that resolves to the liveness status.\n */\nexport type SmartTransactionsControllerFetchLivenessAction = {\n type: `SmartTransactionsController:fetchLiveness`;\n handler: SmartTransactionsController['fetchLiveness'];\n};\n\nexport type SmartTransactionsControllerSetStatusRefreshIntervalAction = {\n type: `SmartTransactionsController:setStatusRefreshInterval`;\n handler: SmartTransactionsController['setStatusRefreshInterval'];\n};\n\nexport type SmartTransactionsControllerGetTransactionsAction = {\n type: `SmartTransactionsController:getTransactions`;\n handler: SmartTransactionsController['getTransactions'];\n};\n\nexport type SmartTransactionsControllerGetSmartTransactionByMinedTxHashAction =\n {\n type: `SmartTransactionsController:getSmartTransactionByMinedTxHash`;\n handler: SmartTransactionsController['getSmartTransactionByMinedTxHash'];\n };\n\nexport type SmartTransactionsControllerWipeSmartTransactionsAction = {\n type: `SmartTransactionsController:wipeSmartTransactions`;\n handler: SmartTransactionsController['wipeSmartTransactions'];\n};\n\n/**\n * Union of all SmartTransactionsController action types.\n */\nexport type SmartTransactionsControllerMethodActions =\n | SmartTransactionsControllerCheckPollAction\n | SmartTransactionsControllerInitializeSmartTransactionsForChainIdAction\n | SmartTransactionsControllerPollAction\n | SmartTransactionsControllerStopAction\n | SmartTransactionsControllerSetOptInStateAction\n | SmartTransactionsControllerTrackStxStatusChangeAction\n | SmartTransactionsControllerIsNewSmartTransactionAction\n | SmartTransactionsControllerUpdateSmartTransactionAction\n | SmartTransactionsControllerUpdateSmartTransactionsAction\n | SmartTransactionsControllerFetchSmartTransactionsStatusAction\n | SmartTransactionsControllerClearFeesAction\n | SmartTransactionsControllerGetFeesAction\n | SmartTransactionsControllerSubmitSignedTransactionsAction\n | SmartTransactionsControllerCancelSmartTransactionAction\n | SmartTransactionsControllerFetchLivenessAction\n | SmartTransactionsControllerSetStatusRefreshIntervalAction\n | SmartTransactionsControllerGetTransactionsAction\n | SmartTransactionsControllerGetSmartTransactionByMinedTxHashAction\n | SmartTransactionsControllerWipeSmartTransactionsAction;\n"]}
@@ -1,16 +1,16 @@
1
- import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
2
- import type { TraceCallback } from "@metamask/controller-utils";
3
- import type { Messenger } from "@metamask/messenger";
4
- import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction, NetworkControllerGetStateAction, NetworkControllerStateChangeEvent } from "@metamask/network-controller";
5
- import type { AuthenticationController } from "@metamask/profile-sync-controller";
6
- import type { RemoteFeatureFlagControllerGetStateAction, RemoteFeatureFlagControllerStateChangeEvent } from "@metamask/remote-feature-flag-controller";
7
- import type { TransactionControllerFailTransactionAction, TransactionControllerGetNonceLockAction, TransactionControllerGetTransactionsAction, TransactionMeta, TransactionParams } from "@metamask/transaction-controller";
8
- import type { Hex } from "@metamask/utils";
9
- import { MetaMetricsEventCategory, MetaMetricsEventName } from "./constants.cjs";
10
- import type { SmartTransactionsControllerMethodActions } from "./SmartTransactionsController-method-action-types.cjs";
11
- import type { Fees, IndividualTxFees, SignedCanceledTransaction, SignedTransaction, SignedTransactionWithMetadata, SmartTransaction, SmartTransactionsStatus, UnsignedTransaction, MetaMetricsProps, FeatureFlags, ClientId } from "./types.cjs";
12
- import { SmartTransactionStatuses } from "./types.cjs";
13
- import { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties } from "./utils.cjs";
1
+ import type { ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller';
2
+ import type { TraceCallback } from '@metamask/controller-utils';
3
+ import type { Messenger } from '@metamask/messenger';
4
+ import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction, NetworkControllerGetStateAction, NetworkControllerStateChangeEvent } from '@metamask/network-controller';
5
+ import type { AuthenticationController } from '@metamask/profile-sync-controller';
6
+ import type { RemoteFeatureFlagControllerGetStateAction, RemoteFeatureFlagControllerStateChangeEvent } from '@metamask/remote-feature-flag-controller';
7
+ import type { TransactionControllerFailTransactionAction, TransactionControllerGetNonceLockAction, TransactionControllerGetTransactionsAction, TransactionMeta, TransactionParams } from '@metamask/transaction-controller';
8
+ import type { Hex } from '@metamask/utils';
9
+ import { MetaMetricsEventCategory, MetaMetricsEventName } from './constants.js';
10
+ import type { SmartTransactionsControllerMethodActions } from './SmartTransactionsController-method-action-types.js';
11
+ import type { Fees, IndividualTxFees, SignedCanceledTransaction, SignedTransaction, SignedTransactionWithMetadata, SmartTransaction, SmartTransactionsStatus, UnsignedTransaction, MetaMetricsProps, FeatureFlags, ClientId } from './types.js';
12
+ import { SmartTransactionStatuses } from './types.js';
13
+ import { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties } from './utils.js';
14
14
  export declare const DEFAULT_INTERVAL: number;
15
15
  /**
16
16
  * The name of the {@link SmartTransactionsController}
@@ -89,18 +89,18 @@ export type SmartTransactionsControllerPollingInput = {
89
89
  chainIds: Hex[];
90
90
  };
91
91
  declare const SmartTransactionsController_base: (abstract new (...args: any[]) => {
92
- readonly "__#6@#intervalIds": Record<string, NodeJS.Timeout>;
93
- "__#6@#intervalLength": number | undefined;
94
- setIntervalLength(intervalLength: number): void;
95
- getIntervalLength(): number | undefined;
96
- _startPolling(input: SmartTransactionsControllerPollingInput): void;
97
- _stopPollingByPollingTokenSetId(key: string): void;
98
- readonly "__#3@#pollingTokenSets": Map<string, Set<string>>;
99
- readonly "__#3@#callbacks": Map<string, Set<(input: SmartTransactionsControllerPollingInput) => void>>;
92
+ readonly _callbacks: Map<string, Set<(input: SmartTransactionsControllerPollingInput) => void>>;
100
93
  _executePoll(input: SmartTransactionsControllerPollingInput): Promise<void>;
101
94
  startPolling(input: SmartTransactionsControllerPollingInput): string;
102
95
  stopAllPolling(): void;
103
96
  stopPollingByPollingToken(pollingToken: string): void;
97
+ readonly _intervalIds: Record<import("@metamask/polling-controller").PollingTokenSetId, NodeJS.Timeout>;
98
+ _intervalLength: number | undefined;
99
+ setIntervalLength(intervalLength: number): void;
100
+ getIntervalLength(): number | undefined;
101
+ _startPolling(input: SmartTransactionsControllerPollingInput): void;
102
+ _stopPollingByPollingTokenSetId(key: import("@metamask/polling-controller").PollingTokenSetId): void;
103
+ readonly _pollingTokenSets: Map<import("@metamask/polling-controller").PollingTokenSetId, Set<string>>;
104
104
  onPollingComplete(input: SmartTransactionsControllerPollingInput, callback: (input: SmartTransactionsControllerPollingInput) => void): void;
105
105
  }) & typeof import("@metamask/base-controller").BaseController;
106
106
  export declare class SmartTransactionsController extends SmartTransactionsController_base<typeof controllerName, SmartTransactionsControllerState, SmartTransactionsControllerMessenger> {
@@ -166,4 +166,4 @@ export declare class SmartTransactionsController extends SmartTransactionsContro
166
166
  }): void;
167
167
  }
168
168
  export {};
169
- //# sourceMappingURL=SmartTransactionsController.d.cts.map
169
+ //# sourceMappingURL=SmartTransactionsController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartTransactionsController.d.ts","sourceRoot":"","sources":["../src/SmartTransactionsController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,MAAM,2BAA2B,CAAC;AAOnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,eAAe,EACf,2CAA2C,EAC3C,+BAA+B,EAC/B,iCAAiC,EAClC,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EACV,yCAAyC,EACzC,2CAA2C,EAC5C,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,0CAA0C,EAC1C,uCAAuC,EACvC,0CAA0C,EAC1C,eAAe,EACf,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAI3C,OAAO,EAGL,wBAAwB,EACxB,oBAAoB,EAGrB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AACrH,OAAO,KAAK,EACV,IAAI,EACJ,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,6BAA6B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GAAG,CAAC;KACV,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBxB;IAEK,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI9D;IAiBD,eAAe,CAAC,EACd,WAAW,EACX,MAAM,GACP,EAAE;QACD,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,wBAAwB,CAAC;KAClC,GAAG,gBAAgB,EAAE,CAKrB;IAED,gCAAgC,CAC9B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,gBAAgB,GAAG,SAAS,CAW9B;IAED,qBAAqB,CAAC,EACpB,OAAO,EACP,aAAa,GACd,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,GAAG,IAAI,CAqBP;CA8BF"}
@@ -10,25 +10,17 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
12
  var _SmartTransactionsController_instances, _SmartTransactionsController_interval, _SmartTransactionsController_clientId, _SmartTransactionsController_chainId, _SmartTransactionsController_supportedChainIds, _SmartTransactionsController_ethQuery, _SmartTransactionsController_trackMetaMetricsEvent, _SmartTransactionsController_getMetaMetricsProps, _SmartTransactionsController_trace, _SmartTransactionsController_isStxMigrationFlagEnabled, _SmartTransactionsController_validateAndReportFeatureFlags, _SmartTransactionsController_fetch, _SmartTransactionsController_updateSmartTransaction, _SmartTransactionsController_addMetaMetricsPropsToNewSmartTransaction, _SmartTransactionsController_createOrUpdateSmartTransaction, _SmartTransactionsController_confirmSmartTransaction, _SmartTransactionsController_addNonceToTransaction, _SmartTransactionsController_getChainId, _SmartTransactionsController_getChainIds, _SmartTransactionsController_getNetworkClientId, _SmartTransactionsController_getEthQuery, _SmartTransactionsController_getCurrentSmartTransactions, _SmartTransactionsController_wipeSmartTransactionsPerChainId;
13
- function $importDefault(module) {
14
- if (module?.__esModule) {
15
- return module.default;
16
- }
17
- return module;
18
- }
19
- import { hexlify } from "@ethersproject/bytes";
20
- import { query, safelyExecute, ChainId, isSafeDynamicKey } from "@metamask/controller-utils";
21
- import $EthQuery from "@metamask/eth-query";
22
- const EthQuery = $importDefault($EthQuery);
23
- import { StaticIntervalPollingController } from "@metamask/polling-controller";
24
- import { BigNumber } from "bignumber.js";
25
- import $cloneDeep from "lodash/cloneDeep.js";
26
- const cloneDeep = $importDefault($cloneDeep);
27
- import { API_BASE_URL, DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS, MetaMetricsEventCategory, MetaMetricsEventName, SENTINEL_API_BASE_URL_MAP, SmartTransactionsTraceName } from "./constants.mjs";
28
- import { getSmartTransactionsFeatureFlags, getSmartTransactionsFeatureFlagsForChain } from "./featureFlags/feature-flags.mjs";
29
- import { validateSmartTransactionsFeatureFlags } from "./featureFlags/validators.mjs";
30
- import { APIType, SmartTransactionStatuses } from "./types.mjs";
31
- import { calculateStatus, getAPIRequestURL, handleFetch, incrementNonceInHex, isSmartTransactionCancellable, isSmartTransactionPending, getTxHash, getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, shouldMarkRegularTransactionsAsFailed, markRegularTransactionsAsFailed } from "./utils.mjs";
13
+ import { hexlify } from '@ethersproject/bytes';
14
+ import { query, safelyExecute, ChainId, isSafeDynamicKey, } from '@metamask/controller-utils';
15
+ import EthQuery from '@metamask/eth-query';
16
+ import { StaticIntervalPollingController } from '@metamask/polling-controller';
17
+ import { BigNumber } from 'bignumber.js';
18
+ import { cloneDeep } from 'lodash-es';
19
+ import { API_BASE_URL, DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS, MetaMetricsEventCategory, MetaMetricsEventName, SENTINEL_API_BASE_URL_MAP, SmartTransactionsTraceName, } from './constants.js';
20
+ import { getSmartTransactionsFeatureFlags, getSmartTransactionsFeatureFlagsForChain, } from './featureFlags/feature-flags.js';
21
+ import { validateSmartTransactionsFeatureFlags } from './featureFlags/validators.js';
22
+ import { APIType, SmartTransactionStatuses } from './types.js';
23
+ import { calculateStatus, getAPIRequestURL, handleFetch, incrementNonceInHex, isSmartTransactionCancellable, isSmartTransactionPending, getTxHash, getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, shouldMarkRegularTransactionsAsFailed, markRegularTransactionsAsFailed, } from './utils.js';
32
24
  const SECOND = 1000;
33
25
  export const DEFAULT_INTERVAL = SECOND * 5;
34
26
  const ETH_QUERY_ERROR_MSG = '`ethQuery` is not defined on SmartTransactionsController';
@@ -735,4 +727,4 @@ async function _SmartTransactionsController_fetch(request, options) {
735
727
  newSmartTransactionsForSelectedChain;
736
728
  });
737
729
  };
738
- //# sourceMappingURL=SmartTransactionsController.mjs.map
730
+ //# sourceMappingURL=SmartTransactionsController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartTransactionsController.js","sourceRoot":"","sources":["../src/SmartTransactionsController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAM/C,OAAO,EACL,KAAK,EACL,aAAa,EACb,OAAO,EACP,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAQ3C,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAc/E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EACL,YAAY,EACZ,iDAAiD,EACjD,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,wCAAwC,GACzC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAC;AAerF,OAAO,EAAE,OA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angeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport {\n query,\n safelyExecute,\n ChainId,\n isSafeDynamicKey,\n} from '@metamask/controller-utils';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport EthQuery from '@metamask/eth-query';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n NetworkClientId,\n NetworkControllerGetNetworkClientByIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerStateChangeEvent,\n} from '@metamask/network-controller';\nimport { StaticIntervalPollingController } from '@metamask/polling-controller';\nimport type { AuthenticationController } from '@metamask/profile-sync-controller';\nimport type {\n RemoteFeatureFlagControllerGetStateAction,\n RemoteFeatureFlagControllerStateChangeEvent,\n} from '@metamask/remote-feature-flag-controller';\nimport type {\n TransactionControllerFailTransactionAction,\n TransactionControllerGetNonceLockAction,\n TransactionControllerGetTransactionsAction,\n TransactionMeta,\n TransactionParams,\n} from '@metamask/transaction-controller';\nimport type { Hex } from '@metamask/utils';\nimport { BigNumber } from 'bignumber.js';\nimport { cloneDeep } from 'lodash-es';\n\nimport {\n API_BASE_URL,\n DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS,\n MetaMetricsEventCategory,\n MetaMetricsEventName,\n SENTINEL_API_BASE_URL_MAP,\n SmartTransactionsTraceName,\n} from './constants.js';\nimport {\n getSmartTransactionsFeatureFlags,\n getSmartTransactionsFeatureFlagsForChain,\n} from './featureFlags/feature-flags.js';\nimport { validateSmartTransactionsFeatureFlags } from './featureFlags/validators.js';\nimport type { SmartTransactionsControllerMethodActions } from './SmartTransactionsController-method-action-types.js';\nimport type {\n Fees,\n IndividualTxFees,\n SignedCanceledTransaction,\n SignedTransaction,\n SignedTransactionWithMetadata,\n SmartTransaction,\n SmartTransactionsStatus,\n UnsignedTransaction,\n MetaMetricsProps,\n FeatureFlags,\n ClientId,\n} from './types.js';\nimport { APIType, SmartTransactionStatuses } from './types.js';\nimport {\n calculateStatus,\n getAPIRequestURL,\n handleFetch,\n incrementNonceInHex,\n isSmartTransactionCancellable,\n isSmartTransactionPending,\n getTxHash,\n getSmartTransactionMetricsProperties,\n getSmartTransactionMetricsSensitiveProperties,\n shouldMarkRegularTransactionsAsFailed,\n markRegularTransactionsAsFailed,\n} from './utils.js';\n\nconst SECOND = 1000;\nexport const DEFAULT_INTERVAL = SECOND * 5;\nconst ETH_QUERY_ERROR_MSG =\n '`ethQuery` is not defined on SmartTransactionsController';\n\n/**\n * The name of the {@link SmartTransactionsController}\n */\nconst controllerName = 'SmartTransactionsController';\n\nconst controllerMetadata: StateMetadata<SmartTransactionsControllerState> = {\n smartTransactionsState: {\n includeInStateLogs: true,\n persist: false,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n};\n\ntype FeeEstimates = {\n approvalTxFees: IndividualTxFees | null;\n tradeTxFees: IndividualTxFees | null;\n};\n\nexport type SmartTransactionsControllerState = {\n smartTransactionsState: {\n smartTransactions: Record<Hex, SmartTransaction[]>;\n userOptIn: boolean | null;\n userOptInV2: boolean | null;\n liveness: boolean | null;\n fees: FeeEstimates;\n feesByChainId: Record<Hex, FeeEstimates>;\n livenessByChainId: Record<Hex, boolean>;\n };\n};\n\n/**\n * Get the default {@link SmartTransactionsController} state.\n *\n * @returns The default {@link SmartTransactionsController} state.\n */\nexport function getDefaultSmartTransactionsControllerState(): SmartTransactionsControllerState {\n return {\n smartTransactionsState: {\n smartTransactions: {},\n userOptIn: null,\n userOptInV2: null,\n fees: {\n approvalTxFees: null,\n tradeTxFees: null,\n },\n\n // TODO: set this to false once the clients are all refreshing the liveness state.\n liveness: true,\n livenessByChainId: {\n [ChainId.mainnet]: true,\n [ChainId.sepolia]: true,\n },\n feesByChainId: {\n [ChainId.mainnet]: {\n approvalTxFees: null,\n tradeTxFees: null,\n },\n [ChainId.sepolia]: {\n approvalTxFees: null,\n tradeTxFees: null,\n },\n },\n },\n };\n}\n\nexport type SmartTransactionsControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n SmartTransactionsControllerState\n >;\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'cancelSmartTransaction',\n 'checkPoll',\n 'clearFees',\n 'fetchLiveness',\n 'fetchSmartTransactionsStatus',\n 'getFees',\n 'getSmartTransactionByMinedTxHash',\n 'getTransactions',\n 'initializeSmartTransactionsForChainId',\n 'isNewSmartTransaction',\n 'poll',\n 'setOptInState',\n 'setStatusRefreshInterval',\n 'stop',\n 'submitSignedTransactions',\n 'trackStxStatusChange',\n 'updateSmartTransaction',\n 'updateSmartTransactions',\n 'wipeSmartTransactions',\n] as const;\n\n/**\n * The actions that can be performed using the {@link SmartTransactionsController}.\n */\nexport type SmartTransactionsControllerActions =\n | SmartTransactionsControllerGetStateAction\n | SmartTransactionsControllerMethodActions;\n\ntype AllowedActions =\n | AuthenticationController.AuthenticationControllerGetBearerTokenAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkControllerGetStateAction\n | RemoteFeatureFlagControllerGetStateAction\n | TransactionControllerFailTransactionAction\n | TransactionControllerGetNonceLockAction\n | TransactionControllerGetTransactionsAction;\n\nexport type SmartTransactionsControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n SmartTransactionsControllerState\n >;\n\nexport type SmartTransactionsControllerSmartTransactionEvent = {\n type: 'SmartTransactionsController:smartTransaction';\n payload: [SmartTransaction];\n};\n\nexport type SmartTransactionsControllerSmartTransactionConfirmationDoneEvent = {\n type: 'SmartTransactionsController:smartTransactionConfirmationDone';\n payload: [SmartTransaction];\n};\n\n/**\n * The events that {@link SmartTransactionsController} can emit.\n */\nexport type SmartTransactionsControllerEvents =\n | SmartTransactionsControllerStateChangeEvent\n | SmartTransactionsControllerSmartTransactionEvent\n | SmartTransactionsControllerSmartTransactionConfirmationDoneEvent;\n\ntype AllowedEvents =\n | NetworkControllerStateChangeEvent\n | RemoteFeatureFlagControllerStateChangeEvent;\n\n/**\n * The messenger of the {@link SmartTransactionsController}.\n */\nexport type SmartTransactionsControllerMessenger = Messenger<\n typeof controllerName,\n SmartTransactionsControllerActions | AllowedActions,\n SmartTransactionsControllerEvents | AllowedEvents\n>;\n\ntype SmartTransactionsControllerOptions = {\n interval?: number;\n clientId: ClientId;\n chainId?: Hex;\n supportedChainIds?: Hex[];\n trackMetaMetricsEvent: (\n event: {\n event: MetaMetricsEventName;\n category: MetaMetricsEventCategory;\n properties?: ReturnType<typeof getSmartTransactionMetricsProperties>;\n sensitiveProperties?: ReturnType<\n typeof getSmartTransactionMetricsSensitiveProperties\n >;\n },\n options?: { metaMetricsId?: string } & Record<string, boolean>,\n ) => void;\n state?: Partial<SmartTransactionsControllerState>;\n messenger: SmartTransactionsControllerMessenger;\n getMetaMetricsProps: () => Promise<MetaMetricsProps>;\n /**\n * @deprecated This option is ignored. Feature flags are now read directly\n * from RemoteFeatureFlagController via the messenger. This option will be\n * removed in a future version.\n */\n getFeatureFlags?: () => FeatureFlags;\n trace?: TraceCallback;\n};\n\nexport type SmartTransactionsControllerPollingInput = {\n chainIds: Hex[];\n};\n\nexport class SmartTransactionsController extends StaticIntervalPollingController<SmartTransactionsControllerPollingInput>()<\n typeof controllerName,\n SmartTransactionsControllerState,\n SmartTransactionsControllerMessenger\n> {\n #interval: number;\n\n readonly #clientId: ClientId;\n\n #chainId: Hex;\n\n readonly #supportedChainIds: Hex[];\n\n timeoutHandle?: NodeJS.Timeout;\n\n #ethQuery: EthQuery | undefined;\n\n readonly #trackMetaMetricsEvent: SmartTransactionsControllerOptions['trackMetaMetricsEvent'];\n\n readonly #getMetaMetricsProps: () => Promise<MetaMetricsProps>;\n\n readonly #trace: TraceCallback;\n\n #isStxMigrationFlagEnabled(flagName: string): boolean {\n const flag = this.messenger.call('RemoteFeatureFlagController:getState')\n ?.remoteFeatureFlags?.[flagName];\n return Boolean(\n flag && typeof flag === 'object' && 'value' in flag && flag.value,\n );\n }\n\n /**\n * Validates the smart transactions feature flags from the remote feature flag controller\n * and reports any validation errors to Sentry via ErrorReportingService.\n * Does not report errors when flags are undefined (not yet fetched).\n */\n #validateAndReportFeatureFlags(): void {\n const remoteFeatureFlagControllerState = this.messenger.call(\n 'RemoteFeatureFlagController:getState',\n );\n const rawFlags =\n remoteFeatureFlagControllerState?.remoteFeatureFlags\n ?.smartTransactionsNetworks;\n\n const { errors } = validateSmartTransactionsFeatureFlags(rawFlags);\n\n // Report each validation error to Sentry\n for (const error of errors) {\n this.messenger.captureException?.(\n new Error(\n `[SmartTransactionsController] Feature flag validation failed: ${\n error.message\n }. Please check the SmartTransactionNetworks feature flag in Remote Config. Smart transactions are disabled for this network. Default disabled config: ${JSON.stringify(\n DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS.default,\n )}`,\n ),\n );\n }\n }\n\n /* istanbul ignore next */\n async #fetch(request: string, options?: RequestInit) {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n ...(this.#clientId && { 'X-Client-Id': this.#clientId }),\n };\n\n const urlMatches =\n request.startsWith(API_BASE_URL) ||\n Object.values(SENTINEL_API_BASE_URL_MAP).some((baseUrl) =>\n request.startsWith(baseUrl),\n );\n\n if (urlMatches) {\n const token = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n }\n }\n\n const fetchOptions = {\n ...options,\n headers: {\n ...headers,\n ...options?.headers,\n },\n };\n\n return handleFetch(request, fetchOptions);\n }\n\n constructor({\n interval = DEFAULT_INTERVAL,\n clientId,\n chainId: InitialChainId = ChainId.mainnet,\n supportedChainIds = [ChainId.mainnet, ChainId.sepolia],\n trackMetaMetricsEvent,\n state = {},\n messenger,\n getMetaMetricsProps,\n trace,\n }: SmartTransactionsControllerOptions) {\n super({\n name: controllerName,\n metadata: controllerMetadata,\n messenger,\n state: {\n ...getDefaultSmartTransactionsControllerState(),\n ...state,\n },\n });\n\n this.#interval = interval;\n this.#clientId = clientId;\n this.#chainId = InitialChainId;\n this.#supportedChainIds = supportedChainIds;\n this.setIntervalLength(interval);\n this.#ethQuery = undefined;\n this.#trackMetaMetricsEvent = trackMetaMetricsEvent;\n this.#getMetaMetricsProps = getMetaMetricsProps;\n this.#trace = trace ?? (((_request, fn) => fn?.()) as TraceCallback);\n\n this.initializeSmartTransactionsForChainId();\n\n this.messenger.subscribe(\n 'NetworkController:stateChange',\n ({ selectedNetworkClientId }) => {\n const {\n configuration: { chainId },\n provider,\n } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n this.#chainId = chainId;\n this.#ethQuery = new EthQuery(provider);\n this.initializeSmartTransactionsForChainId();\n this.checkPoll(this.state);\n },\n );\n\n this.messenger.subscribe(`${controllerName}:stateChange`, (currentState) =>\n this.checkPoll(currentState),\n );\n\n // Validate feature flags on changes\n this.messenger.subscribe('RemoteFeatureFlagController:stateChange', () => {\n this.#validateAndReportFeatureFlags();\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n async _executePoll({\n chainIds,\n }: SmartTransactionsControllerPollingInput): Promise<void> {\n // if this is going to be truly UI driven polling we shouldn't really reach here\n // with a networkClientId that is not supported, but for now I'll add a check in case\n // wondering if we should add some kind of predicate to the polling controller to check whether\n // we should poll or not\n const filteredChainIds = (chainIds ?? []).filter((chainId) =>\n this.#supportedChainIds.includes(chainId),\n );\n\n if (filteredChainIds.length === 0) {\n return Promise.resolve();\n }\n return this.updateSmartTransactions({ chainIds: filteredChainIds });\n }\n\n checkPoll({\n smartTransactionsState: { smartTransactions },\n }: SmartTransactionsControllerState) {\n const smartTransactionsForAllChains =\n Object.values(smartTransactions).flat();\n\n const pendingTransactions = smartTransactionsForAllChains?.filter(\n isSmartTransactionPending,\n );\n if (!this.timeoutHandle && pendingTransactions?.length > 0) {\n this.poll();\n } else if (this.timeoutHandle && pendingTransactions?.length === 0) {\n this.stop();\n }\n }\n\n initializeSmartTransactionsForChainId() {\n if (this.#supportedChainIds.includes(this.#chainId)) {\n this.update((state) => {\n state.smartTransactionsState.smartTransactions[this.#chainId] =\n state.smartTransactionsState.smartTransactions[this.#chainId] ?? [];\n });\n }\n }\n\n async poll(interval?: number): Promise<void> {\n if (interval) {\n this.#interval = interval;\n }\n\n this.timeoutHandle && clearInterval(this.timeoutHandle);\n\n if (!this.#supportedChainIds.includes(this.#chainId)) {\n return;\n }\n\n this.timeoutHandle = setInterval(() => {\n safelyExecute(async () => this.updateSmartTransactions());\n }, this.#interval);\n await safelyExecute(async () => this.updateSmartTransactions());\n }\n\n async stop() {\n this.timeoutHandle && clearInterval(this.timeoutHandle);\n this.timeoutHandle = undefined;\n }\n\n setOptInState(optInState: boolean | null): void {\n this.update((state) => {\n state.smartTransactionsState.userOptInV2 = optInState;\n });\n }\n\n trackStxStatusChange(\n smartTransaction: SmartTransaction,\n prevSmartTransaction?: SmartTransaction,\n ) {\n let updatedSmartTransaction = cloneDeep(smartTransaction);\n updatedSmartTransaction = {\n ...cloneDeep(prevSmartTransaction),\n ...updatedSmartTransaction,\n };\n\n if (updatedSmartTransaction.status === prevSmartTransaction?.status) {\n return; // If status hasn't changed, don't track it again.\n }\n\n this.#trackMetaMetricsEvent({\n event: MetaMetricsEventName.StxStatusUpdated,\n category: MetaMetricsEventCategory.Transactions,\n properties: getSmartTransactionMetricsProperties(updatedSmartTransaction),\n sensitiveProperties: getSmartTransactionMetricsSensitiveProperties(\n updatedSmartTransaction,\n ),\n });\n }\n\n isNewSmartTransaction(smartTransactionUuid: string, chainId?: Hex): boolean {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n const currentSmartTransactions =\n smartTransactions[chainId ?? this.#chainId];\n const currentIndex = currentSmartTransactions?.findIndex(\n (stx) => stx.uuid === smartTransactionUuid,\n );\n return currentIndex === -1 || currentIndex === undefined;\n }\n\n updateSmartTransaction(\n smartTransaction: SmartTransaction,\n { networkClientId }: { networkClientId?: NetworkClientId } = {},\n ) {\n let ethQuery = this.#ethQuery;\n let chainId = this.#chainId;\n if (networkClientId) {\n const { configuration, provider } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n );\n chainId = configuration.chainId;\n ethQuery = new EthQuery(provider);\n }\n\n this.#createOrUpdateSmartTransaction(smartTransaction, {\n chainId,\n ethQuery,\n });\n }\n\n #updateSmartTransaction(\n smartTransaction: SmartTransaction,\n {\n chainId = this.#chainId,\n }: {\n chainId: Hex;\n },\n ) {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n const currentSmartTransactions = smartTransactions[chainId] ?? [];\n const currentIndex = currentSmartTransactions?.findIndex(\n (stx) => stx.uuid === smartTransaction.uuid,\n );\n\n if (currentIndex === -1) {\n return; // Smart transaction not found, don't update anything.\n }\n\n if (!isSafeDynamicKey(chainId)) {\n return;\n }\n\n this.update((state) => {\n state.smartTransactionsState.smartTransactions[chainId][currentIndex] = {\n ...state.smartTransactionsState.smartTransactions[chainId][\n currentIndex\n ],\n ...smartTransaction,\n };\n });\n }\n\n async #addMetaMetricsPropsToNewSmartTransaction(\n smartTransaction: SmartTransaction,\n ) {\n const metaMetricsProps = await this.#getMetaMetricsProps();\n smartTransaction.accountHardwareType =\n metaMetricsProps?.accountHardwareType;\n smartTransaction.accountType = metaMetricsProps?.accountType;\n smartTransaction.deviceModel = metaMetricsProps?.deviceModel;\n }\n\n async #createOrUpdateSmartTransaction(\n smartTransaction: SmartTransaction,\n {\n chainId = this.#chainId,\n ethQuery = this.#ethQuery,\n }: {\n chainId: Hex;\n ethQuery: EthQuery | undefined;\n },\n ): Promise<void> {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n const currentSmartTransactions = smartTransactions[chainId] ?? [];\n const currentIndex = currentSmartTransactions?.findIndex(\n (stx) => stx.uuid === smartTransaction.uuid,\n );\n const isNewSmartTransaction = this.isNewSmartTransaction(\n smartTransaction.uuid,\n chainId,\n );\n if (ethQuery === undefined) {\n throw new Error(ETH_QUERY_ERROR_MSG);\n }\n\n if (isNewSmartTransaction) {\n try {\n await this.#addMetaMetricsPropsToNewSmartTransaction(smartTransaction);\n } catch (error) {\n console.error(\n 'Failed to add metrics props to smart transaction:',\n error,\n );\n // Continue without metrics props\n }\n }\n\n this.trackStxStatusChange(\n smartTransaction,\n isNewSmartTransaction\n ? undefined\n : currentSmartTransactions[currentIndex],\n );\n\n if (isNewSmartTransaction) {\n // add smart transaction\n const cancelledNonceIndex = currentSmartTransactions?.findIndex(\n (stx: SmartTransaction) =>\n stx.txParams?.nonce === smartTransaction.txParams?.nonce &&\n stx.status?.startsWith('cancelled'),\n );\n const snapshot = cloneDeep(smartTransaction);\n const history = [snapshot];\n const historifiedSmartTransaction = { ...smartTransaction, history };\n const nextSmartTransactions =\n cancelledNonceIndex > -1\n ? currentSmartTransactions\n .slice(0, cancelledNonceIndex)\n .concat(currentSmartTransactions.slice(cancelledNonceIndex + 1))\n .concat(historifiedSmartTransaction)\n : currentSmartTransactions.concat(historifiedSmartTransaction);\n\n this.update((state) => {\n state.smartTransactionsState.smartTransactions[chainId] =\n nextSmartTransactions;\n });\n return;\n }\n\n const currentSmartTransaction = currentSmartTransactions[currentIndex];\n const nextSmartTransaction = {\n ...currentSmartTransaction,\n ...smartTransaction,\n };\n\n // We have to emit this event here, so a txHash is returned to the TransactionController once it's available.\n this.messenger.publish(\n `SmartTransactionsController:smartTransaction`,\n nextSmartTransaction,\n );\n\n const featureFlags = getSmartTransactionsFeatureFlagsForChain(\n getSmartTransactionsFeatureFlags(this.messenger),\n chainId,\n );\n\n if (\n shouldMarkRegularTransactionsAsFailed({\n smartTransaction: nextSmartTransaction,\n clientId: this.#clientId,\n featureFlags,\n })\n ) {\n markRegularTransactionsAsFailed({\n smartTransaction: nextSmartTransaction,\n getRegularTransactions: () =>\n this.messenger.call('TransactionController:getTransactions'),\n failTransaction: (transactionId: string, error: Error) =>\n this.messenger.call(\n 'TransactionController:failTransaction',\n transactionId,\n error,\n ),\n });\n }\n\n if (\n (smartTransaction.status === SmartTransactionStatuses.SUCCESS ||\n smartTransaction.status === SmartTransactionStatuses.REVERTED) &&\n !smartTransaction.confirmed\n ) {\n await this.#confirmSmartTransaction(nextSmartTransaction, {\n chainId,\n ethQuery,\n });\n } else {\n this.#updateSmartTransaction(smartTransaction, {\n chainId,\n });\n }\n }\n\n async updateSmartTransactions(\n {\n chainIds,\n }: {\n chainIds: Hex[];\n } = {\n chainIds: this.#getChainIds(),\n },\n ): Promise<void> {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n\n // Iterate over each chain group directly\n for (const [chainId, transactions] of Object.entries(smartTransactions)) {\n if (chainIds && !chainIds.includes(chainId as Hex)) {\n continue;\n }\n // Filter pending transactions and map them to the desired shape\n const pendingTransactions = transactions\n .filter(isSmartTransactionPending)\n .map((pendingSmartTransaction) => {\n // Use the transaction's chainId (from the key) to derive a networkClientId\n const networkClientIdToUse = this.#getNetworkClientId({\n chainId,\n });\n return {\n uuid: pendingSmartTransaction.uuid,\n networkClientId: networkClientIdToUse,\n chainId: pendingSmartTransaction.chainId as Hex, // same as the key, but explicit on the transaction\n };\n });\n\n if (pendingTransactions.length > 0) {\n // Since each group is per chain, all transactions share the same chainId.\n await this.fetchSmartTransactionsStatus(pendingTransactions);\n }\n }\n }\n\n async #confirmSmartTransaction(\n smartTransaction: SmartTransaction,\n {\n chainId = this.#chainId,\n ethQuery = this.#ethQuery,\n }: {\n chainId: Hex;\n ethQuery: EthQuery | undefined;\n },\n ) {\n if (ethQuery === undefined) {\n throw new Error(ETH_QUERY_ERROR_MSG);\n }\n const txHash = smartTransaction.statusMetadata?.minedHash;\n try {\n const transactionReceipt: {\n blockNumber: string;\n } | null = await query(ethQuery, 'getTransactionReceipt', [txHash]);\n\n if (transactionReceipt?.blockNumber) {\n this.#trackMetaMetricsEvent({\n event: MetaMetricsEventName.StxConfirmed,\n category: MetaMetricsEventCategory.Transactions,\n properties: getSmartTransactionMetricsProperties(smartTransaction),\n sensitiveProperties:\n getSmartTransactionMetricsSensitiveProperties(smartTransaction),\n });\n this.#updateSmartTransaction(\n { ...smartTransaction, confirmed: true },\n {\n chainId,\n },\n );\n }\n } catch (error) {\n this.#trackMetaMetricsEvent({\n event: MetaMetricsEventName.StxConfirmationFailed,\n category: MetaMetricsEventCategory.Transactions,\n });\n console.error('confirm error', error);\n } finally {\n this.messenger.publish(\n `SmartTransactionsController:smartTransactionConfirmationDone`,\n smartTransaction,\n );\n }\n }\n\n // ! Ask backend API to accept list of uuids as params\n async fetchSmartTransactionsStatus(\n transactions: {\n uuid: string;\n networkClientId?: NetworkClientId;\n chainId: Hex;\n }[],\n ): Promise<Record<string, SmartTransactionsStatus>> {\n // Since transactions come from the same chain group, take the chainId from the first one.\n const { chainId } = transactions[0];\n\n // Build query parameters with all UUIDs\n const uuids = transactions.map((tx) => tx.uuid);\n const params = new URLSearchParams({ uuids: uuids.join(',') });\n\n // Get the ethQuery for the first transaction's networkClientId\n const ethQuery = this.#getEthQuery({\n networkClientId: transactions[0].networkClientId,\n });\n\n // Construct the URL and fetch the data\n const useSentinelForBatchStatus = this.#isStxMigrationFlagEnabled(\n 'stxMigrationBatchStatus',\n );\n const url = `${getAPIRequestURL(\n APIType.BATCH_STATUS,\n chainId,\n useSentinelForBatchStatus,\n )}?${params.toString()}`;\n const data = (await this.#fetch(url)) as Record<\n string,\n SmartTransactionsStatus\n >;\n\n // Process each returned status\n for (const [uuid, stxStatus] of Object.entries(data)) {\n const matchingTx = transactions.find((tx) => tx.uuid === uuid);\n if (!matchingTx) {\n console.error(`No matching transaction found for uuid: ${uuid}`);\n continue;\n }\n\n const smartTransaction: SmartTransaction = {\n statusMetadata: stxStatus,\n status: calculateStatus(stxStatus),\n cancellable: isSmartTransactionCancellable(stxStatus),\n uuid,\n networkClientId: matchingTx.networkClientId,\n };\n\n await this.#createOrUpdateSmartTransaction(smartTransaction, {\n chainId,\n ethQuery,\n });\n }\n\n return data;\n }\n\n async #addNonceToTransaction(\n transaction: UnsignedTransaction,\n networkClientId: NetworkClientId,\n ): Promise<UnsignedTransaction> {\n const nonceLock = await this.messenger.call(\n 'TransactionController:getNonceLock',\n transaction.from,\n networkClientId,\n );\n const nonce = nonceLock.nextNonce;\n nonceLock.releaseLock();\n return {\n ...transaction,\n nonce: `0x${nonce.toString(16)}`,\n };\n }\n\n clearFees(): Fees {\n const fees = {\n approvalTxFees: null,\n tradeTxFees: null,\n };\n this.update((state) => {\n state.smartTransactionsState.fees = fees;\n });\n\n return fees;\n }\n\n async getFees(\n tradeTx: UnsignedTransaction,\n approvalTx?: UnsignedTransaction,\n { networkClientId }: { networkClientId?: NetworkClientId } = {},\n ): Promise<Fees> {\n const selectedNetworkClientId =\n networkClientId ??\n this.messenger.call('NetworkController:getState').selectedNetworkClientId;\n const chainId = this.#getChainId({\n networkClientId: selectedNetworkClientId,\n });\n const transactions: UnsignedTransaction[] = [];\n let unsignedTradeTransactionWithNonce;\n if (approvalTx) {\n const unsignedApprovalTransactionWithNonce =\n await this.#addNonceToTransaction(approvalTx, selectedNetworkClientId);\n transactions.push(unsignedApprovalTransactionWithNonce);\n unsignedTradeTransactionWithNonce = {\n ...tradeTx,\n // If there is an approval tx, the trade tx's nonce is increased by 1.\n nonce: incrementNonceInHex(unsignedApprovalTransactionWithNonce.nonce),\n };\n } else if (tradeTx.nonce) {\n unsignedTradeTransactionWithNonce = tradeTx;\n } else {\n unsignedTradeTransactionWithNonce = await this.#addNonceToTransaction(\n tradeTx,\n selectedNetworkClientId,\n );\n }\n transactions.push(unsignedTradeTransactionWithNonce);\n const useSentinelForGetFees = this.#isStxMigrationFlagEnabled(\n 'stxMigrationGetFees',\n );\n const data = await this.#trace(\n { name: SmartTransactionsTraceName.GetFees },\n async () =>\n await this.#fetch(\n getAPIRequestURL(APIType.GET_FEES, chainId, useSentinelForGetFees),\n {\n method: 'POST',\n body: JSON.stringify({\n txs: transactions,\n }),\n },\n ),\n );\n let approvalTxFees: IndividualTxFees | null;\n let tradeTxFees: IndividualTxFees | null;\n if (approvalTx) {\n approvalTxFees = data?.txs[0];\n tradeTxFees = data?.txs[1];\n } else {\n approvalTxFees = null;\n tradeTxFees = data?.txs[0];\n }\n\n this.update((state) => {\n if (chainId === this.#chainId) {\n state.smartTransactionsState.fees = {\n approvalTxFees,\n tradeTxFees,\n };\n }\n state.smartTransactionsState.feesByChainId[chainId] = {\n approvalTxFees,\n tradeTxFees,\n };\n });\n\n return {\n approvalTxFees,\n tradeTxFees,\n };\n }\n\n // * After this successful call client must add a nonce representative to\n // * transaction controller external transactions list\n async submitSignedTransactions({\n transactionMeta,\n txParams,\n signedTransactions,\n signedCanceledTransactions = [],\n signedTransactionsWithMetadata,\n networkClientId,\n }: {\n signedTransactions: SignedTransaction[];\n signedCanceledTransactions?: SignedCanceledTransaction[];\n signedTransactionsWithMetadata?: SignedTransactionWithMetadata[];\n transactionMeta?: TransactionMeta;\n txParams?: TransactionParams;\n networkClientId?: NetworkClientId;\n }) {\n const selectedNetworkClientId =\n networkClientId ??\n this.messenger.call('NetworkController:getState').selectedNetworkClientId;\n const chainId = this.#getChainId({\n networkClientId: selectedNetworkClientId,\n });\n const ethQuery = this.#getEthQuery({\n networkClientId: selectedNetworkClientId,\n });\n const useSentinelForSubmitTransactions = this.#isStxMigrationFlagEnabled(\n 'stxMigrationSubmitTransactions',\n );\n const data = await this.#trace(\n { name: SmartTransactionsTraceName.SubmitTransactions },\n async () =>\n await this.#fetch(\n getAPIRequestURL(\n APIType.SUBMIT_TRANSACTIONS,\n chainId,\n useSentinelForSubmitTransactions,\n ),\n {\n method: 'POST',\n body: JSON.stringify({\n rawTxs: signedTransactions,\n rawCancelTxs: signedCanceledTransactions,\n rawTxsWithMetadata: signedTransactionsWithMetadata,\n }),\n },\n ),\n );\n const time = Date.now();\n let preTxBalance;\n try {\n if (txParams?.from) {\n const preTxBalanceBN = await query(ethQuery, 'getBalance', [\n txParams.from,\n ]);\n preTxBalance = new BigNumber(preTxBalanceBN).toString(16);\n }\n } catch (error) {\n console.error('ethQuery.getBalance error:', error);\n }\n\n const requiresNonce = txParams && !txParams.nonce;\n let nonce;\n let nonceLock;\n let nonceDetails = {};\n\n // This should only happen for Swaps. Non-swaps transactions should already have a nonce\n if (requiresNonce) {\n try {\n nonceLock = await this.messenger.call(\n 'TransactionController:getNonceLock',\n txParams.from,\n selectedNetworkClientId,\n );\n nonce = hexlify(nonceLock.nextNonce);\n nonceDetails = nonceLock.nonceDetails;\n txParams.nonce ??= nonce;\n } catch (error) {\n console.error('Failed to acquire nonce lock:', error);\n throw error;\n }\n }\n\n const txHashes = signedTransactions.map((tx) => getTxHash(tx));\n const submitTransactionResponse = {\n ...data,\n txHash: txHashes[txHashes.length - 1], // For backward compatibility - use the last tx hash\n txHashes,\n };\n\n try {\n await this.#createOrUpdateSmartTransaction(\n {\n chainId,\n nonceDetails,\n preTxBalance,\n status: SmartTransactionStatuses.PENDING,\n time,\n txParams,\n uuid: submitTransactionResponse.uuid,\n txHash: submitTransactionResponse.txHash,\n cancellable: true,\n type: transactionMeta?.type ?? 'swap',\n transactionId: transactionMeta?.id,\n networkClientId: selectedNetworkClientId,\n txHashes, // Add support for multiple transaction hashes\n },\n { chainId, ethQuery },\n );\n } catch (error) {\n console.error('Failed to create a smart transaction:', error);\n throw error;\n } finally {\n if (nonceLock) {\n nonceLock.releaseLock();\n }\n }\n\n return submitTransactionResponse;\n }\n\n #getChainId({\n networkClientId,\n }: { networkClientId?: NetworkClientId } = {}): Hex {\n if (networkClientId) {\n return this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n ).configuration.chainId;\n }\n\n return this.#chainId;\n }\n\n #getChainIds(): Hex[] {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n return Object.keys(networkConfigurationsByChainId).filter(\n (chainId): chainId is Hex =>\n this.#supportedChainIds.includes(chainId as Hex),\n );\n }\n\n #getNetworkClientId({ chainId }: { chainId: string }): string {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n return networkConfigurationsByChainId[chainId as Hex].rpcEndpoints[\n networkConfigurationsByChainId[chainId as Hex].defaultRpcEndpointIndex\n ].networkClientId;\n }\n\n #getEthQuery({\n networkClientId,\n }: {\n networkClientId?: NetworkClientId;\n } = {}): EthQuery {\n if (networkClientId) {\n const { provider } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n );\n return new EthQuery(provider);\n }\n\n if (this.#ethQuery === undefined) {\n throw new Error(ETH_QUERY_ERROR_MSG);\n }\n\n return this.#ethQuery;\n }\n\n // TODO: This should return if the cancellation was on chain or not (for nonce management)\n // After this successful call client must update nonce representative\n // in transaction controller external transactions list\n async cancelSmartTransaction(\n uuid: string,\n {\n networkClientId,\n }: {\n networkClientId?: NetworkClientId;\n } = {},\n ): Promise<void> {\n const chainId = this.#getChainId({ networkClientId });\n const useSentinelForCancel =\n this.#isStxMigrationFlagEnabled('stxMigrationCancel');\n await this.#trace(\n { name: SmartTransactionsTraceName.CancelTransaction },\n async () =>\n await this.#fetch(\n getAPIRequestURL(APIType.CANCEL, chainId, useSentinelForCancel),\n {\n method: 'POST',\n body: JSON.stringify({ uuid }),\n },\n ),\n );\n }\n\n /**\n * Fetches the liveness status of Smart Transactions for a given chain.\n *\n * @param options - The options object.\n * @param options.chainId - The chain ID to fetch liveness for. Preferred over networkClientId.\n * @param options.networkClientId - The network client ID to derive chain ID from.\n * @returns A promise that resolves to the liveness status.\n */\n async fetchLiveness({\n networkClientId,\n chainId: chainIdArg,\n }: {\n /** @deprecated Use `chainId` instead. */\n networkClientId?: NetworkClientId;\n chainId?: Hex;\n } = {}): Promise<boolean> {\n // Use chainId directly if provided, otherwise derive from networkClientId\n const chainId = chainIdArg ?? this.#getChainId({ networkClientId });\n let liveness = false;\n try {\n const response = await this.#trace(\n { name: SmartTransactionsTraceName.FetchLiveness },\n async () =>\n await this.#fetch(getAPIRequestURL(APIType.LIVENESS, chainId)),\n );\n liveness = Boolean(response.smartTransactions);\n } catch {\n console.log('\"fetchLiveness\" API call failed');\n }\n\n this.update((state) => {\n if (chainId === this.#chainId) {\n state.smartTransactionsState.liveness = liveness;\n }\n state.smartTransactionsState.livenessByChainId[chainId] = liveness;\n });\n\n return liveness;\n }\n\n async setStatusRefreshInterval(interval: number): Promise<void> {\n if (interval !== this.#interval) {\n this.#interval = interval;\n }\n }\n\n #getCurrentSmartTransactions(): SmartTransaction[] {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n const smartTransactionsForAllChains =\n Object.values(smartTransactions).flat();\n if (\n !smartTransactionsForAllChains ||\n smartTransactionsForAllChains.length === 0\n ) {\n return [];\n }\n return smartTransactionsForAllChains;\n }\n\n getTransactions({\n addressFrom,\n status,\n }: {\n addressFrom: string;\n status: SmartTransactionStatuses;\n }): SmartTransaction[] {\n const currentSmartTransactions = this.#getCurrentSmartTransactions();\n return currentSmartTransactions.filter((stx) => {\n return stx.status === status && stx.txParams?.from === addressFrom;\n });\n }\n\n getSmartTransactionByMinedTxHash(\n txHash: string | undefined,\n ): SmartTransaction | undefined {\n if (!txHash) {\n return undefined;\n }\n const currentSmartTransactions = this.#getCurrentSmartTransactions();\n return currentSmartTransactions.find((smartTransaction) => {\n return (\n smartTransaction.statusMetadata?.minedHash?.toLowerCase() ===\n txHash.toLowerCase()\n );\n });\n }\n\n wipeSmartTransactions({\n address,\n ignoreNetwork,\n }: {\n address: string;\n ignoreNetwork?: boolean;\n }): void {\n if (!address) {\n return;\n }\n const addressLowerCase = address.toLowerCase();\n if (ignoreNetwork) {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n (Object.keys(smartTransactions) as Hex[]).forEach((chainId) => {\n this.#wipeSmartTransactionsPerChainId({\n chainId,\n addressLowerCase,\n });\n });\n } else {\n this.#wipeSmartTransactionsPerChainId({\n chainId: this.#chainId,\n addressLowerCase,\n });\n }\n }\n\n #wipeSmartTransactionsPerChainId({\n chainId,\n addressLowerCase,\n }: {\n chainId: Hex;\n addressLowerCase: string;\n }): void {\n const {\n smartTransactionsState: { smartTransactions },\n } = this.state;\n const smartTransactionsForSelectedChain: SmartTransaction[] =\n smartTransactions?.[chainId];\n if (\n !smartTransactionsForSelectedChain ||\n smartTransactionsForSelectedChain.length === 0\n ) {\n return;\n }\n const newSmartTransactionsForSelectedChain =\n smartTransactionsForSelectedChain.filter(\n (smartTransaction: SmartTransaction) =>\n smartTransaction.txParams?.from !== addressLowerCase,\n );\n this.update((state) => {\n state.smartTransactionsState.smartTransactions[chainId] =\n newSmartTransactionsForSelectedChain;\n });\n }\n}\n"]}
@@ -41,4 +41,4 @@ export declare const DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS: {
41
41
  };
42
42
  };
43
43
  export {};
44
- //# sourceMappingURL=constants.d.cts.map
44
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,2CAA2C,CAAC;AAErE,KAAK,qBAAqB,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,qBASvC,CAAC;AAEF,oBAAY,oBAAoB;IAC9B,gBAAgB,uBAAuB;IACvC,YAAY,kBAAkB;IAC9B,qBAAqB,4BAA4B;IACjD,cAAc,oBAAoB;CACnC;AAED,oBAAY,wBAAwB;IAClC,YAAY,iBAAiB;IAC7B,UAAU,eAAe;CAC1B;AAED,oBAAY,0BAA0B;IACpC,OAAO,iCAAiC;IACxC,kBAAkB,4CAA4C;IAC9D,iBAAiB,2CAA2C;IAC5D,aAAa,uCAAuC;CACrD;AAED;;;;GAIG;AACH,eAAO,MAAM,iDAAiD;aAC5D,OAAO;iBACL,eAAe;iBACf,YAAY;iBACZ,eAAe;iBACf,mBAAmB;iBACnB,gBAAgB,EAAE,EAAE;iBACpB,WAAW,EAAE,GAAG;iBAChB,yBAAyB;iBACzB,8BAA8B;iBAC9B,sBAAsB;iBACtB,uCAAuC;iBACvC,4BAA4B;iBAC5B,0BAA0B,EAAE,IAAI;;CAE1B,CAAC"}
@@ -50,4 +50,4 @@ export const DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS = {
50
50
  batchStatusPollingInterval: 1000,
51
51
  },
52
52
  };
53
- //# sourceMappingURL=constants.mjs.map
53
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,wCAAwC,CAAC;AAMrE,6BAA6B;AAC7B,MAAM,CAAC,MAAM,yBAAyB,GAA0B;IAC9D,CAAC,EAAE,yDAAyD;IAC5D,EAAE,EAAE,oDAAoD;IACxD,GAAG,EAAE,wDAAwD;IAC7D,IAAI,EAAE,0DAA0D;IAChE,IAAI,EAAE,qDAAqD;IAC3D,KAAK,EAAE,yDAAyD;IAChE,KAAK,EAAE,sDAAsD;IAC7D,QAAQ,EAAE,yDAAyD;CACpE,CAAC;AAEF,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAuC,CAAA;IACvC,sDAA8B,CAAA;IAC9B,yEAAiD,CAAA;IACjD,0DAAkC,CAAA;AACpC,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AAED,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,yDAA6B,CAAA;IAC7B,qDAAyB,CAAA;AAC3B,CAAC,EAHW,wBAAwB,KAAxB,wBAAwB,QAGnC;AAED,MAAM,CAAN,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,sEAAwC,CAAA;IACxC,4FAA8D,CAAA;IAC9D,0FAA4D,CAAA;IAC5D,kFAAoD,CAAA;AACtD,CAAC,EALW,0BAA0B,KAA1B,0BAA0B,QAKrC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iDAAiD,GAAG;IAC/D,OAAO,EAAE;QACP,eAAe,EAAE,KAAK;QACtB,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,mBAAmB,EAAE,KAAK;QAC1B,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,GAAG;QAChB,yBAAyB,EAAE,KAAK;QAChC,8BAA8B,EAAE,KAAK;QACrC,sBAAsB,EAAE,KAAK;QAC7B,uCAAuC,EAAE,KAAK;QAC9C,4BAA4B,EAAE,KAAK;QACnC,0BAA0B,EAAE,IAAI;KACjC;CACO,CAAC","sourcesContent":["export const API_BASE_URL = 'https://transaction.api.cx.metamask.io';\n\ntype SentinelApiBaseUrlMap = {\n [key: number]: string;\n};\n\n// The map with types applied\nexport const SENTINEL_API_BASE_URL_MAP: SentinelApiBaseUrlMap = {\n 1: 'https://tx-sentinel-ethereum-mainnet.api.cx.metamask.io',\n 56: 'https://tx-sentinel-bsc-mainnet.api.cx.metamask.io',\n 137: 'https://tx-sentinel-polygon-mainnet.api.cx.metamask.io',\n 4663: 'https://tx-sentinel-robinhood-mainnet.api.cx.metamask.io',\n 8453: 'https://tx-sentinel-base-mainnet.api.cx.metamask.io',\n 42161: 'https://tx-sentinel-arbitrum-mainnet.api.cx.metamask.io',\n 59144: 'https://tx-sentinel-linea-mainnet.api.cx.metamask.io',\n 11155111: 'https://tx-sentinel-ethereum-sepolia.api.cx.metamask.io',\n};\n\nexport enum MetaMetricsEventName {\n StxStatusUpdated = 'STX Status Updated',\n StxConfirmed = 'STX Confirmed',\n StxConfirmationFailed = 'STX Confirmation Failed',\n ReceiveRequest = 'Receive Request',\n}\n\nexport enum MetaMetricsEventCategory {\n Transactions = 'Transactions',\n Navigation = 'Navigation',\n}\n\nexport enum SmartTransactionsTraceName {\n GetFees = 'Smart Transactions: Get Fees',\n SubmitTransactions = 'Smart Transactions: Submit Transactions',\n CancelTransaction = 'Smart Transactions: Cancel Transaction',\n FetchLiveness = 'Smart Transactions: Fetch Liveness',\n}\n\n/**\n * Default feature flags configuration for smart transactions.\n * Used as a fallback when remote feature flags are unavailable or invalid.\n * This is voluntarily defensive because it is applied to any network without valid configuration.\n */\nexport const DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS = {\n default: {\n extensionActive: false,\n mobileActive: false,\n mobileActiveIOS: false,\n mobileActiveAndroid: false,\n expectedDeadline: 45,\n maxDeadline: 150,\n extensionReturnTxHashAsap: false,\n extensionReturnTxHashAsapBatch: false,\n mobileReturnTxHashAsap: false,\n extensionSkipSmartTransactionStatusPage: false,\n gaslessBridgeWith7702Enabled: false,\n batchStatusPollingInterval: 1000,\n },\n} as const;\n"]}
@@ -1,6 +1,6 @@
1
- import type { RemoteFeatureFlagControllerState } from "@metamask/remote-feature-flag-controller";
2
- import type { CaipChainId, Hex } from "@metamask/utils";
3
- import type { SmartTransactionsFeatureFlagsConfig, SmartTransactionsNetworkConfig } from "../types.mjs";
1
+ import type { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-controller';
2
+ import type { CaipChainId, Hex } from '@metamask/utils';
3
+ import type { SmartTransactionsFeatureFlagsConfig, SmartTransactionsNetworkConfig } from '../types.js';
4
4
  /**
5
5
  * Normalizes a chain ID to hex format for EVM chains.
6
6
  * - CAIP-2 EVM format (eip155:X) is converted to hex (0xY)
@@ -73,4 +73,4 @@ export declare function getSmartTransactionsFeatureFlags<T extends {
73
73
  * ```
74
74
  */
75
75
  export declare function getSmartTransactionsFeatureFlagsForChain(featureFlags: SmartTransactionsFeatureFlagsConfig, chainId: Hex | CaipChainId): SmartTransactionsNetworkConfig;
76
- //# sourceMappingURL=feature-flags.d.mts.map
76
+ //# sourceMappingURL=feature-flags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../src/featureFlags/feature-flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AASxD,OAAO,KAAK,EACV,mCAAmC,EACnC,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,GAAG,GAAG,WAAW,GACzB,GAAG,GAAG,WAAW,CAoBnB;AAED;;;;;;;GAOG;AACH,wBAAgB,oCAAoC,CAClD,eAAe,EAAE,OAAO,GACvB,mCAAmC,CASrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,CAAC,SAAS;IACR,IAAI,CACF,MAAM,EAAE,sCAAsC,GAC7C,gCAAgC,CAAC;CACrC,EACD,SAAS,EAAE,CAAC,GAAG,mCAAmC,CAUnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wCAAwC,CACtD,YAAY,EAAE,mCAAmC,EACjD,OAAO,EAAE,GAAG,GAAG,WAAW,GACzB,8BAA8B,CAahC"}
@@ -1,6 +1,6 @@
1
- import { isCaipChainId, KnownCaipNamespace, numberToHex, parseCaipChainId } from "@metamask/utils";
2
- import { DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS } from "../constants.mjs";
3
- import { validateSmartTransactionsFeatureFlags } from "./validators.mjs";
1
+ import { isCaipChainId, KnownCaipNamespace, numberToHex, parseCaipChainId, } from '@metamask/utils';
2
+ import { DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS } from '../constants.js';
3
+ import { validateSmartTransactionsFeatureFlags } from './validators.js';
4
4
  /**
5
5
  * Normalizes a chain ID to hex format for EVM chains.
6
6
  * - CAIP-2 EVM format (eip155:X) is converted to hex (0xY)
@@ -111,4 +111,4 @@ export function getSmartTransactionsFeatureFlagsForChain(featureFlags, chainId)
111
111
  ...chainRemoteConfig,
112
112
  };
113
113
  }
114
- //# sourceMappingURL=feature-flags.mjs.map
114
+ //# sourceMappingURL=feature-flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-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ACZ,MAAM,gCAAgC,GAAG,SAAS,CAAC,IAAI,CACrD,sCAAsC,CACvC,CAAC;IAEF,MAAM,4BAA4B,GAChC,gCAAgC,EAAE,kBAAkB;QAClD,EAAE,yBAAyB,CAAC;IAEhC,OAAO,oCAAoC,CAAC,4BAA4B,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,wCAAwC,CACtD,YAAiD,EACjD,OAA0B;IAE1B,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,IAAI,EAAE,CAAC;IACvD,MAAM,iBAAiB,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAE1D,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,iDAAiD,CAAC,OAAO,CAAC;IACnE,CAAC;IAED,OAAO;QACL,GAAG,mBAAmB;QACtB,GAAG,iBAAiB;KACrB,CAAC;AACJ,CAAC","sourcesContent":["import type { RemoteFeatureFlagControllerState } from '@metamask/remote-feature-flag-controller';\nimport type { CaipChainId, Hex } from '@metamask/utils';\nimport {\n isCaipChainId,\n KnownCaipNamespace,\n numberToHex,\n parseCaipChainId,\n} from '@metamask/utils';\n\nimport { DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS } from '../constants.js';\nimport type {\n SmartTransactionsFeatureFlagsConfig,\n SmartTransactionsNetworkConfig,\n} from '../types.js';\nimport { validateSmartTransactionsFeatureFlags } from './validators.js';\n\n/**\n * Normalizes a chain ID to hex format for EVM chains.\n * - CAIP-2 EVM format (eip155:X) is converted to hex (0xY)\n * - Hex format is returned as-is\n * - Non-EVM CAIP-2 formats are returned as-is (exact match)\n * - Invalid eip155 formats (non-numeric reference) are returned as-is\n * - This is used because the current STX chains are EVM and declared as hex chain IDs in the existing flag.\n *\n * @param chainId - The chain ID in any supported format\n * @returns Normalized chain ID (hex for EVM, original for non-EVM)\n * @example\n * ```ts\n * normalizeChainId('0x1') // → '0x1'\n * normalizeChainId('eip155:1') // → '0x1'\n * normalizeChainId('eip155:137') // → '0x89'\n * normalizeChainId('solana:...') // → 'solana:...' (unchanged)\n * normalizeChainId('eip155:abc') // → 'eip155:abc' (invalid, unchanged)\n * ```\n */\nexport function normalizeChainId(\n chainId: Hex | CaipChainId,\n): Hex | CaipChainId {\n // If it's already hex or not a valid CAIP chain ID, return as-is\n if (!isCaipChainId(chainId)) {\n return chainId;\n }\n\n const { namespace, reference } = parseCaipChainId(chainId);\n\n // Only normalize EVM CAIP-2 chains with valid numeric references to hex\n if (namespace === KnownCaipNamespace.Eip155) {\n const decimal = parseInt(reference, 10);\n // If reference is not a valid number, return as-is\n if (Number.isNaN(decimal)) {\n return chainId;\n }\n return numberToHex(decimal);\n }\n\n // Non-EVM CAIP chains remain unchanged\n return chainId;\n}\n\n/**\n * Processes raw feature flags data and returns a validated configuration.\n * Invalid chain configs are silently removed. Error reporting is handled by\n * the SmartTransactionsController via ErrorReportingService.\n *\n * @param rawFeatureFlags - The raw feature flags data from the remote feature flag controller\n * @returns The validated feature flags configuration (partial if some chains were invalid)\n */\nexport function processSmartTransactionsFeatureFlags(\n rawFeatureFlags: unknown,\n): SmartTransactionsFeatureFlagsConfig {\n const { config } = validateSmartTransactionsFeatureFlags(rawFeatureFlags);\n\n // Return config if it has any valid data, otherwise return defaults\n if (Object.keys(config).length > 0) {\n return config;\n }\n\n return DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS;\n}\n\n/**\n * Gets the smart transactions feature flags from the remote feature flag controller.\n *\n * @param messenger - Any messenger with access to RemoteFeatureFlagController:getState\n * @returns The smart transactions feature flags configuration\n * @example\n * ```ts\n * const featureFlags = getSmartTransactionsFeatureFlags(messenger);\n * const chainConfig = featureFlags['0x1'] ?? featureFlags.default;\n * ```\n */\nexport function getSmartTransactionsFeatureFlags<\n T extends {\n call(\n action: 'RemoteFeatureFlagController:getState',\n ): RemoteFeatureFlagControllerState;\n },\n>(messenger: T): SmartTransactionsFeatureFlagsConfig {\n const remoteFeatureFlagControllerState = messenger.call(\n 'RemoteFeatureFlagController:getState',\n );\n\n const rawSmartTransactionsNetworks =\n remoteFeatureFlagControllerState?.remoteFeatureFlags\n ?.smartTransactionsNetworks;\n\n return processSmartTransactionsFeatureFlags(rawSmartTransactionsNetworks);\n}\n\n/**\n * Gets the merged feature flags configuration for a specific chain.\n * Chain-specific configuration takes precedence over default configuration.\n *\n * For EVM chains, the chain ID is normalized to hex format before lookup.\n * This means both '0x1' and 'eip155:1' will resolve to the same configuration.\n * Non-EVM chains (e.g., Solana, Bitcoin) use exact match.\n *\n * @param featureFlags - The full feature flags configuration\n * @param chainId - The chain ID to get configuration for.\n * Supports both hex (e.g., \"0x1\") and CAIP-2 format (e.g., \"eip155:1\", \"solana:...\")\n * @returns The merged configuration for the specified chain\n * @example\n * ```ts\n * const featureFlags = getSmartTransactionsFeatureFlags(messenger);\n *\n * // Both resolve to the same config (normalized to 0x1)\n * const chainConfig = getSmartTransactionsFeatureFlagsForChain(featureFlags, '0x1');\n * const sameConfig = getSmartTransactionsFeatureFlagsForChain(featureFlags, 'eip155:1');\n *\n * // Non-EVM uses exact match\n * const solanaConfig = getSmartTransactionsFeatureFlagsForChain(featureFlags, 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp');\n *\n * if (chainConfig.extensionActive) {\n * // Smart transactions are enabled for this chain\n * }\n * ```\n */\nexport function getSmartTransactionsFeatureFlagsForChain(\n featureFlags: SmartTransactionsFeatureFlagsConfig,\n chainId: Hex | CaipChainId,\n): SmartTransactionsNetworkConfig {\n const normalizedChainId = normalizeChainId(chainId);\n const defaultRemoteConfig = featureFlags.default ?? {};\n const chainRemoteConfig = featureFlags[normalizedChainId];\n\n if (chainRemoteConfig === undefined) {\n return DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS.default;\n }\n\n return {\n ...defaultRemoteConfig,\n ...chainRemoteConfig,\n };\n}\n"]}
@@ -1,3 +1,3 @@
1
- export { validateSmartTransactionsFeatureFlags, validateSmartTransactionsNetworkConfig, SmartTransactionsNetworkConfigSchema, SmartTransactionsFeatureFlagsConfigSchema, type SmartTransactionsNetworkConfigFromSchema, type SmartTransactionsNetworkConfigFromSchema as SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfigFromSchema, type FeatureFlagsProcessResult, } from "./validators.cjs";
2
- export { getSmartTransactionsFeatureFlags, processSmartTransactionsFeatureFlags, getSmartTransactionsFeatureFlagsForChain, normalizeChainId, } from "./feature-flags.cjs";
3
- //# sourceMappingURL=index.d.cts.map
1
+ export { validateSmartTransactionsFeatureFlags, validateSmartTransactionsNetworkConfig, SmartTransactionsNetworkConfigSchema, SmartTransactionsFeatureFlagsConfigSchema, type SmartTransactionsNetworkConfigFromSchema, type SmartTransactionsNetworkConfigFromSchema as SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfigFromSchema, type FeatureFlagsProcessResult, } from './validators.js';
2
+ export { getSmartTransactionsFeatureFlags, processSmartTransactionsFeatureFlags, getSmartTransactionsFeatureFlagsForChain, normalizeChainId, } from './feature-flags.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/featureFlags/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,EACzC,KAAK,wCAAwC,EAC7C,KAAK,wCAAwC,IAAI,8BAA8B,EAC/E,KAAK,6CAA6C,EAClD,KAAK,yBAAyB,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gCAAgC,EAChC,oCAAoC,EACpC,wCAAwC,EACxC,gBAAgB,GACjB,MAAM,oBAAoB,CAAC"}
@@ -1,3 +1,3 @@
1
- export { validateSmartTransactionsFeatureFlags, validateSmartTransactionsNetworkConfig, SmartTransactionsNetworkConfigSchema, SmartTransactionsFeatureFlagsConfigSchema } from "./validators.mjs";
2
- export { getSmartTransactionsFeatureFlags, processSmartTransactionsFeatureFlags, getSmartTransactionsFeatureFlagsForChain, normalizeChainId } from "./feature-flags.mjs";
3
- //# sourceMappingURL=index.mjs.map
1
+ export { validateSmartTransactionsFeatureFlags, validateSmartTransactionsNetworkConfig, SmartTransactionsNetworkConfigSchema, SmartTransactionsFeatureFlagsConfigSchema, } from './validators.js';
2
+ export { getSmartTransactionsFeatureFlags, processSmartTransactionsFeatureFlags, getSmartTransactionsFeatureFlagsForChain, normalizeChainId, } from './feature-flags.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/featureFlags/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,GAK1C,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,gCAAgC,EAChC,oCAAoC,EACpC,wCAAwC,EACxC,gBAAgB,GACjB,MAAM,oBAAoB,CAAC","sourcesContent":["export {\n validateSmartTransactionsFeatureFlags,\n validateSmartTransactionsNetworkConfig,\n SmartTransactionsNetworkConfigSchema,\n SmartTransactionsFeatureFlagsConfigSchema,\n type SmartTransactionsNetworkConfigFromSchema,\n type SmartTransactionsNetworkConfigFromSchema as SmartTransactionsNetworkConfig,\n type SmartTransactionsFeatureFlagsConfigFromSchema,\n type FeatureFlagsProcessResult,\n} from './validators.js';\n\nexport {\n getSmartTransactionsFeatureFlags,\n processSmartTransactionsFeatureFlags,\n getSmartTransactionsFeatureFlagsForChain,\n normalizeChainId,\n} from './feature-flags.js';\n"]}
@@ -1,4 +1,4 @@
1
- import type { Infer } from "@metamask/superstruct";
1
+ import type { Infer } from '@metamask/superstruct';
2
2
  /**
3
3
  * Schema for validating per-network smart transactions configuration.
4
4
  * All fields are optional to allow partial configuration and merging with defaults.
@@ -145,4 +145,4 @@ export declare function validateSmartTransactionsFeatureFlags(data: unknown): Fe
145
145
  * @returns True if the data is valid, false otherwise
146
146
  */
147
147
  export declare function validateSmartTransactionsNetworkConfig(data: unknown): data is SmartTransactionsNetworkConfigFromSchema;
148
- //# sourceMappingURL=validators.d.mts.map
148
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAcnD;;;GAGG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;IAC/C,qEAAqE;;IAErE,yEAAyE;;IAEzE,iEAAiE;;IAEjE,qEAAqE;;IAErE,mEAAmE;;IAEnE,8EAA8E;;IAE9E,2FAA2F;;IAE3F,iFAAiF;;IAEjF,wFAAwF;;IAExF,sEAAsE;;IAEtE,gEAAgE;;IAEhE,kEAAkE;;IAElE,0CAA0C;;EAE1C,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;IACpD,oEAAoE;;;;;;;;;;;;;;;;QAjCpE,qEAAqE;;QAErE,yEAAyE;;QAEzE,iEAAiE;;QAEjE,qEAAqE;;QAErE,mEAAmE;;QAEnE,8EAA8E;;QAE9E,2FAA2F;;QAE3F,iFAAiF;;QAEjF,wFAAwF;;QAExF,sEAAsE;;QAEtE,gEAAgE;;QAEhE,kEAAkE;;QAElE,0CAA0C;;;EAW1C,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAAG,KAAK,CAC1D,OAAO,oCAAoC,CAC5C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6CAA6C,GAAG,KAAK,CAC/D,OAAO,yCAAyC,CACjD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,+EAA+E;IAC/E,MAAM,EAAE,6CAA6C,GACnD,MAAM,CAAC,MAAM,EAAE,wCAAwC,GAAG,SAAS,CAAC,CAAC;IACvE,+DAA+D;IAC/D,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,OAAO,GACZ,yBAAyB,CAsE3B;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CACpD,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,wCAAwC,CAElD"}
@@ -1,5 +1,5 @@
1
- import { boolean, number, optional, string, type, is, validate } from "@metamask/superstruct";
2
- import { isCaipChainId, isStrictHexString } from "@metamask/utils";
1
+ import { boolean, number, optional, string, type, is, validate, } from '@metamask/superstruct';
2
+ import { isCaipChainId, isStrictHexString } from '@metamask/utils';
3
3
  /**
4
4
  * Validates that a key is a valid chain ID (hex or CAIP-2 format).
5
5
  * Supports both EVM hex chain IDs and chain-agnostic CAIP-2 identifiers.
@@ -120,4 +120,4 @@ export function validateSmartTransactionsFeatureFlags(data) {
120
120
  export function validateSmartTransactionsNetworkConfig(data) {
121
121
  return is(data, SmartTransactionsNetworkConfigSchema);
122
122
  }
123
- //# sourceMappingURL=validators.mjs.map
123
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,EAAE,EACF,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,oCAAoC,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,SAAS,CAAC,uCAAuC;QACnD,CAAC;QAED,wBAAwB;QACxB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG,QAAQ,CAC3C,KAAK,EACL,oCAAoC,CACrC,CAAC;YACF,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAChE,SAAS,CAAC,uCAAuC;YACnD,CAAC;YACD,oDAAoD;YACpD,WAAW,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC;QACpC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sCAAsC,CACpD,IAAa;IAEb,OAAO,EAAE,CAAC,IAAI,EAAE,oCAAoC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import {\n boolean,\n number,\n optional,\n string,\n type,\n is,\n validate,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\nimport { isCaipChainId, isStrictHexString } from '@metamask/utils';\n\n/**\n * Validates that a key is a valid chain ID (hex or CAIP-2 format).\n * Supports both EVM hex chain IDs and chain-agnostic CAIP-2 identifiers.\n *\n * @param key - The key to validate\n * @returns True if the key is a valid chain ID format\n */\nfunction isValidChainIdKey(key: string): boolean {\n return isStrictHexString(key) || isCaipChainId(key);\n}\n\n/**\n * Schema for validating per-network smart transactions configuration.\n * All fields are optional to allow partial configuration and merging with defaults.\n */\nexport const SmartTransactionsNetworkConfigSchema = type({\n /** Whether smart transactions are active for the extension client */\n extensionActive: optional(boolean()),\n /** Whether smart transactions are active for mobile clients (generic) */\n mobileActive: optional(boolean()),\n /** Whether smart transactions are active for iOS specifically */\n mobileActiveIOS: optional(boolean()),\n /** Whether smart transactions are active for Android specifically */\n mobileActiveAndroid: optional(boolean()),\n /** Expected time in seconds for a smart transaction to be mined */\n expectedDeadline: optional(number()),\n /** Maximum time in seconds before a smart transaction is considered failed */\n maxDeadline: optional(number()),\n /** Whether extension should return tx hash immediately without waiting for confirmation */\n extensionReturnTxHashAsap: optional(boolean()),\n /** Whether extension should return tx hash immediately for batch transactions */\n extensionReturnTxHashAsapBatch: optional(boolean()),\n /** Whether mobile should return tx hash immediately without waiting for confirmation */\n mobileReturnTxHashAsap: optional(boolean()),\n /** Whether extension should skip the smart transaction status page */\n extensionSkipSmartTransactionStatusPage: optional(boolean()),\n /** Polling interval in milliseconds for batch status updates */\n batchStatusPollingInterval: optional(number()),\n /** Whether gasless bridge with 7702 is enabled for the network */\n gaslessBridgeWith7702Enabled: optional(boolean()),\n /** Custom sentinel URL for the network */\n sentinelUrl: optional(string()),\n});\n\n/**\n * Schema for validating the complete smart transactions feature flags configuration.\n * This includes a default configuration and optional chain-specific overrides.\n */\nexport const SmartTransactionsFeatureFlagsConfigSchema = type({\n /** Default configuration applied to all chains unless overridden */\n default: optional(SmartTransactionsNetworkConfigSchema),\n});\n\n/**\n * Type inferred from the SmartTransactionsNetworkConfigSchema\n */\nexport type SmartTransactionsNetworkConfigFromSchema = Infer<\n typeof SmartTransactionsNetworkConfigSchema\n>;\n\n/**\n * Type inferred from the SmartTransactionsFeatureFlagsConfigSchema\n */\nexport type SmartTransactionsFeatureFlagsConfigFromSchema = Infer<\n typeof SmartTransactionsFeatureFlagsConfigSchema\n>;\n\n/**\n * Result of processing feature flags with collected validation errors.\n * Uses per-chain validation: invalid chains are removed, valid ones are kept.\n */\nexport type FeatureFlagsProcessResult = {\n /** The validated configuration (may be partial if some chains were invalid) */\n config: SmartTransactionsFeatureFlagsConfigFromSchema &\n Record<string, SmartTransactionsNetworkConfigFromSchema | undefined>;\n /** Validation errors for invalid parts of the configuration */\n errors: Error[];\n};\n\n/**\n * Validates smart transactions feature flags with per-chain validation.\n * - If the input is not an object, returns empty config with error\n * - If `default` is present and invalid, returns empty config with error\n * - For each chain: if invalid, removes it and collects error; if valid, includes it\n *\n * @param data - The data to validate\n * @returns The validated config and any validation errors\n */\nexport function validateSmartTransactionsFeatureFlags(\n data: unknown,\n): FeatureFlagsProcessResult {\n const errors: Error[] = [];\n\n // Step 1: Check if it's a valid object\n if (typeof data !== 'object' || data === null || Array.isArray(data)) {\n const typeDescription = data === null ? 'null' : typeof data;\n const arraySuffix = Array.isArray(data) ? ' (array)' : '';\n return {\n config: {},\n errors: [\n new Error(\n `Expected an object, received ${typeDescription}${arraySuffix}`,\n ),\n ],\n };\n }\n\n const dataRecord = data as Record<string, unknown>;\n const validConfig: FeatureFlagsProcessResult['config'] = {};\n\n // Step 2: Validate 'default' - if present and invalid, reject everything\n if (dataRecord.default !== undefined) {\n const [defaultError, validatedDefault] = validate(\n dataRecord.default,\n SmartTransactionsNetworkConfigSchema,\n );\n if (defaultError) {\n return {\n config: {},\n errors: [\n new Error(`Invalid 'default' config: ${defaultError.message}`),\n ],\n };\n }\n // validatedDefault is properly typed from superstruct\n validConfig.default = validatedDefault;\n }\n\n // Step 3: Validate chain-specific configs, keeping valid ones\n for (const [key, value] of Object.entries(dataRecord)) {\n if (key === 'default') {\n continue;\n }\n\n // Check chain ID format\n if (!isValidChainIdKey(key)) {\n errors.push(\n new Error(\n `Invalid chain ID key \"${key}\". Expected hex string (e.g., \"0x1\") or CAIP-2 format (e.g., \"eip155:1\", \"solana:...\")`,\n ),\n );\n continue; // Skip this chain, don't add to result\n }\n\n // Validate chain config\n if (value !== undefined) {\n const [chainError, validatedChain] = validate(\n value,\n SmartTransactionsNetworkConfigSchema,\n );\n if (chainError) {\n errors.push(new Error(`Chain \"${key}\": ${chainError.message}`));\n continue; // Skip this chain, don't add to result\n }\n // validatedChain is properly typed from superstruct\n validConfig[key] = validatedChain;\n }\n }\n\n return { config: validConfig, errors };\n}\n\n/**\n * Validates that the given data conforms to the SmartTransactionsNetworkConfig schema.\n *\n * @param data - The data to validate\n * @returns True if the data is valid, false otherwise\n */\nexport function validateSmartTransactionsNetworkConfig(\n data: unknown,\n): data is SmartTransactionsNetworkConfigFromSchema {\n return is(data, SmartTransactionsNetworkConfigSchema);\n}\n"]}
@@ -1,8 +1,8 @@
1
- export { SmartTransactionsController } from "./SmartTransactionsController.cjs";
2
- export type { SmartTransactionsControllerMessenger, SmartTransactionsControllerState, SmartTransactionsControllerGetStateAction, SmartTransactionsControllerActions, SmartTransactionsControllerStateChangeEvent, SmartTransactionsControllerSmartTransactionEvent, SmartTransactionsControllerSmartTransactionConfirmationDoneEvent, SmartTransactionsControllerEvents, } from "./SmartTransactionsController.cjs";
3
- export type { SmartTransactionsControllerCheckPollAction, SmartTransactionsControllerInitializeSmartTransactionsForChainIdAction, SmartTransactionsControllerPollAction, SmartTransactionsControllerStopAction, SmartTransactionsControllerSetOptInStateAction, SmartTransactionsControllerTrackStxStatusChangeAction, SmartTransactionsControllerIsNewSmartTransactionAction, SmartTransactionsControllerUpdateSmartTransactionAction, SmartTransactionsControllerUpdateSmartTransactionsAction, SmartTransactionsControllerFetchSmartTransactionsStatusAction, SmartTransactionsControllerClearFeesAction, SmartTransactionsControllerGetFeesAction, SmartTransactionsControllerSubmitSignedTransactionsAction, SmartTransactionsControllerCancelSmartTransactionAction, SmartTransactionsControllerFetchLivenessAction, SmartTransactionsControllerSetStatusRefreshIntervalAction, SmartTransactionsControllerGetTransactionsAction, SmartTransactionsControllerGetSmartTransactionByMinedTxHashAction, SmartTransactionsControllerWipeSmartTransactionsAction, } from "./SmartTransactionsController-method-action-types.cjs";
4
- export { type Fee, type Fees, type IndividualTxFees, type FeatureFlags, type SmartTransaction, type SentinelMeta, type SignedTransactionWithMetadata, type SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfig, SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, OriginalTransactionStatus, ClientId, Feature, Kind, } from "./types.cjs";
5
- export { MetaMetricsEventName, MetaMetricsEventCategory } from "./constants.cjs";
6
- export { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, } from "./utils.cjs";
7
- export { selectSmartTransactionsFeatureFlags, selectSmartTransactionsFeatureFlagsForChain, type SmartTransactionsFeatureFlagsState, } from "./selectors.cjs";
8
- //# sourceMappingURL=index.d.cts.map
1
+ export { SmartTransactionsController } from './SmartTransactionsController.js';
2
+ export type { SmartTransactionsControllerMessenger, SmartTransactionsControllerState, SmartTransactionsControllerGetStateAction, SmartTransactionsControllerActions, SmartTransactionsControllerStateChangeEvent, SmartTransactionsControllerSmartTransactionEvent, SmartTransactionsControllerSmartTransactionConfirmationDoneEvent, SmartTransactionsControllerEvents, } from './SmartTransactionsController.js';
3
+ export type { SmartTransactionsControllerCheckPollAction, SmartTransactionsControllerInitializeSmartTransactionsForChainIdAction, SmartTransactionsControllerPollAction, SmartTransactionsControllerStopAction, SmartTransactionsControllerSetOptInStateAction, SmartTransactionsControllerTrackStxStatusChangeAction, SmartTransactionsControllerIsNewSmartTransactionAction, SmartTransactionsControllerUpdateSmartTransactionAction, SmartTransactionsControllerUpdateSmartTransactionsAction, SmartTransactionsControllerFetchSmartTransactionsStatusAction, SmartTransactionsControllerClearFeesAction, SmartTransactionsControllerGetFeesAction, SmartTransactionsControllerSubmitSignedTransactionsAction, SmartTransactionsControllerCancelSmartTransactionAction, SmartTransactionsControllerFetchLivenessAction, SmartTransactionsControllerSetStatusRefreshIntervalAction, SmartTransactionsControllerGetTransactionsAction, SmartTransactionsControllerGetSmartTransactionByMinedTxHashAction, SmartTransactionsControllerWipeSmartTransactionsAction, } from './SmartTransactionsController-method-action-types.js';
4
+ export { type Fee, type Fees, type IndividualTxFees, type FeatureFlags, type SmartTransaction, type SentinelMeta, type SignedTransactionWithMetadata, type SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfig, SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, OriginalTransactionStatus, ClientId, Feature, Kind, } from './types.js';
5
+ export { MetaMetricsEventName, MetaMetricsEventCategory } from './constants.js';
6
+ export { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, } from './utils.js';
7
+ export { selectSmartTransactionsFeatureFlags, selectSmartTransactionsFeatureFlagsForChain, type SmartTransactionsFeatureFlagsState, } from './selectors.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EACV,oCAAoC,EACpC,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,EAC3C,gDAAgD,EAChD,gEAAgE,EAChE,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,0CAA0C,EAC1C,sEAAsE,EACtE,qCAAqC,EACrC,qCAAqC,EACrC,8CAA8C,EAC9C,qDAAqD,EACrD,sDAAsD,EACtD,uDAAuD,EACvD,wDAAwD,EACxD,6DAA6D,EAC7D,0CAA0C,EAC1C,wCAAwC,EACxC,yDAAyD,EACzD,uDAAuD,EACvD,8CAA8C,EAC9C,yDAAyD,EACzD,gDAAgD,EAChD,iEAAiE,EACjE,sDAAsD,GACvD,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,KAAK,GAAG,EACR,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,uBAAuB,EACvB,kCAAkC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,QAAQ,EACR,OAAO,EACP,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,oCAAoC,EACpC,6CAA6C,GAC9C,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,mCAAmC,EACnC,2CAA2C,EAC3C,KAAK,kCAAkC,GACxC,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { SmartTransactionsController } from './SmartTransactionsController.js';
2
+ export { SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, OriginalTransactionStatus, ClientId, Feature, Kind, } from './types.js';
3
+ export { MetaMetricsEventName, MetaMetricsEventCategory } from './constants.js';
4
+ export { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, } from './utils.js';
5
+ // Feature flag selectors
6
+ export { selectSmartTransactionsFeatureFlags, selectSmartTransactionsFeatureFlagsForChain, } from './selectors.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAgC/E,OAAO,EAUL,uBAAuB,EACvB,kCAAkC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,QAAQ,EACR,OAAO,EACP,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,oCAAoC,EACpC,6CAA6C,GAC9C,MAAM,YAAY,CAAC;AAEpB,yBAAyB;AACzB,OAAO,EACL,mCAAmC,EACnC,2CAA2C,GAE5C,MAAM,gBAAgB,CAAC","sourcesContent":["export { SmartTransactionsController } from './SmartTransactionsController.js';\nexport type {\n SmartTransactionsControllerMessenger,\n SmartTransactionsControllerState,\n SmartTransactionsControllerGetStateAction,\n SmartTransactionsControllerActions,\n SmartTransactionsControllerStateChangeEvent,\n SmartTransactionsControllerSmartTransactionEvent,\n SmartTransactionsControllerSmartTransactionConfirmationDoneEvent,\n SmartTransactionsControllerEvents,\n} from './SmartTransactionsController.js';\nexport type {\n SmartTransactionsControllerCheckPollAction,\n SmartTransactionsControllerInitializeSmartTransactionsForChainIdAction,\n SmartTransactionsControllerPollAction,\n SmartTransactionsControllerStopAction,\n SmartTransactionsControllerSetOptInStateAction,\n SmartTransactionsControllerTrackStxStatusChangeAction,\n SmartTransactionsControllerIsNewSmartTransactionAction,\n SmartTransactionsControllerUpdateSmartTransactionAction,\n SmartTransactionsControllerUpdateSmartTransactionsAction,\n SmartTransactionsControllerFetchSmartTransactionsStatusAction,\n SmartTransactionsControllerClearFeesAction,\n SmartTransactionsControllerGetFeesAction,\n SmartTransactionsControllerSubmitSignedTransactionsAction,\n SmartTransactionsControllerCancelSmartTransactionAction,\n SmartTransactionsControllerFetchLivenessAction,\n SmartTransactionsControllerSetStatusRefreshIntervalAction,\n SmartTransactionsControllerGetTransactionsAction,\n SmartTransactionsControllerGetSmartTransactionByMinedTxHashAction,\n SmartTransactionsControllerWipeSmartTransactionsAction,\n} from './SmartTransactionsController-method-action-types.js';\nexport {\n type Fee,\n type Fees,\n type IndividualTxFees,\n type FeatureFlags,\n type SmartTransaction,\n type SentinelMeta,\n type SignedTransactionWithMetadata,\n type SmartTransactionsNetworkConfig,\n type SmartTransactionsFeatureFlagsConfig,\n SmartTransactionMinedTx,\n SmartTransactionCancellationReason,\n SmartTransactionStatuses,\n OriginalTransactionStatus,\n ClientId,\n Feature,\n Kind,\n} from './types.js';\nexport { MetaMetricsEventName, MetaMetricsEventCategory } from './constants.js';\nexport {\n getSmartTransactionMetricsProperties,\n getSmartTransactionMetricsSensitiveProperties,\n} from './utils.js';\n\n// Feature flag selectors\nexport {\n selectSmartTransactionsFeatureFlags,\n selectSmartTransactionsFeatureFlagsForChain,\n type SmartTransactionsFeatureFlagsState,\n} from './selectors.js';\n"]}