Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/perps-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump `@metamask/controller-utils` from `^11.19.0` to `^11.20.0` ([#8344](https://github.com/MetaMask/core/pull/8344))
- Bump `@metamask/messenger` from `^1.0.0` to `^1.1.0` ([#8364](https://github.com/MetaMask/core/pull/8364))

### Removed

- **BREAKING:** Remove `adaptMarketFromMYX`, `adaptPriceFromMYX`, `adaptMarketDataFromMYX`, `filterMYXExclusiveMarkets`, `isOverlappingMarket`, `buildPoolSymbolMap`, `buildSymbolPoolsMap`, and `extractSymbolFromPoolId` from the public package exports to prevent `@myx-trade/sdk` from being included in the static webpack bundle ([#8374](https://github.com/MetaMask/core/pull/8374))
- These functions are still used internally by `MYXProvider`, which is loaded via dynamic import
- Consumers that imported these utilities directly should instead import from `@metamask/perps-controller/src/utils/myxAdapter` or duplicate the logic locally

### Fixed

- Fix incorrect fee estimate when flipping a position ([#8333](https://github.com/MetaMask/core/pull/8333))
Expand Down
4 changes: 3 additions & 1 deletion packages/perps-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@metamask/controller-utils": "^11.20.0",
"@metamask/messenger": "^1.1.0",
"@metamask/utils": "^11.9.0",
"@myx-trade/sdk": "^0.1.265",
"@nktkas/hyperliquid": "^0.30.2",
"bignumber.js": "^9.1.2",
"reselect": "^5.1.1",
Expand All @@ -83,6 +82,9 @@
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
},
"optionalDependencies": {
"@myx-trade/sdk": "^0.1.265"
},
"engines": {
"node": "^18.18 || >=20"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/perps-controller/src/PerpsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,9 @@ export class PerpsController extends BaseController<
// IMPORTANT: Must use import() — NOT require() — for core/extension tree-shaking.
// require() is synchronous and bundlers include it in the main bundle.
// import() enables true code splitting so MYX is excluded when not enabled.
this.#myxRegistrationPromise = import('./providers/MYXProvider')
this.#myxRegistrationPromise = import(
/* webpackIgnore: true */ './providers/MYXProvider'
)
.then(({ MYXProvider }) => {
this.registerMYXProvider(MYXProvider);
return undefined;
Expand Down
10 changes: 0 additions & 10 deletions packages/perps-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,6 @@ export {
formatChange,
} from './utils';
export type { HyperLiquidMarketData } from './utils';
export {
adaptMarketFromMYX,
adaptPriceFromMYX,
adaptMarketDataFromMYX,
filterMYXExclusiveMarkets,
isOverlappingMarket,
buildPoolSymbolMap,
buildSymbolPoolsMap,
extractSymbolFromPoolId,
} from './utils';
export {
MAX_MARKET_PATTERN_LENGTH,
escapeRegex,
Expand Down
1 change: 0 additions & 1 deletion packages/perps-controller/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export * from './hyperLiquidOrderBookProcessor';
export * from './hyperLiquidValidation';
export * from './idUtils';
export * from './marketDataTransform';
export * from './myxAdapter';
export * from './marketUtils';
export * from './orderCalculations';
export * from './rewardsUtils';
Expand Down
3 changes: 3 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4791,6 +4791,9 @@ __metadata:
typedoc-plugin-missing-exports: "npm:^2.0.0"
typescript: "npm:~5.3.3"
uuid: "npm:^8.3.2"
dependenciesMeta:
"@myx-trade/sdk":
optional: true
languageName: unknown
linkType: soft

Expand Down
Loading