@metamask/snaps-simulation 2.5.0 → 2.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/methods/hooks/get-preferences.cjs +3 -1
  3. package/dist/methods/hooks/get-preferences.cjs.map +1 -1
  4. package/dist/methods/hooks/get-preferences.d.cts +3 -1
  5. package/dist/methods/hooks/get-preferences.d.cts.map +1 -1
  6. package/dist/methods/hooks/get-preferences.d.mts +3 -1
  7. package/dist/methods/hooks/get-preferences.d.mts.map +1 -1
  8. package/dist/methods/hooks/get-preferences.mjs +3 -1
  9. package/dist/methods/hooks/get-preferences.mjs.map +1 -1
  10. package/dist/middleware/internal-methods/accounts.cjs.map +1 -1
  11. package/dist/middleware/internal-methods/accounts.d.cts +2 -2
  12. package/dist/middleware/internal-methods/accounts.d.cts.map +1 -1
  13. package/dist/middleware/internal-methods/accounts.d.mts +2 -2
  14. package/dist/middleware/internal-methods/accounts.d.mts.map +1 -1
  15. package/dist/middleware/internal-methods/accounts.mjs.map +1 -1
  16. package/dist/middleware/internal-methods/chain-id.cjs.map +1 -1
  17. package/dist/middleware/internal-methods/chain-id.d.cts +2 -2
  18. package/dist/middleware/internal-methods/chain-id.d.cts.map +1 -1
  19. package/dist/middleware/internal-methods/chain-id.d.mts +2 -2
  20. package/dist/middleware/internal-methods/chain-id.d.mts.map +1 -1
  21. package/dist/middleware/internal-methods/chain-id.mjs.map +1 -1
  22. package/dist/middleware/internal-methods/middleware.cjs +2 -0
  23. package/dist/middleware/internal-methods/middleware.cjs.map +1 -1
  24. package/dist/middleware/internal-methods/middleware.d.cts.map +1 -1
  25. package/dist/middleware/internal-methods/middleware.d.mts.map +1 -1
  26. package/dist/middleware/internal-methods/middleware.mjs +2 -0
  27. package/dist/middleware/internal-methods/middleware.mjs.map +1 -1
  28. package/dist/middleware/internal-methods/net-version.cjs.map +1 -1
  29. package/dist/middleware/internal-methods/net-version.d.cts +2 -2
  30. package/dist/middleware/internal-methods/net-version.d.cts.map +1 -1
  31. package/dist/middleware/internal-methods/net-version.d.mts +2 -2
  32. package/dist/middleware/internal-methods/net-version.d.mts.map +1 -1
  33. package/dist/middleware/internal-methods/net-version.mjs.map +1 -1
  34. package/dist/middleware/internal-methods/provider-state.cjs.map +1 -1
  35. package/dist/middleware/internal-methods/provider-state.d.cts +2 -2
  36. package/dist/middleware/internal-methods/provider-state.d.cts.map +1 -1
  37. package/dist/middleware/internal-methods/provider-state.d.mts +2 -2
  38. package/dist/middleware/internal-methods/provider-state.d.mts.map +1 -1
  39. package/dist/middleware/internal-methods/provider-state.mjs.map +1 -1
  40. package/dist/middleware/internal-methods/switch-ethereum-chain.cjs +21 -0
  41. package/dist/middleware/internal-methods/switch-ethereum-chain.cjs.map +1 -0
  42. package/dist/middleware/internal-methods/switch-ethereum-chain.d.cts +16 -0
  43. package/dist/middleware/internal-methods/switch-ethereum-chain.d.cts.map +1 -0
  44. package/dist/middleware/internal-methods/switch-ethereum-chain.d.mts +16 -0
  45. package/dist/middleware/internal-methods/switch-ethereum-chain.d.mts.map +1 -0
  46. package/dist/middleware/internal-methods/switch-ethereum-chain.mjs +17 -0
  47. package/dist/middleware/internal-methods/switch-ethereum-chain.mjs.map +1 -0
  48. package/dist/options.cjs +1 -0
  49. package/dist/options.cjs.map +1 -1
  50. package/dist/options.d.cts +3 -0
  51. package/dist/options.d.cts.map +1 -1
  52. package/dist/options.d.mts +3 -0
  53. package/dist/options.d.mts.map +1 -1
  54. package/dist/options.mjs +1 -0
  55. package/dist/options.mjs.map +1 -1
  56. package/package.json +14 -14
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.6.0]
11
+
12
+ ### Added
13
+
14
+ - Add support for `wallet_switchEthereumChain` ([#2634](https://github.com/MetaMask/snaps/pull/2634))
15
+ - Add `showTestnets` to `snap_getPreferences` ([#3395](https://github.com/MetaMask/snaps/pull/3395))
16
+
10
17
  ## [2.5.0]
11
18
 
12
19
  ### Added
@@ -153,7 +160,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
153
160
 
154
161
  - Initial release of `@metamask/snaps-simulation` package ([#2727](https://github.com/MetaMask/snaps/pull/2727))
155
162
 
156
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-simulation@2.5.0...HEAD
163
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-simulation@2.6.0...HEAD
164
+ [2.6.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-simulation@2.5.0...@metamask/snaps-simulation@2.6.0
157
165
  [2.5.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-simulation@2.4.1...@metamask/snaps-simulation@2.5.0
158
166
  [2.4.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-simulation@2.4.0...@metamask/snaps-simulation@2.4.1
159
167
  [2.4.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-simulation@2.3.0...@metamask/snaps-simulation@2.4.0
@@ -15,9 +15,10 @@ exports.getGetPreferencesMethodImplementation = void 0;
15
15
  * @param options.displayNftMedia - Whether to display NFT media.
16
16
  * @param options.useNftDetection - Whether to auto-detect NFTs.
17
17
  * @param options.useExternalPricingData - Whether to get token price data from an external source.
18
+ * @param options.showTestnets - Whether to show testnets.
18
19
  * @returns The implementation of the `getPreferences` hook.
19
20
  */
20
- function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, }) {
21
+ function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, showTestnets, }) {
21
22
  return () => {
22
23
  return {
23
24
  currency,
@@ -30,6 +31,7 @@ function getGetPreferencesMethodImplementation({ currency, locale, hideBalances,
30
31
  displayNftMedia,
31
32
  useNftDetection,
32
33
  useExternalPricingData,
34
+ showTestnets,
33
35
  };
34
36
  };
35
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-preferences.cjs","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,GACJ;IAClB,OAAO,GAAG,EAAE;QACV,OAAO;YACL,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,iBAAiB;YACjB,sBAAsB;YACtB,iBAAiB;YACjB,kBAAkB;YAClB,eAAe;YACf,eAAe;YACf,sBAAsB;SACvB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AA1BD,sFA0BC","sourcesContent":["import type { SimulationOptions } from '../../options';\n\n/**\n * Get the implementation of the `getPreferences` hook.\n *\n * @param options - The simulation options.\n * @param options.currency - The currency to use.\n * @param options.locale - The locale to use.\n * @param options.hideBalances - Whether to hide balances.\n * @param options.useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @param options.simulateOnChainActions - Whether to simulate transactions and signatures.\n * @param options.useTokenDetection - Whether to auto-detect tokens.\n * @param options.batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @param options.displayNftMedia - Whether to display NFT media.\n * @param options.useNftDetection - Whether to auto-detect NFTs.\n * @param options.useExternalPricingData - Whether to get token price data from an external source.\n * @returns The implementation of the `getPreferences` hook.\n */\nexport function getGetPreferencesMethodImplementation({\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n}: SimulationOptions) {\n return () => {\n return {\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n };\n };\n}\n"]}
1
+ {"version":3,"file":"get-preferences.cjs","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,YAAY,GACM;IAClB,OAAO,GAAG,EAAE;QACV,OAAO;YACL,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,iBAAiB;YACjB,sBAAsB;YACtB,iBAAiB;YACjB,kBAAkB;YAClB,eAAe;YACf,eAAe;YACf,sBAAsB;YACtB,YAAY;SACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AA5BD,sFA4BC","sourcesContent":["import type { SimulationOptions } from '../../options';\n\n/**\n * Get the implementation of the `getPreferences` hook.\n *\n * @param options - The simulation options.\n * @param options.currency - The currency to use.\n * @param options.locale - The locale to use.\n * @param options.hideBalances - Whether to hide balances.\n * @param options.useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @param options.simulateOnChainActions - Whether to simulate transactions and signatures.\n * @param options.useTokenDetection - Whether to auto-detect tokens.\n * @param options.batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @param options.displayNftMedia - Whether to display NFT media.\n * @param options.useNftDetection - Whether to auto-detect NFTs.\n * @param options.useExternalPricingData - Whether to get token price data from an external source.\n * @param options.showTestnets - Whether to show testnets.\n * @returns The implementation of the `getPreferences` hook.\n */\nexport function getGetPreferencesMethodImplementation({\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n showTestnets,\n}: SimulationOptions) {\n return () => {\n return {\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n showTestnets,\n };\n };\n}\n"]}
@@ -13,9 +13,10 @@ import type { SimulationOptions } from "../../options.cjs";
13
13
  * @param options.displayNftMedia - Whether to display NFT media.
14
14
  * @param options.useNftDetection - Whether to auto-detect NFTs.
15
15
  * @param options.useExternalPricingData - Whether to get token price data from an external source.
16
+ * @param options.showTestnets - Whether to show testnets.
16
17
  * @returns The implementation of the `getPreferences` hook.
17
18
  */
18
- export declare function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, }: SimulationOptions): () => {
19
+ export declare function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, showTestnets, }: SimulationOptions): () => {
19
20
  currency: string;
20
21
  locale: string;
21
22
  hideBalances: boolean;
@@ -26,5 +27,6 @@ export declare function getGetPreferencesMethodImplementation({ currency, locale
26
27
  displayNftMedia: boolean;
27
28
  useNftDetection: boolean;
28
29
  useExternalPricingData: boolean;
30
+ showTestnets: boolean;
29
31
  };
30
32
  //# sourceMappingURL=get-preferences.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-preferences.d.cts","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAsB;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,EAAE,iBAAiB;;;;;;;;;;;EAenB"}
1
+ {"version":3,"file":"get-preferences.d.cts","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAsB;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,YAAY,GACb,EAAE,iBAAiB;;;;;;;;;;;;EAgBnB"}
@@ -13,9 +13,10 @@ import type { SimulationOptions } from "../../options.mjs";
13
13
  * @param options.displayNftMedia - Whether to display NFT media.
14
14
  * @param options.useNftDetection - Whether to auto-detect NFTs.
15
15
  * @param options.useExternalPricingData - Whether to get token price data from an external source.
16
+ * @param options.showTestnets - Whether to show testnets.
16
17
  * @returns The implementation of the `getPreferences` hook.
17
18
  */
18
- export declare function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, }: SimulationOptions): () => {
19
+ export declare function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, showTestnets, }: SimulationOptions): () => {
19
20
  currency: string;
20
21
  locale: string;
21
22
  hideBalances: boolean;
@@ -26,5 +27,6 @@ export declare function getGetPreferencesMethodImplementation({ currency, locale
26
27
  displayNftMedia: boolean;
27
28
  useNftDetection: boolean;
28
29
  useExternalPricingData: boolean;
30
+ showTestnets: boolean;
29
31
  };
30
32
  //# sourceMappingURL=get-preferences.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-preferences.d.mts","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAsB;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,EAAE,iBAAiB;;;;;;;;;;;EAenB"}
1
+ {"version":3,"file":"get-preferences.d.mts","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAsB;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,YAAY,GACb,EAAE,iBAAiB;;;;;;;;;;;;EAgBnB"}
@@ -12,9 +12,10 @@
12
12
  * @param options.displayNftMedia - Whether to display NFT media.
13
13
  * @param options.useNftDetection - Whether to auto-detect NFTs.
14
14
  * @param options.useExternalPricingData - Whether to get token price data from an external source.
15
+ * @param options.showTestnets - Whether to show testnets.
15
16
  * @returns The implementation of the `getPreferences` hook.
16
17
  */
17
- export function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, }) {
18
+ export function getGetPreferencesMethodImplementation({ currency, locale, hideBalances, useSecurityAlerts, simulateOnChainActions, useTokenDetection, batchCheckBalances, displayNftMedia, useNftDetection, useExternalPricingData, showTestnets, }) {
18
19
  return () => {
19
20
  return {
20
21
  currency,
@@ -27,6 +28,7 @@ export function getGetPreferencesMethodImplementation({ currency, locale, hideBa
27
28
  displayNftMedia,
28
29
  useNftDetection,
29
30
  useExternalPricingData,
31
+ showTestnets,
30
32
  };
31
33
  };
32
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-preferences.mjs","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,GACJ;IAClB,OAAO,GAAG,EAAE;QACV,OAAO;YACL,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,iBAAiB;YACjB,sBAAsB;YACtB,iBAAiB;YACjB,kBAAkB;YAClB,eAAe;YACf,eAAe;YACf,sBAAsB;SACvB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { SimulationOptions } from '../../options';\n\n/**\n * Get the implementation of the `getPreferences` hook.\n *\n * @param options - The simulation options.\n * @param options.currency - The currency to use.\n * @param options.locale - The locale to use.\n * @param options.hideBalances - Whether to hide balances.\n * @param options.useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @param options.simulateOnChainActions - Whether to simulate transactions and signatures.\n * @param options.useTokenDetection - Whether to auto-detect tokens.\n * @param options.batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @param options.displayNftMedia - Whether to display NFT media.\n * @param options.useNftDetection - Whether to auto-detect NFTs.\n * @param options.useExternalPricingData - Whether to get token price data from an external source.\n * @returns The implementation of the `getPreferences` hook.\n */\nexport function getGetPreferencesMethodImplementation({\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n}: SimulationOptions) {\n return () => {\n return {\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n };\n };\n}\n"]}
1
+ {"version":3,"file":"get-preferences.mjs","sourceRoot":"","sources":["../../../src/methods/hooks/get-preferences.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qCAAqC,CAAC,EACpD,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,YAAY,GACM;IAClB,OAAO,GAAG,EAAE;QACV,OAAO;YACL,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,iBAAiB;YACjB,sBAAsB;YACtB,iBAAiB;YACjB,kBAAkB;YAClB,eAAe;YACf,eAAe;YACf,sBAAsB;YACtB,YAAY;SACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { SimulationOptions } from '../../options';\n\n/**\n * Get the implementation of the `getPreferences` hook.\n *\n * @param options - The simulation options.\n * @param options.currency - The currency to use.\n * @param options.locale - The locale to use.\n * @param options.hideBalances - Whether to hide balances.\n * @param options.useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @param options.simulateOnChainActions - Whether to simulate transactions and signatures.\n * @param options.useTokenDetection - Whether to auto-detect tokens.\n * @param options.batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @param options.displayNftMedia - Whether to display NFT media.\n * @param options.useNftDetection - Whether to auto-detect NFTs.\n * @param options.useExternalPricingData - Whether to get token price data from an external source.\n * @param options.showTestnets - Whether to show testnets.\n * @returns The implementation of the `getPreferences` hook.\n */\nexport function getGetPreferencesMethodImplementation({\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n showTestnets,\n}: SimulationOptions) {\n return () => {\n return {\n currency,\n locale,\n hideBalances,\n useSecurityAlerts,\n simulateOnChainActions,\n useTokenDetection,\n batchCheckBalances,\n displayNftMedia,\n useNftDetection,\n useExternalPricingData,\n showTestnets,\n };\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":";;;AAIA,iDAA+C;AAW/C;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,kBAAkB,CACtC,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B,EAC7B,KAA8B;IAE9B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,IAAI,GAAG,MAAM,oBAAS,CAAC,kBAAkB,CAAC;QAC9C,cAAc,EAAE;YACd,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,WAAW;YACX,UAAU;YACV,SAAS;YACT,SAAS;SACV;KACF,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAtBD,gDAsBC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport { BIP44Node } from '@metamask/key-tree';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\nexport type GetAccountsHandlerHooks = {\n getMnemonic: () => Promise<Uint8Array>;\n};\n\n/**\n * A mock handler for account related methods that always returns the first\n * address for the selected secret recovery phrase.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @param hooks - Any hooks required by this handler.\n * @returns The JSON-RPC response.\n */\nexport async function getAccountsHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n hooks: GetAccountsHandlerHooks,\n) {\n const { getMnemonic } = hooks;\n\n const node = await BIP44Node.fromDerivationPath({\n derivationPath: [\n await getMnemonic(),\n `bip32:44'`,\n `bip32:60'`,\n `bip32:0'`,\n `bip32:0`,\n `bip32:0`,\n ],\n });\n\n response.result = [node.address];\n return end();\n}\n"]}
1
+ {"version":3,"file":"accounts.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":";;;AAIA,iDAA+C;AAO/C;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,kBAAkB,CACtC,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B,EAC7B,KAA8B;IAE9B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,IAAI,GAAG,MAAM,oBAAS,CAAC,kBAAkB,CAAC;QAC9C,cAAc,EAAE;YACd,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,WAAW;YACX,UAAU;YACV,SAAS;YACT,SAAS;SACV;KACF,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAtBD,gDAsBC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport { BIP44Node } from '@metamask/key-tree';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\nexport type GetAccountsHandlerHooks = {\n getMnemonic: () => Promise<Uint8Array>;\n};\n\n/**\n * A mock handler for account related methods that always returns the first\n * address for the selected secret recovery phrase.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @param hooks - Any hooks required by this handler.\n * @returns The JSON-RPC response.\n */\nexport async function getAccountsHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n hooks: GetAccountsHandlerHooks,\n) {\n const { getMnemonic } = hooks;\n\n const node = await BIP44Node.fromDerivationPath({\n derivationPath: [\n await getMnemonic(),\n `bip32:44'`,\n `bip32:60'`,\n `bip32:0'`,\n `bip32:0`,\n `bip32:0`,\n ],\n });\n\n response.result = [node.address];\n return end();\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  export type GetAccountsHandlerHooks = {
4
4
  getMnemonic: () => Promise<Uint8Array>;
5
5
  };
@@ -16,5 +16,5 @@ export type GetAccountsHandlerHooks = {
16
16
  * @param hooks - Any hooks required by this handler.
17
17
  * @returns The JSON-RPC response.
18
18
  */
19
- export declare function getAccountsHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback, hooks: GetAccountsHandlerHooks): Promise<void>;
19
+ export declare function getAccountsHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback, hooks: GetAccountsHandlerHooks): Promise<void>;
20
20
  //# sourceMappingURL=accounts.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AAEnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,uBAAuB,iBAiB/B"}
1
+ {"version":3,"file":"accounts.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,uBAAuB,iBAiB/B"}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  export type GetAccountsHandlerHooks = {
4
4
  getMnemonic: () => Promise<Uint8Array>;
5
5
  };
@@ -16,5 +16,5 @@ export type GetAccountsHandlerHooks = {
16
16
  * @param hooks - Any hooks required by this handler.
17
17
  * @returns The JSON-RPC response.
18
18
  */
19
- export declare function getAccountsHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback, hooks: GetAccountsHandlerHooks): Promise<void>;
19
+ export declare function getAccountsHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback, hooks: GetAccountsHandlerHooks): Promise<void>;
20
20
  //# sourceMappingURL=accounts.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AAEnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,uBAAuB,iBAiB/B"}
1
+ {"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,uBAAuB,iBAiB/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,2BAA2B;AAW/C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B,EAC7B,KAA8B;IAE9B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,kBAAkB,CAAC;QAC9C,cAAc,EAAE;YACd,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,WAAW;YACX,UAAU;YACV,SAAS;YACT,SAAS;SACV;KACF,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport { BIP44Node } from '@metamask/key-tree';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\nexport type GetAccountsHandlerHooks = {\n getMnemonic: () => Promise<Uint8Array>;\n};\n\n/**\n * A mock handler for account related methods that always returns the first\n * address for the selected secret recovery phrase.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @param hooks - Any hooks required by this handler.\n * @returns The JSON-RPC response.\n */\nexport async function getAccountsHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n hooks: GetAccountsHandlerHooks,\n) {\n const { getMnemonic } = hooks;\n\n const node = await BIP44Node.fromDerivationPath({\n derivationPath: [\n await getMnemonic(),\n `bip32:44'`,\n `bip32:60'`,\n `bip32:0'`,\n `bip32:0`,\n `bip32:0`,\n ],\n });\n\n response.result = [node.address];\n return end();\n}\n"]}
1
+ {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/accounts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,2BAA2B;AAO/C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B,EAC7B,KAA8B;IAE9B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9B,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,kBAAkB,CAAC;QAC9C,cAAc,EAAE;YACd,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,WAAW;YACX,UAAU;YACV,SAAS;YACT,SAAS;SACV;KACF,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport { BIP44Node } from '@metamask/key-tree';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\nexport type GetAccountsHandlerHooks = {\n getMnemonic: () => Promise<Uint8Array>;\n};\n\n/**\n * A mock handler for account related methods that always returns the first\n * address for the selected secret recovery phrase.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @param hooks - Any hooks required by this handler.\n * @returns The JSON-RPC response.\n */\nexport async function getAccountsHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n hooks: GetAccountsHandlerHooks,\n) {\n const { getMnemonic } = hooks;\n\n const node = await BIP44Node.fromDerivationPath({\n derivationPath: [\n await getMnemonic(),\n `bip32:44'`,\n `bip32:60'`,\n `bip32:0'`,\n `bip32:0`,\n `bip32:0`,\n ],\n });\n\n response.result = [node.address];\n return end();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chain-id.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,iBAAiB,CACrC,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;IAEzB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAXD,8CAWC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for eth_chainId that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getChainIdHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '0x01';\n\n return end();\n}\n"]}
1
+ {"version":3,"file":"chain-id.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,iBAAiB,CACrC,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;IAEzB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAXD,8CAWC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for eth_chainId that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getChainIdHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '0x01';\n\n return end();\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for eth_chainId that always returns a specific
5
5
  * hardcoded result.
@@ -12,5 +12,5 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/uti
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
13
  * @returns The JSON-RPC response.
14
14
  */
15
- export declare function getChainIdHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
15
+ export declare function getChainIdHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
16
  //# sourceMappingURL=chain-id.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain-id.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
1
+ {"version":3,"file":"chain-id.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for eth_chainId that always returns a specific
5
5
  * hardcoded result.
@@ -12,5 +12,5 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/uti
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
13
  * @returns The JSON-RPC response.
14
14
  */
15
- export declare function getChainIdHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
15
+ export declare function getChainIdHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
16
  //# sourceMappingURL=chain-id.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain-id.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
1
+ {"version":3,"file":"chain-id.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"chain-id.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;IAEzB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for eth_chainId that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getChainIdHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '0x01';\n\n return end();\n}\n"]}
1
+ {"version":3,"file":"chain-id.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/chain-id.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;IAEzB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for eth_chainId that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getChainIdHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '0x01';\n\n return end();\n}\n"]}
@@ -6,6 +6,7 @@ const accounts_1 = require("./accounts.cjs");
6
6
  const chain_id_1 = require("./chain-id.cjs");
7
7
  const net_version_1 = require("./net-version.cjs");
8
8
  const provider_state_1 = require("./provider-state.cjs");
9
+ const switch_ethereum_chain_1 = require("./switch-ethereum-chain.cjs");
9
10
  const methodHandlers = {
10
11
  /* eslint-disable @typescript-eslint/naming-convention */
11
12
  metamask_getProviderState: provider_state_1.getProviderStateHandler,
@@ -13,6 +14,7 @@ const methodHandlers = {
13
14
  eth_accounts: accounts_1.getAccountsHandler,
14
15
  eth_chainId: chain_id_1.getChainIdHandler,
15
16
  net_version: net_version_1.getNetworkVersionHandler,
17
+ wallet_switchEthereumChain: switch_ethereum_chain_1.getSwitchEthereumChainHandler,
16
18
  /* eslint-enable @typescript-eslint/naming-convention */
17
19
  };
18
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":";;;AACA,uDAAiD;AAGjD,6CAAgD;AAChD,6CAA+C;AAC/C,mDAAyD;AACzD,yDAA2D;AAW3D,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,yBAAyB,EAAE,wCAAuB;IAClD,mBAAmB,EAAE,6BAAkB;IACvC,YAAY,EAAE,6BAAkB;IAChC,WAAW,EAAE,4BAAiB;IAC9B,WAAW,EAAE,sCAAwB;IACrC,wDAAwD;CACzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,SAAgB,+BAA+B,CAC7C,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACjE,MAAM,OAAO,GACX,cAAc,CAAC,OAAO,CAAC,MAAqC,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,kEAAkE;gBAClE,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAA,sBAAQ,EAAC,KAAK,CAAC,CAAC;gBAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AApBD,0EAoBC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getChainIdHandler } from './chain-id';\nimport { getNetworkVersionHandler } from './net-version';\nimport { getProviderStateHandler } from './provider-state';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n eth_chainId: getChainIdHandler,\n net_version: getNetworkVersionHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"]}
1
+ {"version":3,"file":"middleware.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":";;;AACA,uDAAiD;AAGjD,6CAAgD;AAChD,6CAA+C;AAC/C,mDAAyD;AACzD,yDAA2D;AAC3D,uEAAwE;AAWxE,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,yBAAyB,EAAE,wCAAuB;IAClD,mBAAmB,EAAE,6BAAkB;IACvC,YAAY,EAAE,6BAAkB;IAChC,WAAW,EAAE,4BAAiB;IAC9B,WAAW,EAAE,sCAAwB;IACrC,0BAA0B,EAAE,qDAA6B;IACzD,wDAAwD;CACzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,SAAgB,+BAA+B,CAC7C,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACjE,MAAM,OAAO,GACX,cAAc,CAAC,OAAO,CAAC,MAAqC,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,kEAAkE;gBAClE,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,IAAA,sBAAQ,EAAC,KAAK,CAAC,CAAC;gBAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AApBD,0EAoBC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getChainIdHandler } from './chain-id';\nimport { getNetworkVersionHandler } from './net-version';\nimport { getProviderStateHandler } from './provider-state';\nimport { getSwitchEthereumChainHandler } from './switch-ethereum-chain';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n eth_chainId: getChainIdHandler,\n net_version: getNetworkVersionHandler,\n wallet_switchEthereumChain: getSwitchEthereumChainHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAO3D,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAYF;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAkBxC"}
1
+ {"version":3,"file":"middleware.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAQ3D,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAaF;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAkBxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAO3D,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAYF;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAkBxC"}
1
+ {"version":3,"file":"middleware.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kCAAkC;AAEnE,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAQ3D,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACxC,CAAC;AAaF;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,CAkBxC"}
@@ -3,6 +3,7 @@ import { getAccountsHandler } from "./accounts.mjs";
3
3
  import { getChainIdHandler } from "./chain-id.mjs";
4
4
  import { getNetworkVersionHandler } from "./net-version.mjs";
5
5
  import { getProviderStateHandler } from "./provider-state.mjs";
6
+ import { getSwitchEthereumChainHandler } from "./switch-ethereum-chain.mjs";
6
7
  const methodHandlers = {
7
8
  /* eslint-disable @typescript-eslint/naming-convention */
8
9
  metamask_getProviderState: getProviderStateHandler,
@@ -10,6 +11,7 @@ const methodHandlers = {
10
11
  eth_accounts: getAccountsHandler,
11
12
  eth_chainId: getChainIdHandler,
12
13
  net_version: getNetworkVersionHandler,
14
+ wallet_switchEthereumChain: getSwitchEthereumChainHandler,
13
15
  /* eslint-enable @typescript-eslint/naming-convention */
14
16
  };
15
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAGjD,OAAO,EAAE,kBAAkB,EAAE,uBAAmB;AAChD,OAAO,EAAE,iBAAiB,EAAE,uBAAmB;AAC/C,OAAO,EAAE,wBAAwB,EAAE,0BAAsB;AACzD,OAAO,EAAE,uBAAuB,EAAE,6BAAyB;AAW3D,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,yBAAyB,EAAE,uBAAuB;IAClD,mBAAmB,EAAE,kBAAkB;IACvC,YAAY,EAAE,kBAAkB;IAChC,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,wDAAwD;CACzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,+BAA+B,CAC7C,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACjE,MAAM,OAAO,GACX,cAAc,CAAC,OAAO,CAAC,MAAqC,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,kEAAkE;gBAClE,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getChainIdHandler } from './chain-id';\nimport { getNetworkVersionHandler } from './net-version';\nimport { getProviderStateHandler } from './provider-state';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n eth_chainId: getChainIdHandler,\n net_version: getNetworkVersionHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"]}
1
+ {"version":3,"file":"middleware.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AAGjD,OAAO,EAAE,kBAAkB,EAAE,uBAAmB;AAChD,OAAO,EAAE,iBAAiB,EAAE,uBAAmB;AAC/C,OAAO,EAAE,wBAAwB,EAAE,0BAAsB;AACzD,OAAO,EAAE,uBAAuB,EAAE,6BAAyB;AAC3D,OAAO,EAAE,6BAA6B,EAAE,oCAAgC;AAWxE,MAAM,cAAc,GAAG;IACrB,yDAAyD;IACzD,yBAAyB,EAAE,uBAAuB;IAClD,mBAAmB,EAAE,kBAAkB;IACvC,YAAY,EAAE,kBAAkB;IAChC,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,0BAA0B,EAAE,6BAA6B;IACzD,wDAAwD;CACzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,+BAA+B,CAC7C,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,KAAK,UAAU,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG;QACjE,MAAM,OAAO,GACX,cAAc,CAAC,OAAO,CAAC,MAAqC,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC;gBACH,kEAAkE;gBAClE,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAChB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getChainIdHandler } from './chain-id';\nimport { getNetworkVersionHandler } from './net-version';\nimport { getProviderStateHandler } from './provider-state';\nimport { getSwitchEthereumChainHandler } from './switch-ethereum-chain';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n eth_chainId: getChainIdHandler,\n net_version: getNetworkVersionHandler,\n wallet_switchEthereumChain: getSwitchEthereumChainHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"net-version.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,wBAAwB,CAC5C,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IAEtB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAXD,4DAWC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for net_version that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getNetworkVersionHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '1';\n\n return end();\n}\n"]}
1
+ {"version":3,"file":"net-version.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,wBAAwB,CAC5C,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IAEtB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAXD,4DAWC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for net_version that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getNetworkVersionHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '1';\n\n return end();\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for net_version that always returns a specific
5
5
  * hardcoded result.
@@ -12,5 +12,5 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/uti
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
13
  * @returns The JSON-RPC response.
14
14
  */
15
- export declare function getNetworkVersionHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
15
+ export declare function getNetworkVersionHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
16
  //# sourceMappingURL=net-version.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"net-version.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
1
+ {"version":3,"file":"net-version.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for net_version that always returns a specific
5
5
  * hardcoded result.
@@ -12,5 +12,5 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/uti
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
13
  * @returns The JSON-RPC response.
14
14
  */
15
- export declare function getNetworkVersionHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
15
+ export declare function getNetworkVersionHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
16
  //# sourceMappingURL=net-version.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"net-version.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
1
+ {"version":3,"file":"net-version.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAO9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"net-version.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IAEtB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for net_version that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getNetworkVersionHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '1';\n\n return end();\n}\n"]}
1
+ {"version":3,"file":"net-version.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/net-version.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC;IAEtB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for net_version that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getNetworkVersionHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = '1';\n\n return end();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-state.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":";;;AAUA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAhBD,0DAgBC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
1
+ {"version":3,"file":"provider-state.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAhBD,0DAgBC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for metamask_getProviderState that always returns a specific
5
5
  * hardcoded result.
@@ -12,5 +12,5 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/uti
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
13
  * @returns The JSON-RPC response.
14
14
  */
15
- export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
15
+ export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
16
  //# sourceMappingURL=provider-state.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider-state.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
1
+ {"version":3,"file":"provider-state.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
@@ -1,5 +1,5 @@
1
1
  import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
- import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
3
  /**
4
4
  * A mock handler for metamask_getProviderState that always returns a specific
5
5
  * hardcoded result.
@@ -12,5 +12,5 @@ import type { Json, JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/uti
12
12
  * @param end - The `json-rpc-engine` middleware end handler.
13
13
  * @returns The JSON-RPC response.
14
14
  */
15
- export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse<Json>, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
15
+ export declare function getProviderStateHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
16
  //# sourceMappingURL=provider-state.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider-state.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,sBAAsB,EACvB,wBAAwB;AAEzB;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,CAAC,EACtC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
1
+ {"version":3,"file":"provider-state.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAY9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-state.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAsC,EACtC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
1
+ {"version":3,"file":"provider-state.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/provider-state.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,GAAG;QAChB,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The JSON-RPC response.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSwitchEthereumChainHandler = void 0;
4
+ /**
5
+ * A mock handler for the `wallet_switchEthereumChain` method that always
6
+ * returns `null`.
7
+ *
8
+ * @param _request - Incoming JSON-RPC request. This is ignored for this
9
+ * specific handler.
10
+ * @param response - The outgoing JSON-RPC response, modified to return the
11
+ * result.
12
+ * @param _next - The `json-rpc-engine` middleware next handler.
13
+ * @param end - The `json-rpc-engine` middleware end handler.
14
+ * @returns The response.
15
+ */
16
+ async function getSwitchEthereumChainHandler(_request, response, _next, end) {
17
+ response.result = null;
18
+ return end();
19
+ }
20
+ exports.getSwitchEthereumChainHandler = getSwitchEthereumChainHandler;
21
+ //# sourceMappingURL=switch-ethereum-chain.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-ethereum-chain.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/switch-ethereum-chain.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,6BAA6B,CACjD,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AARD,sEAQC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for the `wallet_switchEthereumChain` method that always\n * returns `null`.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The response.\n */\nexport async function getSwitchEthereumChainHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n response.result = null;\n return end();\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
+ /**
4
+ * A mock handler for the `wallet_switchEthereumChain` method that always
5
+ * returns `null`.
6
+ *
7
+ * @param _request - Incoming JSON-RPC request. This is ignored for this
8
+ * specific handler.
9
+ * @param response - The outgoing JSON-RPC response, modified to return the
10
+ * result.
11
+ * @param _next - The `json-rpc-engine` middleware next handler.
12
+ * @param end - The `json-rpc-engine` middleware end handler.
13
+ * @returns The response.
14
+ */
15
+ export declare function getSwitchEthereumChainHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
+ //# sourceMappingURL=switch-ethereum-chain.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-ethereum-chain.d.cts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/switch-ethereum-chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAI9B"}
@@ -0,0 +1,16 @@
1
+ import type { JsonRpcEngineEndCallback, JsonRpcEngineNextCallback } from "@metamask/json-rpc-engine";
2
+ import type { JsonRpcRequest, PendingJsonRpcResponse } from "@metamask/utils";
3
+ /**
4
+ * A mock handler for the `wallet_switchEthereumChain` method that always
5
+ * returns `null`.
6
+ *
7
+ * @param _request - Incoming JSON-RPC request. This is ignored for this
8
+ * specific handler.
9
+ * @param response - The outgoing JSON-RPC response, modified to return the
10
+ * result.
11
+ * @param _next - The `json-rpc-engine` middleware next handler.
12
+ * @param end - The `json-rpc-engine` middleware end handler.
13
+ * @returns The response.
14
+ */
15
+ export declare function getSwitchEthereumChainHandler(_request: JsonRpcRequest, response: PendingJsonRpcResponse, _next: JsonRpcEngineNextCallback, end: JsonRpcEngineEndCallback): Promise<void>;
16
+ //# sourceMappingURL=switch-ethereum-chain.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-ethereum-chain.d.mts","sourceRoot":"","sources":["../../../src/middleware/internal-methods/switch-ethereum-chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,kCAAkC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,wBAAwB;AAE9E;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,yBAAyB,EAChC,GAAG,EAAE,wBAAwB,iBAI9B"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A mock handler for the `wallet_switchEthereumChain` method that always
3
+ * returns `null`.
4
+ *
5
+ * @param _request - Incoming JSON-RPC request. This is ignored for this
6
+ * specific handler.
7
+ * @param response - The outgoing JSON-RPC response, modified to return the
8
+ * result.
9
+ * @param _next - The `json-rpc-engine` middleware next handler.
10
+ * @param end - The `json-rpc-engine` middleware end handler.
11
+ * @returns The response.
12
+ */
13
+ export async function getSwitchEthereumChainHandler(_request, response, _next, end) {
14
+ response.result = null;
15
+ return end();
16
+ }
17
+ //# sourceMappingURL=switch-ethereum-chain.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-ethereum-chain.mjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/switch-ethereum-chain.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for the `wallet_switchEthereumChain` method that always\n * returns `null`.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The response.\n */\nexport async function getSwitchEthereumChainHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n response.result = null;\n return end();\n}\n"]}
package/dist/options.cjs CHANGED
@@ -18,6 +18,7 @@ const SimulationOptionsStruct = (0, superstruct_1.object)({
18
18
  displayNftMedia: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.boolean)()), true),
19
19
  useNftDetection: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.boolean)()), true),
20
20
  useExternalPricingData: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.boolean)()), true),
21
+ showTestnets: (0, superstruct_1.defaulted)((0, superstruct_1.optional)((0, superstruct_1.boolean)()), true),
21
22
  });
22
23
  /**
23
24
  * Get the options for the simulation.
@@ -1 +1 @@
1
- {"version":3,"file":"options.cjs","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;AACA,uDAS+B;AAC/B,2CAA6C;AAE7C,+CAA4E;AAE5E,MAAM,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IACrC,QAAQ,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,4BAAgB,CAAC;IACzD,oBAAoB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,uBAAW,CAAC;IAChE,MAAM,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,0BAAc,CAAC;IACrD,KAAK,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACxE,gBAAgB,EAAE,IAAA,uBAAS,EACzB,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,EAChD,IAAI,CACL;IACD,YAAY,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,KAAK,CAAC;IACnD,iBAAiB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACvD,sBAAsB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IAC5D,iBAAiB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACvD,kBAAkB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACxD,eAAe,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACrD,eAAe,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACrD,sBAAsB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;CAC7D,CAAC,CAAC;AA4BH;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,OAA8B;IACvD,OAAO,IAAA,oBAAM,EACX,OAAO,EACP,uBAAuB,CACW,CAAC;AACvC,CAAC;AALD,gCAKC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n boolean,\n create,\n defaulted,\n nullable,\n object,\n optional,\n record,\n string,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { DEFAULT_CURRENCY, DEFAULT_LOCALE, DEFAULT_SRP } from './constants';\n\nconst SimulationOptionsStruct = object({\n currency: defaulted(optional(string()), DEFAULT_CURRENCY),\n secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),\n locale: defaulted(optional(string()), DEFAULT_LOCALE),\n state: defaulted(optional(nullable(record(string(), JsonStruct))), null),\n unencryptedState: defaulted(\n optional(nullable(record(string(), JsonStruct))),\n null,\n ),\n hideBalances: defaulted(optional(boolean()), false),\n useSecurityAlerts: defaulted(optional(boolean()), true),\n simulateOnChainActions: defaulted(optional(boolean()), true),\n useTokenDetection: defaulted(optional(boolean()), true),\n batchCheckBalances: defaulted(optional(boolean()), true),\n displayNftMedia: defaulted(optional(boolean()), true),\n useNftDetection: defaulted(optional(boolean()), true),\n useExternalPricingData: defaulted(optional(boolean()), true),\n});\n\n/**\n * Options for the simulation.\n *\n * @property currency - The currency to use. Defaults to `usd`.\n * @property secretRecoveryPhrase - The secret recovery phrase to use. This is\n * used to derive addresses and private keys. Defaults to a test recovery\n * phrase.\n * @property locale - The locale to use. Defaults to `en`.\n * @property state - The initial state of the Snap, if any. Defaults to `null`.\n * @property useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @property simulateOnChainActions - Whether to simulate transactions and signatures.\n * @property useTokenDetection - Whether to auto-detect tokens.\n * @property batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @property displayNftMedia - Whether to display NFT media.\n * @property useNftDetection - Whether to auto-detect NFTs.\n * @property useExternalPricingData - Whether to get token price data from an external source.\n */\nexport type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;\n\n/**\n * Options for the simulation, with defaults filled in.\n *\n * See {@link SimulationUserOptions} for documentation.\n */\nexport type SimulationOptions = Required<SimulationUserOptions>;\n\n/**\n * Get the options for the simulation.\n *\n * @param options - The user options. Any options not specified will be filled\n * in with default values.\n * @returns The simulation options.\n */\nexport function getOptions(options: SimulationUserOptions): SimulationOptions {\n return create(\n options,\n SimulationOptionsStruct,\n ) as Required<SimulationUserOptions>;\n}\n"]}
1
+ {"version":3,"file":"options.cjs","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;AACA,uDAS+B;AAC/B,2CAA6C;AAE7C,+CAA4E;AAE5E,MAAM,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IACrC,QAAQ,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,4BAAgB,CAAC;IACzD,oBAAoB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,uBAAW,CAAC;IAChE,MAAM,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC,EAAE,0BAAc,CAAC;IACrD,KAAK,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACxE,gBAAgB,EAAE,IAAA,uBAAS,EACzB,IAAA,sBAAQ,EAAC,IAAA,sBAAQ,EAAC,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,EAChD,IAAI,CACL;IACD,YAAY,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,KAAK,CAAC;IACnD,iBAAiB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACvD,sBAAsB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IAC5D,iBAAiB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACvD,kBAAkB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACxD,eAAe,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACrD,eAAe,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IACrD,sBAAsB,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;IAC5D,YAAY,EAAE,IAAA,uBAAS,EAAC,IAAA,sBAAQ,EAAC,IAAA,qBAAO,GAAE,CAAC,EAAE,IAAI,CAAC;CACnD,CAAC,CAAC;AA6BH;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,OAA8B;IACvD,OAAO,IAAA,oBAAM,EACX,OAAO,EACP,uBAAuB,CACW,CAAC;AACvC,CAAC;AALD,gCAKC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n boolean,\n create,\n defaulted,\n nullable,\n object,\n optional,\n record,\n string,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { DEFAULT_CURRENCY, DEFAULT_LOCALE, DEFAULT_SRP } from './constants';\n\nconst SimulationOptionsStruct = object({\n currency: defaulted(optional(string()), DEFAULT_CURRENCY),\n secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),\n locale: defaulted(optional(string()), DEFAULT_LOCALE),\n state: defaulted(optional(nullable(record(string(), JsonStruct))), null),\n unencryptedState: defaulted(\n optional(nullable(record(string(), JsonStruct))),\n null,\n ),\n hideBalances: defaulted(optional(boolean()), false),\n useSecurityAlerts: defaulted(optional(boolean()), true),\n simulateOnChainActions: defaulted(optional(boolean()), true),\n useTokenDetection: defaulted(optional(boolean()), true),\n batchCheckBalances: defaulted(optional(boolean()), true),\n displayNftMedia: defaulted(optional(boolean()), true),\n useNftDetection: defaulted(optional(boolean()), true),\n useExternalPricingData: defaulted(optional(boolean()), true),\n showTestnets: defaulted(optional(boolean()), true),\n});\n\n/**\n * Options for the simulation.\n *\n * @property currency - The currency to use. Defaults to `usd`.\n * @property secretRecoveryPhrase - The secret recovery phrase to use. This is\n * used to derive addresses and private keys. Defaults to a test recovery\n * phrase.\n * @property locale - The locale to use. Defaults to `en`.\n * @property state - The initial state of the Snap, if any. Defaults to `null`.\n * @property useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @property simulateOnChainActions - Whether to simulate transactions and signatures.\n * @property useTokenDetection - Whether to auto-detect tokens.\n * @property batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @property displayNftMedia - Whether to display NFT media.\n * @property useNftDetection - Whether to auto-detect NFTs.\n * @property useExternalPricingData - Whether to get token price data from an external source.\n * @property showTestnets - Whether to show testnets.\n */\nexport type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;\n\n/**\n * Options for the simulation, with defaults filled in.\n *\n * See {@link SimulationUserOptions} for documentation.\n */\nexport type SimulationOptions = Required<SimulationUserOptions>;\n\n/**\n * Get the options for the simulation.\n *\n * @param options - The user options. Any options not specified will be filled\n * in with default values.\n * @returns The simulation options.\n */\nexport function getOptions(options: SimulationUserOptions): SimulationOptions {\n return create(\n options,\n SimulationOptionsStruct,\n ) as Required<SimulationUserOptions>;\n}\n"]}
@@ -13,6 +13,7 @@ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
13
13
  displayNftMedia?: boolean | undefined;
14
14
  useNftDetection?: boolean | undefined;
15
15
  useExternalPricingData?: boolean | undefined;
16
+ showTestnets?: boolean | undefined;
16
17
  }, {
17
18
  currency: import("@metamask/superstruct").Struct<string | undefined, null>;
18
19
  secretRecoveryPhrase: import("@metamask/superstruct").Struct<string | undefined, null>;
@@ -27,6 +28,7 @@ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
27
28
  displayNftMedia: import("@metamask/superstruct").Struct<boolean | undefined, null>;
28
29
  useNftDetection: import("@metamask/superstruct").Struct<boolean | undefined, null>;
29
30
  useExternalPricingData: import("@metamask/superstruct").Struct<boolean | undefined, null>;
31
+ showTestnets: import("@metamask/superstruct").Struct<boolean | undefined, null>;
30
32
  }>;
31
33
  /**
32
34
  * Options for the simulation.
@@ -44,6 +46,7 @@ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
44
46
  * @property displayNftMedia - Whether to display NFT media.
45
47
  * @property useNftDetection - Whether to auto-detect NFTs.
46
48
  * @property useExternalPricingData - Whether to get token price data from an external source.
49
+ * @property showTestnets - Whether to show testnets.
47
50
  */
48
51
  export type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;
49
52
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.cts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3B,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAK5E"}
1
+ {"version":3,"file":"options.d.cts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB3B,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAK5E"}
@@ -13,6 +13,7 @@ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
13
13
  displayNftMedia?: boolean | undefined;
14
14
  useNftDetection?: boolean | undefined;
15
15
  useExternalPricingData?: boolean | undefined;
16
+ showTestnets?: boolean | undefined;
16
17
  }, {
17
18
  currency: import("@metamask/superstruct").Struct<string | undefined, null>;
18
19
  secretRecoveryPhrase: import("@metamask/superstruct").Struct<string | undefined, null>;
@@ -27,6 +28,7 @@ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
27
28
  displayNftMedia: import("@metamask/superstruct").Struct<boolean | undefined, null>;
28
29
  useNftDetection: import("@metamask/superstruct").Struct<boolean | undefined, null>;
29
30
  useExternalPricingData: import("@metamask/superstruct").Struct<boolean | undefined, null>;
31
+ showTestnets: import("@metamask/superstruct").Struct<boolean | undefined, null>;
30
32
  }>;
31
33
  /**
32
34
  * Options for the simulation.
@@ -44,6 +46,7 @@ declare const SimulationOptionsStruct: import("@metamask/superstruct").Struct<{
44
46
  * @property displayNftMedia - Whether to display NFT media.
45
47
  * @property useNftDetection - Whether to auto-detect NFTs.
46
48
  * @property useExternalPricingData - Whether to get token price data from an external source.
49
+ * @property showTestnets - Whether to show testnets.
47
50
  */
48
51
  export type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;
49
52
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.mts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3B,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAK5E"}
1
+ {"version":3,"file":"options.d.mts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB3B,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AAEhE;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAK5E"}
package/dist/options.mjs CHANGED
@@ -15,6 +15,7 @@ const SimulationOptionsStruct = object({
15
15
  displayNftMedia: defaulted(optional(boolean()), true),
16
16
  useNftDetection: defaulted(optional(boolean()), true),
17
17
  useExternalPricingData: defaulted(optional(boolean()), true),
18
+ showTestnets: defaulted(optional(boolean()), true),
18
19
  });
19
20
  /**
20
21
  * Get the options for the simulation.
@@ -1 +1 @@
1
- {"version":3,"file":"options.mjs","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACP,8BAA8B;AAC/B,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAoB;AAE5E,MAAM,uBAAuB,GAAG,MAAM,CAAC;IACrC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACzD,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,WAAW,CAAC;IAChE,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC;IACrD,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACxE,gBAAgB,EAAE,SAAS,CACzB,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EAChD,IAAI,CACL;IACD,YAAY,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC;IACnD,iBAAiB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACvD,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IAC5D,iBAAiB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACvD,kBAAkB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACxD,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACrD,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACrD,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;CAC7D,CAAC,CAAC;AA4BH;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,OAA8B;IACvD,OAAO,MAAM,CACX,OAAO,EACP,uBAAuB,CACW,CAAC;AACvC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n boolean,\n create,\n defaulted,\n nullable,\n object,\n optional,\n record,\n string,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { DEFAULT_CURRENCY, DEFAULT_LOCALE, DEFAULT_SRP } from './constants';\n\nconst SimulationOptionsStruct = object({\n currency: defaulted(optional(string()), DEFAULT_CURRENCY),\n secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),\n locale: defaulted(optional(string()), DEFAULT_LOCALE),\n state: defaulted(optional(nullable(record(string(), JsonStruct))), null),\n unencryptedState: defaulted(\n optional(nullable(record(string(), JsonStruct))),\n null,\n ),\n hideBalances: defaulted(optional(boolean()), false),\n useSecurityAlerts: defaulted(optional(boolean()), true),\n simulateOnChainActions: defaulted(optional(boolean()), true),\n useTokenDetection: defaulted(optional(boolean()), true),\n batchCheckBalances: defaulted(optional(boolean()), true),\n displayNftMedia: defaulted(optional(boolean()), true),\n useNftDetection: defaulted(optional(boolean()), true),\n useExternalPricingData: defaulted(optional(boolean()), true),\n});\n\n/**\n * Options for the simulation.\n *\n * @property currency - The currency to use. Defaults to `usd`.\n * @property secretRecoveryPhrase - The secret recovery phrase to use. This is\n * used to derive addresses and private keys. Defaults to a test recovery\n * phrase.\n * @property locale - The locale to use. Defaults to `en`.\n * @property state - The initial state of the Snap, if any. Defaults to `null`.\n * @property useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @property simulateOnChainActions - Whether to simulate transactions and signatures.\n * @property useTokenDetection - Whether to auto-detect tokens.\n * @property batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @property displayNftMedia - Whether to display NFT media.\n * @property useNftDetection - Whether to auto-detect NFTs.\n * @property useExternalPricingData - Whether to get token price data from an external source.\n */\nexport type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;\n\n/**\n * Options for the simulation, with defaults filled in.\n *\n * See {@link SimulationUserOptions} for documentation.\n */\nexport type SimulationOptions = Required<SimulationUserOptions>;\n\n/**\n * Get the options for the simulation.\n *\n * @param options - The user options. Any options not specified will be filled\n * in with default values.\n * @returns The simulation options.\n */\nexport function getOptions(options: SimulationUserOptions): SimulationOptions {\n return create(\n options,\n SimulationOptionsStruct,\n ) as Required<SimulationUserOptions>;\n}\n"]}
1
+ {"version":3,"file":"options.mjs","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACP,8BAA8B;AAC/B,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,wBAAoB;AAE5E,MAAM,uBAAuB,GAAG,MAAM,CAAC;IACrC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACzD,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,WAAW,CAAC;IAChE,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC;IACrD,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACxE,gBAAgB,EAAE,SAAS,CACzB,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,EAChD,IAAI,CACL;IACD,YAAY,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC;IACnD,iBAAiB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACvD,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IAC5D,iBAAiB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACvD,kBAAkB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACxD,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACrD,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IACrD,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;IAC5D,YAAY,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC;CACnD,CAAC,CAAC;AA6BH;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,OAA8B;IACvD,OAAO,MAAM,CACX,OAAO,EACP,uBAAuB,CACW,CAAC;AACvC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n boolean,\n create,\n defaulted,\n nullable,\n object,\n optional,\n record,\n string,\n} from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { DEFAULT_CURRENCY, DEFAULT_LOCALE, DEFAULT_SRP } from './constants';\n\nconst SimulationOptionsStruct = object({\n currency: defaulted(optional(string()), DEFAULT_CURRENCY),\n secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),\n locale: defaulted(optional(string()), DEFAULT_LOCALE),\n state: defaulted(optional(nullable(record(string(), JsonStruct))), null),\n unencryptedState: defaulted(\n optional(nullable(record(string(), JsonStruct))),\n null,\n ),\n hideBalances: defaulted(optional(boolean()), false),\n useSecurityAlerts: defaulted(optional(boolean()), true),\n simulateOnChainActions: defaulted(optional(boolean()), true),\n useTokenDetection: defaulted(optional(boolean()), true),\n batchCheckBalances: defaulted(optional(boolean()), true),\n displayNftMedia: defaulted(optional(boolean()), true),\n useNftDetection: defaulted(optional(boolean()), true),\n useExternalPricingData: defaulted(optional(boolean()), true),\n showTestnets: defaulted(optional(boolean()), true),\n});\n\n/**\n * Options for the simulation.\n *\n * @property currency - The currency to use. Defaults to `usd`.\n * @property secretRecoveryPhrase - The secret recovery phrase to use. This is\n * used to derive addresses and private keys. Defaults to a test recovery\n * phrase.\n * @property locale - The locale to use. Defaults to `en`.\n * @property state - The initial state of the Snap, if any. Defaults to `null`.\n * @property useSecurityAlerts - Whether to run transactions and signatures through security providers.\n * @property simulateOnChainActions - Whether to simulate transactions and signatures.\n * @property useTokenDetection - Whether to auto-detect tokens.\n * @property batchCheckBalances - Whether to fetch balances in an aggregated manner.\n * @property displayNftMedia - Whether to display NFT media.\n * @property useNftDetection - Whether to auto-detect NFTs.\n * @property useExternalPricingData - Whether to get token price data from an external source.\n * @property showTestnets - Whether to show testnets.\n */\nexport type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;\n\n/**\n * Options for the simulation, with defaults filled in.\n *\n * See {@link SimulationUserOptions} for documentation.\n */\nexport type SimulationOptions = Required<SimulationUserOptions>;\n\n/**\n * Get the options for the simulation.\n *\n * @param options - The user options. Any options not specified will be filled\n * in with default values.\n * @returns The simulation options.\n */\nexport function getOptions(options: SimulationUserOptions): SimulationOptions {\n return create(\n options,\n SimulationOptionsStruct,\n ) as Required<SimulationUserOptions>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-simulation",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -55,20 +55,20 @@
55
55
  "test:watch": "jest --watch"
56
56
  },
57
57
  "dependencies": {
58
- "@metamask/base-controller": "^8.0.0",
59
- "@metamask/eth-json-rpc-middleware": "^16.0.1",
58
+ "@metamask/base-controller": "^8.0.1",
59
+ "@metamask/eth-json-rpc-middleware": "^17.0.0",
60
60
  "@metamask/json-rpc-engine": "^10.0.2",
61
61
  "@metamask/json-rpc-middleware-stream": "^8.0.7",
62
62
  "@metamask/key-tree": "^10.1.1",
63
63
  "@metamask/permission-controller": "^11.0.6",
64
- "@metamask/phishing-controller": "^12.4.1",
65
- "@metamask/snaps-controllers": "^11.2.1",
66
- "@metamask/snaps-execution-environments": "^7.2.1",
67
- "@metamask/snaps-rpc-methods": "^12.1.0",
68
- "@metamask/snaps-sdk": "^6.22.0",
69
- "@metamask/snaps-utils": "^9.2.0",
64
+ "@metamask/phishing-controller": "^12.5.0",
65
+ "@metamask/snaps-controllers": "^12.1.0",
66
+ "@metamask/snaps-execution-environments": "^8.1.0",
67
+ "@metamask/snaps-rpc-methods": "^12.3.0",
68
+ "@metamask/snaps-sdk": "^6.24.0",
69
+ "@metamask/snaps-utils": "^9.3.0",
70
70
  "@metamask/superstruct": "^3.2.1",
71
- "@metamask/utils": "^11.2.0",
71
+ "@metamask/utils": "^11.4.0",
72
72
  "@reduxjs/toolkit": "^1.9.5",
73
73
  "fast-deep-equal": "^3.1.3",
74
74
  "mime": "^3.0.0",
@@ -76,17 +76,17 @@
76
76
  "redux-saga": "^1.2.3"
77
77
  },
78
78
  "devDependencies": {
79
- "@lavamoat/allow-scripts": "^3.0.4",
80
- "@metamask/auto-changelog": "^5.0.1",
79
+ "@lavamoat/allow-scripts": "^3.3.3",
80
+ "@metamask/auto-changelog": "^5.0.2",
81
81
  "@ts-bridge/cli": "^0.6.1",
82
- "@types/express": "^4.17.17",
82
+ "@types/express": "^5.0.1",
83
83
  "@types/jest": "^27.5.1",
84
84
  "@types/mime": "^3.0.0",
85
85
  "@types/readable-stream": "^4.0.15",
86
86
  "deepmerge": "^4.2.2",
87
87
  "depcheck": "^1.4.7",
88
88
  "eslint": "^9.11.0",
89
- "express": "^4.21.2",
89
+ "express": "^5.1.0",
90
90
  "jest": "^29.0.2",
91
91
  "jest-it-up": "^2.0.0",
92
92
  "jest-silent-reporter": "^0.6.0",