@somnia-chain/markets-sdk / index / isLiquidationKind
Function: isLiquidationKind()
isLiquidationKind(
kind): kind is "AutoDeleveraged" | "CloseOutMarginSettled" | "BadDebtAbsorbed" | "PositionTransferred" | "AccountLiquidated" | "PositionLiquidated" | "PositionTakenOver" | "ResidualBadDebt" | "ResidualBackedByOpenPnl" | "AdlCapacityShortfall" | "AdlPriceCapacityExhausted" | "AdlSessionDiscarded" | "PositionSkipped" | "Throttled" | "KeeperReward" | "OrderPanicked" | "CoverageDeclined"
Defined in: packages/sdk/src/perp/history.ts:135
Whether a wire kind is one this SDK version knows, narrowing it to
LiquidationKind.
This is the seam between the open rows and the closed filter, and it exists because the two really are different: LiquidationEvent.kind is whatever the DEPLOYED indexer wrote, which can outrun a pinned SDK, while ListLiquidationsOptions.kind is a value the caller chooses and must not be able to misspell. Narrow a row's kind to switch on it exhaustively, or to pass it back into the filter; the false branch is the honest "a kind this version does not know" rather than a cast over it.
Parameters
kind
string
Returns
kind is "AutoDeleveraged" | "CloseOutMarginSettled" | "BadDebtAbsorbed" | "PositionTransferred" | "AccountLiquidated" | "PositionLiquidated" | "PositionTakenOver" | "ResidualBadDebt" | "ResidualBackedByOpenPnl" | "AdlCapacityShortfall" | "AdlPriceCapacityExhausted" | "AdlSessionDiscarded" | "PositionSkipped" | "Throttled" | "KeeperReward" | "OrderPanicked" | "CoverageDeclined"