@somnia-chain/markets-sdk


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

Interface: UnifiedOrder

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

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

Properties

id

id: string

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

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:216

The tradable symbol the order is viewed on.


chainId

chainId: number

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

Numeric chain id the market lives on.


type?

optional type?: "market" | "limit"

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

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

Absent on orders read back from the indexer — fetchOrders, 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:236

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:238

Limit price, human units; absent when unknown.


amount

amount: number

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

Full order size, human base units.


filled

filled: number

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

Quantity filled so far, human base units.


remaining

remaining: number

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

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


status

status: UnifiedOrderStatus

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

Lifecycle state — see UnifiedOrderStatus.


txHash?

optional txHash?: string

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

Tx hash the order was placed in, when known.


timestamp?

optional timestamp?: number

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

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


datetime?

optional datetime?: string

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

ISO-8601 of timestamp.


info

info: unknown

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

The native order row / PlaceOrderResult.