@metamask-previews/perps-controller 19.0.0-preview-8cc0f94 → 20.0.0-preview-daf00d2
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 +55 -70
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,50 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
- Add `reconcileChaseOrderCancellation` to the controller, messenger and optional provider contract. Lighter reconciles an already attempted cancellation under its exact original owner, handle, child and transaction identity with local settlement writes but no new financial dispatch, even if acknowledgement becomes failure while the child remains open. Missing, malformed or stale original ownership rejects; unknown outcomes remain unresolved. Aggregated mode routes only the explicit provider and unsupported providers never fall back to ordinary cancellation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
13
|
-
|
|
14
|
-
- Export `LIGHTER_SCALE_SETTLEMENT_WINDOW_MS`, `LIGHTER_SCALE_SETTLEMENT_POLL_MS`, `LIGHTER_CHASE_CANCEL_SETTLEMENT_WINDOW_MS` and `LIGHTER_CHASE_CANCEL_SETTLEMENT_POLL_MS` through the `constants` and `constants/lighterConfig` package entrypoints for shared settlement policy ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
15
|
-
|
|
16
|
-
- Support explicit independent Lighter partial TP/SL pairs, including captured full-position siblings, through cancellation-first durable per-leg dispatch. Expose supported pair linkages and role-bound protection receipts without changing native OCO defaults ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
17
|
-
|
|
18
|
-
- Support explicit Lighter `marginMode` selections with required leverage, authoritative position/order locks and exact mode transaction execution before dependent exposure. Ready active perpetual capabilities report both native modes ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
19
|
-
- Add `getChaseOrderOwnership({handle, providerId, owner?})` to the controller, messenger and optional provider contract. Lighter returns validated durable local history for every exact child under its original wallet/network/account/key owner, including superseded and unresolved attempts, without signing, transport, automatic continuation or durable writes. Missing handles and owner mismatches return unavailable; corrupt storage rejects. Aggregated mode routes one explicit provider; providers without durable history return unsupported. Existing Chase and disabled TWAP behavior remain unchanged ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
20
|
-
|
|
21
|
-
- Add the default-off testnet-only `chaseTestnetProbe` constructor option to `LighterProvider` for bounded, durable native Chase cancel/replace. Production strategy capabilities remain unavailable ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
22
|
-
- Implement Lighter `getChaseOrders`, `suspendChaseOrders` and `cancelOrder` with `orderType: 'chase'`. Unbound or recordless absent accounts return empty management state; absent venue discovery retains remembered wallet/network cleanup obligations without signing authority. Confirmed cancel-on-stop reports `canceled`; native records retain the first `stopReason` and uncertain cleanup remains `termination_pending` ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
23
|
-
- Expose `LIGHTER_MAX_CLIENT_ORDER_INDEX`, `LIGHTER_NATIVE_PROBE_MAX_NOTIONAL` and `LIGHTER_CHASE_*` bounds/defaults through `constants/lighterConfig` for shared native identity and Chase policy validation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
24
|
-
- Expose `utils/lighterChase.readLighterChaseQuote`, `reconcileLighterChaseChild` and `identifyLighterChaseChild` for native quotes, exact fill accounting and immutable child validation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
25
|
-
- Reconcile failed or expired never-landed Chase transactions without releasing uncertain ownership. Keep accepted orders active through indexer lag, use absolute duration deadlines, and interrupt replacements synchronously when cancellation is requested. Retain TWAP exclusion when expired-placement order evidence is incomplete. Fence starts waiting on preparation, signer readiness or the account mutex when suspension occurs; preserve duration cleanup after a wrong-symbol cancellation. Report confirmed explicit cleanup independently of an earlier failed stop cause, and keep basis-point conversion independent of policy limits ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
26
|
-
|
|
27
|
-
- Support native Lighter same-order price and size edits for verified unfilled ordinary perpetual limits. Add `OrderResult.orderEdit` and `OrderEditObservation` for durable pending, settled, failed and terminal outcomes; acceptance alone is pending. Export the seven-argument `LighterSignModifyOrderWireParams` bridge contract. Trigger, strategy and protection children remain unsupported ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
28
|
-
- Preserve attached exact-failure settlement across review and nonce-ledger retries. Explicit attached review can settle fresh complete exact-leg acceptance into an acknowledgeable recovered outcome when the transaction hash is absent and its nonce advanced; saved IDs alone remain insufficient. Bound history by preparation time and page/row budgets, reporting optional `AttachedOrderGroup.historyStatus` for incomplete reviews ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
29
|
-
- Expose `OrderResult.attachedOrderGroup`, `AttachedOrderGroup`, `ReadyPerpsOrderCapabilities.attachedTpsl`, optional provider `getAttachedOrderGroups`/`reviewAttachedOrderGroups`, and controller messenger actions `PerpsControllerGetAttachedOrderGroupsAction`/`PerpsControllerReviewAttachedOrderGroupsAction`. The group submission union includes `completed` for exactly correlated terminal legs ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
30
|
-
- Export `LIGHTER_MAX_WIRE_PRICE`, `LIGHTER_GROUPING_ONE_TRIGGERS_THE_OTHER` and `LIGHTER_GROUPING_ONE_TRIGGERS_OCO` through `constants` and `constants/lighterConfig`. The public `utils/lighterAttachedOrders` subpath exposes `LighterAttachedGroup`, `parseLighterAttachedGroups`, `correlateLighterAttachedOrders`, `toAttachedOrderGroup`, `LIGHTER_ATTACHED_MAX_GROUPS` and `LIGHTER_ATTACHED_HANDLE_PREFIX` ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
31
|
-
- Add optional `OrderParams.expectedScaleLadder` and exported `ExpectedScaleLadder` to bind Lighter Scale placement to approved prices, quantities, totals, minimums and size precision. Refuse stale or malformed constraints with `ORDER_SCALE_PREVIEW_STALE` before writes. Snapshot caller intent before readiness and fee waits, and recheck the complete normalized ladder and venue precision/minimums before signing and final dispatch, preserving accepted child receipts when later metadata changes. Omission preserves unbound placement-time normalization; other providers refuse the constraint ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
32
|
-
|
|
33
|
-
- Add optional `GetScalePriceLadderParams.sizing` for exact base size or bounded quote budget and optional skew. Lighter returns venue-valid `PerpsScalePriceLadder.sizingPreview` quantities, totals and maker minimums without account or signer setup; unsupported providers leave the preview absent ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
34
|
-
- Add durable Lighter Scale ladders with exact-grid preview, aggregate exposure checks, uncertain-child retention and exact group cancellation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
35
|
-
- Add optional `getScaleOrderGroups` and `reviewScaleOrderGroups` provider methods and controller actions, with the exported `ScaleOrderGroup` inventory type ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
36
|
-
- Attribute real Lighter Scale order rows through `strategyGroupId`; keep rows that contradict durably rejected children unattributed and retain ordinary order reads when optional attribution is unavailable ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
37
|
-
- Reconcile Scale dispatch proof across review, expiry and nonce recovery, and poll bounded venue visibility after placement and cancellation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
38
|
-
- Add default-off bounded Lighter Chase probe coordination with durable child ownership, exact fill-aware cancel/replace, public management views and explicit termination; TWAP and production Chase capabilities remain unavailable. Expose `utils/lighterChase.readLighterChaseQuote`, `reconcileLighterChaseChild` and `identifyLighterChaseChild` for native quote, fill and immutable child validation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
10
|
+
### Changed
|
|
39
11
|
|
|
40
|
-
-
|
|
12
|
+
- Bump `reselect` from `^5.1.1` to `^5.3.0` ([#10532](https://github.com/MetaMask/core/pull/10532))
|
|
41
13
|
|
|
42
|
-
|
|
43
|
-
- Add provider-only `getNativeTwapObservations()` for exact parent/client-ID reads and complete child-trade reconciliation. Cancellation acknowledgment retains ownership pending independently verified terminal mapping ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
44
|
-
- Expose `utils/lighterTwapReconciliation.reconcileLighterTwapObservation` and `identifyLighterTwapParent` for exact native reconciliation and immutable cancellation ownership. Exact cancellation remains available when mutable fill history is unavailable ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
45
|
-
- Release provably unsent native probe transactions and expired, never-landed TWAP transactions while retaining attempted and uncertain cleanup obligations. Validate optional native trade string IDs against numeric counterparts ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
14
|
+
## [20.0.0]
|
|
46
15
|
|
|
47
|
-
|
|
16
|
+
### Added
|
|
48
17
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- Add
|
|
18
|
+
- Add `reconcileChaseOrderCancellation` to the controller, messenger and optional provider contract. Lighter reconciles an already attempted cancellation under its exact original owner, handle, child and transaction identity with local settlement writes but no new financial dispatch, even if acknowledgement becomes failure while the child remains open. Missing, malformed or stale original ownership rejects; unknown outcomes remain unresolved. Aggregated mode routes only the explicit provider and unsupported providers never fall back to ordinary cancellation. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
19
|
+
- Export `LIGHTER_SCALE_SETTLEMENT_WINDOW_MS`, `LIGHTER_SCALE_SETTLEMENT_POLL_MS`, `LIGHTER_CHASE_CANCEL_SETTLEMENT_WINDOW_MS` and `LIGHTER_CHASE_CANCEL_SETTLEMENT_POLL_MS` through the `constants` and `constants/lighterConfig` package entrypoints for shared settlement policy. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
20
|
+
- Support explicit independent Lighter partial TP/SL pairs, including captured full-position siblings, through cancellation-first durable per-leg dispatch. Expose supported pair linkages and role-bound protection receipts without changing native OCO defaults. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
21
|
+
- Support explicit Lighter `marginMode` selections with required leverage, authoritative position/order locks and exact mode transaction execution before dependent exposure. Ready active perpetual capabilities report both native modes. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
22
|
+
- Add `getChaseOrderOwnership({handle, providerId, owner?})` to the controller, messenger and optional provider contract. Lighter returns validated durable local history for every exact child under its original wallet/network/account/key owner, including superseded and unresolved attempts, without signing, transport, automatic continuation or durable writes. Missing handles and owner mismatches return unavailable; corrupt storage rejects. Aggregated mode routes one explicit provider; providers without durable history return unsupported. Existing Chase and disabled TWAP behavior remain unchanged. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
23
|
+
- Add the default-off testnet-only `chaseTestnetProbe` constructor option to `LighterProvider` for bounded, durable native Chase cancel/replace. Production strategy capabilities remain unavailable. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
24
|
+
- Implement Lighter `getChaseOrders`, `suspendChaseOrders` and `cancelOrder` with `orderType: 'chase'`. Unbound or recordless absent accounts return empty management state; absent venue discovery retains remembered wallet/network cleanup obligations without signing authority. Confirmed cancel-on-stop reports `canceled`; native records retain the first `stopReason` and uncertain cleanup remains `termination_pending`. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
25
|
+
- Expose `LIGHTER_MAX_CLIENT_ORDER_INDEX`, `LIGHTER_NATIVE_PROBE_MAX_NOTIONAL` and `LIGHTER_CHASE_*` bounds/defaults through `constants/lighterConfig` for shared native identity and Chase policy validation. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
26
|
+
- Expose `utils/lighterChase.readLighterChaseQuote`, `reconcileLighterChaseChild` and `identifyLighterChaseChild` for native quotes, exact fill accounting and immutable child validation. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
27
|
+
- Reconcile failed or expired never-landed Chase transactions without releasing uncertain ownership. Keep accepted orders active through indexer lag, use absolute duration deadlines, and interrupt replacements synchronously when cancellation is requested. Retain TWAP exclusion when expired-placement order evidence is incomplete. Fence starts waiting on preparation, signer readiness or the account mutex when suspension occurs; preserve duration cleanup after a wrong-symbol cancellation. Report confirmed explicit cleanup independently of an earlier failed stop cause, and keep basis-point conversion independent of policy limits. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
28
|
+
- Support native Lighter same-order price and size edits for verified unfilled ordinary perpetual limits. Add `OrderResult.orderEdit` and `OrderEditObservation` for durable pending, settled, failed and terminal outcomes; acceptance alone is pending. Export the seven-argument `LighterSignModifyOrderWireParams` bridge contract. Trigger, strategy and protection children remain unsupported. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
29
|
+
- Preserve attached exact-failure settlement across review and nonce-ledger retries. Explicit attached review can settle fresh complete exact-leg acceptance into an acknowledgeable recovered outcome when the transaction hash is absent and its nonce advanced; saved IDs alone remain insufficient. Bound history by preparation time and page/row budgets, reporting optional `AttachedOrderGroup.historyStatus` for incomplete reviews. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
30
|
+
- Expose `OrderResult.attachedOrderGroup`, `AttachedOrderGroup`, `ReadyPerpsOrderCapabilities.attachedTpsl`, optional provider `getAttachedOrderGroups`/`reviewAttachedOrderGroups`, and controller messenger actions `PerpsControllerGetAttachedOrderGroupsAction`/`PerpsControllerReviewAttachedOrderGroupsAction`. The group submission union includes `completed` for exactly correlated terminal legs. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
31
|
+
- Export `LIGHTER_MAX_WIRE_PRICE`, `LIGHTER_GROUPING_ONE_TRIGGERS_THE_OTHER` and `LIGHTER_GROUPING_ONE_TRIGGERS_OCO` through `constants` and `constants/lighterConfig`. The public `utils/lighterAttachedOrders` subpath exposes `LighterAttachedGroup`, `parseLighterAttachedGroups`, `correlateLighterAttachedOrders`, `toAttachedOrderGroup`, `LIGHTER_ATTACHED_MAX_GROUPS` and `LIGHTER_ATTACHED_HANDLE_PREFIX`. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
32
|
+
- Add optional `OrderParams.expectedScaleLadder` and exported `ExpectedScaleLadder` to bind Lighter Scale placement to approved prices, quantities, totals, minimums and size precision. Refuse stale or malformed constraints with `ORDER_SCALE_PREVIEW_STALE` before writes. Snapshot caller intent before readiness and fee waits, and recheck the complete normalized ladder and venue precision/minimums before signing and final dispatch, preserving accepted child receipts when later metadata changes. Omission preserves unbound placement-time normalization; other providers refuse the constraint. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
33
|
+
- Add optional `GetScalePriceLadderParams.sizing` for exact base size or bounded quote budget and optional skew. Lighter returns venue-valid `PerpsScalePriceLadder.sizingPreview` quantities, totals and maker minimums without account or signer setup; unsupported providers leave the preview absent. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
34
|
+
- Add durable Lighter Scale ladders with exact-grid preview, aggregate exposure checks, uncertain-child retention and exact group cancellation. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
35
|
+
- Add optional `getScaleOrderGroups` and `reviewScaleOrderGroups` provider methods and controller actions, with the exported `ScaleOrderGroup` inventory type. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
36
|
+
- Attribute real Lighter Scale order rows through `strategyGroupId`; keep rows that contradict durably rejected children unattributed and retain ordinary order reads when optional attribution is unavailable. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
37
|
+
- Reconcile Scale dispatch proof across review, expiry and nonce recovery, and poll bounded venue visibility after placement and cancellation. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
38
|
+
- Support ordinary Lighter post-only limit placement with native TIF 2, fresh crossing checks and durable dispatch recovery; TWAP and production Chase capabilities remain unavailable. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
39
|
+
- Add the default-off `nativeTwapTestnetProbe` constructor option for bounded Lighter native TWAP validation with durable account/network/slot ownership. Unresolved TWAP and Chase probes exclude further probe placement on the same account. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
40
|
+
- Add provider-only `getNativeTwapObservations()` for exact parent/client-ID reads and complete child-trade reconciliation. Cancellation acknowledgment retains ownership pending independently verified terminal mapping. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
41
|
+
- Expose `utils/lighterTwapReconciliation.reconcileLighterTwapObservation` and `identifyLighterTwapParent` for exact native reconciliation and immutable cancellation ownership. Exact cancellation remains available when mutable fill history is unavailable. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
42
|
+
- Release provably unsent native probe transactions and expired, never-landed TWAP transactions while retaining attempted and uncertain cleanup obligations. Validate optional native trade string IDs against numeric counterparts. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
43
|
+
- Add `utils/lighterTwap.prepareLighterTwapOrder` for exact native TWAP wire preparation only. Keep Lighter TWAP unavailable pending authoritative parent-fill and terminal-cancellation semantics. Reject unsupported management reads and TWAP cancellation before signer setup rather than reporting an empty inventory or treating generic cancel acknowledgment as schedule termination. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
44
|
+
- Support fixed partial Lighter position protection with single triggers or equal-quantity OCO pairs, exact downward quantity normalization and cancellation-first replacement. Expose optional `positionTpsl.defaultCoverage`, `positionTpsl.partialCoverage` and `PerpsPendingManualRecovery.partialIntent`. Lighter reports snapshot defaults, equal-quantity OCO and explicit current-position recovery; `HYPERLIQUID_ORDER_CAPABILITIES` reports dynamic defaults, independent partial pairs and provider-default recovery. Release proven-unsent partial attempts without removing prior protection or unresolved dispatched obligations. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
45
|
+
- Expose `LIGHTER_RECOVERY_ACCOUNT_INDEX_LIMIT` through `constants` and `constants/lighterConfig` to bound the durable wallet/network recovery account index. Record verified account identity before venue mutation so pending dispatches remain discoverable after account absence. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
46
|
+
- Add native Lighter parent orders with attached TP/SL through OTO and OTOCO groups, durable parent/child identities, local `getAttachedOrderGroups`, explicit read-only `reviewAttachedOrderGroups`, and exact group cancellation. Preserve local groups for confirmed absent and known Premium accounts. Explicit partial child sizes and position linkage remain unsupported; activation, partial-fill coverage and automatic cancellation guarantees remain unverified. Persist exact terminal non-acceptance before nonce evidence retirement. Dispatched intent requires fresh absent transaction/order evidence after expiry, or exact transaction failure, before abandonment. Review traverses bounded history, batches reads per market, skips unchanged writes and reclaims only proven terminal groups. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
47
|
+
- Add strict provider-scoped `reviewRecoveryVenue` and explicit `resolveRecoveryProtection` controller/provider capabilities, including opaque manual-obligation identities, original-slot reconciliation and durable source-to-successor protection settlement. Review uses matching registered read authority without registration or financial writes; unsupported providers report a distinct capability result. Manual and dispatch rows expose optional provider, wallet and network metadata; aggregate rows carry their owning provider. Ordinary protection changes refuse pending selected transfers across trading slots. Pending or unknown transaction statuses remain unresolved even when order books already match; executed (2), pending-final (3) with matching books, or definitive failure resolves them. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
48
|
+
- Add optional `reconcileRecoveredDispatches` provider capability and controller action for explicit non-financial venue checks with local persistence. Lighter checks owner-null dispatches across trading slots without signing, retrying or acknowledging outcomes; unsupported providers return their local listing. Reject account, network or provider changes while readiness, reconciliation or fallback listing completes; propagate provider failures unchanged. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
54
49
|
- Expose `utils/positionProtection.assertExpectedPosition` and `utils/guardedHyperLiquidClient.createGuardedHyperLiquidClient` through the existing public wildcard exports for position snapshot validation and operation-local signed-dispatch guards ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
55
50
|
- Add optional `UpdatePositionTPSLParams.expectedPosition` signed-size and entry-price preconditions. Lighter and HyperLiquid reject stale or invalid protection preconditions with `TPSL_UPDATE_FAILED` before setup and recheck before writes ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
56
51
|
- Report `positionTpsl` precondition support, receipt identity guarantees and native TP/SL execution types in ready order capabilities ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
@@ -73,9 +68,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
73
68
|
|
|
74
69
|
### Changed
|
|
75
70
|
|
|
76
|
-
- **BREAKING:** Lighter `placeOrder` and `validateOrder` now accept supported native attached TP/SL instead of refusing all attachments; omitted `tpslLinkage` defaults to `order`. Mobile and Extension must gate forwarding on `attachedTpsl` and their rollout policy. Native lifecycle verification remains pending; client adoption is not included ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
77
|
-
- **BREAKING:** Grouped Lighter signer calls require grouping/count `1/2` or `2/2` with two orders, or `3/3` with three orders. Update `LighterSignCreateGroupedOrdersWireParams` and `LighterWasmCall<'_signCreateGroupedOrders'>` callers to these tuple unions; each order retains its ten-field wire tuple ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
78
|
-
- **BREAKING:** Add `canceled` to `ScaleOrderChild.state` for accepted children canceled after placement. Consumers exhaustively matching this union must handle the new state. Scale receipts distinguish submitted, accepted and known filled exposure ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
71
|
+
- **BREAKING:** Lighter `placeOrder` and `validateOrder` now accept supported native attached TP/SL instead of refusing all attachments; omitted `tpslLinkage` defaults to `order`. Mobile and Extension must gate forwarding on `attachedTpsl` and their rollout policy. Native lifecycle verification remains pending; client adoption is not included. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
72
|
+
- **BREAKING:** Grouped Lighter signer calls require grouping/count `1/2` or `2/2` with two orders, or `3/3` with three orders. Update `LighterSignCreateGroupedOrdersWireParams` and `LighterWasmCall<'_signCreateGroupedOrders'>` callers to these tuple unions; each order retains its ten-field wire tuple. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
73
|
+
- **BREAKING:** Add `canceled` to `ScaleOrderChild.state` for accepted children canceled after placement. Consumers exhaustively matching this union must handle the new state. Scale receipts distinguish submitted, accepted and known filled exposure. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
79
74
|
- **BREAKING:** Add `order_market_unsupported` to `DirectProviderOrderCapabilitiesUnavailableReason` and `OrderCapabilitiesUnavailableReason` for known markets that are inactive or not perpetual and cannot accept native triggers. Consumers exhaustively matching these unions must include the new reason; Scale price-ladder reasons are unchanged ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
80
75
|
- **BREAKING:** Refuse stray `triggerPrice` on Lighter basic market and limit orders with `ORDER_TRIGGER_PRICE_NOT_SUPPORTED` rather than silently ignoring it. Omit the field or select an explicit trigger order type ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
81
76
|
- **BREAKING:** Lighter position TP/SL replacement and removal preserve independent partial triggers and trigger limits. Legacy unrecorded trigger-market orders count as protection only on the closing side with exactly the in-lock position quantity and a known restorable time-in-force. Cancel independent orders and pre-upgrade protection whose quantity no longer matches explicitly ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
@@ -87,33 +82,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
87
82
|
|
|
88
83
|
### Fixed
|
|
89
84
|
|
|
90
|
-
- Retain each Lighter Scale child cancellation identity and acknowledgement before transport completion so unresolved requests and provider restarts reconcile without signing or sending again. Permit explicit retry only after exact failure or expired, venue-confirmed never-landed evidence; legacy acknowledgement omissions remain uncertain. Reobserve exact active/history overlaps while preserving strict identity and cumulative-fill checks ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
- Wait for exact
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
- Select and persist the bounded testnet Chase child's final book quote after preparation and nonce acquisition, retaining five-second quote freshness, original duration and dispatch safety checks ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
105
|
-
|
|
106
|
-
- Reject Scale children above Lighter's native base-amount maximum before preview readiness or trading setup, and validate the same limit in durable records. Preserve valid larger aggregates split across bounded children ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
107
|
-
- Resolve public perps constant and utility subpaths from source during monorepo checks without requiring built outputs; retain separate compiled consumer validation ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
108
|
-
|
|
109
|
-
- Preserve exact replacement child receipts when reconciling committed protection successors; omit unavailable identities and reserve empty receipts for confirmed removal ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
110
|
-
|
|
111
|
-
- Require fresh isolated-position identity and collateral bounds for Lighter margin adjustments, recheck before signing and dispatch, and report success only after exact transaction execution. Preserve unresolved collateral/mode transactions across expiry, nonce advance and restart until exact terminal proof; require exact micro-USDC amounts ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
112
|
-
|
|
113
|
-
- Keep ordinary Lighter orders unattributed when a live row contradicts a durably rejected Scale child ([#10638](https://github.com/MetaMask/core/pull/10638)).
|
|
85
|
+
- Retain each Lighter Scale child cancellation identity and acknowledgement before transport completion so unresolved requests and provider restarts reconcile without signing or sending again. Permit explicit retry only after exact failure or expired, venue-confirmed never-landed evidence; legacy acknowledgement omissions remain uncertain. Reobserve exact active/history overlaps while preserving strict identity and cumulative-fill checks. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
86
|
+
- Give Lighter Scale placement a dedicated ten-second visibility window and share one ten-second deadline across a group's exact child cancellations. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
87
|
+
- Wait for exact Lighter Chase cancellation settlement and reconcile retained attempts without signing or sending again, preserving session authority and cumulative fill evidence. Save transport acceptance and exact nonfailed transaction observations under their original owner before nonce retirement, including across session changes. Keep accepted placement and cancellation journals readable when completion reads, parsing or matching fail. Keep conflicting and legacy unknown evidence unresolved; expiry release also requires explicit unacknowledged evidence, a fresh unconsumed slot nonce and exact owned order evidence. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
88
|
+
- Recognize and cancel exact Lighter Chase children when the venue order nonce differs from the signed transaction nonce, preserving transaction and order ownership checks. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
89
|
+
- Wait for bounded exact transaction and order settlement after an accepted Lighter native edit, without signing or sending the edit again. Preserve pending outcomes when visibility does not settle within the polling bound. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
90
|
+
- Wait for bounded exact transaction execution reads before completing Lighter margin mode and collateral updates, without resubmitting pending transactions. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
91
|
+
- Retire the exact HyperLiquid agent signature when a post-signing guard refuses dispatch, preserving the original wallet attribution, other pending requests and the guard error. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
92
|
+
- Select and persist the bounded testnet Chase child's final book quote after preparation and nonce acquisition, retaining five-second quote freshness, original duration and dispatch safety checks. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
93
|
+
- Reject Scale children above Lighter's native base-amount maximum before preview readiness or trading setup, and validate the same limit in durable records. Preserve valid larger aggregates split across bounded children. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
94
|
+
- Resolve public perps constant and utility subpaths from source during monorepo checks without requiring built outputs; retain separate compiled consumer validation. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
95
|
+
- Preserve exact replacement child receipts when reconciling committed protection successors; omit unavailable identities and reserve empty receipts for confirmed removal. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
96
|
+
- Require fresh isolated-position identity and collateral bounds for Lighter margin adjustments, recheck before signing and dispatch, and report success only after exact transaction execution. Preserve unresolved collateral/mode transactions across expiry, nonce advance and restart until exact terminal proof; require exact micro-USDC amounts. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
97
|
+
- Keep ordinary Lighter orders unattributed when a live row contradicts a durably rejected Scale child. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
114
98
|
- Return `ORDER_SCALE_PREVIEW_STALE` as an unsuccessful order result for malformed Scale expectations passed directly to `TradingService`, before fee resolution or placement ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
115
|
-
- Preserve Lighter Chase cancellation capacity when venue account authority is absent. Persist repeated local stop intent without adding cancellation attempts, retain uncertain dispatched cleanup across restart, and allow exact cleanup after the original authority returns ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
116
|
-
- Treat confirmed absent and known Premium Lighter accounts as local-only recovery inventories without acknowledgment. Verify account ownership and index before caching or recording recovery authority. Preserve durable obligations and refuse transport, storage, ownership or unverified account-type failures; Premium trading remains unsupported ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
99
|
+
- Preserve Lighter Chase cancellation capacity when venue account authority is absent. Persist repeated local stop intent without adding cancellation attempts, retain uncertain dispatched cleanup across restart, and allow exact cleanup after the original authority returns. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
100
|
+
- Treat confirmed absent and known Premium Lighter accounts as local-only recovery inventories without acknowledgment. Verify account ownership and index before caching or recording recovery authority. Preserve durable obligations and refuse transport, storage, ownership or unverified account-type failures; Premium trading remains unsupported. ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
117
101
|
- Persist guarded Lighter protection removals as non-resumable before dispatch. Recovery reconciles attempted cancellations and preserves surviving orders for explicit review even when saving a later refusal fails; fully settled removals clear without an obsolete warning ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
118
102
|
- Recheck HyperLiquid position protection after SDK signing and correlate partial SDK acknowledgments by exact signed child IDs. Preserve uncertain outcomes and restore only exact pre-call reduce-only protection when replacement becomes stale after cancellation; report protection loss if restoration fails ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
119
103
|
- Release only proven-unsent Lighter TP/SL attempts, ownership and nonce reservations after final position rejection, allowing a refreshed update or close while retaining older uncertain attempts ([#10638](https://github.com/MetaMask/core/pull/10638))
|
|
@@ -1226,7 +1210,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1226
1210
|
|
|
1227
1211
|
- Bump `@metamask/controller-utils` from `^11.18.0` to `^11.19.0` ([#7995](https://github.com/MetaMask/core/pull/7995))
|
|
1228
1212
|
|
|
1229
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@
|
|
1213
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@20.0.0...HEAD
|
|
1214
|
+
[20.0.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@19.0.0...@metamask/perps-controller@20.0.0
|
|
1230
1215
|
[19.0.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@18.0.1...@metamask/perps-controller@19.0.0
|
|
1231
1216
|
[18.0.1]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@18.0.0...@metamask/perps-controller@18.0.1
|
|
1232
1217
|
[18.0.0]: https://github.com/MetaMask/core/compare/@metamask/perps-controller@17.4.0...@metamask/perps-controller@18.0.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/perps-controller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0-preview-daf00d2",
|
|
4
4
|
"description": "Controller for perpetual trading functionality in MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@metamask/utils": "^12.0.0",
|
|
79
79
|
"@nktkas/hyperliquid": "^0.33.3",
|
|
80
80
|
"bignumber.js": "^9.1.2",
|
|
81
|
-
"reselect": "^5.
|
|
81
|
+
"reselect": "^5.3.0",
|
|
82
82
|
"uuid": "^11.1.1"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|