Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
3e6154a
fix(perps): recover registered Lighter trading keys
abretonc7s Sep 30, 2026
ee3a367
docs(perps): link Lighter recovery changelog
abretonc7s Sep 30, 2026
7797616
fix(perps): retain Lighter key slot across dispatch bookkeeping
abretonc7s Sep 30, 2026
4255113
docs(perps): clarify Lighter dispatch recovery preconditions
abretonc7s Sep 30, 2026
c077fdd
test(perps): type recovery mocks for the repository checker
abretonc7s Sep 30, 2026
8c605a2
fix(perps): preserve fill snapshot completeness and discovery errors
abretonc7s Sep 30, 2026
647d5a7
fix(perps): clarify unresolved protection and cover invalid fill deltas
abretonc7s Sep 30, 2026
68349e7
test(perps): retain initialized old-key recovery advice
abretonc7s Sep 30, 2026
ce2c888
fix(perps): retain Lighter closing fills with unknown pnl
abretonc7s Sep 30, 2026
916d2ca
docs(perps): correct omitted closing PnL changelog
abretonc7s Sep 30, 2026
f3205c2
fix(perps): skip unrelated nonce ledgers during key recovery
abretonc7s Sep 30, 2026
b7cc3af
test(perps): block key changes during nonce-adjusted recovery
abretonc7s Sep 30, 2026
3f3b2f6
fix: preserve Lighter recovery visibility across key selection
abretonc7s Oct 1, 2026
9e809fd
fix: fence Lighter financial writes across account key slots
abretonc7s Oct 1, 2026
22f0d46
fix: preserve Lighter order replay authority on rejected frames
abretonc7s Oct 1, 2026
fc726f1
test: pin exact public recovery contracts
abretonc7s Oct 1, 2026
3638e3e
fix(perps): preserve fills when trades container is omitted
abretonc7s Oct 1, 2026
69e6028
fix(perps): fence signer readiness after venue lock returns
abretonc7s Oct 1, 2026
b4d35ba
docs(perps): keep recovery changelog fixes contiguous
abretonc7s Oct 1, 2026
992f82c
feat(perps): support native Lighter standalone trigger orders
abretonc7s Sep 30, 2026
fa08f0d
feat(perps): declare provider-owned trigger order capabilities
abretonc7s Sep 30, 2026
6adee27
docs(perps): document native trigger capability changes
abretonc7s Sep 30, 2026
732106c
docs(perps): document standalone trigger capabilities
abretonc7s Sep 30, 2026
b745007
fix(perps): preserve independent triggers during protection updates
abretonc7s Sep 30, 2026
381db50
docs(perps-controller): describe standalone trigger capabilities
abretonc7s Sep 30, 2026
5e1999b
fix(perps): retain Lighter protection ownership across resizing
abretonc7s Sep 30, 2026
18ae053
test(perps): cover public trigger capability contracts
abretonc7s Oct 1, 2026
b624a16
fix(perps): retain Lighter protection through lag and storage failures
abretonc7s Sep 30, 2026
a9e5361
fix(perps): bound ownership pruning and refresh settlement proofs
abretonc7s Sep 30, 2026
6f24b50
fix(perps): reclaim protection ownership after signed order expiry
abretonc7s Sep 30, 2026
3871ec0
test(perps): correct expiry regression types and changelog
abretonc7s Sep 30, 2026
e31e6a6
refactor: name native Lighter protection bounds and verify public types
abretonc7s Oct 1, 2026
755ec78
refactor: keep Lighter protection bounds internal
abretonc7s Oct 1, 2026
b33ace4
fix(perps): remove managed protection without live quantity
abretonc7s Oct 1, 2026
78d0ead
test(perps): assert durable managed removal ownership
abretonc7s Oct 1, 2026
b3593f6
test(perps): cover invalid-side managed protection removal
abretonc7s Oct 1, 2026
2c0ab48
test(perps): simplify managed removal quantity fixture
abretonc7s Oct 1, 2026
a398a65
feat(perps): return exact position protection receipts
abretonc7s Sep 30, 2026
c45bce3
fix(perps): reject conflicting protection receipt identities
abretonc7s Sep 30, 2026
5d7c8d2
fix: fence position protection writes and correlate HyperLiquid receipts
abretonc7s Oct 1, 2026
cb53c49
fix: preserve protection loss and scope across asynchronous writes
abretonc7s Oct 1, 2026
5172cf7
fix: fence signed protection dispatch and reconcile exact recovery id…
abretonc7s Oct 1, 2026
45a342d
fix: recover HyperLiquid protection across SDK rejection boundaries
abretonc7s Oct 1, 2026
c580fa6
fix: retain protection recovery receipts and failure context
abretonc7s Oct 1, 2026
e0fe862
refactor: remove unreachable protection recovery fallback
abretonc7s Oct 1, 2026
530ffb7
fix: return localized protection precondition error code
abretonc7s Oct 1, 2026
8ad8fa0
fix: preserve structured position drift failures before signing
abretonc7s Oct 1, 2026
c2115ab
fix: validate position protection tests on supported Node versions
abretonc7s Oct 1, 2026
bfab7ac
test(perps): preserve explicit managed removal preconditions
abretonc7s Oct 1, 2026
4570b16
fix(perps): validate final position protection evidence
abretonc7s Oct 1, 2026
e2dbc30
feat(perps): expose non-financial dispatch reconciliation
abretonc7s Oct 1, 2026
930d856
fix(perps): fence dispatch reconciliation across readiness
abretonc7s Oct 1, 2026
c869880
feat: expose strict venue review and selected protection recovery
abretonc7s Oct 1, 2026
3559461
fix(perps): fence recovered dispatch acknowledgments
abretonc7s Oct 1, 2026
9dd4d5b
fix: finalize and resume selected Lighter recovery safely
abretonc7s Oct 1, 2026
290995d
test(perps): clarify acknowledgment completion and rejection context
abretonc7s Oct 1, 2026
c4071f1
fix: retire failed Lighter recovery coverage and trace resolution
abretonc7s Oct 1, 2026
191f7c2
docs: describe acknowledgment context test coverage accurately
abretonc7s Oct 1, 2026
0f69c27
test(perps): mock SDK boundary for Node 22 acknowledgment coverage
abretonc7s Oct 1, 2026
7eba1e8
fix: prune interrupted failed protection journals
abretonc7s Oct 1, 2026
deffa84
fix(perps): propagate recovery corrections into capability
abretonc7s Oct 1, 2026
5b20f17
fix(perps): propagate recovery corrections into native
abretonc7s Oct 1, 2026
07d6908
fix(perps): propagate recovery corrections into position
abretonc7s Oct 1, 2026
22244b2
fix(perps): propagate recovery corrections into strict recovery
abretonc7s Oct 1, 2026
e6ba489
fix(perps): fence acknowledgment across provider lifetimes
abretonc7s Oct 1, 2026
d58f694
fix(perps): propagate acknowledgment lifetime fence
abretonc7s Oct 1, 2026
49693f8
fix(perps): propagate acknowledgment lifetime fence
abretonc7s Oct 1, 2026
5b94d17
fix(perps): propagate acknowledgment lifetime fence
abretonc7s Oct 1, 2026
d86cfb0
fix(perps): propagate acknowledgment lifetime fence
abretonc7s Oct 1, 2026
421483a
fix(perps): retire recovery acknowledgments after failed switches
abretonc7s Oct 1, 2026
732ace0
fix(perps): ignore retired providers in new recovery actions
abretonc7s Oct 1, 2026
5558684
fix(perps): propagate reviewed acknowledgment context corrections
abretonc7s Oct 1, 2026
1d510e0
fix(perps): propagate reviewed acknowledgment context corrections
abretonc7s Oct 1, 2026
2307bb0
fix(perps): propagate reviewed acknowledgment context corrections
abretonc7s Oct 1, 2026
e321958
fix(perps): propagate reviewed acknowledgment context corrections
abretonc7s Oct 1, 2026
bb9e1a6
feat: support fixed partial Lighter position protection
abretonc7s Oct 1, 2026
0893fb2
fix: fence Lighter protection after ownership storage
abretonc7s Oct 1, 2026
fe68926
fix: propagate Lighter ownership storage fence
abretonc7s Oct 1, 2026
745f7a3
fix: clarify position protection identities and receipts
abretonc7s Oct 1, 2026
4ee6e14
fix: propagate reviewed protection corrections into recovery
abretonc7s Oct 1, 2026
372eda6
fix: clarify Lighter protection recovery checks
abretonc7s Oct 1, 2026
26612eb
fix: propagate Lighter protection review refinements
abretonc7s Oct 1, 2026
911ba03
fix: propagate final protection corrections into recovery
abretonc7s Oct 1, 2026
ff0e20c
fix: propagate corrected foundation into partial protection
abretonc7s Oct 1, 2026
c431eab
feat: type native attached Lighter signer groups
abretonc7s Oct 1, 2026
6b165f9
feat(perps-controller): prepare native Lighter attached order groups
abretonc7s Oct 1, 2026
8708c0a
fix(perps-controller): bound partial quantities and release unsent in…
abretonc7s Oct 1, 2026
2ccca98
fix(perps-controller): retain recovery inventory without trading support
abretonc7s Oct 1, 2026
3c559bd
fix(perps-controller): preserve raw partial bounds and retire unsent …
abretonc7s Oct 1, 2026
821f980
fix(perps-controller): verify recovery account ownership
abretonc7s Oct 1, 2026
0332af4
fix(perps-controller): preserve partial cleanup diagnostics
abretonc7s Oct 1, 2026
9ac8b8a
merge(perps-controller): integrate partial protection recovery inventory
abretonc7s Oct 1, 2026
e94a904
feat(perps-controller): integrate durable attached protection
abretonc7s Oct 1, 2026
72b21f8
fix: settle attached order ownership and reclaim terminal groups
abretonc7s Oct 2, 2026
f47e1ee
fix: verify attached abandonment and traverse bounded history
abretonc7s Oct 2, 2026
cd363f8
feat(perps-controller): add durable Lighter Scale groups
abretonc7s Oct 2, 2026
f1b3c16
fix: reconcile attached acceptance and bound review history
abretonc7s Oct 2, 2026
b2d66bc
fix: settle Scale recovery and validate exposure before setup
abretonc7s Oct 2, 2026
80e1a1a
test: cover attached recovery settlement refusal guards
abretonc7s Oct 2, 2026
72dbbe8
fix: gate unverified Lighter TWAP management and prepare native fields
abretonc7s Oct 2, 2026
085f1a5
fix(perps): preserve Lighter Scale execution and cancellation recovery
abretonc7s Oct 2, 2026
4a3af2a
feat: add gated Lighter native TWAP lifecycle observations
abretonc7s Oct 2, 2026
7ea38c8
test(perps): clarify attached recovery regression names
abretonc7s Oct 2, 2026
c86361b
chore: sync Lighter recovery with main
abretonc7s Oct 2, 2026
f6b96a8
feat: support guarded Lighter post-only limit orders
abretonc7s Oct 2, 2026
89bac08
fix(perps): reject conflicting Scale venue recovery
abretonc7s Oct 2, 2026
09665e1
chore: sync Lighter recovery follow-up with main
abretonc7s Oct 2, 2026
d48033a
feat: add bounded Lighter Chase probe lifecycle
abretonc7s Oct 2, 2026
2b9df44
fix: fence protection changes behind previous key journals
abretonc7s Oct 2, 2026
d1a81df
test: inject journal storage failure at clear boundary
abretonc7s Oct 2, 2026
ca09277
test: use typed mocks for journal follow-up assertions
abretonc7s Oct 2, 2026
7195a31
test: assert journal bridge call records without binding methods
abretonc7s Oct 2, 2026
fe5de6b
chore: propagate reviewed recovery journal gate into capabilities
abretonc7s Oct 2, 2026
867ae0b
chore: propagate recovery journal gate into native triggers
abretonc7s Oct 2, 2026
2568a97
fix: reject native Lighter triggers on spot markets
abretonc7s Oct 2, 2026
4203f0d
chore: propagate recovery and spot guards into position protection
abretonc7s Oct 2, 2026
fe3c947
fix: park Lighter removals rejected by position guards
abretonc7s Oct 2, 2026
0f0e10b
fix: address native Lighter probe review findings
abretonc7s Oct 2, 2026
2ae3b65
feat(perps): preview Lighter Scale quantities and maker minimums
abretonc7s Oct 2, 2026
87c76d2
merge: integrate approved partial recovery with migrated-slot journal…
abretonc7s Oct 2, 2026
b8c273f
merge: integrate approved attached protection with perpetual-market g…
abretonc7s Oct 2, 2026
008d458
merge: combine Scale preview and attached ownership recovery
abretonc7s Oct 2, 2026
fb81f11
merge: integrate bounded Chase and TWAP with advanced order ownership
abretonc7s Oct 2, 2026
286149b
fix: persist guarded removal refusal authority before dispatch
abretonc7s Oct 2, 2026
8288b80
fix(perps): capture Scale preview intent before readiness
abretonc7s Oct 2, 2026
0f585d9
docs: describe native Lighter triggers as perpetual-only
abretonc7s Oct 2, 2026
76b4e06
fix: settle migrated Lighter protection without original-key signing
abretonc7s Oct 2, 2026
28cdc4b
merge: propagate read-only old-slot recovery into capabilities
abretonc7s Oct 2, 2026
5e8c7f8
merge: propagate original-slot recovery into native triggers
abretonc7s Oct 2, 2026
7048e61
merge: combine durable guarded removal with original-slot recovery
abretonc7s Oct 2, 2026
838ce82
docs: retain one corrected native trigger changelog entry
abretonc7s Oct 2, 2026
dd1324a
docs: preserve released dependency changelog history
abretonc7s Oct 2, 2026
80a0833
fix: integrate ordered Lighter recovery and guarded removal corrections
abretonc7s Oct 2, 2026
7bd6682
fix: reconcile Lighter native Chase and TWAP lifecycle
abretonc7s Oct 2, 2026
9227637
chore: checkpoint incomplete Lighter margin parity before review corr…
abretonc7s Oct 2, 2026
e595a35
fix: clear completed guarded Lighter removals during recovery
abretonc7s Oct 2, 2026
175da90
fix: clear settled Lighter warnings after current-key protection updates
abretonc7s Oct 2, 2026
18b1195
test: verify migrated warning cleanup survives provider restart
abretonc7s Oct 2, 2026
b18c037
test: assert failed successor preservation unconditionally
abretonc7s Oct 2, 2026
ffe29ff
Merge commit 'b18c03773f' into feat/lighter-capability-followup-03
abretonc7s Oct 2, 2026
c034c11
merge: propagate settled warning cleanup into native triggers
abretonc7s Oct 2, 2026
bb1ee15
test: preserve optional update success type in captured proof
abretonc7s Oct 2, 2026
cdb7c2d
Merge commit 'bb1ee15c20' into feat/lighter-capability-followup-03
abretonc7s Oct 2, 2026
054c12d
merge: combine migrated warning cleanup with guarded removal recovery
abretonc7s Oct 2, 2026
e9489e1
Merge branch 'feat/lighter-capability-followup-03' into feat/lighter-…
abretonc7s Oct 2, 2026
5ca7c85
Merge branch 'feat/lighter-native-followup-03' into feat/lighter-posi…
abretonc7s Oct 2, 2026
f4f8d77
fix: close Lighter Chase lifecycle gaps
abretonc7s Oct 2, 2026
45c0a72
fix(perps): bind Lighter Scale placement to approved normalized preview
abretonc7s Oct 2, 2026
e9b0ba3
fix: preserve settled protection success during warning cleanup
abretonc7s Oct 2, 2026
3b0c9af
merge: consolidate reviewed recovery into advanced protection
abretonc7s Oct 2, 2026
cb38ad5
test: preserve combined protection receipts during cleanup faults
abretonc7s Oct 2, 2026
5fcaf8b
test: use valid unresolved journals in warning cleanup races
abretonc7s Oct 2, 2026
7492037
test: assert retained warning lists without conditional assertions
abretonc7s Oct 2, 2026
50d0d61
test: inspect cleanup logger through typed spies
abretonc7s Oct 2, 2026
c7e86d6
fix: preserve Chase cancellation capacity during local stops
abretonc7s Oct 2, 2026
bc3b39f
fix: retain pending Lighter key registration across reconnects
abretonc7s Oct 2, 2026
85a011d
fix: preserve explicit legacy slot registration behavior
abretonc7s Oct 2, 2026
8a06c77
merge: retain pending registrations in combined advanced orders
abretonc7s Oct 2, 2026
7e50877
fix: preserve bound Scale intent through async dispatch
abretonc7s Oct 2, 2026
5422b9c
fix: retain public order action parameter names
abretonc7s Oct 2, 2026
2f2e24b
feat: expose durable Chase child ownership through the controller
abretonc7s Oct 2, 2026
755b59f
fix: validate and settle Lighter isolated collateral changes
abretonc7s Oct 2, 2026
dae2a37
fix: retain observed Lighter registration execution
abretonc7s Oct 2, 2026
8b540fa
fix: return stale Scale preview refusals from trading service
abretonc7s Oct 2, 2026
79635b7
merge: preserve observed registration execution in advanced orders
abretonc7s Oct 2, 2026
7934de0
feat: support durable native Lighter resting-order edits
abretonc7s Oct 2, 2026
016228c
merge: retain published recovery and protection in advanced integration
abretonc7s Oct 2, 2026
b6b2bdd
merge: bind Scale previews across integrated advanced orders
abretonc7s Oct 2, 2026
39e64d7
merge: preserve Chase ownership and lifecycle in advanced integration
abretonc7s Oct 2, 2026
b7708fa
test: preserve partial intent during migrated protection cleanup
abretonc7s Oct 2, 2026
a6373e4
merge: integrate durable native same-order edits
abretonc7s Oct 2, 2026
f0ad5c6
fix: preserve integrated recovery boundaries and stable test identities
abretonc7s Oct 2, 2026
13d3226
feat(perps-controller): support independent Lighter protection pairs
abretonc7s Oct 2, 2026
c8d866f
fix(perps-controller): validate native Scale bounds and clean source …
abretonc7s Oct 2, 2026
f955309
fix(perps-controller): prepare bounded Chase quote before signing
abretonc7s Oct 2, 2026
8665d5a
chore: sync Lighter recovery with current main
abretonc7s Oct 2, 2026
a807e41
Merge recovery base into advanced perps integration
abretonc7s Oct 2, 2026
1c87013
fix(perps-controller): retire guarded agent signatures
abretonc7s Oct 2, 2026
f0cca81
fix(perps-controller): fence recovered reconciliation results
abretonc7s Oct 3, 2026
a3afafb
docs(perps-controller): regenerate recovery action documentation
abretonc7s Oct 3, 2026
d436afc
fix(perps-controller): await exact Lighter margin execution
abretonc7s Oct 3, 2026
c38cd55
fix(perps-controller): await native Lighter edit settlement
abretonc7s Oct 3, 2026
84a7596
fix(perps-controller): distinguish Chase order and transaction nonces
abretonc7s Oct 3, 2026
1c8c3dd
test(perps-controller): type Chase recovery order lookup
abretonc7s Oct 3, 2026
aebc669
fix(perps): wait for Scale and Chase settlement
abretonc7s Oct 3, 2026
e9affb8
fix(perps): bound Lighter group settlement
abretonc7s Oct 3, 2026
104a4cb
fix(perps): retain Scale cancellations through indexer lag
abretonc7s Oct 3, 2026
76c96cd
fix(perps): release proven never-landed Scale cancellations
abretonc7s Oct 3, 2026
af5b7ab
fix(perps): preserve observed Chase cancellation acceptance
abretonc7s Oct 3, 2026
e3d7a4c
fix(perps): persist original-owner Chase dispatch evidence
abretonc7s Oct 3, 2026
db75bde
fix: preserve accepted Lighter Chase journal invariants
abretonc7s Oct 3, 2026
1ffc52a
fix(perps-controller): reconcile Chase cancellation without dispatch
abretonc7s Oct 3, 2026
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 jest.config.packages.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ module.exports = {
// Here we ensure that Jest resolves `@metamask/*` imports to the uncompiled source code for packages that live in this repo.
// NOTE: This must be synchronized with the `paths` option in `tsconfig.base.json`.
moduleNameMapper: {
'^@metamask/perps-controller/constants/(.+)$': [
'<rootDir>/../perps-controller/src/constants/$1',
],
'^@metamask/perps-controller/utils/(.+)$': [
'<rootDir>/../perps-controller/src/utils/$1',
],
// Strip .js extensions from relative imports so Jest resolves them to
// the TypeScript source files.
'^(\\.{1,2}/.+)\\.js$': '$1',
Expand Down
18 changes: 0 additions & 18 deletions oxlint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4668,9 +4668,6 @@
}
},
"packages/perps-controller/src/providers/LighterProvider.ts": {
"no-useless-return": {
"count": 5
},
"typescript/prefer-nullish-coalescing": {
"count": 1
}
Expand Down Expand Up @@ -4765,21 +4762,6 @@
}
},
"packages/perps-controller/tests/src/providers/LighterProvider.test.ts": {
"typescript/no-unsafe-argument": {
"count": 6
},
"typescript/no-unsafe-assignment": {
"count": 8
},
"typescript/no-unsafe-call": {
"count": 3
},
"typescript/no-unsafe-member-access": {
"count": 21
},
"typescript/no-unsafe-return": {
"count": 3
},
"typescript/unbound-method": {
"count": 5
}
Expand Down
104 changes: 103 additions & 1 deletion packages/perps-controller/CHANGELOG.md

Large diffs are not rendered by default.

587 changes: 586 additions & 1 deletion packages/perps-controller/README.md

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions packages/perps-controller/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ module.exports = {
},
}),

