@proof-labs/trading-sdk 7.2.0 → 8.0.0

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.
Files changed (65) hide show
  1. package/README.md +70 -24
  2. package/dist/account-recovery.d.ts +117 -0
  3. package/dist/account-recovery.d.ts.map +1 -0
  4. package/dist/account-recovery.js +330 -0
  5. package/dist/account-recovery.js.map +1 -0
  6. package/dist/bridge.d.ts +5 -8
  7. package/dist/bridge.d.ts.map +1 -1
  8. package/dist/bridge.js +5 -8
  9. package/dist/bridge.js.map +1 -1
  10. package/dist/client.d.ts +59 -55
  11. package/dist/client.d.ts.map +1 -1
  12. package/dist/client.js +252 -223
  13. package/dist/client.js.map +1 -1
  14. package/dist/codec-adapter.d.ts.map +1 -1
  15. package/dist/codec-adapter.js +13 -0
  16. package/dist/codec-adapter.js.map +1 -1
  17. package/dist/errors.d.ts +24 -0
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/errors.js +77 -0
  20. package/dist/errors.js.map +1 -1
  21. package/dist/feed-types.d.ts +22 -0
  22. package/dist/feed-types.d.ts.map +1 -1
  23. package/dist/feed.d.ts +52 -0
  24. package/dist/feed.d.ts.map +1 -1
  25. package/dist/feed.js +342 -24
  26. package/dist/feed.js.map +1 -1
  27. package/dist/financial-state.d.ts +2 -1
  28. package/dist/financial-state.d.ts.map +1 -1
  29. package/dist/financial-state.js +19 -9
  30. package/dist/financial-state.js.map +1 -1
  31. package/dist/governance-query.d.ts.map +1 -1
  32. package/dist/governance-query.js +69 -0
  33. package/dist/governance-query.js.map +1 -1
  34. package/dist/http-transport.d.ts +56 -0
  35. package/dist/http-transport.d.ts.map +1 -0
  36. package/dist/http-transport.js +78 -0
  37. package/dist/http-transport.js.map +1 -0
  38. package/dist/index.d.ts +7 -3
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +5 -2
  41. package/dist/index.js.map +1 -1
  42. package/dist/insurance-funding.d.ts +6 -0
  43. package/dist/insurance-funding.d.ts.map +1 -0
  44. package/dist/insurance-funding.js +54 -0
  45. package/dist/insurance-funding.js.map +1 -0
  46. package/dist/liquidation-config.d.ts +11 -0
  47. package/dist/liquidation-config.d.ts.map +1 -0
  48. package/dist/liquidation-config.js +54 -0
  49. package/dist/liquidation-config.js.map +1 -0
  50. package/dist/liquidation-events.d.ts +135 -0
  51. package/dist/liquidation-events.d.ts.map +1 -0
  52. package/dist/liquidation-events.js +273 -0
  53. package/dist/liquidation-events.js.map +1 -0
  54. package/dist/market-snapshot.d.ts +2 -1
  55. package/dist/market-snapshot.d.ts.map +1 -1
  56. package/dist/market-snapshot.js +4 -2
  57. package/dist/market-snapshot.js.map +1 -1
  58. package/dist/types.d.ts +88 -13
  59. package/dist/types.d.ts.map +1 -1
  60. package/dist/wasm/proof_trading_sdk_wasm.d.ts +1 -1
  61. package/dist/wasm/proof_trading_sdk_wasm.js +1 -1
  62. package/dist/wasm/proof_trading_sdk_wasm_bg.wasm +0 -0
  63. package/dist/wasm-loader.d.ts +3 -3
  64. package/dist/wasm-loader.d.ts.map +1 -1
  65. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ /** `globalThis.fetch`, called with exactly the arguments the request has. */
