@0xmonaco/types 1.0.50 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ export interface TradeEventData {
15
15
  /** Executed quantity */
16
16
  quantity: string;
17
17
  /** Side of the maker order (BUY or SELL) */
18
- makerSide: OrderSide;
18
+ makerSide: OrderSide | (string & {});
19
19
  /** Timestamp when the trade was executed (ISO 8601) */
20
20
  executedAt: string;
21
21
  }
@@ -28,7 +28,7 @@ export interface TradeEvent {
28
28
  /** Trading pair ID (UUID) */
29
29
  tradingPairId: string;
30
30
  /** Trading mode (SPOT or MARGIN) */
31
- tradingMode: TradingMode;
31
+ tradingMode: TradingMode | (string & {});
32
32
  /** Trade execution data */
33
33
  data: TradeEventData;
34
34
  }
@@ -18,12 +18,20 @@ export type TwapOrderEventReason = "created" | "slice_placed" | "slice_skipped"
18
18
  * Field names mirror the backend `TwapOrderEventData` payload (snake_case on
19
19
  * the wire, camelCased by the client); the SDK parser normalizes explicit
20
20
  * `null` values to absent, so nullable wire fields are optional here.
21
+ *
22
+ * **The value unions below are the values the server sends today, not a
23
+ * runtime guarantee**, which is why each is typed `Union | (string & {})`:
24
+ * `@0xmonaco/core` hands this whole payload through with a single cast and
25
+ * validates no value field, so an unrecognized `side`, `tradingMode`,
26
+ * `executionStyle`, `state`, `triggerDirection` or `reason` arrives as-is
27
+ * rather than dropping the update (0XM-2628). Autocomplete still offers the
28
+ * known values; `switch` over one with a `default` branch.
21
29
  */
