@metamask/smart-transactions-controller 22.5.0 → 22.6.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 +8 -1
- package/dist/constants.cjs +1 -0
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +1 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +1 -0
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +1 -0
- package/dist/constants.mjs.map +1 -1
- package/dist/featureFlags/validators.cjs +2 -0
- package/dist/featureFlags/validators.cjs.map +1 -1
- package/dist/featureFlags/validators.d.cts +7 -0
- package/dist/featureFlags/validators.d.cts.map +1 -1
- package/dist/featureFlags/validators.d.mts +7 -0
- package/dist/featureFlags/validators.d.mts.map +1 -1
- package/dist/featureFlags/validators.mjs +2 -0
- package/dist/featureFlags/validators.mjs.map +1 -1
- package/dist/selectors.d.cts +4 -0
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts +4 -0
- package/dist/selectors.d.mts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [22.6.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- chore(gasless-bridge): add gaslessBridgeWith7702Enabled feature flag ([#568](https://github.com/MetaMask/smart-transactions-controller/pull/568))
|
|
15
|
+
|
|
10
16
|
## [22.5.0]
|
|
11
17
|
|
|
12
18
|
### Changed
|
|
@@ -722,7 +728,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
722
728
|
- Add initial SmartTransactionsController ([#1](https://github.com/MetaMask/smart-transactions-controller/pull/1))
|
|
723
729
|
- Initial commit
|
|
724
730
|
|
|
725
|
-
[Unreleased]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.
|
|
731
|
+
[Unreleased]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.6.0...HEAD
|
|
732
|
+
[22.6.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.5.0...v22.6.0
|
|
726
733
|
[22.5.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.4.0...v22.5.0
|
|
727
734
|
[22.4.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.3.0...v22.4.0
|
|
728
735
|
[22.3.0]: https://github.com/MetaMask/smart-transactions-controller/compare/v22.2.0...v22.3.0
|
package/dist/constants.cjs
CHANGED
|
@@ -48,6 +48,7 @@ exports.DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS = {
|
|
|
48
48
|
extensionReturnTxHashAsapBatch: false,
|
|
49
49
|
mobileReturnTxHashAsap: false,
|
|
50
50
|
extensionSkipSmartTransactionStatusPage: false,
|
|
51
|
+
gaslessBridgeWith7702Enabled: false,
|
|
51
52
|
batchStatusPollingInterval: 1000,
|
|
52
53
|
},
|
|
53
54
|
};
|
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,wCAAwC,CAAC;AAMrE,6BAA6B;AAChB,QAAA,yBAAyB,GAA0B;IAC9D,CAAC,EAAE,yDAAyD;IAC5D,EAAE,EAAE,oDAAoD;IACxD,GAAG,EAAE,wDAAwD;IAC7D,IAAI,EAAE,qDAAqD;IAC3D,KAAK,EAAE,yDAAyD;IAChE,KAAK,EAAE,sDAAsD;IAC7D,QAAQ,EAAE,yDAAyD;CACpE,CAAC;AAEF,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAuC,CAAA;IACvC,sDAA8B,CAAA;IAC9B,yEAAiD,CAAA;IACjD,0DAAkC,CAAA;AACpC,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAED,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,yDAA6B,CAAA;IAC7B,qDAAyB,CAAA;AAC3B,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,sEAAwC,CAAA;IACxC,4FAA8D,CAAA;IAC9D,0FAA4D,CAAA;IAC5D,kFAAoD,CAAA;AACtD,CAAC,EALW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAKrC;AAED;;;;GAIG;AACU,QAAA,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,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 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 batchStatusPollingInterval: 1000,\n },\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,wCAAwC,CAAC;AAMrE,6BAA6B;AAChB,QAAA,yBAAyB,GAA0B;IAC9D,CAAC,EAAE,yDAAyD;IAC5D,EAAE,EAAE,oDAAoD;IACxD,GAAG,EAAE,wDAAwD;IAC7D,IAAI,EAAE,qDAAqD;IAC3D,KAAK,EAAE,yDAAyD;IAChE,KAAK,EAAE,sDAAsD;IAC7D,QAAQ,EAAE,yDAAyD;CACpE,CAAC;AAEF,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAuC,CAAA;IACvC,sDAA8B,CAAA;IAC9B,yEAAiD,CAAA;IACjD,0DAAkC,CAAA;AACpC,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAED,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,yDAA6B,CAAA;IAC7B,qDAAyB,CAAA;AAC3B,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,sEAAwC,CAAA;IACxC,4FAA8D,CAAA;IAC9D,0FAA4D,CAAA;IAC5D,kFAAoD,CAAA;AACtD,CAAC,EALW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAKrC;AAED;;;;GAIG;AACU,QAAA,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 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"]}
|
package/dist/constants.d.cts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS: {
|
|
|
36
36
|
readonly extensionReturnTxHashAsapBatch: false;
|
|
37
37
|
readonly mobileReturnTxHashAsap: false;
|
|
38
38
|
readonly extensionSkipSmartTransactionStatusPage: false;
|
|
39
|
+
readonly gaslessBridgeWith7702Enabled: false;
|
|
39
40
|
readonly batchStatusPollingInterval: 1000;
|
|
40
41
|
};
|
|
41
42
|
};
|
package/dist/constants.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,2CAA2C,CAAC;AAErE,aAAK,qBAAqB,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,qBAQvC,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
|
|
1
|
+
{"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,2CAA2C,CAAC;AAErE,aAAK,qBAAqB,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,qBAQvC,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;;;;;;;;;;;;;;;CAepD,CAAC"}
|
package/dist/constants.d.mts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS: {
|
|
|
36
36
|
readonly extensionReturnTxHashAsapBatch: false;
|
|
37
37
|
readonly mobileReturnTxHashAsap: false;
|
|
38
38
|
readonly extensionSkipSmartTransactionStatusPage: false;
|
|
39
|
+
readonly gaslessBridgeWith7702Enabled: false;
|
|
39
40
|
readonly batchStatusPollingInterval: 1000;
|
|
40
41
|
};
|
|
41
42
|
};
|
package/dist/constants.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,2CAA2C,CAAC;AAErE,aAAK,qBAAqB,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,qBAQvC,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
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,2CAA2C,CAAC;AAErE,aAAK,qBAAqB,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,qBAQvC,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;;;;;;;;;;;;;;;CAepD,CAAC"}
|
package/dist/constants.mjs
CHANGED
|
@@ -45,6 +45,7 @@ export const DEFAULT_DISABLED_SMART_TRANSACTIONS_FEATURE_FLAGS = {
|
|
|
45
45
|
extensionReturnTxHashAsapBatch: false,
|
|
46
46
|
mobileReturnTxHashAsap: false,
|
|
47
47
|
extensionSkipSmartTransactionStatusPage: false,
|
|
48
|
+
gaslessBridgeWith7702Enabled: false,
|
|
48
49
|
batchStatusPollingInterval: 1000,
|
|
49
50
|
},
|
|
50
51
|
};
|
package/dist/constants.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","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,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,GAApB,oBAAoB,KAApB,oBAAoB,QAK/B;AAED,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,yDAA6B,CAAA;IAC7B,qDAAyB,CAAA;AAC3B,CAAC,EAHW,wBAAwB,GAAxB,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,GAA1B,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,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 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 batchStatusPollingInterval: 1000,\n },\n} as const;\n"]}
|
|
1
|
+
{"version":3,"file":"constants.mjs","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,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,GAApB,oBAAoB,KAApB,oBAAoB,QAK/B;AAED,MAAM,CAAN,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,yDAA6B,CAAA;IAC7B,qDAAyB,CAAA;AAC3B,CAAC,EAHW,wBAAwB,GAAxB,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,GAA1B,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 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"]}
|
|
@@ -40,6 +40,8 @@ exports.SmartTransactionsNetworkConfigSchema = (0, superstruct_1.type)({
|
|
|
40
40
|
extensionSkipSmartTransactionStatusPage: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
41
41
|
/** Polling interval in milliseconds for batch status updates */
|
|
42
42
|
batchStatusPollingInterval: (0, superstruct_1.optional)((0, superstruct_1.number)()),
|
|
43
|
+
/** Whether gasless bridge with 7702 is enabled for the network */
|
|
44
|
+
gaslessBridgeWith7702Enabled: (0, superstruct_1.optional)((0, superstruct_1.boolean)()),
|
|
43
45
|
/** Custom sentinel URL for the network */
|
|
44
46
|
sentinelUrl: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
45
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.cj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;KACxC;IAED,8DAA8D;IAC9D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACrD,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,SAAS;SACV;QAED,wBAAwB;QACxB,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,CAAC,IAAI,CACT,IAAI,KAAK,CACP,yBAAyB,GAAG,wFAAwF,CACrH,CACF,CAAC;YACF,SAAS,CAAC,uCAAuC;SAClD;QAED,wBAAwB;QACxB,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG,IAAA,sBAAQ,EAC3C,KAAK,EACL,4CAAoC,CACrC,CAAC;YACF,IAAI,UAAU,EAAE;gBACd,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAChE,SAAS,CAAC,uCAAuC;aAClD;YACD,oDAAoD;YACpD,WAAW,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC;SACnC;KACF;IAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC;AAxED,sFAwEC;AAED;;;;;GAKG;AACH,SAAgB,sCAAsC,CACpD,IAAa;IAEb,OAAO,IAAA,gBAAE,EAAC,IAAI,EAAE,4CAAoC,CAAC,CAAC;AACxD,CAAC;AAJD,wFAIC","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 /** 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
|
+
{"version":3,"file":"validators.cjs","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":";;;AAAA,uDAQ+B;AAE/B,2CAAmE;AAEnE;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAO,IAAA,yBAAiB,EAAC,GAAG,CAAC,IAAI,IAAA,qBAAa,EAAC,GAAG,CAAC,CAAC;AACtD,CAAC;AAED;;;GAGG;AACU,QAAA,oCAAoC,GAAG,IAAA,kBAAI,EAAC;IACvD,qEAAqE;IACrE,eAAe,EAAE,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC;IACpC,yEAAyE;IACzE,YAAY,EAAE,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC;IACjC,iEAAiE;IACjE,eAAe,EAAE,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC;IACpC,qEAAqE;IACrE,mBAAmB,EAAE,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC;IACxC,mEAAmE;IACnE,gBAAgB,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IACpC,8EAA8E;IAC9E,WAAW,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC/B,2FAA2F;IAC3F,yBAAyB,EAAE,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AC;SACnC;KACF;IAED,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC;AAxED,sFAwEC;AAED;;;;;GAKG;AACH,SAAgB,sCAAsC,CACpD,IAAa;IAEb,OAAO,IAAA,gBAAE,EAAC,IAAI,EAAE,4CAAoC,CAAC,CAAC;AACxD,CAAC;AAJD,wFAIC","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"]}
|
|
@@ -15,6 +15,7 @@ export declare const SmartTransactionsNetworkConfigSchema: import("@metamask/sup
|
|
|
15
15
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
16
16
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
17
17
|
batchStatusPollingInterval?: number | undefined;
|
|
18
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
18
19
|
sentinelUrl?: string | undefined;
|
|
19
20
|
}, {
|
|
20
21
|
/** Whether smart transactions are active for the extension client */
|
|
@@ -39,6 +40,8 @@ export declare const SmartTransactionsNetworkConfigSchema: import("@metamask/sup
|
|
|
39
40
|
extensionSkipSmartTransactionStatusPage: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
40
41
|
/** Polling interval in milliseconds for batch status updates */
|
|
41
42
|
batchStatusPollingInterval: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
43
|
+
/** Whether gasless bridge with 7702 is enabled for the network */
|
|
44
|
+
gaslessBridgeWith7702Enabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
42
45
|
/** Custom sentinel URL for the network */
|
|
43
46
|
sentinelUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
44
47
|
}>;
|
|
@@ -59,6 +62,7 @@ export declare const SmartTransactionsFeatureFlagsConfigSchema: import("@metamas
|
|
|
59
62
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
60
63
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
61
64
|
batchStatusPollingInterval?: number | undefined;
|
|
65
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
62
66
|
sentinelUrl?: string | undefined;
|
|
63
67
|
} | undefined;
|
|
64
68
|
}, {
|
|
@@ -75,6 +79,7 @@ export declare const SmartTransactionsFeatureFlagsConfigSchema: import("@metamas
|
|
|
75
79
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
76
80
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
77
81
|
batchStatusPollingInterval?: number | undefined;
|
|
82
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
78
83
|
sentinelUrl?: string | undefined;
|
|
79
84
|
} | undefined, {
|
|
80
85
|
/** Whether smart transactions are active for the extension client */
|
|
@@ -99,6 +104,8 @@ export declare const SmartTransactionsFeatureFlagsConfigSchema: import("@metamas
|
|
|
99
104
|
extensionSkipSmartTransactionStatusPage: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
100
105
|
/** Polling interval in milliseconds for batch status updates */
|
|
101
106
|
batchStatusPollingInterval: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
107
|
+
/** Whether gasless bridge with 7702 is enabled for the network */
|
|
108
|
+
gaslessBridgeWith7702Enabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
102
109
|
/** Custom sentinel URL for the network */
|
|
103
110
|
sentinelUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
104
111
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.cts","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;;GAGG;AACH,eAAO,MAAM,oCAAoC
|
|
1
|
+
{"version":3,"file":"validators.d.cts","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;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,oBAAY,wCAAwC,GAAG,KAAK,CAC1D,OAAO,oCAAoC,CAC5C,CAAC;AAEF;;GAEG;AACH,oBAAY,6CAA6C,GAAG,KAAK,CAC/D,OAAO,yCAAyC,CACjD,CAAC;AAEF;;;GAGG;AACH,oBAAY,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"}
|
|
@@ -15,6 +15,7 @@ export declare const SmartTransactionsNetworkConfigSchema: import("@metamask/sup
|
|
|
15
15
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
16
16
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
17
17
|
batchStatusPollingInterval?: number | undefined;
|
|
18
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
18
19
|
sentinelUrl?: string | undefined;
|
|
19
20
|
}, {
|
|
20
21
|
/** Whether smart transactions are active for the extension client */
|
|
@@ -39,6 +40,8 @@ export declare const SmartTransactionsNetworkConfigSchema: import("@metamask/sup
|
|
|
39
40
|
extensionSkipSmartTransactionStatusPage: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
40
41
|
/** Polling interval in milliseconds for batch status updates */
|
|
41
42
|
batchStatusPollingInterval: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
43
|
+
/** Whether gasless bridge with 7702 is enabled for the network */
|
|
44
|
+
gaslessBridgeWith7702Enabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
42
45
|
/** Custom sentinel URL for the network */
|
|
43
46
|
sentinelUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
44
47
|
}>;
|
|
@@ -59,6 +62,7 @@ export declare const SmartTransactionsFeatureFlagsConfigSchema: import("@metamas
|
|
|
59
62
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
60
63
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
61
64
|
batchStatusPollingInterval?: number | undefined;
|
|
65
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
62
66
|
sentinelUrl?: string | undefined;
|
|
63
67
|
} | undefined;
|
|
64
68
|
}, {
|
|
@@ -75,6 +79,7 @@ export declare const SmartTransactionsFeatureFlagsConfigSchema: import("@metamas
|
|
|
75
79
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
76
80
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
77
81
|
batchStatusPollingInterval?: number | undefined;
|
|
82
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
78
83
|
sentinelUrl?: string | undefined;
|
|
79
84
|
} | undefined, {
|
|
80
85
|
/** Whether smart transactions are active for the extension client */
|
|
@@ -99,6 +104,8 @@ export declare const SmartTransactionsFeatureFlagsConfigSchema: import("@metamas
|
|
|
99
104
|
extensionSkipSmartTransactionStatusPage: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
100
105
|
/** Polling interval in milliseconds for batch status updates */
|
|
101
106
|
batchStatusPollingInterval: import("@metamask/superstruct").Struct<number | undefined, null>;
|
|
107
|
+
/** Whether gasless bridge with 7702 is enabled for the network */
|
|
108
|
+
gaslessBridgeWith7702Enabled: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
102
109
|
/** Custom sentinel URL for the network */
|
|
103
110
|
sentinelUrl: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
104
111
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.mts","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAcnD;;;GAGG;AACH,eAAO,MAAM,oCAAoC
|
|
1
|
+
{"version":3,"file":"validators.d.mts","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;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,oBAAY,wCAAwC,GAAG,KAAK,CAC1D,OAAO,oCAAoC,CAC5C,CAAC;AAEF;;GAEG;AACH,oBAAY,6CAA6C,GAAG,KAAK,CAC/D,OAAO,yCAAyC,CACjD,CAAC;AAEF;;;GAGG;AACH,oBAAY,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"}
|
|
@@ -37,6 +37,8 @@ export const SmartTransactionsNetworkConfigSchema = type({
|
|
|
37
37
|
extensionSkipSmartTransactionStatusPage: optional(boolean()),
|
|
38
38
|
/** Polling interval in milliseconds for batch status updates */
|
|
39
39
|
batchStatusPollingInterval: optional(number()),
|
|
40
|
+
/** Whether gasless bridge with 7702 is enabled for the network */
|
|
41
|
+
gaslessBridgeWith7702Enabled: optional(boolean()),
|
|
40
42
|
/** Custom sentinel URL for the network */
|
|
41
43
|
sentinelUrl: optional(string()),
|
|
42
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.mjs","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,EAAE,EACF,QAAQ,EACT,8BAA8B;AAE/B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB;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,GAAG,IAAI,CAAC;IACvD,qEAAqE;IACrE,eAAe,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpC,yEAAyE;IACzE,YAAY,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACjC,iEAAiE;IACjE,eAAe,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpC,qEAAqE;IACrE,mBAAmB,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;I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F;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 /** 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
|
+
{"version":3,"file":"validators.mjs","sourceRoot":"","sources":["../../src/featureFlags/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,EAAE,EACF,QAAQ,EACT,8BAA8B;AAE/B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB;AAEnE;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;AACtD,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,uCAAuC;SAClD;QAED,wBAAwB;QACxB,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,GAAG,QAAQ,CAC3C,KAAK,EACL,oCAAoC,CACrC,CAAC;YACF,IAAI,UAAU,EAAE;gBACd,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAChE,SAAS,CAAC,uCAAuC;aAClD;YACD,oDAAoD;YACpD,WAAW,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC;SACnC;KACF;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"]}
|
package/dist/selectors.d.cts
CHANGED
|
@@ -93,6 +93,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
93
93
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
94
94
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
95
95
|
batchStatusPollingInterval?: number | undefined;
|
|
96
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
96
97
|
sentinelUrl?: string | undefined;
|
|
97
98
|
}) & {
|
|
98
99
|
clearCache: () => void;
|
|
@@ -111,6 +112,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
111
112
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
112
113
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
113
114
|
batchStatusPollingInterval?: number | undefined;
|
|
115
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
114
116
|
sentinelUrl?: string | undefined;
|
|
115
117
|
};
|
|
116
118
|
memoizedResultFunc: ((resultFuncArgs_0: SmartTransactionsFeatureFlagsConfig, resultFuncArgs_1: `0x${string}` | `${string}:${string}`) => {
|
|
@@ -125,6 +127,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
125
127
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
126
128
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
127
129
|
batchStatusPollingInterval?: number | undefined;
|
|
130
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
128
131
|
sentinelUrl?: string | undefined;
|
|
129
132
|
}) & {
|
|
130
133
|
clearCache: () => void;
|
|
@@ -143,6 +146,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
143
146
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
144
147
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
145
148
|
batchStatusPollingInterval?: number | undefined;
|
|
149
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
146
150
|
sentinelUrl?: string | undefined;
|
|
147
151
|
};
|
|
148
152
|
dependencies: [((state: SmartTransactionsFeatureFlagsState) => SmartTransactionsFeatureFlagsConfig) & {
|
package/dist/selectors.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAOxD,OAAO,KAAK,EACV,mCAAmC,EAEpC,oBAAgB;AAEjB;;;GAGG;AACH,oBAAY,kCAAkC,GAAG;IAC/C,kBAAkB,CAAC,EAAE;QACnB,yBAAyB,CAAC,EAAE,OAAO,CAAC;KACrC,CAAC;CACH,CAAC;AAQF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;CAI/C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,2CAA2C
|
|
1
|
+
{"version":3,"file":"selectors.d.cts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAOxD,OAAO,KAAK,EACV,mCAAmC,EAEpC,oBAAgB;AAEjB;;;GAGG;AACH,oBAAY,kCAAkC,GAAG;IAC/C,kBAAkB,CAAC,EAAE;QACnB,yBAAyB,CAAC,EAAE,OAAO,CAAC;KACrC,CAAC;CACH,CAAC;AAQF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;CAI/C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAG3C,kCAAkC,WAAW,GAAG,GAAG,WAAW;;;;;;;;CAK1E,CAAC"}
|
package/dist/selectors.d.mts
CHANGED
|
@@ -93,6 +93,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
93
93
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
94
94
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
95
95
|
batchStatusPollingInterval?: number | undefined;
|
|
96
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
96
97
|
sentinelUrl?: string | undefined;
|
|
97
98
|
}) & {
|
|
98
99
|
clearCache: () => void;
|
|
@@ -111,6 +112,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
111
112
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
112
113
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
113
114
|
batchStatusPollingInterval?: number | undefined;
|
|
115
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
114
116
|
sentinelUrl?: string | undefined;
|
|
115
117
|
};
|
|
116
118
|
memoizedResultFunc: ((resultFuncArgs_0: SmartTransactionsFeatureFlagsConfig, resultFuncArgs_1: `0x${string}` | `${string}:${string}`) => {
|
|
@@ -125,6 +127,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
125
127
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
126
128
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
127
129
|
batchStatusPollingInterval?: number | undefined;
|
|
130
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
128
131
|
sentinelUrl?: string | undefined;
|
|
129
132
|
}) & {
|
|
130
133
|
clearCache: () => void;
|
|
@@ -143,6 +146,7 @@ export declare const selectSmartTransactionsFeatureFlagsForChain: ((state: Smart
|
|
|
143
146
|
mobileReturnTxHashAsap?: boolean | undefined;
|
|
144
147
|
extensionSkipSmartTransactionStatusPage?: boolean | undefined;
|
|
145
148
|
batchStatusPollingInterval?: number | undefined;
|
|
149
|
+
gaslessBridgeWith7702Enabled?: boolean | undefined;
|
|
146
150
|
sentinelUrl?: string | undefined;
|
|
147
151
|
};
|
|
148
152
|
dependencies: [((state: SmartTransactionsFeatureFlagsState) => SmartTransactionsFeatureFlagsConfig) & {
|
package/dist/selectors.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.mts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAOxD,OAAO,KAAK,EACV,mCAAmC,EAEpC,oBAAgB;AAEjB;;;GAGG;AACH,oBAAY,kCAAkC,GAAG;IAC/C,kBAAkB,CAAC,EAAE;QACnB,yBAAyB,CAAC,EAAE,OAAO,CAAC;KACrC,CAAC;CACH,CAAC;AAQF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;CAI/C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,2CAA2C
|
|
1
|
+
{"version":3,"file":"selectors.d.mts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAOxD,OAAO,KAAK,EACV,mCAAmC,EAEpC,oBAAgB;AAEjB;;;GAGG;AACH,oBAAY,kCAAkC,GAAG;IAC/C,kBAAkB,CAAC,EAAE;QACnB,yBAAyB,CAAC,EAAE,OAAO,CAAC;KACrC,CAAC;CACH,CAAC;AAQF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;CAI/C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAG3C,kCAAkC,WAAW,GAAG,GAAG,WAAW;;;;;;;;CAK1E,CAAC"}
|
package/package.json
CHANGED