@metamask-previews/smart-transactions-controller 25.0.1-preview-40d5fb1e2 → 25.0.1-preview-a3e31582e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/SmartTransactionsController-method-action-types.cjs.map +1 -1
- package/dist/SmartTransactionsController-method-action-types.d.cts.map +1 -1
- package/dist/SmartTransactionsController-method-action-types.d.mts.map +1 -1
- package/dist/SmartTransactionsController-method-action-types.mjs.map +1 -1
- package/dist/SmartTransactionsController.cjs +37 -37
- package/dist/SmartTransactionsController.cjs.map +1 -1
- package/dist/SmartTransactionsController.d.cts.map +1 -1
- package/dist/SmartTransactionsController.d.mts.map +1 -1
- package/dist/SmartTransactionsController.mjs.map +1 -1
- package/dist/featureFlags/feature-flags.cjs +5 -5
- package/dist/featureFlags/feature-flags.cjs.map +1 -1
- package/dist/featureFlags/feature-flags.d.cts.map +1 -1
- package/dist/featureFlags/feature-flags.d.mts.map +1 -1
- package/dist/featureFlags/feature-flags.mjs.map +1 -1
- package/dist/featureFlags/index.cjs +10 -10
- package/dist/featureFlags/index.cjs.map +1 -1
- package/dist/featureFlags/index.d.cts.map +1 -1
- package/dist/featureFlags/index.d.mts.map +1 -1
- package/dist/featureFlags/index.mjs.map +1 -1
- package/dist/index.cjs +19 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/selectors.cjs +3 -3
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts.map +1 -1
- package/dist/selectors.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils.cjs +50 -50
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ 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
|
+
- Bump `@metamask/transaction-controller` from `^69.0.0` to `^69.2.1` ([#9568](https://github.com/MetaMask/core/pull/9568), [#9589](https://github.com/MetaMask/core/pull/9589), [#9593](https://github.com/MetaMask/core/pull/9593))
|
|
13
|
+
|
|
10
14
|
## [25.0.1]
|
|
11
15
|
|
|
12
16
|
### Changed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartTransactionsController-method-action-types.cjs","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';\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
|
+
{"version":3,"file":"SmartTransactionsController-method-action-types.cjs","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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartTransactionsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/SmartTransactionsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,
|
|
1
|
+
{"version":3,"file":"SmartTransactionsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/SmartTransactionsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,0CAAyC;AAEpF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,2BAA2B,CAAC,WAAW,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,sEAAsE,GAChF;IACE,IAAI,EAAE,mEAAmE,CAAC;IAC1E,OAAO,EAAE,2BAA2B,CAAC,uCAAuC,CAAC,CAAC;CAC/E,CAAC;AAEJ,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,2BAA2B,CAAC,eAAe,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE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AA2B,CAAC,eAAe,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,2BAA2B,CAAC,0BAA0B,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,2BAA2B,CAAC,iBAAiB,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,MAAM,iEAAiE,GAC3E;IACE,IAAI,EAAE,8DAA8D,CAAC;IACrE,OAAO,EAAE,2BAA2B,CAAC,kCAAkC,CAAC,CAAC;CAC1E,CAAC;AAEJ,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartTransactionsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/SmartTransactionsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,
|
|
1
|
+
{"version":3,"file":"SmartTransactionsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/SmartTransactionsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,E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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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartTransactionsController-method-action-types.mjs","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';\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
|
+
{"version":3,"file":"SmartTransactionsController-method-action-types.mjs","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"]}
|
|
@@ -22,11 +22,11 @@ const eth_query_1 = __importDefault(require("@metamask/eth-query"));
|
|
|
22
22
|
const polling_controller_1 = require("@metamask/polling-controller");
|
|
23
23
|
const bignumber_js_1 = require("bignumber.js");
|
|
24
24
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep.js"));
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
25
|
+
const constants_js_1 = require("./constants.cjs");
|
|
26
|
+
const feature_flags_js_1 = require("./featureFlags/feature-flags.cjs");
|
|
27
|
+
const validators_js_1 = require("./featureFlags/validators.cjs");
|
|
28
|
+
const types_js_1 = require("./types.cjs");
|
|
29
|
+
const utils_js_1 = require("./utils.cjs");
|
|
30
30
|
const SECOND = 1000;
|
|
31
31
|
exports.DEFAULT_INTERVAL = SECOND * 5;
|
|
32
32
|
const ETH_QUERY_ERROR_MSG = '`ethQuery` is not defined on SmartTransactionsController';
|
|
@@ -156,7 +156,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
156
156
|
}
|
|
157
157
|
checkPoll({ smartTransactionsState: { smartTransactions }, }) {
|
|
158
158
|
const smartTransactionsForAllChains = Object.values(smartTransactions).flat();
|
|
159
|
-
const pendingTransactions = smartTransactionsForAllChains?.filter(
|
|
159
|
+
const pendingTransactions = smartTransactionsForAllChains?.filter(utils_js_1.isSmartTransactionPending);
|
|
160
160
|
if (!this.timeoutHandle && pendingTransactions?.length > 0) {
|
|
161
161
|
this.poll();
|
|
162
162
|
}
|
|
@@ -204,10 +204,10 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
204
204
|
return; // If status hasn't changed, don't track it again.
|
|
205
205
|
}
|
|
206
206
|
__classPrivateFieldGet(this, _SmartTransactionsController_trackMetaMetricsEvent, "f").call(this, {
|
|
207
|
-
event:
|
|
208
|
-
category:
|
|
209
|
-
properties: (0,
|
|
210
|
-
sensitiveProperties: (0,
|
|
207
|
+
event: constants_js_1.MetaMetricsEventName.StxStatusUpdated,
|
|
208
|
+
category: constants_js_1.MetaMetricsEventCategory.Transactions,
|
|
209
|
+
properties: (0, utils_js_1.getSmartTransactionMetricsProperties)(updatedSmartTransaction),
|
|
210
|
+
sensitiveProperties: (0, utils_js_1.getSmartTransactionMetricsSensitiveProperties)(updatedSmartTransaction),
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
isNewSmartTransaction(smartTransactionUuid, chainId) {
|
|
@@ -240,7 +240,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
240
240
|
}
|
|
241
241
|
// Filter pending transactions and map them to the desired shape
|
|
242
242
|
const pendingTransactions = transactions
|
|
243
|
-
.filter(
|
|
243
|
+
.filter(utils_js_1.isSmartTransactionPending)
|
|
244
244
|
.map((pendingSmartTransaction) => {
|
|
245
245
|
// Use the transaction's chainId (from the key) to derive a networkClientId
|
|
246
246
|
const networkClientIdToUse = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getNetworkClientId).call(this, {
|
|
@@ -271,7 +271,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
271
271
|
});
|
|
272
272
|
// Construct the URL and fetch the data
|
|
273
273
|
const useSentinelForBatchStatus = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_isStxMigrationFlagEnabled).call(this, 'stxMigrationBatchStatus');
|
|
274
|
-
const url = `${(0,
|
|
274
|
+
const url = `${(0, utils_js_1.getAPIRequestURL)(types_js_1.APIType.BATCH_STATUS, chainId, useSentinelForBatchStatus)}?${params.toString()}`;
|
|
275
275
|
const data = (await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, url));
|
|
276
276
|
// Process each returned status
|
|
277
277
|
for (const [uuid, stxStatus] of Object.entries(data)) {
|
|
@@ -282,8 +282,8 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
282
282
|
}
|
|
283
283
|
const smartTransaction = {
|
|
284
284
|
statusMetadata: stxStatus,
|
|
285
|
-
status: (0,
|
|
286
|
-
cancellable: (0,
|
|
285
|
+
status: (0, utils_js_1.calculateStatus)(stxStatus),
|
|
286
|
+
cancellable: (0, utils_js_1.isSmartTransactionCancellable)(stxStatus),
|
|
287
287
|
uuid,
|
|
288
288
|
networkClientId: matchingTx.networkClientId,
|
|
289
289
|
};
|
|
@@ -318,7 +318,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
318
318
|
unsignedTradeTransactionWithNonce = {
|
|
319
319
|
...tradeTx,
|
|
320
320
|
// If there is an approval tx, the trade tx's nonce is increased by 1.
|
|
321
|
-
nonce: (0,
|
|
321
|
+
nonce: (0, utils_js_1.incrementNonceInHex)(unsignedApprovalTransactionWithNonce.nonce),
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
else if (tradeTx.nonce) {
|
|
@@ -329,7 +329,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
329
329
|
}
|
|
330
330
|
transactions.push(unsignedTradeTransactionWithNonce);
|
|
331
331
|
const useSentinelForGetFees = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_isStxMigrationFlagEnabled).call(this, 'stxMigrationGetFees');
|
|
332
|
-
const data = await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name:
|
|
332
|
+
const data = await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name: constants_js_1.SmartTransactionsTraceName.GetFees }, async () => await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_js_1.getAPIRequestURL)(types_js_1.APIType.GET_FEES, chainId, useSentinelForGetFees), {
|
|
333
333
|
method: 'POST',
|
|
334
334
|
body: JSON.stringify({
|
|
335
335
|
txs: transactions,
|
|
@@ -374,7 +374,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
374
374
|
networkClientId: selectedNetworkClientId,
|
|
375
375
|
});
|
|
376
376
|
const useSentinelForSubmitTransactions = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_isStxMigrationFlagEnabled).call(this, 'stxMigrationSubmitTransactions');
|
|
377
|
-
const data = await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name:
|
|
377
|
+
const data = await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name: constants_js_1.SmartTransactionsTraceName.SubmitTransactions }, async () => await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_js_1.getAPIRequestURL)(types_js_1.APIType.SUBMIT_TRANSACTIONS, chainId, useSentinelForSubmitTransactions), {
|
|
378
378
|
method: 'POST',
|
|
379
379
|
body: JSON.stringify({
|
|
380
380
|
rawTxs: signedTransactions,
|
|
@@ -412,7 +412,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
412
412
|
throw error;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
const txHashes = signedTransactions.map((tx) => (0,
|
|
415
|
+
const txHashes = signedTransactions.map((tx) => (0, utils_js_1.getTxHash)(tx));
|
|
416
416
|
const submitTransactionResponse = {
|
|
417
417
|
...data,
|
|
418
418
|
txHash: txHashes[txHashes.length - 1], // For backward compatibility - use the last tx hash
|
|
@@ -423,7 +423,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
423
423
|
chainId,
|
|
424
424
|
nonceDetails,
|
|
425
425
|
preTxBalance,
|
|
426
|
-
status:
|
|
426
|
+
status: types_js_1.SmartTransactionStatuses.PENDING,
|
|
427
427
|
time,
|
|
428
428
|
txParams,
|
|
429
429
|
uuid: submitTransactionResponse.uuid,
|
|
@@ -452,7 +452,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
452
452
|
async cancelSmartTransaction(uuid, { networkClientId, } = {}) {
|
|
453
453
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
454
454
|
const useSentinelForCancel = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_isStxMigrationFlagEnabled).call(this, 'stxMigrationCancel');
|
|
455
|
-
await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name:
|
|
455
|
+
await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name: constants_js_1.SmartTransactionsTraceName.CancelTransaction }, async () => await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_js_1.getAPIRequestURL)(types_js_1.APIType.CANCEL, chainId, useSentinelForCancel), {
|
|
456
456
|
method: 'POST',
|
|
457
457
|
body: JSON.stringify({ uuid }),
|
|
458
458
|
}));
|
|
@@ -470,7 +470,7 @@ class SmartTransactionsController extends (0, polling_controller_1.StaticInterva
|
|
|
470
470
|
const chainId = chainIdArg ?? __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
471
471
|
let liveness = false;
|
|
472
472
|
try {
|
|
473
|
-
const response = await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name:
|
|
473
|
+
const response = await __classPrivateFieldGet(this, _SmartTransactionsController_trace, "f").call(this, { name: constants_js_1.SmartTransactionsTraceName.FetchLiveness }, async () => await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_js_1.getAPIRequestURL)(types_js_1.APIType.LIVENESS, chainId)));
|
|
474
474
|
liveness = Boolean(response.smartTransactions);
|
|
475
475
|
}
|
|
476
476
|
catch {
|
|
@@ -536,10 +536,10 @@ _SmartTransactionsController_interval = new WeakMap(), _SmartTransactionsControl
|
|
|
536
536
|
const remoteFeatureFlagControllerState = this.messenger.call('RemoteFeatureFlagController:getState');
|
|
537
537
|
const rawFlags = remoteFeatureFlagControllerState?.remoteFeatureFlags
|
|
538
538
|
?.smartTransactionsNetworks;
|
|
539
|
-
const { errors } = (0,
|
|
539
|
+
const { errors } = (0, validators_js_1.validateSmartTransactionsFeatureFlags)(rawFlags);
|
|
540
540
|
// Report each validation error to Sentry
|
|
541
541
|
for (const error of errors) {
|
|
542
|
-
this.messenger.captureException?.(new Error(`[SmartTransactionsController] Feature flag validation failed: ${error.message}. Please check the SmartTransactionNetworks feature flag in Remote Config. Smart transactions are disabled for this network. Default disabled config: ${JSON.stringify(
|
|
542
|
+
this.messenger.captureException?.(new Error(`[SmartTransactionsController] Feature flag validation failed: ${error.message}. Please check the SmartTransactionNetworks feature flag in Remote Config. Smart transactions are disabled for this network. Default disabled config: ${JSON.stringify(constants_js_1.DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS.default)}`));
|
|
543
543
|
}
|
|
544
544
|
}, _SmartTransactionsController_fetch =
|
|
545
545
|
/* istanbul ignore next */
|
|
@@ -548,8 +548,8 @@ async function _SmartTransactionsController_fetch(request, options) {
|
|
|
548
548
|
'Content-Type': 'application/json',
|
|
549
549
|
...(__classPrivateFieldGet(this, _SmartTransactionsController_clientId, "f") && { 'X-Client-Id': __classPrivateFieldGet(this, _SmartTransactionsController_clientId, "f") }),
|
|
550
550
|
};
|
|
551
|
-
const urlMatches = request.startsWith(
|
|
552
|
-
Object.values(
|
|
551
|
+
const urlMatches = request.startsWith(constants_js_1.API_BASE_URL) ||
|
|
552
|
+
Object.values(constants_js_1.SENTINEL_API_BASE_URL_MAP).some((baseUrl) => request.startsWith(baseUrl));
|
|
553
553
|
if (urlMatches) {
|
|
554
554
|
const token = await this.messenger.call('AuthenticationController:getBearerToken');
|
|
555
555
|
if (token) {
|
|
@@ -563,7 +563,7 @@ async function _SmartTransactionsController_fetch(request, options) {
|
|
|
563
563
|
...options?.headers,
|
|
564
564
|
},
|
|
565
565
|
};
|
|
566
|
-
return (0,
|
|
566
|
+
return (0, utils_js_1.handleFetch)(request, fetchOptions);
|
|
567
567
|
}, _SmartTransactionsController_updateSmartTransaction = function _SmartTransactionsController_updateSmartTransaction(smartTransaction, { chainId = __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"), }) {
|
|
568
568
|
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
569
569
|
const currentSmartTransactions = smartTransactions[chainId] ?? [];
|
|
@@ -632,20 +632,20 @@ async function _SmartTransactionsController_fetch(request, options) {
|
|
|
632
632
|
};
|
|
633
633
|
// We have to emit this event here, so a txHash is returned to the TransactionController once it's available.
|
|
634
634
|
this.messenger.publish(`SmartTransactionsController:smartTransaction`, nextSmartTransaction);
|
|
635
|
-
const featureFlags = (0,
|
|
636
|
-
if ((0,
|
|
635
|
+
const featureFlags = (0, feature_flags_js_1.getSmartTransactionsFeatureFlagsForChain)((0, feature_flags_js_1.getSmartTransactionsFeatureFlags)(this.messenger), chainId);
|
|
636
|
+
if ((0, utils_js_1.shouldMarkRegularTransactionsAsFailed)({
|
|
637
637
|
smartTransaction: nextSmartTransaction,
|
|
638
638
|
clientId: __classPrivateFieldGet(this, _SmartTransactionsController_clientId, "f"),
|
|
639
639
|
featureFlags,
|
|
640
640
|
})) {
|
|
641
|
-
(0,
|
|
641
|
+
(0, utils_js_1.markRegularTransactionsAsFailed)({
|
|
642
642
|
smartTransaction: nextSmartTransaction,
|
|
643
643
|
getRegularTransactions: () => this.messenger.call('TransactionController:getTransactions'),
|
|
644
644
|
failTransaction: (transactionId, error) => this.messenger.call('TransactionController:failTransaction', transactionId, error),
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
|
-
if ((smartTransaction.status ===
|
|
648
|
-
smartTransaction.status ===
|
|
647
|
+
if ((smartTransaction.status === types_js_1.SmartTransactionStatuses.SUCCESS ||
|
|
648
|
+
smartTransaction.status === types_js_1.SmartTransactionStatuses.REVERTED) &&
|
|
649
649
|
!smartTransaction.confirmed) {
|
|
650
650
|
await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_confirmSmartTransaction).call(this, nextSmartTransaction, {
|
|
651
651
|
chainId,
|
|
@@ -666,10 +666,10 @@ async function _SmartTransactionsController_fetch(request, options) {
|
|
|
666
666
|
const transactionReceipt = await (0, controller_utils_1.query)(ethQuery, 'getTransactionReceipt', [txHash]);
|
|
667
667
|
if (transactionReceipt?.blockNumber) {
|
|
668
668
|
__classPrivateFieldGet(this, _SmartTransactionsController_trackMetaMetricsEvent, "f").call(this, {
|
|
669
|
-
event:
|
|
670
|
-
category:
|
|
671
|
-
properties: (0,
|
|
672
|
-
sensitiveProperties: (0,
|
|
669
|
+
event: constants_js_1.MetaMetricsEventName.StxConfirmed,
|
|
670
|
+
category: constants_js_1.MetaMetricsEventCategory.Transactions,
|
|
671
|
+
properties: (0, utils_js_1.getSmartTransactionMetricsProperties)(smartTransaction),
|
|
672
|
+
sensitiveProperties: (0, utils_js_1.getSmartTransactionMetricsSensitiveProperties)(smartTransaction),
|
|
673
673
|
});
|
|
674
674
|
__classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_updateSmartTransaction).call(this, { ...smartTransaction, confirmed: true }, {
|
|
675
675
|
chainId,
|
|
@@ -678,8 +678,8 @@ async function _SmartTransactionsController_fetch(request, options) {
|
|
|
678
678
|
}
|
|
679
679
|
catch (error) {
|
|
680
680
|
__classPrivateFieldGet(this, _SmartTransactionsController_trackMetaMetricsEvent, "f").call(this, {
|
|
681
|
-
event:
|
|
682
|
-
category:
|
|
681
|
+
event: constants_js_1.MetaMetricsEventName.StxConfirmationFailed,
|
|
682
|
+
category: constants_js_1.MetaMetricsEventCategory.Transactions,
|
|
683
683
|
});
|
|
684
684
|
console.error('confirm error', error);
|
|
685
685
|
}
|