22
30
  export interface TwapOrderEventData {
23
31
  twapOrderId: string;
24
32
  tradingPairId: string;
25
- side: OrderSide;
26
- tradingMode: TradingMode;
33
+ side: OrderSide | (string & {});
34
+ tradingMode: TradingMode | (string & {});
27
35
  totalQuantity: string;
28
36
  executedQuantity: string;
29
37
  executedNotional: string;
@@ -41,7 +49,7 @@ export interface TwapOrderEventData {
41
49
  clientTwapId?: string;
42
50
  randomize: boolean;
43
51
  /** Child execution style: "TAKER" (banded MARKET slices) or "PASSIVE" (post-only children at the touch, taker sweep at each slice deadline) */
44
- executionStyle: TwapExecutionStyle;
52
+ executionStyle: TwapExecutionStyle | (string & {});
45
53
  /** Window start (ISO 8601) */
46
54
  startAt: string;
47
55
  /** Window end (ISO 8601). Execution stops hard at this time. */
@@ -55,13 +63,23 @@ export interface TwapOrderEventData {
55
63
  nextSliceAt?: string;
56
64
  slicesPlaced: number;
57
65
  slicesSkipped: number;
58
- state: TwapOrderState;
66
+ /**
67
+ * Lifecycle state of the parent order.
68
+ *
69
+ * Widened past {@link TwapOrderState} on purpose: `@0xmonaco/core` parses
70
+ * this frame leniently, so a state added server-side after this SDK version
71
+ * ships is delivered as-is rather than dropping the whole update (0XM-2628).
72
+ * `TwapOrderState` names the values the server sends today — narrow with a
73
+ * `switch` that keeps a `default` branch rather than relying on
74
+ * exhaustiveness.
75
+ */
76
+ state: TwapOrderState | (string & {});
59
77
  /** Terminal annotation, e.g. "ended with shortfall 1.5"; absent for non-terminal parents */
60
78
  terminalReason?: string;
61
79
  /** Conditional configuration + activation stamp (parity with the REST read
62
80
  * model). All absent on unconditional parents. */
63
81
  triggerPrice?: string;
64
- triggerDirection?: "ABOVE" | "BELOW";
82
+ triggerDirection?: "ABOVE" | "BELOW" | (string & {});
65
83
  conditionalExpiry?: string;
66
84
  triggeredAt?: string;
67
85
  createdAt: string;
@@ -69,7 +87,7 @@ export interface TwapOrderEventData {
69
87
  cancelledAt?: string;
70
88
  completedAt?: string;
71
89
  /** Mutation that produced this snapshot */
72
- reason: TwapOrderEventReason;
90
+ reason: TwapOrderEventReason | (string & {});
73
91
  }
74
92
  export interface TwapOrderEvent {
75
93
  eventType: "twap_order_update";
@@ -7,3 +7,4 @@ export * from "./base";
7
7
  export * from "./client";
8
8
  export * from "./clients/orderbook-client";
9
9
  export * from "./events";
10
+ export * from "./snapshots";
@@ -7,3 +7,4 @@ export * from "./base";
7
7
  export * from "./client";
8
8
  export * from "./clients/orderbook-client";
9
9
  export * from "./events";
10
+ export * from "./snapshots";
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Subscribe-time WebSocket snapshot types.
3
+ *
4
+ * The server injects one `Snapshot` frame per subscription, after the
5
+ * `Subscribed` ack and before that subscription's first live diff. Its `data`
6
+ * is the channel's COMPLETE current state as a flat array — a consumer that
7
+ * applies it wholesale needs no REST baseline read for that channel.
8
+ *
9
+ * Two rules hold across every channel:
10
+ *
11
+ * - **A snapshot row is the channel's terminal-state payload, not its event
12
+ * envelope.** The live frame wraps its payload (`{ event_type, user_id, data }`
13
+ * for the authenticated channels); a snapshot row IS the payload, with no
14
+ * wrapper and no change metadata. That is why the rows are delivered to their
15
+ * own callback instead of the event handler: reducing both would apply the
16
+ * same state twice, in two different shapes.
17
+ * - **The row type is the channel's own `…EventData`**, so the baseline and the
18
+ * diffs that follow it describe state identically. `orders` is the one
19
+ * exception and has its own {@link OrderSnapshotItem}: a resting order carries
20
+ * fields no single order event does (`status` alongside the fill totals) and
21
+ * carries none of the change-only fill metadata.
22
+ *
23
+ * A channel whose server arm is not implemented yet simply never sends the
24
+ * frame, so its callback is never invoked. That is a silent no-op, never an
25
+ * error.
26
+ */
27
+ import type { OrderSide, OrderType, TimeInForce, TradingMode } from "../trading";
28
+ /**
29
+ * Receives one channel's complete subscribe-time state.
30
+ *
31
+ * Invoked at most once per `Snapshot` frame, always with an array — an empty
32
+ * baseline arrives as `[]` rather than being skipped, so a consumer can tell
33
+ * "nothing is open" apart from "no baseline yet".
34
+ *
35
+ * Delivery is all-or-nothing: a frame with any unreadable row is withheld
36
+ * entirely rather than delivered short, because the array is contractually
37
+ * COMPLETE and a consumer that replaced state from a truncated one would delete
38
+ * whatever the unreadable row described.
39
+ *
40
+ * A frame is produced per WIRE subscription, so on a channel this client
41
+ * already holds a second subscriber's callback waits for the next reconnect;
42
+ * see `MonacoWebSocket` for the full rule.
43
+ */
44
+ export type SnapshotHandler<T> = (items: T[]) => void;
45
+ /**
46
+ * One resting order in an `orders` channel snapshot.
47
+ *
48
+ * The server builds this to be field-compatible with the live order event's
49
+ * `data` — same names, same casing, decimals as strings — and injects the three
50
+ * identity fields the read model does not itself carry (`userId`,
51
+ * `applicationId`, and the resolved `tradingPair` symbol).
52
+ *
53
+ * The change-only fill metadata of an order EVENT is deliberately absent: a
54
+ * snapshot describes resting state, not a fill, so there is no `eventType`,
55
+ * `tradeId`, `executionPrice`, `lastFillQuantity`, `role`, `fee`, `feeRaw`,
56
+ * `tradesCount` or slippage. The cumulative `filledQuantity` /
57
+ * `averageFillPrice` totals are present, because those are state.
58
+ *
59
+ * Nullability mirrors the wire exactly. Every optional field below is a Rust
60
+ * `Option` serialized WITHOUT `skip_serializing_if`, so the key is always
61
+ * present and carries `null` when unset — hence `| null` rather than `?`.
62
+ * `clientOrderId` is the sole field the server omits outright, so it is the
63
+ * sole `?`.
64
+ *
65
+ * The value unions are widened (`Union | (string & {})`) for the same reason
66
+ * the order event's are: the parser hands an unrecognized value through rather
67
+ * than dropping the row, so a closed type would promise something the runtime
68
+ * does not honour.
69
+ */
70
+ export interface OrderSnapshotItem {
71
+ /** Order identifier (UUID) */
72
+ orderId: string;
73
+ /** Owning user (UUID), taken from the authenticated session */
74
+ userId: string;
75
+ /** Owning application (UUID), taken from the authenticated session */
76
+ applicationId: string;
77
+ /** Trading pair identifier (UUID) */
78
+ tradingPairId: string;
79
+ /** Trading pair symbol, e.g. "BTC/USDC" */
80
+ tradingPair: string;
81
+ /** Trading mode (e.g. "SPOT", "MARGIN") */
82
+ tradingMode: TradingMode | (string & {});
83
+ /** Order side */
84
+ side: OrderSide | (string & {});
85
+ /** Order type */
86
+ orderType: OrderType | (string & {});
87
+ /** Limit price (decimal string); `null` for a market order */
88
+ price: string | null;
89
+ /** Order quantity (decimal string) */
90
+ quantity: string;
91
+ /** `quantity` in RAW (integer, base-unit) precision */
92
+ quantityRaw: string;
93
+ /** Cumulative quantity filled (decimal string) */
94
+ filledQuantity: string;
95
+ /** `filledQuantity` in RAW (integer, base-unit) precision */
96
+ filledQuantityRaw: string;
97
+ /** Quantity still resting (decimal string) */
98
+ remainingQuantity: string | null;
99
+ /** `remainingQuantity` in RAW (integer, base-unit) precision */
100
+ remainingQuantityRaw: string | null;
101
+ /** Order status; the snapshot carries only resting statuses */
102
+ status: string;
103
+ /** Time in force */
104
+ timeInForce: TimeInForce | (string & {}) | null;
105
+ /** Average fill price (decimal string); `null` before the first fill */
106
+ averageFillPrice: string | null;
107
+ /** Order creation timestamp (ISO 8601) */
108
+ createdAt: string;
109
+ /** Last update timestamp (ISO 8601) */
110
+ updatedAt: string | null;
111
+ /** Margin account backing a margin/perp order (UUID) */
112
+ marginAccountId: string | null;
113
+ /** Position the order is linked to (UUID) */
114
+ positionId: string | null;
115
+ /** Leverage for a margin/perp order (decimal string) */
116
+ leverage: string | null;
117
+ /** Whether the order can only reduce existing exposure */
118
+ reduceOnly: boolean;
119
+ /**
120
+ * Client-assigned correlation handle, carried so the baseline and the live
121
+ * events that follow it identify orders the same way. Omitted — not `null` —
122
+ * when the order carried none, matching the live event payload.
123
+ */
124
+ clientOrderId?: string;
125
+ /**
126
+ * Sequencer step this order's state was last written by — the SAME counter
127
+ * the live order events and the REST endpoints carry (0XM-2440).
128
+ *
129
+ * The one field here that is not resting state. It is carried because a
130
+ * reconnecting client ranks this frame against the events it has already
131
+ * applied by comparing exactly this value, so the frame would be unusable
132
+ * for its own purpose without it. Compare with `>=`, not `>`: on the stream
133
+ * equal versions mean the same sequencer step rather than identical state,
134
+ * and the snapshot row is that step's final state.
135
+ *
136
+ * Omitted — not `null` — when unknown, which is what an order last written
137
+ * before the field existed reports. Absent means unknown, never zero.
138
+ */
139
+ version?: number;
140
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Subscribe-time WebSocket snapshot types.
3
+ *
4
+ * The server injects one `Snapshot` frame per subscription, after the
5
+ * `Subscribed` ack and before that subscription's first live diff. Its `data`
6
+ * is the channel's COMPLETE current state as a flat array — a consumer that
7
+ * applies it wholesale needs no REST baseline read for that channel.
8
+ *
9
+ * Two rules hold across every channel:
10
+ *
11
+ * - **A snapshot row is the channel's terminal-state payload, not its event
12
+ * envelope.** The live frame wraps its payload (`{ event_type, user_id, data }`
13
+ * for the authenticated channels); a snapshot row IS the payload, with no
14
+ * wrapper and no change metadata. That is why the rows are delivered to their
15
+ * own callback instead of the event handler: reducing both would apply the
16
+ * same state twice, in two different shapes.
17
+ * - **The row type is the channel's own `…EventData`**, so the baseline and the
18
+ * diffs that follow it describe state identically. `orders` is the one
19
+ * exception and has its own {@link OrderSnapshotItem}: a resting order carries
20
+ * fields no single order event does (`status` alongside the fill totals) and
21
+ * carries none of the change-only fill metadata.
22
+ *
23
+ * A channel whose server arm is not implemented yet simply never sends the
24
+ * frame, so its callback is never invoked. That is a silent no-op, never an
25
+ * error.
26
+ */
@@ -2828,6 +2828,8 @@ export interface components {
2828
2828
  * @example quote-btc-1130-a
2829
2829
  */
2830
2830
  clientOrderId?: string | null;
2831
+ /** @description Optional submission identity, distinct from clientOrderId. Use 1-64 characters from [A-Za-z0-9._:-], without whitespace. Scoped to your authenticated user/subaccount and application, shared by create and batch-create items. Retrying the same key and normalized order payload within 24 hours of the original acceptance returns the original committed submission result, even after a fill or cancellation, without executing again. Different payload returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS; per-item error in batches). Validation failures before acceptance do not reserve the key. The window does not extend on retries; after it expires the key may execute a new order, so never retry an unresolved submission after 24 hours. Generate a fresh key for each intended new order and retain it across transport retries. Without a key, a timeout or 5xx leaves the outcome unknown and must not be blindly retried. */
2832
+ idempotencyKey?: string | null;
2831
2833
  };
2832
2834
  BatchCreateOrdersRequest: {
2833
2835
  orders: components["schemas"]["BatchCreateOrderItem"][];
@@ -3167,6 +3169,12 @@ export interface components {
3167
3169
  parentOrderId?: string | null;
3168
3170
  associationType?: string | null;
3169
3171
  activatedAt?: string | null;
3172
+ /**
3173
+ * Format: int64
3174
+ * @description Opaque, compare-only revision counter for this conditional order's state: the sequencer step that wrote it. A strictly higher value is strictly newer state for that conditional order. The SAME counter is carried on the `conditional_orders` WebSocket SNAPSHOT frame — but deliberately NOT on the live `conditional_orders` events, which build from the row as it stood before the sequencer acted and so could only report the version the row held BEFORE the change they announce. So seed conditional state from the snapshot frame and REST, reconciling on `(conditionalOrderId, version)` — take the REST row when `snapshot.version >= local.version`, else keep local state — and apply the live events as state without ranking them. Note `>=`, not `>`: equal versions mean the SAME STEP rather than identical state, because one step can write several conditional rows (a trigger writes the triggered row and cancels its OCO sibling under one step). A REST row is that step's FINAL state, so it wins a tie. One consequence to plan for: the snapshot is read from the database, which lags the matching engine, so a transition that fires during the read is in neither the snapshot nor the delivered stream and cannot be ranked — re-read the affected rows if a conditional order's state matters at reconnect. Do not read anything else into the number: it is drawn from the same global sequence plain orders use, so values are sparse, gaps are normal, and it is not comparable across different conditional orders — nor against a plain order's version. Absent means unknown: a row last written before this field existed. Fall back to a full field comparison for those rather than treating absent as version zero.
3175
+ * @example 918342
3176
+ */
3177
+ version?: number | null;
3170
3178
  };
3171
3179
  CreateDelegatedSessionRequest: {
3172
3180
  /**
@@ -3334,6 +3342,8 @@ export interface components {
3334
3342
  * @example quote-btc-1130-a
3335
3343
  */
3336
3344
  clientOrderId?: string | null;
3345
+ /** @description Optional submission identity, distinct from clientOrderId. Use 1-64 characters from [A-Za-z0-9._:-], without whitespace. Scoped to your authenticated user/subaccount and application, shared by create and batch-create items. Retrying the same key and normalized order payload within 24 hours of the original acceptance returns the original committed submission result, even after a fill or cancellation, without executing again. Different payload returns IDEMPOTENCY_KEY_CONFLICT (HTTP 409 / gRPC ALREADY_EXISTS; per-item error in batches). Validation failures before acceptance do not reserve the key. The window does not extend on retries; after it expires the key may execute a new order, so never retry an unresolved submission after 24 hours. Generate a fresh key for each intended new order and retain it across transport retries. Without a key, a timeout or 5xx leaves the outcome unknown and must not be blindly retried. */
3346
+ idempotencyKey?: string | null;
3337
3347
  };
3338
3348
  CreateOrderResponse: {
3339
3349
  /**
@@ -4527,6 +4537,12 @@ export interface components {
4527
4537
  * @example false
4528
4538
  */
4529
4539
  postOnly?: boolean | null;
4540
+ /**
4541
+ * Format: int64
4542
+ * @description Opaque, compare-only revision counter for this order's state: the sequencer step that wrote it. A strictly higher value is strictly newer state for that order. The SAME counter is carried on every order WebSocket event and on the `orders` snapshot frame, so a reconnecting client reconciles on `(id, version)` — take the REST row when `snapshot.version >= local.version`, else keep local state. Note `>=`, not `>`: on the stream, equal versions mean the SAME STEP rather than identical state, because one step emits several events for one order (an `OrderPlaced` and then its fills) and a batch shares one step across every item. A REST row is that step's FINAL state, so it wins a tie. Between two REST reads the comparison is simpler — equal there does mean identical state. Do not read anything else into the number: it is not a count of updates, consecutive values are not expected (it is drawn from a global sequence shared by every order, so per-order values are sparse and gaps are normal), and it is not comparable across different orders. Absent means unknown: an order last written before this field existed. Fall back to a full field comparison for those rather than treating absent as version zero — and note that a comparison against an absent value is false in both directions, so an order held locally without one is never refreshed by the merge above; take the REST row unconditionally for those. Reconciling on this counter does NOT on its own close a reconnect gap: an order that filled or was cancelled while the socket was down appears in neither the resting snapshot nor the stream, so recover fills from `listUserTrades` (ordered by execution time) and resolve anything your local state believes is resting that the snapshot no longer lists with a targeted `getOrder`. Unlike `updatedAt`, this value is identical on every REST endpoint that serves the same order state, and never advances without a state change.
4543
+ * @example 918342
4544
+ */
4545
+ version?: number | null;
4530
4546
  };
4531
4547
  /** @description Orderbook snapshot with token metadata and sequence number. */
4532
4548
  GetOrderbookResponse: {
@@ -4804,10 +4820,22 @@ export interface components {
4804
4820
  unrealizedPnl?: string | null;
4805
4821
  realizedPnl?: string | null;
4806
4822
  /**
4807
- * @description Open rows: current isolated collateral for this position's risk bucket.
4808
- * Terminal rows: total initial margin allocated across the position's
4809
- * reducing executions when available — the margin basis for lifetime
4810
- * realized return.
4823
+ * @description Open ISOLATED rows: the position's current backing — its risk bucket's
4824
+ * allocated collateral adjusted by settled realized PnL and funding paid,
4825
+ * net of collateral reserved for the bucket's open orders, clamped at zero
4826
+ * (0XM-2558). Partial closes and partial liquidations shrink the posted
4827
+ * margin pro-rata while the realized loss stays in the bucket, so this,
4828
+ * not the posted margin, is the unrealized-return denominator. Not a hard
4829
+ * -100% bound: the liquidation trigger and liquidation_price measure the
4830
+ * bucket's whole equity, order reserves included, so with a resting order
4831
+ * the return can pass -100% by that order's earmark before liquidation
4832
+ * lands; a mark can gap past the backing before the asynchronous
4833
+ * liquidation; a fully drained bucket serves "0". Served from the live risk
4834
+ * engine; when only persisted state is reachable the value is gross of
4835
+ * order reserves. Open CROSS rows fall back to the position's posted
4836
+ * margin. Terminal rows: total initial margin allocated across the
4837
+ * position's reducing executions when available — the margin basis for
4838
+ * lifetime realized return.
4811
4839
  */
4812
4840
  isolatedMargin?: string | null;
4813
4841
  leverage?: string | null;
@@ -6164,6 +6192,33 @@ export interface components {
6164
6192
  * reconstructable.
6165
6193
  */
6166
6194
  availableOrderCollateral?: string | null;
6195
+ /**
6196
+ * @description The mode this risk bucket is margined under. Always present: every row here is a risk bucket and its mode is a non-null column, unlike MarginAccountSummary.marginMode which is optional because that shape also models a parent row belonging to no bucket. Labels each row so bucket margin can be attributed to cross or isolated from this response alone, instead of resolving the opaque riskBucketId against the margin-accounts surface. It does NOT reconcile with the positions.cross / positions.isolated counts beside it: those are counted by a separate query over every margin account for the caller's user/application pair (these rows come from the single oldest, parent account), and they attribute a legacy position carrying no risk-bucket reference to CROSS whether or not a cross bucket row exists. Treat the counts as account-wide totals, not as a checksum over these rows.
6197
+ * @example CROSS
6198
+ * @enum {string}
6199
+ */
6200
+ marginMode: "ISOLATED" | "CROSS";
6201
+ /**
6202
+ * Format: uuid
6203
+ * @description Trading pair UUID this bucket is scoped to. Present for ISOLATED buckets;
6204
+ * absent for CROSS, which spans the pairs selected into it and is scoped to
6205
+ * none of them individually — the same invariant the transfer-in endpoint
6206
+ * enforces by rejecting a `trading_pair_id` in CROSS mode. Read the cross
6207
+ * bucket's membership from `MarginAccountSummary.selected_trading_pair_ids`;
6208
+ * it is not carried here because it lives in a separate table and would cost
6209
+ * this endpoint an extra query per request.
6210
+ *
6211
+ * These labels do NOT make this response row-for-row joinable with the
6212
+ * margin-accounts surface on (mode, pair). That surface emits rows this one
6213
+ * has no counterpart for — a provisioned-but-unfunded auto bucket, and a
6214
+ * parent row with no mode at all — and on a persisted-fallback read (no live
6215
+ * risk engine snapshot) the two surfaces attribute a legacy position
6216
+ * carrying no risk-bucket reference to OPPOSITE buckets: this endpoint reads
6217
+ * it as cross, the margin-accounts summary as isolated on pair match. Use
6218
+ * these fields to label and group this response, not to cross-foot it
6219
+ * against another.
6220
+ */
6221
+ tradingPairId?: string | null;
6167
6222
  };
6168
6223
  PortfolioSeriesWindow: {
6169
6224
  /**
@@ -6243,10 +6298,22 @@ export interface components {
6243
6298
  unrealizedPnl?: string | null;
6244
6299
  realizedPnl?: string | null;
6245
6300
  /**
6246
- * @description Open rows: current isolated collateral for this position's risk bucket.
6247
- * Terminal rows: total initial margin allocated across the position's
6248
- * reducing executions when available — the margin basis for lifetime
6249
- * realized return.
6301
+ * @description Open ISOLATED rows: the position's current backing — its risk bucket's
6302
+ * allocated collateral adjusted by settled realized PnL and funding paid,
6303
+ * net of collateral reserved for the bucket's open orders, clamped at zero
6304
+ * (0XM-2558). Partial closes and partial liquidations shrink the posted
6305
+ * margin pro-rata while the realized loss stays in the bucket, so this,
6306
+ * not the posted margin, is the unrealized-return denominator. Not a hard
6307
+ * -100% bound: the liquidation trigger and liquidation_price measure the
6308
+ * bucket's whole equity, order reserves included, so with a resting order
6309
+ * the return can pass -100% by that order's earmark before liquidation
6310
+ * lands; a mark can gap past the backing before the asynchronous
6311
+ * liquidation; a fully drained bucket serves "0". Served from the live risk
6312
+ * engine; when only persisted state is reachable the value is gross of
6313
+ * order reserves. Open CROSS rows fall back to the position's posted
6314
+ * margin. Terminal rows: total initial margin allocated across the
6315
+ * position's reducing executions when available — the margin basis for
6316
+ * lifetime realized return.
6250
6317
  */
6251
6318
  isolatedMargin?: string | null;
6252
6319
  leverage?: string | null;
@@ -6897,6 +6964,28 @@ export interface components {
6897
6964
  initialMarginRequiredAfter?: string | null;
6898
6965
  maintenanceMarginRequiredAfter?: string | null;
6899
6966
  freeCollateralAfter?: string | null;
6967
+ /**
6968
+ * @description What this order pays in fees once its WHOLE size has executed, priced by
6969
+ * the role each part of it plays against the book right now: the taker rate
6970
+ * (plus the application's additional taker fee) on the quantity that would
6971
+ * cross immediately, and the maker rate on the quantity that would rest and
6972
+ * be filled later. Both rates are the caller's own tier-resolved rates. One
6973
+ * figure covers both cases — an order that crosses entirely, one that rests
6974
+ * entirely, and every split in between.
6975
+ *
6976
+ * Signed: NEGATIVE means a net rebate, which is the honest answer for a
6977
+ * resting order on a pair whose maker fee is negative. Populated even when
6978
+ * `accepted` is false, and populated for reduce-only orders — closing a
6979
+ * position pays fees like any other fill.
6980
+ *
6981
+ * It assumes the resting part eventually fills, so it states what the order
6982
+ * costs if it runs to completion, not a probability-weighted figure: cancel
6983
+ * before the remainder fills and only the crossing part was ever charged.
6984
+ *
6985
+ * ABSENT — never zero — when the engine could not price the order: it was
6986
+ * refused before it could be matched, or its resolved maker tier exceeds the
6987
+ * pair's cap. Absence means unknown, so do not render it as a free order.
6988
+ */
6900
6989
  estimatedFee?: string | null;
6901
6990
  /**
6902
6991
  * @description Estimated liquidation mark-price. In ISOLATED mode, this is the
@@ -7375,7 +7464,13 @@ export interface components {
7375
7464
  riskBucketId?: string | null;
7376
7465
  /** @description Present when collateral was allocated to a risk bucket. Values: ISOLATED, CROSS. */
7377
7466
  marginMode?: string | null;
7378
- /** @description Present for cross risk-bucket transfers. */
7467
+ /**
7468
+ * @description The cross bucket's recorded pair scope: what trading has recorded (a pair
7469
+ * joins when a cross order on it fills and leaves when its positions close),
7470
+ * plus any pair declared before scope became derived, until it trades and
7471
+ * its positions close. Only on cross risk-bucket transfers, and omitted
7472
+ * while empty — i.e. until a cross order on the bucket has filled.
7473
+ */
7379
7474
  selectedTradingPairIds?: string[] | null;
7380
7475
  /**
7381
7476
  * @description Whether the transfer was committed to a position's stored margin.
@@ -7402,9 +7497,17 @@ export interface components {
7402
7497
  */
7403
7498
  tradingPairId?: string | null;
7404
7499
  strategyKey?: string | null;
7405
- /** @description Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS. */
7500
+ /**
7501
+ * @description Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS. A CROSS
7502
+ * transfer names no pairs: the cross bucket's scope is derived from trading —
7503
+ * a pair joins when a cross order on it succeeds and leaves when its positions
7504
+ * close — so funding the bucket has nothing to declare.
7505
+ */
7406
7506
  marginMode?: string | null;
7407
- /** @description Trading pair UUIDs selected into the cross risk bucket. Required when marginMode is CROSS. */
7507
+ /**
7508
+ * @deprecated
7509
+ * @description Deprecated: accepted and ignored. Cross scope is derived from trading (a pair joins the cross bucket when a cross order on it succeeds and leaves when its positions close), so a cross transfer-in has nothing to declare and can no longer replace the scope. Rejected for ISOLATED, as before. Read the current scope from the cross bucket's row in the margin-accounts list or from this response's selectedTradingPairIds; the parent row carries no scope. Pairs declared before scope became derived stay recorded until they trade and their positions close.
7510
+ */
7408
7511
  selectedTradingPairIds?: string[] | null;
7409
7512
  /**
7410
7513
  * @description What the transferred collateral becomes when the ISOLATED bucket holds an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.50",
3
+ "version": "1.0.53",
4
4
  "type": "module",
5
5
  "homepage": "https://docs.0xmonaco.com/sdk/typescript",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "lint": "biome lint ."
17
17
  },
18
18
  "dependencies": {
19
- "@0xmonaco/contracts": "1.0.50",
19
+ "@0xmonaco/contracts": "1.0.53",
20
20
  "zod": "^4.1.12"
21
21
  },
22
22
  "peerDependencies": {