Skip to main content
This page documents all exported TypeScript types from @outcome.xyz/hip4. Every type listed here is importable from the main entry point. If you only need types without pulling in any runtime code - for example in a shared type package - use the dedicated types entry point instead.
Import types without any runtime cost using @outcome.xyz/hip4/types:

Market types

HIP-4 markets are represented as a discriminated union. Every market carries a type field you can use to narrow to the correct variant.

MarketType

HIP4Market

The top-level discriminated union covering all four market variants:

BaseMarket

Fields shared across all market types:

MarketSide

DefaultBinaryMarket

Recurring price binary markets with a structured pipe-delimited description. Extends BaseMarket.

LabelledBinaryMarket

Standalone binary markets with custom side names. Extends BaseMarket with no additional fields.

MultiOutcomeMarket

Outcomes grouped under a parent question, with a fallback outcome representing “none of the above”. Extends BaseMarket.

PriceBucketMarket

Multi-bucket price range markets where each outcome covers a specific price band. Extends BaseMarket.

Event types

Events are the top-level grouping for prediction markets.

PredictionEvent

PredictionMarket

A single question within an event containing tradeable outcome tokens.

PredictionOutcome

One tradeable side of a prediction market.

PredictionCategory

The SDK defines two built-in categories: "custom" (manually created markets) and "recurring" (automated recurring markets).

PredictionEventStatus

The HIP-4 adapter currently sets only "active" and "resolved".

Trading types

PredictionOrderParams

Parameters for placing an order via hip4.trading.placeOrder.

PredictionOrderResult

Returned by hip4.trading.placeOrder and hip4.trading.modifyOrder. Rejections come back in this object instead of being thrown, so always check success.

PredictionBatchOrderResult

Returned by hip4.trading.placeOrders (batch). Results are index-matched to the input params array.

PredictionCancelParams

Parameters for cancelling a resting order via hip4.trading.cancelOrder.

Account types

PredictionPosition

An open position in a prediction market outcome, derived from spot balances.

PredictionActivity

A historical account activity record.

PredictionAuthState

The current authentication state of the trading adapter.

Market data types

PredictionOrderBook

PredictionOrderBookLevel

PredictionPrice

PredictionTrade