// Node 22 cannot require the SDK's ESM entrypoint through Jest. Compile the
// real SDK and its ESM dependencies with the existing TypeScript transformer.
transform: {
...baseConfig.transform,
'^.+\\.js$': [
'ts-jest',
{
// ts-jest follows Jest's supportsStaticESM flag: CommonJS on Node 22,
// native ESM when Node 24 loads the SDK through require(esm).
useESM: true,
tsconfig: {
allowJs: true,
checkJs: false,
module: 'ESNext',
moduleResolution: 'Node',
verbatimModuleSyntax: false,
ignoreDeprecations: '6.0',
},
},
],
},
transformIgnorePatterns: [
'/node_modules/(?!@nktkas/(?:hyperliquid|rews)/|@noble/hashes/)',
],

// Coverage is collected from real source files. Barrel files are excluded
// because they only re-export the tested modules.
// Applied after merge to fully replace (not concat) the base array.
Expand Down
163 changes: 150 additions & 13 deletions packages/perps-controller/src/PerpsController-method-action-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type PerpsControllerGetActiveProviderOrNullAction = {
};

/**
* Get strategy capabilities through the active provider route used by order
* Get order capabilities through the active provider route used by order
* placement. The query waits for in-flight initialization and reports an
* explicit unavailable status when no provider route can answer reliably.
*
Expand Down Expand Up @@ -114,9 +114,9 @@ export type PerpsControllerGetMarginModeLockAction = {
/**
* Build a Scale price ladder using the active provider's venue rules.
*
* @param params - Market, ladder bounds, count, and optional explicit route.
* @returns Provider-normalized prices or a typed unavailable result.
* @throws When the provider cannot normalize the requested ladder.
* @param params - Market, ladder bounds, count, optional sizing and explicit route.
* @returns Provider-normalized prices with sizingPreview when supported, or a typed unavailable result.
* @throws When bounds or sizing violate the provider's venue rules.
*/
export type PerpsControllerGetScalePriceLadderAction = {
type: `PerpsController:getScalePriceLadder`;
Expand Down Expand Up @@ -181,8 +181,37 @@ export type PerpsControllerGetChaseOrdersAction = {
};

/**
* Stop Chase repricing for app backgrounding without cancelling the current
* resting children.
* Observe durable ownership for an exact Chase handle through one provider.
* Starts no signing, transport, continuation, cancellation or durable writes.
* Original owner/child IDs are observations, never permission for cleanup in
* a different context. Providers without durable history report unsupported.
*
* @param input - Opaque handle, explicit route and optional original owner.
* @returns Complete local child history, unsupported, or explicit absence.
* @throws On corrupt storage or account/network/provider/lifetime changes.
*/
export type PerpsControllerGetChaseOrderOwnershipAction = {
type: `PerpsController:getChaseOrderOwnership`;
handler: PerpsController['getChaseOrderOwnership'];
};

/**
* Reconcile one retained exact Chase cancellation without any new cancellation.
* Unsupported providers are never routed to ordinary financial cancellation.
*
* @param input - Original handle, owner, child and transaction identity.
* @returns Proven terminal state, unresolved cleanup or unsupported capability.
* @throws On invalid ownership or stale provider/account/network lifetime.
*/
export type PerpsControllerReconcileChaseOrderCancellationAction = {
type: `PerpsController:reconcileChaseOrderCancellation`;
handler: PerpsController['reconcileChaseOrderCancellation'];
};

/**
* Stop Chase repricing for app backgrounding. HyperLiquid leaves current
* children resting. The bounded Lighter probe attempts exact cancellation and
* reports canceled or termination_pending rather than a resting status.
*
* @returns Chase snapshots after suspension.
* @throws If an aggregated provider cannot suspend every active venue. Other
Expand Down Expand Up @@ -404,7 +433,10 @@ export type PerpsControllerGetOrderFillsAction = {
/**
* List TP/SL protection changes the active provider parked for
* explicit manual re-establishment. Providers without durable
* settlement state return an empty list.
* settlement state return an empty list. Lighter includes previous-key and
* pre-initialization journals for the selected wallet/account, waits for any
* in-flight key selection and keeps failed-setup obligations visible. A
* current-key update does not clear an earlier key's unfinished journal.
*
* @returns Pending manual-recovery entries.
*/
Expand All @@ -413,24 +445,120 @@ export type PerpsControllerGetPendingManualRecoveriesAction = {
handler: PerpsController['getPendingManualRecoveries'];
};

/**
* Review native attached lifecycle through provider-owned read authority.
*
* @returns Exact venue identities without financial replay or key registration.
*/
export type PerpsControllerReviewAttachedOrderGroupsAction = {
type: `PerpsController:reviewAttachedOrderGroups`;
handler: PerpsController['reviewAttachedOrderGroups'];
};

/**
* List durable attached identities for the selected provider and account.
*
* @returns Stored intent without venue writes, signer setup or automatic replay.
*/
export type PerpsControllerGetAttachedOrderGroupsAction = {
type: `PerpsController:getAttachedOrderGroups`;
handler: PerpsController['getAttachedOrderGroups'];
};

/**
* READ-ONLY list of the active provider's recovered-dispatch outcomes
* (previously ambiguous submissions later resolved). Providers without
* durable dispatch state return an empty list.
*
* @returns Pending recovered-dispatch outcomes.
* durable dispatch state return an empty list. Lighter scans the bounded
* local trading-slot range, including skipped keys, without signing or
* changing quarantine. After controller initialization, this works before
* Lighter signer initialization and after signer setup failure; an in-flight
* selection settles first. Preserve opaque recovery IDs exactly. Raw pending
* dispatches report unknown with acknowledgeable:false and cannot be cleared
* by acknowledgment, including current-session in-flight submissions. Listing
* starts no background reconciliation. A later financial action re-checks
* authoritative state for all account slots before dispatch and remains
* blocked while an obligation is unresolved.
*
* @returns Pending recovered-dispatch outcomes, with their original key slot
* when supplied by the provider.
*/
export type PerpsControllerGetRecoveredDispatchesAction = {
type: `PerpsController:getRecoveredDispatches`;
handler: PerpsController['getRecoveredDispatches'];
};

/**
* Execute an explicit successor for one selected durable protection obligation.
*
* @param params - Owning provider, opaque source ID and new protection intent.
* @returns Settled, unresolved or unsupported recovery result.
*/
export type PerpsControllerResolveRecoveryProtectionAction = {
type: `PerpsController:resolveRecoveryProtection`;
handler: PerpsController['resolveRecoveryProtection'];
};

/**
* Read durable Scale groups without placing or replaying any child.
* @returns Groups belonging to the issuing controller context.
*/
export type PerpsControllerGetScaleOrderGroupsAction = {
type: `PerpsController:getScaleOrderGroups`;
handler: PerpsController['getScaleOrderGroups'];
};

/**
* Reconcile durable Scale groups for an explicitly selected provider.
* @param params - Issuing provider route.
* @param params.providerId - Provider to review.
* @returns Fresh durable groups; never replays placement.
*/
export type PerpsControllerReviewScaleOrderGroupsAction = {
type: `PerpsController:reviewScaleOrderGroups`;
handler: PerpsController['reviewScaleOrderGroups'];
};

/**
* Review fresh venue positions and orders for one issuing provider context.
* Auth signing may be required; registration and financial writes are forbidden.
*
* @param params - Owning provider route.
* @param params.providerId - Explicit provider identifier.
* @returns Strict venue review or honest unsupported capability.
*/
export type PerpsControllerReviewRecoveryVenueAction = {
type: `PerpsController:reviewRecoveryVenue`;
handler: PerpsController['reviewRecoveryVenue'];
};

/**
* Explicit non-financial reconciliation with local persistence. Never signs,
* retries or acknowledges dispatches. Unsupported providers return their local
* listed state, or an empty list when neither capability is available.
* Rejects account, network or provider changes while controller readiness,
* reconciliation or fallback listing completes. Provider rejections propagate
* unchanged.
*
* @returns Newly scoped pending and recovered dispatches.
*/
export type PerpsControllerReconcileRecoveredDispatchesAction = {
type: `PerpsController:reconcileRecoveredDispatches`;
handler: PerpsController['reconcileRecoveredDispatches'];
};

/**
* Acknowledge ONE recovered-dispatch outcome by its stable id, after
* refreshing venue state. Throws when the active provider has no
* durable dispatch state or the id no longer matches.
*
* @param recoveryId - Stable id from {@link getRecoveredDispatches}.
* durable dispatch state or the id no longer matches. Lighter scopes IDs to
* wallet/network/account/key and accepts legacy IDs only when unambiguous
* across local account ledgers. Acknowledgment removes one stored outcome,
* never an unresolved dispatch or a TP/SL journal, and authorizes no retry.
* Rejects account, network, provider or lifecycle changes while readiness or
* acknowledgment completes. A stale rejection after provider success does
* not undo removal in the issuing account. Re-list outcomes before acting
* again. Provider rejections propagate unchanged.
*
* @param recoveryId - Opaque stable id from {@link getRecoveredDispatches}.
* @returns Resolves when the outcome is acknowledged.
*/
export type PerpsControllerAcknowledgeRecoveredDispatchAction = {
Expand Down Expand Up @@ -1477,6 +1605,8 @@ export type PerpsControllerMethodActions =
| PerpsControllerCancelOrderAction
| PerpsControllerGetTwapOrdersAction
| PerpsControllerGetChaseOrdersAction
| PerpsControllerGetChaseOrderOwnershipAction
| PerpsControllerReconcileChaseOrderCancellationAction
| PerpsControllerSuspendChaseOrdersAction
| PerpsControllerCancelOrdersAction
| PerpsControllerClosePositionAction
Expand All @@ -1496,7 +1626,14 @@ export type PerpsControllerMethodActions =
| PerpsControllerGetPositionsAction
| PerpsControllerGetOrderFillsAction
| PerpsControllerGetPendingManualRecoveriesAction
| PerpsControllerReviewAttachedOrderGroupsAction
| PerpsControllerGetAttachedOrderGroupsAction
| PerpsControllerGetRecoveredDispatchesAction
| PerpsControllerResolveRecoveryProtectionAction
| PerpsControllerGetScaleOrderGroupsAction
| PerpsControllerReviewScaleOrderGroupsAction
| PerpsControllerReviewRecoveryVenueAction
| PerpsControllerReconcileRecoveredDispatchesAction
| PerpsControllerAcknowledgeRecoveredDispatchAction
| PerpsControllerGetOrdersAction
| PerpsControllerGetOpenOrdersAction
Expand Down
Loading
Loading