2
+ export const defaultExchangeHttpTransport = (input, init) => init === undefined ? globalThis.fetch(input) : globalThis.fetch(input, init);
3
+ /** Cancellation traffic and its confirmation are safety-urgent. */
4
+ export function exchangeHttpPriorityForAction(action) {
5
+ return action.type === "CancelOrder" ||
6
+ action.type === "CancelClientOrder" ||
7
+ action.type === "CancelAllOrders"
8
+ ? "urgent"
9
+ : "critical";
10
+ }
11
+ /**
12
+ * Context for a read. Owner-scoped reads (account, open orders, owner
13
+ * history) are `urgent`: a maker reconciles its exposure from them. Other
14
+ * reads are `critical`.
15
+ */
16
+ export function readContext(url, purpose) {
17
+ return {
18
+ purpose,
19
+ priority: purpose === "account" ? "urgent" : "critical",
20
+ surface: surfaceFor(url),
21
+ };
22
+ }
23
+ /**
24
+ * Context for a `reads()` request, which carries no method-level context of
25
+ * its own. A read is owner-scoped, and so `urgent`, when its `/info` body
26
+ * names a `user` or its query string names a `user` or `owner`. An `/info`
27
+ * read is labelled by its type (`api_info_openOrders`), as the typed reads
28
+ * are.
29
+ */
30
+ export function gatewayReadContext(url, init) {
31
+ let infoType;
32
+ let owned = false;
33
+ if (typeof init?.body === "string") {
34
+ try {
35
+ const body = JSON.parse(init.body);
36
+ if (body !== null && typeof body === "object") {
37
+ const fields = body;
38
+ if (typeof fields.type === "string")
39
+ infoType = fields.type;
40
+ owned = typeof fields.user === "string";
41
+ }
42
+ }
43
+ catch {
44
+ /* not a JSON body: classified by its URL alone */
45
+ }
46
+ }
47
+ const query = url.includes("?")
48
+ ? new URLSearchParams(url.slice(url.indexOf("?") + 1))
49
+ : undefined;
50
+ if (query?.has("user") || query?.has("owner"))
51
+ owned = true;
52
+ const context = readContext(url, owned ? "account" : "query");
53
+ return infoType === undefined
54
+ ? context
55
+ : { ...context, surface: `api_info_${infoType}` };
56
+ }
57
+ const ID_SEGMENT = /^(0x)?[0-9a-fA-F]{40}$|^(0x)?[0-9a-fA-F]{64}$|^\d+$/;
58
+ /**
59
+ * A stable label for a request URL: `api_` plus the path below `/v1/`, with
60
+ * owner, hash and numeric id segments dropped, so `/v1/orderbook/7` and
61
+ * `/v1/orderbook/9` share `api_orderbook`. A path outside `/v1/` is labelled
62
+ * by its own segments (`/info` becomes `api_info`).
63
+ */
64
+ export function surfaceFor(url) {
65
+ let path;
66
+ try {
67
+ path = new URL(url).pathname;
68
+ }
69
+ catch {
70
+ path = url.split("?")[0] ?? url;
71
+ }
72
+ const segments = path
73
+ .split("/")
74
+ .filter((s) => s !== "" && s !== "v1" && !ID_SEGMENT.test(s))
75
+ .map((s) => s.replace(/[^A-Za-z0-9]+/g, "_").toLowerCase());
76
+ return `api_${segments.join("_") || "root"}`;
77
+ }
78
+ //# sourceMappingURL=http-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-transport.js","sourceRoot":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,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC5D,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9D,OAAO,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,MAAM,EAAE,CAAC;AAC/C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- export { type Address, Side, TimeInForce, ActionType, type ActionTypeValue, type Action, type TraderAction, type OperatorAction, type PlaceOrder, type CancelOrder, type CancelClientOrder, type CancelAllOrders, type CancelReplaceOrder, type AmendOrder, type AtomicBasketLeg, type AtomicBasketOrder, type ClosePosition, type OracleUpdate, type OracleUpdateComposite, type MarketOrder, type MarketsSnapshot, type Deposit, type Withdraw, type CreateMarket, type WithdrawRequest, type ConfirmDeposit, type DepositLocator, type ConfirmWithdrawal, type FailWithdrawal, type ConfirmWithdrawalReceipt, type FailWithdrawalReceipt, type AuthorizeWithdrawal, type TriggerLimb, type SetPositionTriggers, type CancelPositionTriggers, type SetTriggerMarketConfig, type SetOracleGuards, type ScheduleUpgrade, type CancelUpgrade, type BridgeWithdrawalReceipt, type OperatorReceiptProof, type ApproveAgent, type RevokeAgent, type EventOracleSource, type PriceComparison, type ResolveEvent, type CreateEvent, type AttachConditional, type AttachedConditional, type EventInfo, type EventStatus, type CreateSubAccount, type SubAccountTransfer, type ClaimWithdrawalPayout, type UpdateMarketFees, type SetUserMarketLeverage, type GovernanceAction, type AdminAction, type AdminBatchItem, type EmergencyAction, type UpdateAdminSignerRegistry, type CancelAllOrdersForAccount, type ProposeAdminAction, type ApproveAdminAction, type RejectAdminAction, type EmergencyAdminAction, type AdminSignerRegistry, type AuthoritiesSnapshot, type PendingUpgradePlan, type ExecutedUpgrade, type UpgradesInfo, type NodeVersion, type ExpiryReason, type ProposalStatus, type ProposalDisplayInfo, type ProposalPage, Branch, Outcome, type TxResult, type TxOutcome, type TxEvent, type ExchangeEvent, type OrderPlacedEvent, type OrderCancelledEvent, type CancelReason, type OrderMigratedEvent, type PositionMigratedEvent, type TradeExecutedEvent, type PositionUpdatedEvent, type PositionClosedEvent, type PriceUpdatedEvent, type FundingAppliedEvent, type FundingSettledEvent, type AccountLiquidatedEvent, type InsuranceFundUpdatedEvent, type PositionAutoDeleveragedEvent, type PlpAbsorbedEvent, type MarketCreatedEvent, type AdlQueueEntry, type Ticker, type Orderbook, type OrderbookLevel, type OpenOrder, type TriggerKind, type TriggerLimbState, type TriggerOutcomeReason, type TriggerEvaluation, type StoredTriggerLimb, type TriggerMarketConfig, type PendingTriggerMarketConfig, type TriggerMarketConfigState, type TriggerMarketConfigInfo, type TriggerEffectiveAvailability, type PositionTriggerBracket, type PositionTriggerInfo, type TriggerStatus, type TriggerHistoryTime, type PositionTriggerHistoryFilters, type TriggerMarketHistoryFilters, type PositionTriggerHistoryEventType, type TriggerMarketHistoryEventType, type TriggerHistoryEventType, type TriggerHistoryPayloadBase, type OwnerTriggerHistoryPayloadBase, type PendingTriggerHistoryPayloadBase, type PendingTriggersAttachedHistoryPayload, type PendingTriggersDiscardedHistoryPayload, type PendingTriggerDiscardReason, type PositionTriggersSetHistoryPayload, type PositionTriggersCancelledHistoryPayload, type PositionTriggersInvalidatedHistoryPayload, type PositionTriggerActivatedHistoryPayload, type PositionTriggerExecutedHistoryPayload, type PositionTriggerDeferredHistoryPayload, type TriggerMarketDeferredHistoryPayload, type TriggerMarketResumedHistoryPayload, type TriggerHistoryEvent, type PositionTriggerHistoryEvent, type TriggerMarketHistoryEvent, type PositionTriggerHistoryPage, type TriggerMarketHistoryPage, type AccountInfo, type PositionInfo, type MarketConfig, type MarkSourceMode, type BindingScenarioEntry, type HistoryCashFlow, type HistoryFill, type HistoryFillsPage, type HistoryResolution, type ConversionFallbackReason, type HistoryPositionSnapshot, type HistoryPosition, type HistoryPositionsPage, type WithdrawalStatus, type WithdrawalRecord, type MarketKind, type FeeTier, type AgentApprovedEvent, type AgentRevokedEvent, type FeesCollectedEvent, } from "./types.js";
1
+ export { type Address, Side, TimeInForce, ActionType, type ActionTypeValue, type Action, type TraderAction, type OperatorAction, type PlaceOrder, type CancelOrder, type CancelClientOrder, type CancelAllOrders, type CancelReplaceOrder, type AmendOrder, type AtomicBasketLeg, type AtomicBasketOrder, type ClosePosition, type OracleUpdate, type OracleUpdateComposite, type MarketOrder, type MarketsSnapshot, type Deposit, type Withdraw, type CreateMarket, type WithdrawRequest, type ConfirmDeposit, type DepositLocator, type ConfirmWithdrawal, type FailWithdrawal, type ConfirmWithdrawalReceipt, type FailWithdrawalReceipt, type AuthorizeWithdrawal, type TriggerLimb, type SetPositionTriggers, type CancelPositionTriggers, type SetTriggerMarketConfig, type SetOracleGuards, type FundInsuranceFund, type InsuranceFundAllocation, type WithdrawInsuranceFund, type LiquidationConfig, type SetLiquidationConfig, type ScheduleUpgrade, type CancelUpgrade, type BridgeWithdrawalReceipt, type OperatorReceiptProof, type ApproveAgent, type RevokeAgent, type EventOracleSource, type PriceComparison, type ResolveEvent, type CreateEvent, type AttachConditional, type AttachedConditional, type EventInfo, type EventStatus, type CreateSubAccount, type SubAccountTransfer, type ClaimWithdrawalPayout, type UpdateMarketFees, type SetUserMarketLeverage, type GovernanceAction, type AdminAction, type AdminBatchItem, type EmergencyAction, type UpdateAdminSignerRegistry, type CancelAllOrdersForAccount, type ProposeAdminAction, type ApproveAdminAction, type RejectAdminAction, type EmergencyAdminAction, type AdminSignerRegistry, type AuthoritiesSnapshot, type PendingUpgradePlan, type ExecutedUpgrade, type UpgradesInfo, type NodeVersion, type ExpiryReason, type ProposalStatus, type ProposalDisplayInfo, type ProposalPage, Branch, Outcome, type TxResult, type TxOutcome, type TxEvent, type ExchangeEvent, type OrderPlacedEvent, type OrderCancelledEvent, type CancelReason, type OrderMigratedEvent, type PositionMigratedEvent, type TradeExecutedEvent, type PositionUpdatedEvent, type PositionClosedEvent, type PriceUpdatedEvent, type FundingAppliedEvent, type FundingSettledEvent, type AccountLiquidatedEvent, type InsuranceFundUpdatedEvent, type PositionAutoDeleveragedEvent, type PlpAbsorbedEvent, type MarketCreatedEvent, type AdlQueueEntry, type Ticker, type Orderbook, type OrderbookLevel, type OpenOrder, type TriggerKind, type TriggerLimbState, type TriggerOutcomeReason, type TriggerEvaluation, type StoredTriggerLimb, type TriggerMarketConfig, type PendingTriggerMarketConfig, type TriggerMarketConfigState, type TriggerMarketConfigInfo, type TriggerEffectiveAvailability, type PositionTriggerBracket, type PositionTriggerInfo, type TriggerStatus, type TriggerHistoryTime, type PositionTriggerHistoryFilters, type TriggerMarketHistoryFilters, type PositionTriggerHistoryEventType, type TriggerMarketHistoryEventType, type TriggerHistoryEventType, type TriggerHistoryPayloadBase, type OwnerTriggerHistoryPayloadBase, type PendingTriggerHistoryPayloadBase, type PendingTriggersAttachedHistoryPayload, type PendingTriggersDiscardedHistoryPayload, type PendingTriggerDiscardReason, type PositionTriggersSetHistoryPayload, type PositionTriggersCancelledHistoryPayload, type PositionTriggersInvalidatedHistoryPayload, type PositionTriggerActivatedHistoryPayload, type PositionTriggerExecutedHistoryPayload, type PositionTriggerDeferredHistoryPayload, type TriggerMarketDeferredHistoryPayload, type TriggerMarketResumedHistoryPayload, type TriggerHistoryEvent, type PositionTriggerHistoryEvent, type TriggerMarketHistoryEvent, type PositionTriggerHistoryPage, type TriggerMarketHistoryPage, type AccountInfo, type PositionInfo, type MarketConfig, type MarkSourceMode, type BindingScenarioEntry, type HistoryCashFlow, type HistoryFill, type HistoryFillsPage, type HistoryResolution, type ConversionFallbackReason, type HistoryPositionSnapshot, type HistoryPosition, type HistoryPositionsPage, type WithdrawalStatus, type WithdrawalRecord, type MarketKind, type FeeTier, type AgentApprovedEvent, type AgentRevokedEvent, type FeesCollectedEvent, } from "./types.js";
2
2
  export { MAX_TRIGGER_SLIPPAGE_BPS, validateSetPositionTriggers, validateCancelPositionTriggers, validateOrderTriggers, type OrderTriggerFields, validateSetTriggerMarketConfig, decodePositionTriggerInfos, decodeTriggerMarketConfigInfos, decodeTriggerStatusJson, } from "./triggers.js";
