@somnia-chain/markets-sdk


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

Type Alias: OrdersOptions

OrdersOptions = object

Defined in: packages/sdk/src/orders.ts:199

Options for SomniaMarketsClient.getOpenOrders / SomniaMarketsClient.getOrders. All optional.

Properties

pool?

optional pool?: string

Defined in: packages/sdk/src/orders.ts:201

Restrict to one pool.


pools?

optional pools?: readonly string[]

Defined in: packages/sdk/src/orders.ts:212

Restrict to orders on ANY of these pools (case-insensitive) — the batched form of pool, for folding several venues into one read. An empty array matches nothing. Supplying pool as well narrows to both (the intersection), so neither silently overrides the other. The list accepts at most 100 entries. A longer list rejects with InvalidInputError.

Each pool is resolved to its market scope, so a recycled BINARY pool still selects every market life of that pool, exactly as pool does.


market?

optional market?: string

Defined in: packages/sdk/src/orders.ts:219

Restrict to orders in one market (bytes32 marketId, case-insensitive).

Prefer this over pool on binary, where one pool hosts successive markets: a market id names exactly one of them.


markets?

optional markets?: readonly string[]

Defined in: packages/sdk/src/orders.ts:226

Restrict to orders in ANY of these markets (bytes32 marketIds, case-insensitive) — the batched form of market. Same empty-array and intersection rules as pools. The list accepts at most 100 entries. A longer list rejects with InvalidInputError.


status?

optional status?: OrderStatus

Defined in: packages/sdk/src/orders.ts:228

Order status. SomniaMarketsClient.getOrders only — SomniaMarketsClient.getOpenOrders is always "Open".


side?

optional side?: OpenOrder["side"]

Defined in: packages/sdk/src/orders.ts:230

Restrict to one side.


userData?

optional userData?: bigint | string

Defined in: packages/sdk/src/orders.ts:239

Restrict to orders placed with this client order id — the uint64 tag the placement carried (see OpenOrder.userData). Pass a bigint, or a decimal string when the value came from a row and never needs arithmetic.

The column is not indexed, so this filter is a scan on a large Order table. Narrow it with pool/pools and a status where the caller can.


sinceBlock?

optional sinceBlock?: number | bigint

Defined in: packages/sdk/src/orders.ts:255

Restrict to orders PLACED at or after this block (Order.placedAtBlock).

It selects orders by their placement block only. It does NOT select a later fill, reduction or cancellation of an older order: the entity has no last-mutation block column, so this is not an account order-change stream. An amend places a replacement under a new id, which this filter can select by that replacement's placement block. For an order placed before the bound, a fill read recovers only executions. Reconcile the known order's indexed lifecycle with getOrder(pool, orderId), or use getOrderOnchain(pool, orderId) when only current active state is needed.

The column is not indexed, so bound it with pool/pools where the caller can. Accepts the bigint a transaction receipt carries.


limit?

optional limit?: number

Defined in: packages/sdk/src/orders.ts:257

Max rows.


offset?

optional offset?: number

Defined in: packages/sdk/src/orders.ts:259

Row offset (default 0).