@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / UnifiedOrder

Interface: UnifiedOrder

Defined in: packages/sdk/src/unified/structs.ts:203

An order, in the tradable's own terms (prices/amounts human units).

Properties

id

id: string

Defined in: packages/sdk/src/unified/structs.ts:208

On-chain order id (decimal string) — pass to SomniaMarkets.cancelOrder. Falls back to the tx hash for a write that left nothing resting.


symbol

symbol: string

Defined in: packages/sdk/src/unified/structs.ts:210

The tradable symbol the order is viewed on.


type?

optional type?: "limit" | "market"

Defined in: packages/sdk/src/unified/structs.ts:226

Requested execution style ("market" computed a crossing IOC limit).

Absent on orders read back from the indexerfetchOrders, fetchOpenOrders and watchOrders all leave it undefined. The pools do not emit the order type: OrderPlaced carries a placedOrder struct with no order-type member, and binary pools emit only the YES/NO side, so the indexer has nothing to store and the SDK has nothing to read. Populating it needs a contract change.

Present only where the value is genuinely known: on the result of SomniaMarkets.createOrder, which echoes the caller's own argument. (UnifiedStopOrder.type is always known — the stop registry does emit the order type.)


side

side: "buy" | "sell"

Defined in: packages/sdk/src/unified/structs.ts:228

Direction on this tradable's book (a NO buy is a YES sell internally).


price?

optional price?: number

Defined in: packages/sdk/src/unified/structs.ts:230

Limit price, human units; absent when unknown.


amount

amount: number

Defined in: packages/sdk/src/unified/structs.ts:232

Full order size, human base units.


filled

filled: number

Defined in: packages/sdk/src/unified/structs.ts:234

Quantity filled so far, human base units.


remaining

remaining: number

Defined in: packages/sdk/src/unified/structs.ts:236

Quantity still open (amount − filled), human base units.


status

status: UnifiedOrderStatus

Defined in: packages/sdk/src/unified/structs.ts:238

Lifecycle state — see UnifiedOrderStatus.


txHash?

optional txHash?: string

Defined in: packages/sdk/src/unified/structs.ts:240

Tx hash the order was placed in, when known.


timestamp?

optional timestamp?: number

Defined in: packages/sdk/src/unified/structs.ts:242

Placement time (ms); write results stamp the local clock.


datetime?

optional datetime?: string

Defined in: packages/sdk/src/unified/structs.ts:244

ISO-8601 of timestamp.


info

info: unknown

Defined in: packages/sdk/src/unified/structs.ts:246

The native order row / PlaceOrderResult.