@metamask-previews/perps-controller 1.2.0-preview-91888a29f → 1.2.0-preview-0b8553c95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,12 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Changed
11
-
12
- - Exclude `@myx-trade/sdk` from build output by default, reducing bundled size by ~57% ([#8234](https://github.com/MetaMask/core/pull/8234))
13
- - MYX provider files are stripped from `dist/` unless `MM_PERPS_MYX_PROVIDER_ENABLED=true` is set at build time
14
- - Static import of `MYXProvider` replaced with dynamic `import()` to break the eager dependency chain
15
-
16
10
  ## [1.2.0]
17
11
 
18
12
  ### Added
@@ -24,6 +24,7 @@ const perpsConfig_1 = require("./constants/perpsConfig.cjs");
24
24
  const perpsErrorCodes_1 = require("./perpsErrorCodes.cjs");
25
25
  const AggregatedPerpsProvider_1 = require("./providers/AggregatedPerpsProvider.cjs");
26
26
  const HyperLiquidProvider_1 = require("./providers/HyperLiquidProvider.cjs");
27
+ const MYXProvider_1 = require("./providers/MYXProvider.cjs");
27
28
  const AccountService_1 = require("./services/AccountService.cjs");
28
29
  const DataLakeService_1 = require("./services/DataLakeService.cjs");
29
30
  const DepositService_1 = require("./services/DepositService.cjs");
@@ -2835,27 +2836,17 @@ async function _PerpsController_performInitialization() {
2835
2836
  messenger: this.messenger,
2836
2837
  });
2837
2838
  this.providers.set('hyperliquid', hyperLiquidProvider);
2838
- // Register MYX provider if enabled via feature flag.
2839
- // Uses dynamic import so @myx-trade/sdk is excluded from the bundle
2840
- // unless MM_PERPS_MYX_PROVIDER_ENABLED=true is set at build time.
2841
- // Wrapped in try/catch so a missing module (stripped at build time)
2842
- // only skips MYX registration instead of aborting initialization.
2839
+ // Register MYX provider if enabled via feature flag
2843
2840
  const isMYXEnabled = __classPrivateFieldGet(this, _PerpsController_instances, "m", _PerpsController_isMYXProviderEnabled).call(this);
2844
2841
  if (isMYXEnabled) {
2845
- try {
2846
- const { MYXProvider } = await import("./providers/MYXProvider.cjs");
2847
- const myxProvider = new MYXProvider({
2848
- isTestnet: perpsConfig_1.PROVIDER_CONFIG.MYX_TESTNET_ONLY || this.state.isTestnet,
2849
- platformDependencies: __classPrivateFieldGet(this, _PerpsController_options, "f").infrastructure,
2850
- });
2851
- this.providers.set('myx', myxProvider);
2852
- __classPrivateFieldGet(this, _PerpsController_instances, "m", _PerpsController_debugLog).call(this, 'PerpsController: MYX provider registered', {
2853
- isTestnet: perpsConfig_1.PROVIDER_CONFIG.MYX_TESTNET_ONLY || this.state.isTestnet,
2854
- });
2855
- }
2856
- catch {
2857
- __classPrivateFieldGet(this, _PerpsController_instances, "m", _PerpsController_debugLog).call(this, 'PerpsController: MYX provider module not available (stripped from build), skipping registration');
2858
- }
2842
+ const myxProvider = new MYXProvider_1.MYXProvider({
2843
+ isTestnet: perpsConfig_1.PROVIDER_CONFIG.MYX_TESTNET_ONLY || this.state.isTestnet,
2844
+ platformDependencies: __classPrivateFieldGet(this, _PerpsController_options, "f").infrastructure,
2845
+ });
2846
+ this.providers.set('myx', myxProvider);
2847
+ __classPrivateFieldGet(this, _PerpsController_instances, "m", _PerpsController_debugLog).call(this, 'PerpsController: MYX provider registered', {
2848
+ isTestnet: perpsConfig_1.PROVIDER_CONFIG.MYX_TESTNET_ONLY || this.state.isTestnet,
2849
+ });
2859
2850
  }
2860
2851
  // Set up active provider based on activeProvider value in state
2861
2852
  // 'aggregated' is treated as just another provider that wraps others