@metamask-previews/perps-controller 1.2.0-preview-45f35b773 → 1.2.0-preview-e0f8f1907
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/dist/PerpsController.cjs
CHANGED
|
@@ -2835,20 +2835,27 @@ async function _PerpsController_performInitialization() {
|
|
|
2835
2835
|
messenger: this.messenger,
|
|
2836
2836
|
});
|
|
2837
2837
|
this.providers.set('hyperliquid', hyperLiquidProvider);
|
|
2838
|
-
// Register MYX provider if enabled via feature flag
|
|
2838
|
+
// Register MYX provider if enabled via feature flag.
|
|
2839
2839
|
// Uses dynamic import so @myx-trade/sdk is excluded from the bundle
|
|
2840
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.
|
|
2841
2843
|
const isMYXEnabled = __classPrivateFieldGet(this, _PerpsController_instances, "m", _PerpsController_isMYXProviderEnabled).call(this);
|
|
2842
2844
|
if (isMYXEnabled) {
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
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
|
+
}
|
|
2852
2859
|
}
|
|
2853
2860
|
// Set up active provider based on activeProvider value in state
|
|
2854
2861
|
// 'aggregated' is treated as just another provider that wraps others
|