Skip to content
Merged
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
7 changes: 1 addition & 6 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1519,12 +1519,7 @@
},
"packages/perps-controller/src/PerpsController.ts": {
"no-restricted-syntax": {
"count": 3
}
},
"packages/perps-controller/src/services/HyperLiquidSubscriptionService.ts": {
"@typescript-eslint/no-unused-vars": {
"count": 1
"count": 2
}
},
"packages/perps-controller/src/utils/myxAdapter.ts": {
Expand Down
4 changes: 4 additions & 0 deletions packages/perps-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Invalid parameters are rejected with a typed `PERPS_ERROR_CODES` value, and nothing invalid is ever signed; see the new error codes entry below for the full list and for which few are decided after a read rather than before any request.
- Add `twap`, `scale` and `chase` to `PERPS_EVENT_VALUE.ORDER_TYPE`, which dashboards key on and which `TradingService` emits verbatim ([#9832](https://github.com/MetaMask/core/pull/9832))
- Add the `StrategyOrderType` and `OrdinaryOrderType` types, plus `STRATEGY_ORDER_TYPES`, `isStrategyOrderType`, `SCALE_ORDER_COUNT`, `computeScalePriceLadder`, `splitScaleSizes`, `computeChaseQuotePrice`, `getPriceTick`, `CHASE_ORDER_CONFIG`, and `HYPERLIQUID_TWAP_LIMITS` ([#9832](https://github.com/MetaMask/core/pull/9832))
- Add an optional schema-v2 Terminal market snapshot path with strict identity, freshness, completeness, unit, and payload validation before falling back to HyperLiquid ([#9815](https://github.com/MetaMask/core/pull/9815)).
- Add `PerpsController.getUserDataSnapshot()` to fetch and cache positions, open orders, and account state as one account- and DEX-scoped result ([#9815](https://github.com/MetaMask/core/pull/9815)).

### Changed

Expand All @@ -55,6 +57,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `isLimitExecutionOrderType` is unchanged: it answers the narrower question of whether `OrderParams.price` carries a real limit price, which for a strategy placement it does not.
- `TriggerOrderType` is now spelled out as `'stop_market' | 'stop_limit' | 'take_profit_market' | 'take_profit_limit'` instead of being derived as `Exclude<OrderType, 'market' | 'limit'>` ([#9832](https://github.com/MetaMask/core/pull/9832))
- The resolved type is unchanged for existing consumers. Deriving it meant that any order type added to `OrderType` that was neither `market` nor `limit` was pulled into the trigger union automatically and started demanding a trigger price it had no concept of.
- Reuse provider DEX discovery for subscriptions, and start account preloading independently from market preloading to reduce cold-start blocking ([#9815](https://github.com/MetaMask/core/pull/9815)).
- Require a selected EVM address and the current Hyperliquid network/HIP-3/DEX identity before returning cached account data; legacy or mismatched entries now fail closed and refresh ([#9815](https://github.com/MetaMask/core/pull/9815)).

## [11.0.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ export type PerpsControllerGetCachedUserDataForActiveProviderAction = {
handler: PerpsController['getCachedUserDataForActiveProvider'];
};

/**
* Fetch, validate, and atomically cache a complete user-data snapshot.
* This remains callable after mount so consumers can seed their live channel
* from one coherent positions/orders/account result.
*
* @returns The accepted user-data snapshot.
*/
export type PerpsControllerGetUserDataSnapshotAction = {
type: `PerpsController:getUserDataSnapshot`;
handler: PerpsController['getUserDataSnapshot'];
};

/**
* Initialize the PerpsController providers
* Must be called before using any other methods
Expand Down Expand Up @@ -1123,6 +1135,7 @@ export type PerpsControllerIsCurrentlyReinitializingAction = {
export type PerpsControllerMethodActions =
| PerpsControllerGetCachedMarketDataForActiveProviderAction
| PerpsControllerGetCachedUserDataForActiveProviderAction
| PerpsControllerGetUserDataSnapshotAction
| PerpsControllerInitAction
| PerpsControllerGetActiveProviderAction
| PerpsControllerGetActiveProviderOrNullAction
Expand Down
Loading