3
3
  export { validateSetOracleGuards } from "./oracle-guards.js";
4
4
  export { validateScheduleUpgrade } from "./upgrade-plan.js";
5
+ export { MAX_PARTIAL_PENALTY_BPS, RATIO_ONE_BPS, validateLiquidationConfig, validateSetLiquidationConfig, } from "./liquidation-config.js";
6
+ export { ADL_SKIP_REASONS, LIQUIDATION_MODES, LIQUIDATION_PROGRESS_OUTCOMES, LIQUIDATION_REFUSALS, LIQUIDATION_REFUSED_CODE, decodeLiquidationEvent, type AdlCounterpartySkippedEvent, type AdlSkipReason, type LiquidationConfigSetEvent, type LiquidationEvent, type LiquidationEventInput, type LiquidationFailedEvent, type LiquidationMode, type LiquidationProgress, type LiquidationProgressReportedEvent, type LiquidationRefusal, type PartialLiquidationFeeEvent, type PositionLiquidatedEvent, } from "./liquidation-events.js";
5
7
  export { BINARY_PRICE_MAX, BinaryPriceError, type BinaryErrorName, type BinaryPositionView, type NoOrder, binaryPositionView, yesLimb, yesOrder, yesSide, } from "./binary.js";
6
8
  export { decodePositionTriggerHistoryPage, decodeTriggerMarketHistoryPage, positionTriggerHistorySearchParams, triggerMarketHistorySearchParams, } from "./trigger-history.js";
