@somnia-chain/markets-sdk


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

Type Alias: PerpOrderRejection

PerpOrderRejection = object

Defined in: packages/sdk/src/perp/history.ts:1003

One order refused inside a batch placement (mirror of the indexer PerpOrderRejection entity).

Batch placements only. placeOrder / placeOrderFor REVERT on the same conditions, and a reverted transaction discards its logs, so a singular placement leaves no row here — its reason arrives as a decoded revert instead. A batch keeps the accepted orders and records the refused ones, which is the only reason this history exists.

There is no Order row to join to: a rejected request never rested and never filled. requestIndex is its position in the submitted batch, which is how a caller maps the row back to the request it sent.

Properties

id

id: string

Defined in: packages/sdk/src/perp/history.ts:1005

Row id (${txHash}_${logIndex}).


owner

owner: string

Defined in: packages/sdk/src/perp/history.ts:1007

The order's owner (lowercased).


pool

pool: string

Defined in: packages/sdk/src/perp/history.ts:1009

The PerpPool the batch was submitted to (lowercased).


reason

reason: PerpOrderRejectionReason | null

Defined in: packages/sdk/src/perp/history.ts:1020

The reason as a NAME, or null when the pool reported a member this SDK version does not know.

Null rather than a default member, deliberately, and for the same reason the intent field on PerpStopOrder does it: the enum appends — DropReason gained NoFill — and naming an unrecognized index would tell a caller the order was refused for a reason it was not. PerpOrderRejection.reasonRaw still carries the index, so a null is never a lost row.


reasonRaw

reasonRaw: number

Defined in: packages/sdk/src/perp/history.ts:1029

The raw enum index, always present.

Kept beside the decoded name because the indexer deliberately stores this un-decoded: a member added after the reindex still lands intact, and no row is ever lost to a name the indexer did not know. A consumer that wants to handle a newer-than-SDK reason reads this.


requestIndex

requestIndex: string

Defined in: packages/sdk/src/perp/history.ts:1031

The order's position in the submitted batch — how to map the row back to the request.


timestamp

timestamp: string

Defined in: packages/sdk/src/perp/history.ts:1033

Timestamp (unix seconds) of the rejection.


blockNumber

blockNumber: string

Defined in: packages/sdk/src/perp/history.ts:1035

Block the rejection landed in.


txHash

txHash: string

Defined in: packages/sdk/src/perp/history.ts:1037

Tx hash the batch landed in.