@somnia-chain/markets-sdk / index / UnifiedOrder
Interface: UnifiedOrder
Defined in: packages/sdk/src/unified/structs.ts:197
An order, in the tradable's own terms (prices/amounts human units).
Properties
id
id:
string
Defined in: packages/sdk/src/unified/structs.ts:202
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:204
The tradable symbol the order is viewed on.
type?
optionaltype?:"limit"|"market"
Defined in: packages/sdk/src/unified/structs.ts:220
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:222
Direction on this tradable's book (a NO buy is a YES sell internally).
price?
optionalprice?:number
Defined in: packages/sdk/src/unified/structs.ts:224
Limit price, human units; absent when unknown.
amount
amount:
number
Defined in: packages/sdk/src/unified/structs.ts:226
Full order size, human base units.
filled
filled:
number
Defined in: packages/sdk/src/unified/structs.ts:228
Quantity filled so far, human base units.
remaining
remaining:
number
Defined in: packages/sdk/src/unified/structs.ts:230
Quantity still open (amount − filled), human base units.
status
status:
UnifiedOrderStatus
Defined in: packages/sdk/src/unified/structs.ts:232
Lifecycle state — see UnifiedOrderStatus.
txHash?
optionaltxHash?:string
Defined in: packages/sdk/src/unified/structs.ts:234
Tx hash the order was placed in, when known.
timestamp?
optionaltimestamp?:number
Defined in: packages/sdk/src/unified/structs.ts:236
Placement time (ms); write results stamp the local clock.
datetime?
optionaldatetime?:string
Defined in: packages/sdk/src/unified/structs.ts:238
ISO-8601 of timestamp.
info
info:
unknown
Defined in: packages/sdk/src/unified/structs.ts:240
The native order row / PlaceOrderResult.