7
9
  export { ENVELOPE_VERSION, encodeSignedTx, signAndEncode, signEnvelopeFromPayload, encodePayloadBytes, decodeTx, decodeSigningMessage, type DecodedSigningMessage, peekActionType, adminProposalContentHash, type AdminProposalContext, } from "./codec.js";
@@ -9,15 +11,17 @@ export { ready } from "./wasm-loader.js";
9
11
  export { decodeAdminAction, decodeAdminSignerRegistry, decodeAdminSignerRegistryInfo, decodeAuthoritiesSnapshot, decodeUpgradesInfo, decodeNodeVersion, decodeProposalPage, decodeProposalDisplayInfo, decodeProposalStatus, } from "./governance-query.js";
10
12
  export { fetchChainId } from "./client.js";
11
13
  export { BRIDGE_RECEIPT_LEN, QUORUM_OPERATOR_M_OF_N, TERMINAL_CANCELLED, TERMINAL_PAID, VAULT_TIER_COLD, VAULT_TIER_HOT, VAULT_TIER_WARM, WITHDRAWAL_AUTHORIZATION_LEN, encodeBridgeReceipt, encodeWithdrawalAuthorization, signOperatorReceipt, withdrawalAuthorizationDigest, type WithdrawalAuthorizationV1, } from "./bridge.js";
12
- export { GatewayHttpError, isMissingMark, type ExecErrorInfo, ExecErrorCode, decodeExecError, execErrorName, } from "./errors.js";
14
+ export { FeedSubscriptionError, GatewayHttpError, isMissingMark, type ExecErrorInfo, ExecErrorCode, decodeExecError, execErrorName, } from "./errors.js";
13
15
  export { generateKeypair, getPublicKey, pubkeyToOwner, deriveSubAccount, SUB_ACCOUNT_DERIVATION_DOMAIN, ownerToHex, hexToBytes, bytesToHex, signingMessage, sign, verify, chainIdFromString, UNBOUND_CHAIN_ID, DOMAIN_PREFIX, } from "./crypto.js";
14
- export { ExchangeClient, type ExchangeClientOptions, type WsStreamOptions, } from "./client.js";
16
+ export { ExchangeClient, type ExchangeClientOptions } from "./client.js";
17
+ export { defaultExchangeHttpTransport, exchangeHttpPriorityForAction, type ExchangeHttpPriority, type ExchangeHttpPurpose, type ExchangeHttpRequestContext, type ExchangeHttpTransport, } from "./http-transport.js";
15
18
  export { decodeOraclePermissions, ORACLE_DIAGNOSTIC_BITS, ORACLE_FAULT_BITS, } from "./oracle-permissions.js";
16
19
  export { decodeFinancialState, type FinancialStateSelection, type FinancialState, type FinancialAccountState, type FinancialMarketState, } from "./financial-state.js";
17
20
  export { decodeAccountState, type AccountState, type RawAccountPosition, } from "./account-state.js";
18
21
  export type { OraclePermissions, OraclePolicyEpoch, OraclePolicySource, CommittedOracleVerdict, OracleVerdictStatus, OracleVerdictReason, OracleSelectedSource, OracleVerdictDiagnostic, } from "./oracle-permissions.js";
19
22
  export { GatewayFeed, type GatewayFeedOptions, type AccountFeedAuth, type AccountAuthProvider, type WebSocketLike, type WebSocketFactory, } from "./feed.js";
