@metamask/smart-transactions-controller 22.1.0 → 22.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -2
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs +21 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +21 -0
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +21 -0
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +20 -0
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,11 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [22.2.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add `Feature`, `Kind`, `Client` and `Wallet` fields to `SentinelMeta` ([#560](https://github.com/MetaMask/smart-transactions-controller/pull/560))
|
|
15
|
+
|
|
10
16
|
## [22.1.0]
|
|
11
17
|
|
|
12
18
|
### Added
|
|
13
19
|
|
|
14
|
-
-
|
|
20
|
+
- Add support for signed transactions with metadata in SmartTransactionsController ([#557](https://github.com/MetaMask/smart-transactions-controller/pull/557))
|
|
15
21
|
|
|
16
22
|
## [22.0.0]
|
|
17
23
|
|
|
@@ -698,7 +704,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
698
704
|
- Add initial SmartTransactionsController ([#1](https://github.com/MetaMask/smart-transactions-controller/pull/1))
|
|
699
705
|
- Initial commit
|
|
700
706
|
|
|
701
|
-
[Unreleased]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.
|
|
707
|
+
[Unreleased]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.2.0...HEAD
|
|
708
|
+
[22.2.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.1.0...v22.2.0
|
|
702
709
|
[22.1.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.0.0...v22.1.0
|
|
703
710
|
[22.0.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v21.1.0...v22.0.0
|
|
704
711
|
[21.1.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v21.0.0...v21.1.0
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectSmartTransactionsFeatureFlagsForChain = exports.selectSmartTransactionsFeatureFlags = exports.getSmartTransactionMetricsSensitiveProperties = exports.getSmartTransactionMetricsProperties = exports.MetaMetricsEventCategory = exports.MetaMetricsEventName = exports.ClientId = exports.SmartTransactionStatuses = exports.SmartTransactionCancellationReason = exports.SmartTransactionMinedTx = exports.SmartTransactionsController = void 0;
|
|
3
|
+
exports.selectSmartTransactionsFeatureFlagsForChain = exports.selectSmartTransactionsFeatureFlags = exports.getSmartTransactionMetricsSensitiveProperties = exports.getSmartTransactionMetricsProperties = exports.MetaMetricsEventCategory = exports.MetaMetricsEventName = exports.Kind = exports.Feature = exports.ClientId = exports.SmartTransactionStatuses = exports.SmartTransactionCancellationReason = exports.SmartTransactionMinedTx = exports.SmartTransactionsController = void 0;
|
|
4
4
|
var SmartTransactionsController_1 = require("./SmartTransactionsController.cjs");
|
|
5
5
|
Object.defineProperty(exports, "SmartTransactionsController", { enumerable: true, get: function () { return SmartTransactionsController_1.SmartTransactionsController; } });
|
|
6
6
|
var types_1 = require("./types.cjs");
|
|
@@ -8,6 +8,8 @@ Object.defineProperty(exports, "SmartTransactionMinedTx", { enumerable: true, ge
|
|
|
8
8
|
Object.defineProperty(exports, "SmartTransactionCancellationReason", { enumerable: true, get: function () { return types_1.SmartTransactionCancellationReason; } });
|
|
9
9
|
Object.defineProperty(exports, "SmartTransactionStatuses", { enumerable: true, get: function () { return types_1.SmartTransactionStatuses; } });
|
|
10
10
|
Object.defineProperty(exports, "ClientId", { enumerable: true, get: function () { return types_1.ClientId; } });
|
|
11
|
+
Object.defineProperty(exports, "Feature", { enumerable: true, get: function () { return types_1.Feature; } });
|
|
12
|
+
Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return types_1.Kind; } });
|
|
11
13
|
var constants_1 = require("./constants.cjs");
|
|
12
14
|
Object.defineProperty(exports, "MetaMetricsEventName", { enumerable: true, get: function () { return constants_1.MetaMetricsEventName; } });
|
|
13
15
|
Object.defineProperty(exports, "MetaMetricsEventCategory", { enumerable: true, get: function () { return constants_1.MetaMetricsEventCategory; } });
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iFAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AAWpC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iFAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AAWpC,qCAgBiB;AANf,gHAAA,uBAAuB,OAAA;AACvB,2HAAA,kCAAkC,OAAA;AAClC,iHAAA,wBAAwB,OAAA;AACxB,iGAAA,QAAQ,OAAA;AACR,gGAAA,OAAO,OAAA;AACP,6FAAA,IAAI,OAAA;AAEN,6CAA6E;AAApE,iHAAA,oBAAoB,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AACvD,qCAGiB;AAFf,6HAAA,oCAAoC,OAAA;AACpC,sIAAA,6CAA6C,OAAA;AAG/C,yBAAyB;AACzB,6CAIqB;AAHnB,gIAAA,mCAAmC,OAAA;AACnC,wIAAA,2CAA2C,OAAA","sourcesContent":["export { SmartTransactionsController } from './SmartTransactionsController';\nexport type {\n SmartTransactionsControllerMessenger,\n SmartTransactionsControllerState,\n SmartTransactionsControllerGetStateAction,\n SmartTransactionsControllerActions,\n SmartTransactionsControllerStateChangeEvent,\n SmartTransactionsControllerSmartTransactionEvent,\n SmartTransactionsControllerSmartTransactionConfirmationDoneEvent,\n SmartTransactionsControllerEvents,\n} from './SmartTransactionsController';\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 ClientId,\n Feature,\n Kind,\n} from './types';\nexport { MetaMetricsEventName, MetaMetricsEventCategory } from './constants';\nexport {\n getSmartTransactionMetricsProperties,\n getSmartTransactionMetricsSensitiveProperties,\n} from './utils';\n\n// Feature flag selectors\nexport {\n selectSmartTransactionsFeatureFlags,\n selectSmartTransactionsFeatureFlagsForChain,\n type SmartTransactionsFeatureFlagsState,\n} from './selectors';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SmartTransactionsController } from "./SmartTransactionsController.cjs";
|
|
2
2
|
export type { SmartTransactionsControllerMessenger, SmartTransactionsControllerState, SmartTransactionsControllerGetStateAction, SmartTransactionsControllerActions, SmartTransactionsControllerStateChangeEvent, SmartTransactionsControllerSmartTransactionEvent, SmartTransactionsControllerSmartTransactionConfirmationDoneEvent, SmartTransactionsControllerEvents, } from "./SmartTransactionsController.cjs";
|
|
3
|
-
export { type Fee, type Fees, type IndividualTxFees, type FeatureFlags, type SmartTransaction, type SentinelMeta, type SignedTransactionWithMetadata, type SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfig, SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, ClientId, } from "./types.cjs";
|
|
3
|
+
export { type Fee, type Fees, type IndividualTxFees, type FeatureFlags, type SmartTransaction, type SentinelMeta, type SignedTransactionWithMetadata, type SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfig, SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, ClientId, Feature, Kind, } from "./types.cjs";
|
|
4
4
|
export { MetaMetricsEventName, MetaMetricsEventCategory } from "./constants.cjs";
|
|
5
5
|
export { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, } from "./utils.cjs";
|
|
6
6
|
export { selectSmartTransactionsFeatureFlags, selectSmartTransactionsFeatureFlagsForChain, type SmartTransactionsFeatureFlagsState, } from "./selectors.cjs";
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,0CAAsC;AAC5E,YAAY,EACV,oCAAoC,EACpC,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,EAC3C,gDAAgD,EAChD,gEAAgE,EAChE,iCAAiC,GAClC,0CAAsC;AACvC,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,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,0CAAsC;AAC5E,YAAY,EACV,oCAAoC,EACpC,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,EAC3C,gDAAgD,EAChD,gEAAgE,EAChE,iCAAiC,GAClC,0CAAsC;AACvC,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,QAAQ,EACR,OAAO,EACP,IAAI,GACL,oBAAgB;AACjB,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,wBAAoB;AAC7E,OAAO,EACL,oCAAoC,EACpC,6CAA6C,GAC9C,oBAAgB;AAGjB,OAAO,EACL,mCAAmC,EACnC,2CAA2C,EAC3C,KAAK,kCAAkC,GACxC,wBAAoB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SmartTransactionsController } from "./SmartTransactionsController.mjs";
|
|
2
2
|
export type { SmartTransactionsControllerMessenger, SmartTransactionsControllerState, SmartTransactionsControllerGetStateAction, SmartTransactionsControllerActions, SmartTransactionsControllerStateChangeEvent, SmartTransactionsControllerSmartTransactionEvent, SmartTransactionsControllerSmartTransactionConfirmationDoneEvent, SmartTransactionsControllerEvents, } from "./SmartTransactionsController.mjs";
|
|
3
|
-
export { type Fee, type Fees, type IndividualTxFees, type FeatureFlags, type SmartTransaction, type SentinelMeta, type SignedTransactionWithMetadata, type SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfig, SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, ClientId, } from "./types.mjs";
|
|
3
|
+
export { type Fee, type Fees, type IndividualTxFees, type FeatureFlags, type SmartTransaction, type SentinelMeta, type SignedTransactionWithMetadata, type SmartTransactionsNetworkConfig, type SmartTransactionsFeatureFlagsConfig, SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, ClientId, Feature, Kind, } from "./types.mjs";
|
|
4
4
|
export { MetaMetricsEventName, MetaMetricsEventCategory } from "./constants.mjs";
|
|
5
5
|
export { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties, } from "./utils.mjs";
|
|
6
6
|
export { selectSmartTransactionsFeatureFlags, selectSmartTransactionsFeatureFlagsForChain, type SmartTransactionsFeatureFlagsState, } from "./selectors.mjs";
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,0CAAsC;AAC5E,YAAY,EACV,oCAAoC,EACpC,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,EAC3C,gDAAgD,EAChD,gEAAgE,EAChE,iCAAiC,GAClC,0CAAsC;AACvC,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,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,0CAAsC;AAC5E,YAAY,EACV,oCAAoC,EACpC,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,EAC3C,gDAAgD,EAChD,gEAAgE,EAChE,iCAAiC,GAClC,0CAAsC;AACvC,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,QAAQ,EACR,OAAO,EACP,IAAI,GACL,oBAAgB;AACjB,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,wBAAoB;AAC7E,OAAO,EACL,oCAAoC,EACpC,6CAA6C,GAC9C,oBAAgB;AAGjB,OAAO,EACL,mCAAmC,EACnC,2CAA2C,EAC3C,KAAK,kCAAkC,GACxC,wBAAoB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { SmartTransactionsController } from "./SmartTransactionsController.mjs";
|
|
2
|
-
export { SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, ClientId } from "./types.mjs";
|
|
2
|
+
export { SmartTransactionMinedTx, SmartTransactionCancellationReason, SmartTransactionStatuses, ClientId, Feature, Kind } from "./types.mjs";
|
|
3
3
|
export { MetaMetricsEventName, MetaMetricsEventCategory } from "./constants.mjs";
|
|
4
4
|
export { getSmartTransactionMetricsProperties, getSmartTransactionMetricsSensitiveProperties } from "./utils.mjs";
|
|
5
5
|
// Feature flag selectors
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,0CAAsC;AAW5E,OAAO,EAUL,uBAAuB,EACvB,kCAAkC,EAClC,wBAAwB,EACxB,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,0CAAsC;AAW5E,OAAO,EAUL,uBAAuB,EACvB,kCAAkC,EAClC,wBAAwB,EACxB,QAAQ,EACR,OAAO,EACP,IAAI,EACL,oBAAgB;AACjB,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,wBAAoB;AAC7E,OAAO,EACL,oCAAoC,EACpC,6CAA6C,EAC9C,oBAAgB;AAEjB,yBAAyB;AACzB,OAAO,EACL,mCAAmC,EACnC,2CAA2C,EAE5C,wBAAoB","sourcesContent":["export { SmartTransactionsController } from './SmartTransactionsController';\nexport type {\n SmartTransactionsControllerMessenger,\n SmartTransactionsControllerState,\n SmartTransactionsControllerGetStateAction,\n SmartTransactionsControllerActions,\n SmartTransactionsControllerStateChangeEvent,\n SmartTransactionsControllerSmartTransactionEvent,\n SmartTransactionsControllerSmartTransactionConfirmationDoneEvent,\n SmartTransactionsControllerEvents,\n} from './SmartTransactionsController';\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 ClientId,\n Feature,\n Kind,\n} from './types';\nexport { MetaMetricsEventName, MetaMetricsEventCategory } from './constants';\nexport {\n getSmartTransactionMetricsProperties,\n getSmartTransactionMetricsSensitiveProperties,\n} from './utils';\n\n// Feature flag selectors\nexport {\n selectSmartTransactionsFeatureFlags,\n selectSmartTransactionsFeatureFlagsForChain,\n type SmartTransactionsFeatureFlagsState,\n} from './selectors';\n"]}
|
package/dist/types.cjs
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cancellationReasonToStatusMap = exports.ClientId = exports.SmartTransactionStatuses = exports.SmartTransactionCancellationReason = exports.SmartTransactionMinedTx = exports.APIType = void 0;
|
|
3
|
+
exports.cancellationReasonToStatusMap = exports.ClientId = exports.SmartTransactionStatuses = exports.SmartTransactionCancellationReason = exports.SmartTransactionMinedTx = exports.APIType = exports.Kind = exports.Feature = void 0;
|
|
4
|
+
// This list does not belong here, but as these are reported to tx-sentinel, it is ok to have it here for now.
|
|
5
|
+
var Feature;
|
|
6
|
+
(function (Feature) {
|
|
7
|
+
Feature["Swap"] = "Swap";
|
|
8
|
+
Feature["Staking"] = "Staking";
|
|
9
|
+
Feature["Ramp"] = "Ramp";
|
|
10
|
+
Feature["Prediction"] = "Prediction";
|
|
11
|
+
Feature["Perp"] = "Perp";
|
|
12
|
+
Feature["Earn"] = "Earn";
|
|
13
|
+
Feature["Card"] = "Card";
|
|
14
|
+
Feature["Bridge"] = "Bridge";
|
|
15
|
+
Feature["dAppTransaction"] = "dAppTransaction";
|
|
16
|
+
})(Feature = exports.Feature || (exports.Feature = {}));
|
|
17
|
+
var Kind;
|
|
18
|
+
(function (Kind) {
|
|
19
|
+
Kind["Regular"] = "Regular";
|
|
20
|
+
Kind["STX"] = "STX";
|
|
21
|
+
Kind["GaslessSendBundle"] = "GaslessSendBundle";
|
|
22
|
+
Kind["GaslessEIP7702"] = "GaslessEIP7702";
|
|
23
|
+
})(Kind = exports.Kind || (exports.Kind = {}));
|
|
4
24
|
/** API */
|
|
5
25
|
var APIType;
|
|
6
26
|
(function (APIType) {
|
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAcA,8GAA8G;AAC9G,IAAY,OAUX;AAVD,WAAY,OAAO;IACjB,wBAAa,CAAA;IACb,8BAAmB,CAAA;IACnB,wBAAa,CAAA;IACb,oCAAyB,CAAA;IACzB,wBAAa,CAAA;IACb,wBAAa,CAAA;IACb,wBAAa,CAAA;IACb,4BAAiB,CAAA;IACjB,8CAAmC,CAAA;AACrC,CAAC,EAVW,OAAO,GAAP,eAAO,KAAP,eAAO,QAUlB;AAED,IAAY,IAKX;AALD,WAAY,IAAI;IACd,2BAAmB,CAAA;IACnB,mBAAW,CAAA;IACX,+CAAuC,CAAA;IACvC,yCAAiC,CAAA;AACnC,CAAC,EALW,IAAI,GAAJ,YAAI,KAAJ,YAAI,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AAC,eAAe,CAAC,EAClD,wBAAwB,CAAC,SAAS;IACpC,CAAC,kCAAkC,CAAC,aAAa,CAAC,EAChD,wBAAwB,CAAC,SAAS;IACpC,CAAC,kCAAkC,CAAC,cAAc,CAAC,EACjD,wBAAwB,CAAC,wBAAwB;CACpD,CAAC","sourcesContent":["import type { NetworkClientId } from '@metamask/network-controller';\nimport type { TransactionType } from '@metamask/transaction-controller';\nimport type { CaipChainId, Hex } from '@metamask/utils';\n\nimport type { SmartTransactionsNetworkConfig } from './featureFlags';\n\nexport type SentinelMeta = {\n txType?: TransactionType;\n feature?: Feature;\n kind?: Kind;\n client?: ClientId;\n wallet?: string;\n};\n\n// This list does not belong here, but as these are reported to tx-sentinel, it is ok to have it here for now.\nexport enum Feature {\n Swap = 'Swap',\n Staking = 'Staking',\n Ramp = 'Ramp',\n Prediction = 'Prediction',\n Perp = 'Perp',\n Earn = 'Earn',\n Card = 'Card',\n Bridge = 'Bridge',\n dAppTransaction = 'dAppTransaction',\n}\n\nexport enum Kind {\n Regular = 'Regular',\n STX = 'STX',\n GaslessSendBundle = 'GaslessSendBundle',\n GaslessEIP7702 = 'GaslessEIP7702',\n}\n\n/** API */\nexport enum APIType {\n 'GET_FEES',\n 'ESTIMATE_GAS',\n 'SUBMIT_TRANSACTIONS',\n 'CANCEL',\n 'BATCH_STATUS',\n 'LIVENESS',\n}\n\n/** SmartTransactions */\nexport enum SmartTransactionMinedTx {\n NOT_MINED = 'not_mined',\n SUCCESS = 'success',\n CANCELLED = 'cancelled',\n REVERTED = 'reverted',\n UNKNOWN = 'unknown',\n}\n\nexport enum SmartTransactionCancellationReason {\n WOULD_REVERT = 'would_revert',\n TOO_CHEAP = 'too_cheap',\n DEADLINE_MISSED = 'deadline_missed',\n INVALID_NONCE = 'invalid_nonce',\n USER_CANCELLED = 'user_cancelled',\n NOT_CANCELLED = 'not_cancelled',\n}\n\nexport enum SmartTransactionStatuses {\n PENDING = 'pending',\n SUCCESS = 'success',\n REVERTED = 'reverted',\n UNKNOWN = 'unknown',\n CANCELLED = 'cancelled',\n CANCELLED_USER_CANCELLED = 'cancelled_user_cancelled',\n RESOLVED = 'resolved',\n}\n\nexport enum ClientId {\n Mobile = 'mobile',\n Extension = 'extension',\n}\n\nexport const cancellationReasonToStatusMap = {\n [SmartTransactionCancellationReason.WOULD_REVERT]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.TOO_CHEAP]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.DEADLINE_MISSED]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.INVALID_NONCE]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.USER_CANCELLED]:\n SmartTransactionStatuses.CANCELLED_USER_CANCELLED,\n};\n\nexport type SmartTransactionsStatus = {\n error?: string;\n cancellationFeeWei: number;\n cancellationReason?: SmartTransactionCancellationReason;\n deadlineRatio: number;\n minedHash: string;\n minedTx: SmartTransactionMinedTx;\n isSettled: boolean;\n duplicated?: boolean;\n timedOut?: boolean;\n proxied?: boolean;\n};\n\nexport type SmartTransaction = {\n uuid: string;\n txHash?: string;\n txHashes?: string[];\n chainId?: string;\n destinationTokenAddress?: string;\n destinationTokenDecimals?: string;\n destinationTokenSymbol?: string;\n history?: any;\n nonceDetails?: any;\n origin?: string;\n preTxBalance?: string;\n status?: string;\n statusMetadata?: SmartTransactionsStatus;\n sourceTokenSymbol?: string;\n swapMetaData?: any;\n swapTokenValue?: string;\n time?: number; // @deprecated We should use creationTime instead.\n creationTime?: number;\n txParams?: any;\n type?: string;\n confirmed?: boolean;\n cancellable?: boolean;\n accountHardwareType?: string;\n accountType?: string;\n deviceModel?: string;\n transactionId?: string; // It's an ID for a regular transaction from the TransactionController.\n networkClientId?: NetworkClientId;\n};\n\nexport type Fee = {\n maxFeePerGas: number;\n maxPriorityFeePerGas: number;\n};\n\nexport type IndividualTxFees = {\n fees: Fee[];\n cancelFees: Fee[];\n feeEstimate: number;\n gasLimit: number;\n gasUsed: number;\n};\n\nexport type Fees = {\n approvalTxFees: IndividualTxFees | null;\n tradeTxFees: IndividualTxFees | null;\n};\n\n// TODO\nexport type UnsignedTransaction = any;\n\n// TODO\nexport type SignedTransaction = any;\n\nexport type SignedTransactionWithMetadata = {\n tx: string;\n metadata?: SentinelMeta;\n};\n\n// TODO\nexport type SignedCanceledTransaction = any;\n\nexport type MetaMetricsProps = {\n accountHardwareType?: string;\n accountType?: string;\n deviceModel?: string;\n};\n\nexport type FeatureFlags = {\n smartTransactions?: {\n mobileReturnTxHashAsap?: boolean;\n extensionReturnTxHashAsap?: boolean;\n };\n};\n\n/**\n * Configuration for smart transactions on a specific network.\n * These flags control feature availability and behavior per chain.\n *\n * This type is inferred from the SmartTransactionsNetworkConfigSchema.\n * To add a new field, update the schema in `src/featureFlags/validators.ts`.\n */\nexport type { SmartTransactionsNetworkConfig };\n\n/**\n * Feature flags configuration for smart transactions across all networks.\n * Contains a default configuration and optional chain-specific overrides.\n */\nexport type SmartTransactionsFeatureFlagsConfig = {\n /** Default configuration applied to all chains unless overridden */\n default?: SmartTransactionsNetworkConfig;\n} & {\n /**\n * Chain-specific configuration overrides, keyed by chain ID.\n * Supports both hex (e.g., \"0x1\") and CAIP-2 format (e.g., \"eip155:1\", \"solana:...\")\n */\n [chainId: Hex | CaipChainId]: SmartTransactionsNetworkConfig | undefined;\n};\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -4,7 +4,28 @@ import type { CaipChainId, Hex } from "@metamask/utils";
|
|
|
4
4
|
import type { SmartTransactionsNetworkConfig } from "./featureFlags/index.cjs";
|
|
5
5
|
export declare type SentinelMeta = {
|
|
6
6
|
txType?: TransactionType;
|
|
7
|
+
feature?: Feature;
|
|
8
|
+
kind?: Kind;
|
|
9
|
+
client?: ClientId;
|
|
10
|
+
wallet?: string;
|
|
7
11
|
};
|
|
12
|
+
export declare enum Feature {
|
|
13
|
+
Swap = "Swap",
|
|
14
|
+
Staking = "Staking",
|
|
15
|
+
Ramp = "Ramp",
|
|
16
|
+
Prediction = "Prediction",
|
|
17
|
+
Perp = "Perp",
|
|
18
|
+
Earn = "Earn",
|
|
19
|
+
Card = "Card",
|
|
20
|
+
Bridge = "Bridge",
|
|
21
|
+
dAppTransaction = "dAppTransaction"
|
|
22
|
+
}
|
|
23
|
+
export declare enum Kind {
|
|
24
|
+
Regular = "Regular",
|
|
25
|
+
STX = "STX",
|
|
26
|
+
GaslessSendBundle = "GaslessSendBundle",
|
|
27
|
+
GaslessEIP7702 = "GaslessEIP7702"
|
|
28
|
+
}
|
|
8
29
|
/** API */
|
|
9
30
|
export declare enum APIType {
|
|
10
31
|
'GET_FEES' = 0,
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qCAAqC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,yCAAyC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAExD,OAAO,KAAK,EAAE,8BAA8B,EAAE,iCAAuB;AAErE,oBAAY,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qCAAqC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,yCAAyC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAExD,OAAO,KAAK,EAAE,8BAA8B,EAAE,iCAAuB;AAErE,oBAAY,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,QAAQ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
|
@@ -4,7 +4,28 @@ import type { CaipChainId, Hex } from "@metamask/utils";
|
|
|
4
4
|
import type { SmartTransactionsNetworkConfig } from "./featureFlags/index.mjs";
|
|
5
5
|
export declare type SentinelMeta = {
|
|
6
6
|
txType?: TransactionType;
|
|
7
|
+
feature?: Feature;
|
|
8
|
+
kind?: Kind;
|
|
9
|
+
client?: ClientId;
|
|
10
|
+
wallet?: string;
|
|
7
11
|
};
|
|
12
|
+
export declare enum Feature {
|
|
13
|
+
Swap = "Swap",
|
|
14
|
+
Staking = "Staking",
|
|
15
|
+
Ramp = "Ramp",
|
|
16
|
+
Prediction = "Prediction",
|
|
17
|
+
Perp = "Perp",
|
|
18
|
+
Earn = "Earn",
|
|
19
|
+
Card = "Card",
|
|
20
|
+
Bridge = "Bridge",
|
|
21
|
+
dAppTransaction = "dAppTransaction"
|
|
22
|
+
}
|
|
23
|
+
export declare enum Kind {
|
|
24
|
+
Regular = "Regular",
|
|
25
|
+
STX = "STX",
|
|
26
|
+
GaslessSendBundle = "GaslessSendBundle",
|
|
27
|
+
GaslessEIP7702 = "GaslessEIP7702"
|
|
28
|
+
}
|
|
8
29
|
/** API */
|
|
9
30
|
export declare enum APIType {
|
|
10
31
|
'GET_FEES' = 0,
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qCAAqC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,yCAAyC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAExD,OAAO,KAAK,EAAE,8BAA8B,EAAE,iCAAuB;AAErE,oBAAY,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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yB,CAAC,EAAE,OAAO,CAAC;KACrC,CAAC;CACH,CAAC;AAEF;;;;;;GAMG;AACH,YAAY,EAAE,8BAA8B,EAAE,CAAC;AAE/C;;;GAGG;AACH,oBAAY,mCAAmC,GAAG;IAChD,oEAAoE;IACpE,OAAO,CAAC,EAAE,8BAA8B,CAAC;CAC1C,GAAG;IACF;;;OAGG;IACH,CAAC,OAAO,EAAE,GAAG,GAAG,WAAW,GAAG,8BAA8B,GAAG,SAAS,CAAC;CAC1E,CAAC"}
|
package/dist/types.mjs
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
// This list does not belong here, but as these are reported to tx-sentinel, it is ok to have it here for now.
|
|
2
|
+
export var Feature;
|
|
3
|
+
(function (Feature) {
|
|
4
|
+
Feature["Swap"] = "Swap";
|
|
5
|
+
Feature["Staking"] = "Staking";
|
|
6
|
+
Feature["Ramp"] = "Ramp";
|
|
7
|
+
Feature["Prediction"] = "Prediction";
|
|
8
|
+
Feature["Perp"] = "Perp";
|
|
9
|
+
Feature["Earn"] = "Earn";
|
|
10
|
+
Feature["Card"] = "Card";
|
|
11
|
+
Feature["Bridge"] = "Bridge";
|
|
12
|
+
Feature["dAppTransaction"] = "dAppTransaction";
|
|
13
|
+
})(Feature = Feature || (Feature = {}));
|
|
14
|
+
export var Kind;
|
|
15
|
+
(function (Kind) {
|
|
16
|
+
Kind["Regular"] = "Regular";
|
|
17
|
+
Kind["STX"] = "STX";
|
|
18
|
+
Kind["GaslessSendBundle"] = "GaslessSendBundle";
|
|
19
|
+
Kind["GaslessEIP7702"] = "GaslessEIP7702";
|
|
20
|
+
})(Kind = Kind || (Kind = {}));
|
|
1
21
|
/** API */
|
|
2
22
|
export var APIType;
|
|
3
23
|
(function (APIType) {
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.mjs","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BAQX;AARD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,+CAAmB,CAAA;IACnB,mDAAuB,CAAA;IACvB,iFAAqD,CAAA;IACrD,iDAAqB,CAAA;AACvB,CAAC,EARW,wBAAwB,GAAxB,wBAAwB,KAAxB,wBAAwB,QAQnC;AAED,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,mCAAuB,CAAA;AACzB,CAAC,EAHW,QAAQ,GAAR,QAAQ,KAAR,QAAQ,QAGnB;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,CAAC,kCAAkC,CAAC,YAAY,CAAC,EAC/C,wBAAwB,CAAC,SAAS;IACpC,CAAC,kCAAkC,CAAC,SAAS,CAAC,EAC5C,wBAAwB,CAAC,SAAS;IACpC,CAAC,kCAAkC,CAAC,eAAe,CAAC,EAClD,wBAAwB,CAAC,SAAS;IACpC,CAAC,kCAAkC,CAAC,aAAa,CAAC,EAChD,wBAAwB,CAAC,SAAS;IACpC,CAAC,kCAAkC,CAAC,cAAc,CAAC,EACjD,wBAAwB,CAAC,wBAAwB;CACpD,CAAC","sourcesContent":["import type { NetworkClientId } from '@metamask/network-controller';\nimport type { TransactionType } from '@metamask/transaction-controller';\nimport type { CaipChainId, Hex } from '@metamask/utils';\n\nimport type { SmartTransactionsNetworkConfig } from './featureFlags';\n\nexport type SentinelMeta = {\n txType?: TransactionType;\n feature?: Feature;\n kind?: Kind;\n client?: ClientId;\n wallet?: string;\n};\n\n// This list does not belong here, but as these are reported to tx-sentinel, it is ok to have it here for now.\nexport enum Feature {\n Swap = 'Swap',\n Staking = 'Staking',\n Ramp = 'Ramp',\n Prediction = 'Prediction',\n Perp = 'Perp',\n Earn = 'Earn',\n Card = 'Card',\n Bridge = 'Bridge',\n dAppTransaction = 'dAppTransaction',\n}\n\nexport enum Kind {\n Regular = 'Regular',\n STX = 'STX',\n GaslessSendBundle = 'GaslessSendBundle',\n GaslessEIP7702 = 'GaslessEIP7702',\n}\n\n/** API */\nexport enum APIType {\n 'GET_FEES',\n 'ESTIMATE_GAS',\n 'SUBMIT_TRANSACTIONS',\n 'CANCEL',\n 'BATCH_STATUS',\n 'LIVENESS',\n}\n\n/** SmartTransactions */\nexport enum SmartTransactionMinedTx {\n NOT_MINED = 'not_mined',\n SUCCESS = 'success',\n CANCELLED = 'cancelled',\n REVERTED = 'reverted',\n UNKNOWN = 'unknown',\n}\n\nexport enum SmartTransactionCancellationReason {\n WOULD_REVERT = 'would_revert',\n TOO_CHEAP = 'too_cheap',\n DEADLINE_MISSED = 'deadline_missed',\n INVALID_NONCE = 'invalid_nonce',\n USER_CANCELLED = 'user_cancelled',\n NOT_CANCELLED = 'not_cancelled',\n}\n\nexport enum SmartTransactionStatuses {\n PENDING = 'pending',\n SUCCESS = 'success',\n REVERTED = 'reverted',\n UNKNOWN = 'unknown',\n CANCELLED = 'cancelled',\n CANCELLED_USER_CANCELLED = 'cancelled_user_cancelled',\n RESOLVED = 'resolved',\n}\n\nexport enum ClientId {\n Mobile = 'mobile',\n Extension = 'extension',\n}\n\nexport const cancellationReasonToStatusMap = {\n [SmartTransactionCancellationReason.WOULD_REVERT]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.TOO_CHEAP]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.DEADLINE_MISSED]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.INVALID_NONCE]:\n SmartTransactionStatuses.CANCELLED,\n [SmartTransactionCancellationReason.USER_CANCELLED]:\n SmartTransactionStatuses.CANCELLED_USER_CANCELLED,\n};\n\nexport type SmartTransactionsStatus = {\n error?: string;\n cancellationFeeWei: number;\n cancellationReason?: SmartTransactionCancellationReason;\n deadlineRatio: number;\n minedHash: string;\n minedTx: SmartTransactionMinedTx;\n isSettled: boolean;\n duplicated?: boolean;\n timedOut?: boolean;\n proxied?: boolean;\n};\n\nexport type SmartTransaction = {\n uuid: string;\n txHash?: string;\n txHashes?: string[];\n chainId?: string;\n destinationTokenAddress?: string;\n destinationTokenDecimals?: string;\n destinationTokenSymbol?: string;\n history?: any;\n nonceDetails?: any;\n origin?: string;\n preTxBalance?: string;\n status?: string;\n statusMetadata?: SmartTransactionsStatus;\n sourceTokenSymbol?: string;\n swapMetaData?: any;\n swapTokenValue?: string;\n time?: number; // @deprecated We should use creationTime instead.\n creationTime?: number;\n txParams?: any;\n type?: string;\n confirmed?: boolean;\n cancellable?: boolean;\n accountHardwareType?: string;\n accountType?: string;\n deviceModel?: string;\n transactionId?: string; // It's an ID for a regular transaction from the TransactionController.\n networkClientId?: NetworkClientId;\n};\n\nexport type Fee = {\n maxFeePerGas: number;\n maxPriorityFeePerGas: number;\n};\n\nexport type IndividualTxFees = {\n fees: Fee[];\n cancelFees: Fee[];\n feeEstimate: number;\n gasLimit: number;\n gasUsed: number;\n};\n\nexport type Fees = {\n approvalTxFees: IndividualTxFees | null;\n tradeTxFees: IndividualTxFees | null;\n};\n\n// TODO\nexport type UnsignedTransaction = any;\n\n// TODO\nexport type SignedTransaction = any;\n\nexport type SignedTransactionWithMetadata = {\n tx: string;\n metadata?: SentinelMeta;\n};\n\n// TODO\nexport type SignedCanceledTransaction = any;\n\nexport type MetaMetricsProps = {\n accountHardwareType?: string;\n accountType?: string;\n deviceModel?: string;\n};\n\nexport type FeatureFlags = {\n smartTransactions?: {\n mobileReturnTxHashAsap?: boolean;\n extensionReturnTxHashAsap?: boolean;\n };\n};\n\n/**\n * Configuration for smart transactions on a specific network.\n * These flags control feature availability and behavior per chain.\n *\n * This type is inferred from the SmartTransactionsNetworkConfigSchema.\n * To add a new field, update the schema in `src/featureFlags/validators.ts`.\n */\nexport type { SmartTransactionsNetworkConfig };\n\n/**\n * Feature flags configuration for smart transactions across all networks.\n * Contains a default configuration and optional chain-specific overrides.\n */\nexport type SmartTransactionsFeatureFlagsConfig = {\n /** Default configuration applied to all chains unless overridden */\n default?: SmartTransactionsNetworkConfig;\n} & {\n /**\n * Chain-specific configuration overrides, keyed by chain ID.\n * Supports both hex (e.g., \"0x1\") and CAIP-2 format (e.g., \"eip155:1\", \"solana:...\")\n */\n [chainId: Hex | CaipChainId]: SmartTransactionsNetworkConfig | undefined;\n};\n"]}
|
package/package.json
CHANGED