20
23
  export type { FeedChannel, FeedOrderbookLevel, OrderbookSnapshotFrame, OrderbookUpdateFrame, OrderbookFrame, TradeFrame, AccountSnapshotFrame, AccountEventFrame, AccountFrame, FeedFrame, FeedErrorFrame, FeedState, } from "./feed-types.js";
24
+ export type { AccountEventKey, AccountRecoveryStatus, } from "./account-recovery.js";
21
25
  export { type GatewayReads, type GatewayReadOptions, type GatewayFetch, type HistoryWindow, type OwnerHistoryParams, type CandleHistoryParams, type AccountEventsParams, type ExplorerBlocksParams, type GatewayTriggerLimbJson, type GatewayPendingTriggerRow, type GatewayTriggerPositionRow, } from "./gateway-reads.js";
22
26
  export { decodeSubAccountList, type SubAccountListRow, } from "./sub-accounts.js";
23
27
  export type { ExternalSigner } from "./client.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAA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,GACvB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EACV,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,8 @@ export { Side, TimeInForce, ActionType, Branch, Outcome, } from "./types.js";
3
3
  export { MAX_TRIGGER_SLIPPAGE_BPS, validateSetPositionTriggers, validateCancelPositionTriggers, validateOrderTriggers, validateSetTriggerMarketConfig, decodePositionTriggerInfos, decodeTriggerMarketConfigInfos, decodeTriggerStatusJson, } from "./triggers.js";
4
4
  export { validateSetOracleGuards } from "./oracle-guards.js";
5
5
  export { validateScheduleUpgrade } from "./upgrade-plan.js";
6
+ export { MAX_PARTIAL_PENALTY_BPS, RATIO_ONE_BPS, validateLiquidationConfig, validateSetLiquidationConfig, } from "./liquidation-config.js";
7
+ export { ADL_SKIP_REASONS, LIQUIDATION_MODES, LIQUIDATION_PROGRESS_OUTCOMES, LIQUIDATION_REFUSALS, LIQUIDATION_REFUSED_CODE, decodeLiquidationEvent, } from "./liquidation-events.js";
6
8
  export { BINARY_PRICE_MAX, BinaryPriceError, binaryPositionView, yesLimb, yesOrder, yesSide, } from "./binary.js";
7
9
  export { decodePositionTriggerHistoryPage, decodeTriggerMarketHistoryPage, positionTriggerHistorySearchParams, triggerMarketHistorySearchParams, } from "./trigger-history.js";
8
10
  // Codec
@@ -20,11 +22,12 @@ export { fetchChainId } from "./client.js";
20
22
  // engine's receipt path signs and verifies.
21
23
  export { BRIDGE_RECEIPT_LEN, QUORUM_OPERATOR_M_OF_N, TERMINAL_CANCELLED, TERMINAL_PAID, VAULT_TIER_COLD, VAULT_TIER_HOT, VAULT_TIER_WARM, WITHDRAWAL_AUTHORIZATION_LEN, encodeBridgeReceipt, encodeWithdrawalAuthorization, signOperatorReceipt, withdrawalAuthorizationDigest, } from "./bridge.js";
22
24
  // Errors
23
- export { GatewayHttpError, isMissingMark, ExecErrorCode, decodeExecError, execErrorName, } from "./errors.js";
25
+ export { FeedSubscriptionError, GatewayHttpError, isMissingMark, ExecErrorCode, decodeExecError, execErrorName, } from "./errors.js";
24
26
  // Crypto
25
27
  export { generateKeypair, getPublicKey, pubkeyToOwner, deriveSubAccount, SUB_ACCOUNT_DERIVATION_DOMAIN, ownerToHex, hexToBytes, bytesToHex, signingMessage, sign, verify, chainIdFromString, UNBOUND_CHAIN_ID, DOMAIN_PREFIX, } from "./crypto.js";
26
28
  // Client
27
- export { ExchangeClient, } from "./client.js";
29
+ export { ExchangeClient } from "./client.js";
30
+ export { defaultExchangeHttpTransport, exchangeHttpPriorityForAction, } from "./http-transport.js";
28
31
  export { decodeOraclePermissions, ORACLE_DIAGNOSTIC_BITS, ORACLE_FAULT_BITS, } from "./oracle-permissions.js";
29
32
  export { decodeFinancialState, } from "./financial-state.js";
30
33
  export { decodeAccountState, } from "./account-state.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,UAAU,EAyEV,MAAM,EACN,OAAO,GAoFR,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,8BAA8B,EAC9B,qBAAqB,EAErB,8BAA8B,EAC9B,0BAA0B,EAC1B,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC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J,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,SAAS;AACT,OAAO,EAAE,cAAc,EAA8B,MAAM,aAAa,CAAC;AACzE,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAK9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,oBAAoB,GAKrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,GAGnB,MAAM,oBAAoB,CAAC;AAY5B,OAAO,EACL,WAAW,GAMZ,MAAM,WAAW,CAAC;AAgCnB,OAAO,EACL,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,2BAA2B,GAI5B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,GAI1B,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { FundInsuranceFund, WithdrawInsuranceFund } from "./types.js";
2
+ /** Mirrors proposal shape checks, not authority, balance or live-state checks. */
3
+ export declare function validateFundInsuranceFund(value: FundInsuranceFund): void;
4
+ /** Shape checks only: quorum and pool balances remain engine checks. */
5
+ export declare function validateWithdrawInsuranceFund(value: WithdrawInsuranceFund): void;
6
+ //# sourceMappingURL=insurance-funding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insurance-funding.d.ts","sourceRoot":"","sources":["../src/insurance-funding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA6DpB,kFAAkF;AAClF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAIxE;AAED,wEAAwE;AACxE,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,qBAAqB,GAC3B,IAAI,CAIN"}
@@ -0,0 +1,54 @@
1
+ const U64_MAX = (1n << 64n) - 1n;
2
+ const I64_MAX = (1n << 63n) - 1n;
3
+ /** Allocation bound enforced by the engine's insurance `validate_transfer`. */
4
+ const MAX_ALLOCATIONS = 8;
5
+ function validateAccount(value, field) {
6
+ if (!(value instanceof Uint8Array) ||
7
+ value.length !== 20 ||
8
+ !value.some(Boolean)) {
9
+ throw new Error(`${field} must be a 20-byte non-zero account address`);
10
+ }
11
+ }
12
+ function validateId(value, field) {
13
+ if (typeof value !== "bigint" || value < 0n || value > U64_MAX) {
14
+ throw new Error(`${field} must be an unsigned 64-bit bigint`);
15
+ }
16
+ }
17
+ function validateAllocations(allocations, label) {
18
+ if (!Array.isArray(allocations) ||
19
+ allocations.length < 1 ||
20
+ allocations.length > MAX_ALLOCATIONS) {
21
+ throw new Error(`${label} requires 1..${MAX_ALLOCATIONS} allocations`);
22
+ }
23
+ let previous = -1;
24
+ let total = 0n;
25
+ for (const [i, allocation] of allocations.entries()) {
26
+ if (!Number.isInteger(allocation.poolId) ||
27
+ allocation.poolId <= previous ||
28
+ allocation.poolId > 255) {
29
+ throw new Error(`${label} allocations[${i}].poolId must be an unsigned byte in strictly ascending order`);
30
+ }
31
+ previous = allocation.poolId;
32
+ if (typeof allocation.amount !== "bigint" ||
33
+ allocation.amount <= 0n ||
34
+ allocation.amount > I64_MAX) {
35
+ throw new Error(`${label} allocations[${i}].amount must be a positive bigint within i64::MAX`);
36
+ }
37
+ total += allocation.amount;
38
+ if (total > I64_MAX)
39
+ throw new Error(`${label} total exceeds i64::MAX`);
40
+ }
41
+ }
42
+ /** Mirrors proposal shape checks, not authority, balance or live-state checks. */
43
+ export function validateFundInsuranceFund(value) {
44
+ validateAccount(value.source, "insurance funding source");
45
+ validateId(value.fundingId, "fundingId");
46
+ validateAllocations(value.allocations, "insurance funding");
47
+ }
48
+ /** Shape checks only: quorum and pool balances remain engine checks. */
49
+ export function validateWithdrawInsuranceFund(value) {
50
+ validateId(value.withdrawalId, "withdrawalId");
51
+ validateAccount(value.recipient, "insurance withdrawal recipient");
52
+ validateAllocations(value.allocations, "insurance withdrawal");
53
+ }
54
+ //# sourceMappingURL=insurance-funding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insurance-funding.js","sourceRoot":"","sources":["../src/insurance-funding.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AACjC,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AACjC,+EAA+E;AAC/E,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,SAAS,eAAe,CAAC,KAAiB,EAAE,KAAa;IACvD,IACE,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC;QAC9B,KAAK,CAAC,MAAM,KAAK,EAAE;QACnB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EACpB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,6CAA6C,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,KAAa;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,EAAE,IAAI,KAAK,GAAG,OAAO,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,oCAAoC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,WAAsC,EACtC,KAAa;IAEb,IACE,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC3B,WAAW,CAAC,MAAM,GAAG,CAAC;QACtB,WAAW,CAAC,MAAM,GAAG,eAAe,EACpC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,gBAAgB,eAAe,cAAc,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,IAAI,KAAK,GAAG,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AW,EAAE,sBAAsB,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { LiquidationConfig, SetLiquidationConfig } from "./types.js";
2
+ /** Basis points that equal a ratio of one. */
3
+ export declare const RATIO_ONE_BPS = 10000;
4
+ /** Largest partial-liquidation penalty a configuration may carry. */
5
+ export declare const MAX_PARTIAL_PENALTY_BPS = 100;
6
+ /** Mirror proof-wire's `LiquidationConfig::validate`. */
7
+ export declare function validateLiquidationConfig(config: LiquidationConfig): void;
8
+ /** Mirror proof-wire's `SetLiquidationConfig::validate`. Whether
9
+ * `predecessor` names the stored configuration stays an engine check. */
10
+ export declare function validateSetLiquidationConfig(action: SetLiquidationConfig): void;
11
+ //# sourceMappingURL=liquidation-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquidation-config.d.ts","sourceRoot":"","sources":["../src/liquidation-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAK1E,8CAA8C;AAC9C,eAAO,MAAM,aAAa,QAAS,CAAC;AAEpC,qEAAqE;AACrE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAc3C,yDAAyD;AACzD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CA4BzE;AAED;0EAC0E;AAC1E,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,oBAAoB,GAC3B,IAAI,CAON"}
@@ -0,0 +1,54 @@
1
+ const U32_MAX = 0xffff_ffff;
2
+ const U64_MAX = (1n << 64n) - 1n;
3
+ /** Basis points that equal a ratio of one. */
4
+ export const RATIO_ONE_BPS = 10_000;
5
+ /** Largest partial-liquidation penalty a configuration may carry. */
6
+ export const MAX_PARTIAL_PENALTY_BPS = 100;
7
+ function u32(value, field) {
8
+ if (!Number.isInteger(value) || value < 0 || value > U32_MAX) {
9
+ throw new Error(`${field} must be an integer in 0..=${U32_MAX}`);
10
+ }
11
+ }
12
+ function u64(value, field) {
13
+ if (typeof value !== "bigint" || value < 0n || value > U64_MAX) {
14
+ throw new Error(`${field} must be an unsigned 64-bit bigint`);
15
+ }
16
+ }
17
+ /** Mirror proof-wire's `LiquidationConfig::validate`. */
18
+ export function validateLiquidationConfig(config) {
19
+ const fields = [
20
+ "targetRatioBps",
21
+ "partialPenaltyBps",
22
+ "maxBookOrders",
23
+ "maxCommittedFills",
24
+ ];
25
+ for (const field of fields)
26
+ u32(config[field], field);
27
+ const { numerator, denominator } = config.fullCloseThreshold;
28
+ u32(numerator, "fullCloseThreshold.numerator");
29
+ u32(denominator, "fullCloseThreshold.denominator");
30
+ if (config.targetRatioBps <= RATIO_ONE_BPS) {
31
+ throw new Error(`targetRatioBps must exceed ${RATIO_ONE_BPS}`);
32
+ }
33
+ if (numerator === 0 || numerator >= denominator) {
34
+ throw new Error("fullCloseThreshold must be strictly between 0 and 1 (0 < numerator < denominator)");
35
+ }
36
+ if (config.partialPenaltyBps > MAX_PARTIAL_PENALTY_BPS) {
37
+ throw new Error(`partialPenaltyBps must be at most ${MAX_PARTIAL_PENALTY_BPS}`);
38
+ }
39
+ for (const field of fields.slice(2)) {
40
+ if (config[field] === 0)
41
+ throw new Error(`${field} must be non-zero`);
42
+ }
43
+ }
44
+ /** Mirror proof-wire's `SetLiquidationConfig::validate`. Whether
45
+ * `predecessor` names the stored configuration stays an engine check. */
46
+ export function validateSetLiquidationConfig(action) {
47
+ u64(action.predecessor, "predecessor");
48
+ u64(action.sequence, "sequence");
49
+ if (action.sequence <= action.predecessor) {
50
+ throw new Error("sequence must exceed predecessor");
51
+ }
52
+ validateLiquidationConfig(action.config);
53
+ }
54
+ //# sourceMappingURL=liquidation-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquidation-config.js","sourceRoot":"","sources":["../src/liquidation-config.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,WAAW,CAAC;AAC5B,MAAM,OAAO,GAAG,CAAC,EAAE,IA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SAAS,IAAI,WAAW,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,iBAAiB,GAAG,uBAAuB,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,qCAAqC,uBAAuB,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,mBAAmB,CAAC,CAAC;IACxE,CAAC;AACH,CAAC;AAED;0EAC0E;AAC1E,MAAM,UAAU,4BAA4B,CAC1C,MAA4B;IAE5B,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACjC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,yBAAyB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Typed decoders for the engine's liquidation events, from the string
3
+ * attributes of one ABCI event: a transaction's `TxEvent`, or a payload the
4
+ * indexer or the account feed carries verbatim.
5
+ *
6
+ * Every integer attribute is a decimal string; a u64 or i64 decodes to
7
+ * `bigint`, since identifiers and amounts can exceed 2^53. An address is 40
8
+ * lowercase hex characters. Attributes these decoders do not name, such as the chain
9
+ * coordinates (`block_height`, `event_key`, …), are ignored. A malformed
10
+ * event throws; an event of another type decodes to `null`.
11
+ */
12
+ import type { BindingScenarioEntry, LiquidationConfig, TxEvent } from "./types.js";
13
+ /** How one liquidation attempt on an owner ended in a block, as the
14
+ * engine writes it into the `outcome` attribute today. A later engine may
15
+ * add a value; the decoder passes it through. */
16
+ export declare const LIQUIDATION_PROGRESS_OUTCOMES: readonly ["not_eligible", "indeterminate", "restored_by_cancellation", "no_fill", "safe_progress", "maintenance_restored_below_target", "target_reached", "full_close_restored_by_cancellation", "full_close_no_fill", "full_close_partly_closed", "full_close_closed", "insolvent", "deferred", "failed"];
17
+ export type LiquidationProgress = (typeof LIQUIDATION_PROGRESS_OUTCOMES)[number] | (string & {});
18
+ /** Which path liquidated a position, as the `mode` attribute names it:
19
+ * `partial` is a step through the book toward the target ratio, `full` a
20
+ * close through the book below the full-close threshold, and `insolvent` a
21
+ * close at mark because equity is negative in some outcome. A later engine
22
+ * may add a mode; the decoder passes it through. */
23
+ export declare const LIQUIDATION_MODES: readonly ["partial", "full", "insolvent"];
24
+ export type LiquidationMode = (typeof LIQUIDATION_MODES)[number] | (string & {});
25
+ /** Why a liquidation attempt was refused rather than failing on an engine
26
+ * error: a position changed under the step reducing it, a resting order
27
+ * did not match its book, or a reference price was unavailable. A later
28
+ * engine may add a reason; the decoder passes it through. */
29
+ export declare const LIQUIDATION_REFUSALS: readonly ["position_mismatch", "invalid_maker", "reference_unavailable"];
30
+ export type LiquidationRefusal = (typeof LIQUIDATION_REFUSALS)[number] | (string & {});
31
+ /** The engine error code of a refused liquidation attempt
32
+ * (`ExecErrorCode.LiquidationRefused`). */
33
+ export declare const LIQUIDATION_REFUSED_CODE = 111;
34
+ /** Why auto-deleveraging left a profitable position out of a deficit's
35
+ * candidate set: `stale_oracle_dependency` means a market the
36
+ * counterparty's portfolio depends on (a position or a resting order) had
37
+ * no fresh oracle verdict, so its solvency was indeterminate. A later engine
38
+ * may add a reason; the decoder passes it through. */
39
+ export declare const ADL_SKIP_REASONS: readonly ["stale_oracle_dependency"];
40
+ export type AdlSkipReason = (typeof ADL_SKIP_REASONS)[number] | (string & {});
41
+ /** The admin quorum replaced the global liquidation configuration. */
42
+ export interface LiquidationConfigSetEvent {
43
+ type: "LiquidationConfigSet";
44
+ sequence: bigint;
45
+ config: LiquidationConfig;
46
+ proposalId: bigint;
47
+ }
48
+ /**
49
+ * The partial-liquidation penalty on one book fill that reduced `owner`'s
50
+ * position. `collected` was paid to `poolId`'s insurance fund; `waived` is
51
+ * never owed later; `assessed = collected + waived`.
52
+ */
53
+ export interface PartialLiquidationFeeEvent {
54
+ type: "PartialLiquidationFee";
55
+ owner: string;
56
+ market: number;
57
+ poolId: number;
58
+ fillId: bigint;
59
+ configSequence: bigint;
60
+ assessed: bigint;
61
+ collected: bigint;
62
+ waived: bigint;
63
+ }
64
+ /** How one owner named in a liquidation batch ended this block. */
65
+ export interface LiquidationProgressReportedEvent {
66
+ type: "LiquidationProgressReported";
67
+ owner: string;
68
+ outcome: LiquidationProgress;
69
+ configSequence: bigint;
70
+ }
71
+ /**
72
+ * One position an owner's liquidation attempt reduced, once per position
73
+ * per attempt. `sizeBefore` is the position's size before the attempt's
74
+ * first step, `sizeClosed` the total its steps closed, and `sizeAfter` what
75
+ * is left. The penalty is the sum of the per-fill penalties charged on this
76
+ * position: `penaltyCollected` went to the insurance fund and
77
+ * `penaltyWaived` is never owed later; a close at mark charges none.
78
+ * `equity` (signed), `maintenance` and `bindingOutcome` are the owner's
79
+ * binding outcome, with pending funding, when the attempt was decided.
80
+ * `bindingOutcome` has one entry per event of the account's domain, and is
81
+ * empty when the account holds no event exposure.
82
+ */
83
+ export interface PositionLiquidatedEvent {
84
+ type: "PositionLiquidated";
85
+ owner: string;
86
+ market: number;
87
+ side: "buy" | "sell";
88
+ mode: LiquidationMode;
89
+ sizeBefore: bigint;
90
+ sizeClosed: bigint;
91
+ sizeAfter: bigint;
92
+ penaltyCollected: bigint;
93
+ penaltyWaived: bigint;
94
+ equity: bigint;
95
+ maintenance: bigint;
96
+ bindingOutcome: BindingScenarioEntry[];
97
+ configSequence: bigint;
98
+ }
99
+ /**
100
+ * An owner's liquidation attempt failed and kept none of its writes.
101
+ * `code` is the engine error code. `refusal` names why when the attempt was
102
+ * refused (the engine writes `LIQUIDATION_REFUSED_CODE` then), and is
103
+ * `null` when it failed on another engine error.
104
+ */
105
+ export interface LiquidationFailedEvent {
106
+ type: "LiquidationFailed";
107
+ owner: string;
108
+ code: number;
109
+ refusal: LiquidationRefusal | null;
110
+ }
111
+ /** Auto-deleveraging left `owner`'s profitable position of `size` on
112
+ * `market` out of the candidate set for `poolId`'s deficit. */
113
+ export interface AdlCounterpartySkippedEvent {
114
+ type: "AdlCounterpartySkipped";
115
+ owner: string;
116
+ market: number;
117
+ poolId: number;
118
+ size: bigint;
119
+ reason: AdlSkipReason;
120
+ }
121
+ export type LiquidationEvent = LiquidationConfigSetEvent | PartialLiquidationFeeEvent | LiquidationProgressReportedEvent | PositionLiquidatedEvent | LiquidationFailedEvent | AdlCounterpartySkippedEvent;
122
+ /** One ABCI event: a `TxEvent`'s attribute list, or the same attributes as
123
+ * a plain object. */
124
+ export interface LiquidationEventInput {
125
+ type: string;
126
+ attributes: TxEvent["attributes"] | Readonly<Record<string, unknown>>;
127
+ }
128
+ /**
129
+ * Decode one of the six liquidation events from its ABCI type (the
130
+ * engine's snake_case name, e.g. `"partial_liquidation_fee"`) and string
131
+ * attributes. Returns `null` for any other event type, so a caller can run
132
+ * it over every event of a transaction or block.
133
+ */
134
+ export declare function decodeLiquidationEvent(event: LiquidationEventInput): LiquidationEvent | null;
135
+ //# sourceMappingURL=liquidation-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquidation-events.d.ts","sourceRoot":"","sources":["../src/liquidation-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,OAAO,EACR,MAAM,YAAY,CAAC;AAGpB;;kDAEkD;AAClD,eAAO,MAAM,6BAA6B,4SAehC,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM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