@0xmonaco/types 1.0.55 → 1.0.57

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.
@@ -199,6 +199,19 @@ export interface AccountBalance {
199
199
  lockedBalanceRaw: string;
200
200
  /** Total balance (available + locked) in raw format (wei) */
201
201
  totalBalanceRaw: string;
202
+ /**
203
+ * Opaque, non-negative producer-owned version for this spot balance row.
204
+ * Compare only within the same account/application/token; higher is newer.
205
+ *
206
+ * OPTIONAL, and absent is not an error: a server that predates this field
207
+ * sends no key at all, which is what a rolling deploy looks like from a
208
+ * client. Absent and 0 mean the same thing — unranked — and never
209
+ * participate in ordering. Normalize before comparing: `undefined <= 710` is
210
+ * false, so an un-normalized guard silently passes and a stale row wins.
211
+ * Fall back to a full field comparison rather than ranking an unranked row
212
+ * as oldest.
213
+ */
214
+ version?: number;
202
215
  /**
203
216
  * True when this asset is the chain's wrapped-native token (e.g. WSEI):
204
217
  * vault deposits can be made in native coin via depositNative (the vault
@@ -22,8 +22,10 @@ export type RegisterSweeperStatus = "registered" | "already_registered";
22
22
  * Body for a deposit-address registration.
23
23
  *
24
24
  * Deliberately tiny: the application and the credited address both come from
25
- * the authenticated session (`login` takes the application's client id), so the
26
- * only thing left to say is which ledger to aim at.
25
+ * the authenticated session (`login` takes the application's client id), and
26
+ * one registration is watched on every supported chain ({@link
27
+ * SweeperAPI.getChains} lists them), so the only thing left to say is which
28
+ * ledger to aim at.
27
29
  */
28
30
  export interface RegisterSweeperRequest {
29
31
  /**
@@ -63,8 +65,48 @@ export interface RegisterSweeperResponse {
63
65
  */
64
66
  initialSweepCheck: boolean;
65
67
  }
68
+ /** One asset the sweeper watches on a chain. */
69
+ export interface SweeperChainAsset {
70
+ /** The asset's symbol on this chain, e.g. `"USDC"` */
71
+ symbol: string;
72
+ /** The ERC20 contract address to send on this chain */
73
+ tokenAddress: string;
74
+ /** The token's decimals on this chain; `0` when not published */
75
+ decimals: number;
76
+ /**
77
+ * Minimum sweepable balance in raw base units (a decimal string — raw
78
+ * amounts can exceed `Number.MAX_SAFE_INTEGER`). Smaller balances are left
79
+ * on the deposit address until a later deposit lifts the total past it.
80
+ */
81
+ minSweepRaw: string;
82
+ }
83
+ /** One chain the sweeper watches. */
84
+ export interface SweeperChain {
85
+ /**
86
+ * The chain's EVM chain id. Always at most `2^53 - 1`
87
+ * (`Number.MAX_SAFE_INTEGER`) — the service refuses larger ids — so the
88
+ * number is exact. Every registered deposit address is watched on every
89
+ * listed chain — the address is identical on all of them.
90
+ */
91
+ chainId: number;
92
+ /** Short human-readable chain name, e.g. `"sei"` */
93
+ name: string;
94
+ /**
95
+ * Whether this is the settlement (hub) chain deposits are forwarded into.
96
+ * Deposits on every other listed chain are bridged there automatically.
97
+ */
98
+ hub: boolean;
99
+ /** The assets swept on this chain */
100
+ assets: SweeperChainAsset[];
101
+ }
102
+ /** The chains and assets the sweeper watches. */
103
+ export interface GetSweeperChainsResponse {
104
+ /** One entry per supported chain */
105
+ chains: SweeperChain[];
106
+ }
66
107
  /**
67
- * Sweeper API interface. The register endpoint requires authentication.
108
+ * Sweeper API interface. The register endpoint requires authentication;
109
+ * the chain listing is public.
68
110
  */
69
111
  export interface SweeperAPI extends BaseAPI {
70
112
  /**
@@ -74,7 +116,10 @@ export interface SweeperAPI extends BaseAPI {
74
116
  *
75
117
  * The application and the credited address both come from the authenticated
76
118
  * session, so this only ever registers the caller's own address under their
77
- * own application. Call it with no arguments for a spot address.
119
+ * own application. The deposit address is identical on every supported
120
+ * chain and ONE registration is watched on all of them (see
121
+ * {@link getChains} for the set) — call it with no arguments for a spot
122
+ * address.
78
123
  *
79
124
  * Returns immediately with the derived deposit address; the one-time
80
125
  * initial balance check runs in the background. Idempotent and safe to
@@ -86,4 +131,13 @@ export interface SweeperAPI extends BaseAPI {
86
131
  * global admission limit is exceeded (429).
87
132
  */
88
133
  register(body?: RegisterSweeperRequest): Promise<RegisterSweeperResponse>;
134
+ /**
135
+ * The chains and assets the sweeper watches — where a registered deposit
136
+ * address accepts deposits, which tokens are swept on each chain, and each
137
+ * token's minimum sweep amount.
138
+ *
139
+ * Public: a depositor needs this before they have any session. The set
140
+ * changes only with operator configuration, so it is safe to cache briefly.
141
+ */
142
+ getChains(): Promise<GetSweeperChainsResponse>;
89
143
  }
@@ -238,6 +238,6 @@ export interface TradingAPI extends BaseAPI {
238
238
  */
239
239
  listTwapOrders(params?: ListTwapOrdersParams): Promise<ListTwapOrdersResponse>;
240
240
  }
241
- export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, Order, OrderRole, OrderSide, OrderStatus, OrderStatusFilter, OrderTerminalReason, OrderType, PositionSide, TimeInForce, TradingMode, TwapExecutionStyle, TwapOrderState, } from "./orders";
241
+ export type { ConditionalOrderConditionType, ConditionalOrderState, ConditionalOrderTriggerSource, ListedOrderType, Order, OrderRole, OrderSide, OrderStatus, OrderStatusFilter, OrderTerminalReason, OrderType, PositionSide, TimeInForce, TradingMode, TwapExecutionStyle, TwapOrderState, } from "./orders";
242
242
  export { ORDER_STATUS_VALUES } from "./orders";
243
243
  export type { BatchCancelError, BatchCancelOrdersResponse, BatchCancelResult, BatchCreateOrderParams, BatchCreateOrdersResponse, BatchCreateResult, BatchError, BatchReplaceOrderParams, BatchReplaceOrdersResponse, BatchReplaceResult, CancelConditionalOrderResponse, CancelOrderResponse, CancelTwapOrderResponse, ConditionalOrder, CreateOrderResponse, CreateTwapOrderOptions, CreateTwapOrderResponse, GetOrderResponse, GetPaginatedOrdersParams, GetPaginatedOrdersResponse, GetTwapOrderTcaResponse, ListConditionalOrdersParams, ListConditionalOrdersResponse, ListTwapOrdersParams, ListTwapOrdersResponse, MatchResult, ParentTpSlLegParams, ReplaceOrderResponse, TwapOrder, UpdatedFields, } from "./responses";
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Types for trading operations and order management.
5
5
  */
6
+ import type { ConditionalOrder, TwapOrder } from "./responses";
6
7
  /**
7
8
  * Standard order structure used across all order-related responses.
8
9
  * This represents the complete order information as returned by the API.
@@ -13,6 +14,13 @@
13
14
  * Orders can transition to `CANCELLED`, `REJECTED`, or `EXPIRED` at various stages.
14
15
  * Fee fields are only populated after order fills occur.
15
16
  *
17
+ * The order listing returns every kind of order in one stream, so a row here
18
+ * may be a book order, a TWAP parent (`orderType: "TWAP"`) or a conditional
19
+ * order (`orderType: "CONDITIONAL"`). Switch on `orderType`: the kind-specific
20
+ * detail hangs off `twap` / `conditional`, and the fields above are populated
21
+ * for every kind — a parent's `quantity` is its total, `filledQuantity` what
22
+ * it has executed so far, and `status` its state expressed as an order status.
23
+ *
16
24
  * @example
17
25
  * To calculate remaining quantity:
18
26
  * ```typescript
@@ -26,8 +34,8 @@ export interface Order {
26
34
  tradingPairId: string;
27
35
  /** Order side (BUY or SELL) */
28
36
  side: OrderSide;
29
- /** Order type - see OrderType for all supported types */
30
- orderType: OrderType;
37
+ /** What kind of order this row is - see ListedOrderType */
38
+ orderType: ListedOrderType;
31
39
  /** Order status - see OrderStatus for lifecycle details */
32
40
  status: OrderStatus;
33
41
  /** Order price - null for market orders, required for limit orders */
@@ -82,6 +90,18 @@ export interface Order {
82
90
  clientOrderId?: string;
83
91
  /** Position ID linked to the order, when available */
84
92
  positionId?: string;
93
+ /**
94
+ * The TWAP parent behind this row - its schedule, slice counters and
95
+ * progress - present only when `orderType` is `"TWAP"`. Identical to what
96
+ * `getTwapOrder` returns for the same id.
97
+ */
98
+ twap?: TwapOrder;
99
+ /**
100
+ * The conditional order behind this row - its trigger and the order it fires
101
+ * - present only when `orderType` is `"CONDITIONAL"`. Identical to what the
102
+ * conditional-order endpoints return for the same id.
103
+ */
104
+ conditional?: ConditionalOrder;
85
105
  /** Stable cause when status is CANCELLED */
86
106
  terminalReason?: OrderTerminalReason;
87
107
  /**
@@ -154,6 +174,16 @@ export type PositionSide = "LONG" | "SHORT" | "NONE";
154
174
  * - TRAILING_STOP: Stop order that trails the market price
155
175
  */
156
176
  export type OrderType = "LIMIT" | "MARKET";
177
+ /**
178
+ * What kind of order a listed row is.
179
+ *
180
+ * Wider than {@link OrderType}, which is what you can place: the order listing
181
+ * serves book orders, TWAP parents and conditional orders as one stream, and
182
+ * `"TWAP"` / `"CONDITIONAL"` name the two kinds that are created through their
183
+ * own endpoints rather than `createOrder`. A row of either kind carries its
184
+ * detail on {@link Order.twap} or {@link Order.conditional}.
185
+ */
186
+ export type ListedOrderType = OrderType | "TWAP" | "CONDITIONAL";
157
187
  /**
158
188
  * Source-of-truth order status values used by runtime validation schemas.
159
189
  */
@@ -300,11 +300,11 @@ export declare const ConditionalOrderTriggerSourceSchema: z.ZodEnum<{
300
300
  export declare const ConditionalOrderStateSchema: z.ZodEnum<{
301
301
  CANCELLED: "CANCELLED";
302
302
  EXPIRED: "EXPIRED";
303
+ FAILED: "FAILED";
303
304
  PENDING_PARENT: "PENDING_PARENT";
304
305
  ACTIVE: "ACTIVE";
305
306
  TRIGGERING: "TRIGGERING";
306
307
  TRIGGERED: "TRIGGERED";
307
- FAILED: "FAILED";
308
308
  }>;
309
309
  export declare const ClosePositionSideSchema: z.ZodEnum<{
310
310
  LONG: "LONG";
@@ -319,11 +319,11 @@ export declare const ListConditionalOrdersSchema: z.ZodObject<{
319
319
  state: z.ZodOptional<z.ZodEnum<{
320
320
  CANCELLED: "CANCELLED";
321
321
  EXPIRED: "EXPIRED";
322
+ FAILED: "FAILED";
322
323
  PENDING_PARENT: "PENDING_PARENT";
323
324
  ACTIVE: "ACTIVE";
324
325
  TRIGGERING: "TRIGGERING";
325
326
  TRIGGERED: "TRIGGERED";
326
- FAILED: "FAILED";
327
327
  }>>;
328
328
  page: z.ZodOptional<z.ZodNumber>;
329
329
  pageSize: z.ZodOptional<z.ZodNumber>;
@@ -62,7 +62,13 @@ export type WebSocketErrorCode =
62
62
  * active and live diffs flow, but the baseline is missing — refetch it (e.g.
63
63
  * from REST) rather than assuming the stream started from a coherent state.
64
64
  */
65
- | "SNAPSHOT_UNAVAILABLE";
65
+ | "SNAPSHOT_UNAVAILABLE"
66
+ /**
67
+ * The per-connection inbound message-rate cap was exceeded; the connection
68
+ * is closed (1008) after this frame. Batch subscriptions and back off
69
+ * before reconnecting — a hot re-subscribe loop trips the cap again.
70
+ */
71
+ | "MESSAGE_RATE_LIMIT";
66
72
  /**
67
73
  * An `Error` frame the server sent on this connection.
68
74
  *
@@ -16,12 +16,16 @@ import type { Address } from "viem";
16
16
  * path: `liquidation` on the liquidated victim's collateral, `adl` on an
17
17
  * account impacted by auto-deleveraging.
18
18
  *
19
- * A single fill can emit more than one `balance_update` for the same account
20
- * (e.g. a `trade` frame plus a `rebate` frame). Each frame carries the
21
- * account's RESULTING balance for its token — it is a terminal-state snapshot,
22
- * not an additive delta — so consume it by applying the latest balance per
23
- * (account, token). That makes reconnect/replay naturally idempotent: never sum
24
- * the `reason` frames as if they were separate credits.
19
+ * A genuine spot frame carries the resulting `user_balances` row and its
20
+ * producer-owned `version`, scoped to the authenticated user/application and
21
+ * token. Higher is newer; equal is idempotent. A collateral transfer that
22
+ * moves the spot wallet row emits a genuine versioned spot frame for that leg.
23
+ * Margin collateral frames — a parent to risk-bucket allocation, which moves
24
+ * no wallet balance — and margin-routed deposit notifications omit `version`:
25
+ * they are not spot rows, and a deposit notification can carry a delta rather
26
+ * than whole-row state.
27
+ * They cannot be reconciled against a spot snapshot or summed as separate
28
+ * credits; refresh authoritative margin-account state instead.
25
29
  */
26
30
  export type BalanceUpdateReason = "lock" | "unlock" | "deposit" | "margin_deposit" | "withdrawal" | "trade" | "fee" | "rebate" | "funding" | "liquidation" | "adl" | "margin_transfer_in" | "margin_transfer_out";
27
31
  /**
@@ -40,15 +44,26 @@ export interface UserBalanceEventData {
40
44
  locked: string;
41
45
  /** Locked balance in raw format (wei) */
42
46
  lockedRaw: string;
43
- /** Total balance (available + locked + margin collateral, normalized) */
47
+ /** Total balance represented by this frame, normalized */
44
48
  total: string;
45
49
  /** Total balance in raw format (wei) */
46
50
  totalRaw: string;
51
+ /**
52
+ * Opaque durable spot-row version. Present only for genuine `user_balances`
53
+ * state; absent on legacy frames and margin collateral notifications.
54
+ *
55
+ * Only a POSITIVE version is rankable. `0` is the legacy sentinel and means
56
+ * exactly what an absent field means — unranked — so normalize the two
57
+ * together. A subscribe-time snapshot can carry a persisted `0`, and ranking
58
+ * it as the oldest revision would suppress the unranked frames a rolling
59
+ * deploy produces.
60
+ */
61
+ version?: number;
47
62
  /** Reason for the balance update */
48
63
  reason: BalanceUpdateReason | (string & {});
49
64
  /** Reference ID for related entity (e.g., order ID, deposit ID) */
50
65
  referenceId: string | null;
51
- /** Timestamp when the balance was updated (ISO 8601) */
66
+ /** Display/source timestamp only; never use it to order balance state. */
52
67
  updatedAt: string;
53
68
  }
54
69
  /**
@@ -10,6 +10,6 @@
10
10
  * hand-written SDK surface. CI regenerates it and fails on a diff, identical to
11
11
  * the `schema.ts` wire-types tripwire (MON-1476), so it can never go stale.
12
12
  */
13
- export declare const OPERATION_IDS: readonly ["attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "cancel_twap_order", "check_trader_code_availability", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_sub_account_limits", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_twap_order", "get_twap_order_tca", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "list_twap_orders", "mint_tokens", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
13
+ export declare const OPERATION_IDS: readonly ["attach_position_tp_sl", "batch_cancel_all", "batch_cancel_all_by_pair", "batch_cancel_orders", "batch_close_all_positions", "batch_create_orders", "batch_replace_orders", "cancel_conditional_order", "cancel_order", "cancel_twap_order", "check_trader_code_availability", "clear_trader_code", "close_position", "create_challenge", "create_delegated_session", "create_order", "create_sub_account_limit", "create_twap_order", "delete_sub_account_limit", "get_application_config", "get_application_stats", "get_available_collateral", "get_candles", "get_conditional_order", "get_faucet_info", "get_funding_state", "get_index_price", "get_margin_account_movements", "get_margin_account_summary", "get_mark_price", "get_market_metadata", "get_market_stats", "get_my_fee_tier", "get_my_trader_code", "get_open_interest", "get_order_by_id", "get_orderbook_snapshot", "get_orders", "get_parent_margin_account_movements", "get_parent_margin_account_summary", "get_perp_market_config", "get_perp_market_summary", "get_portfolio_assets", "get_portfolio_chart", "get_portfolio_margin", "get_portfolio_performance", "get_portfolio_realized_pnl", "get_portfolio_stats", "get_portfolio_summary", "get_position", "get_position_pnl_history", "get_position_risk", "get_pulse", "get_rewards_balance", "get_screener", "get_sub_account_limits", "get_sweeper_chains", "get_trade_by_id", "get_trader_code_info", "get_trades", "get_trading_pair_by_id", "get_twap_order", "get_twap_order_tca", "get_user_balance_by_asset", "get_user_balances", "get_user_movements", "get_user_profile", "get_user_trades", "get_withdrawal", "health_check", "initiate_withdrawal", "list_all_funding_history", "list_application_balances", "list_application_movements", "list_application_orders", "list_application_users", "list_conditional_orders", "list_delegated_agent_owners", "list_delegated_agents", "list_funding_history", "list_funding_payments", "list_margin_accounts", "list_pending_withdrawals", "list_position_history", "list_positions", "list_sub_accounts_with_balances", "list_trading_pairs", "list_twap_orders", "mint_tokens", "refresh_session", "register_deposit_address", "replace_order", "revoke_delegated_agent", "revoke_session", "set_trader_code", "simulate_fees", "simulate_order_risk", "simulate_parent_margin_order_risk", "simulate_risk_bucket_order_risk", "submit_whitelist", "transfer_collateral_from_margin_account", "transfer_collateral_from_parent_margin_account", "transfer_collateral_to_margin_account", "transfer_collateral_to_parent_margin_account", "transfer_collateral_to_risk_bucket", "transfer_rewards", "update_sub_account_limit", "upsert_delegated_agent", "verify_signature"];
14
14
  /** Union of every OpenAPI operationId in the spec. */
15
15
  export type OperationId = (typeof OPERATION_IDS)[number];
@@ -67,6 +67,7 @@ export const OPERATION_IDS = [
67
67
  "get_rewards_balance",
68
68
  "get_screener",
69
69
  "get_sub_account_limits",
70
+ "get_sweeper_chains",
70
71
  "get_trade_by_id",
71
72
  "get_trader_code_info",
72
73
  "get_trades",
@@ -2079,6 +2079,36 @@ export interface paths {
2079
2079
  patch?: never;
2080
2080
  trace?: never;
2081
2081
  };
2082
+ "/api/v1/sweeper/chains": {
2083
+ parameters: {
2084
+ query?: never;
2085
+ header?: never;
2086
+ path?: never;
2087
+ cookie?: never;
2088
+ };
2089
+ /**
2090
+ * List the chains and assets the sweeper watches
2091
+ * @description The chains and assets the sweeper watches.
2092
+ *
2093
+ * One entry per supported chain, each listing the sweepable assets there
2094
+ * with their token addresses and minimum sweep amounts (raw base units;
2095
+ * balances below the minimum wait until a later deposit lifts them past
2096
+ * it). The deposit address returned by `register_deposit_address` is the
2097
+ * same on every listed chain, and a registered address is watched on all of
2098
+ * them.
2099
+ *
2100
+ * Public and unauthenticated; the set changes only with operator
2101
+ * configuration.
2102
+ */
2103
+ get: operations["get_sweeper_chains"];
2104
+ put?: never;
2105
+ post?: never;
2106
+ delete?: never;
2107
+ options?: never;
2108
+ head?: never;
2109
+ patch?: never;
2110
+ trace?: never;
2111
+ };
2082
2112
  "/api/v1/sweeper/register": {
2083
2113
  parameters: {
2084
2114
  query?: never;
@@ -2093,20 +2123,23 @@ export interface paths {
2093
2123
  * @description Register a deposit address for monitoring.
2094
2124
  *
2095
2125
  * Every (application, user, deposit target) triple has a deterministic
2096
- * deposit address. This registers the caller's own address so the sweeper
2097
- * service watches it and automatically forwards every ERC20 deposit into the
2098
- * rollup, crediting the caller under the application.
2126
+ * deposit address — the SAME address on every supported chain. This
2127
+ * registers the caller's own address so the sweeper service watches it on
2128
+ * every chain it is configured for (`get_sweeper_chains` lists the set) and
2129
+ * automatically forwards every supported deposit into the exchange,
2130
+ * crediting the caller under the application. One registration covers all
2131
+ * supported chains — there is nothing chain-specific to choose.
2099
2132
  *
2100
2133
  * Authenticated, and the whole identity comes from the session: the
2101
2134
  * application is the one `login` established the session under, and the
2102
2135
  * credited address is the session's own. Neither is a request parameter, so a
2103
2136
  * caller can only ever register their own address under their own
2104
- * application. The only thing the body carries is which ledger to aim at.
2137
+ * application. The body carries only which ledger to aim at.
2105
2138
  *
2106
2139
  * Registration also runs a one-time initial check in the background: any
2107
- * balance already sitting on the address is swept without waiting for a new
2108
- * transfer. The response returns immediately with the derived address; it
2109
- * does not wait for that check.
2140
+ * balance already sitting on the address, on any supported chain, is swept
2141
+ * without waiting for a new transfer. The response returns immediately with
2142
+ * the derived address; it does not wait for that check.
2110
2143
  *
2111
2144
  * Idempotent and safe to retry: re-registering an existing triple returns
2112
2145
  * `already_registered` with the same address and never re-triggers the
@@ -2340,6 +2373,12 @@ export interface components {
2340
2373
  * @example true
2341
2374
  */
2342
2375
  wrappedNative?: boolean | null;
2376
+ /**
2377
+ * Format: int64
2378
+ * @description Opaque, non-negative producer-owned version for this spot user_balances row. Compare only within the same (user, application, token); higher is newer. 0 is the unranked legacy sentinel and never participates in ordering: it means the row predates this field or came from a producer that does not stamp it, so treat it exactly as an absent version and fall back to a full field comparison rather than ranking it as oldest. This does not order margin collateral.
2379
+ * @example 918342
2380
+ */
2381
+ version?: number | null;
2343
2382
  };
2344
2383
  AppUser: {
2345
2384
  /**
@@ -2905,7 +2944,7 @@ export interface components {
2905
2944
  */
2906
2945
  postOnly?: boolean | null;
2907
2946
  /**
2908
- * @description Client-assigned correlation handle, echoed back on order reads (detail and list) and on order WebSocket events. At most 64 characters from [A-Za-z0-9._:-]; surrounding whitespace is trimmed before storage, and a blank or whitespace-only value is treated as absent. Uniqueness is enforced only among your orders that are RESTING on the book: an item reusing a value another of your resting orders still holds fails that item alone — the batch itself returns 2xx / OK and the offending item's result slot carries error.code CLIENT_ORDER_ID_CONFLICT; no transport-level 409 / ALREADY_EXISTS is raised. An order that never rests — MARKET, IOC/FOK, or a LIMIT that fills completely on arrival — does not take the handle, and the value is released the moment any order reaches a terminal state. It is therefore NOT an idempotency key, though on this replace path a retry cannot double-execute: the request names the original order id, and the sequencer revalidates that original in memory and on the book at sequence time, so once the first replacement succeeds the original is gone and a retry is rejected with ORDER_NOT_FOUND rather than placing a second order. That code is itself ambiguous — the original may instead have filled or been cancelled — so the risk here is acting on a stale view, not duplicate execution. Reconcile a lost response against the order WebSocket stream, which carries this value on the submit acknowledgement and on fills, including for orders that never rest; order history is replica-backed and can omit an order that did land. The stream is not replayable and has no sequence number to backfill from, and its fan-out is non-persistent Core NATS: the service can re-establish an ended upstream subscription without closing your socket, so events can be missed while your connection still looks healthy. A matching event is therefore positive proof the order was accepted, but silence is NEVER evidence it was not, and no client-observable condition makes it so. Absent positive evidence the outcome is unresolved: hold and escalate rather than resubmitting. A replace item carries no order type or time-in-force and its original must still be RESTING, so the IOC/FOK and MARKET post-acceptance rejection shapes are unreachable here. Failures split by WHEN they occur, and the difference decides whether your original survives. Before sequencing: a malformed value is caught up front and rejects the whole batch with HTTP 400 / gRPC INVALID_ARGUMENT, and a per-item validation failure fails that item with no mutation and no event. A pre-cancel gate then drops two more classes before anything is cancelled — a handle conflict, and a post-only replacement that would cross the book as it will stand once this batch's originals are cancelled — so in the ordinary POST_ONLY_WOULD_CROSS case the item fails with its original still RESTING and untouched. After that the endpoint is CANCEL-FIRST: the original is cancelled in pass 1, so a residual placement failure then — a self-trade rejection, or a crossing that only became apparent in pass 2 — leaves the original CANCELLED and emits its cancellation events (terminal reason 'replaced') while the item reports the placement error and no replacement is placed. Never assume a failed item left your original resting; read results[] and the stream. Single ReplaceOrder differs: it is atomic, and a rejected replacement leaves the original untouched. Where no surface is conclusive, do not resubmit. A replacement is a new order with a new id, so it carries its own value and inherits nothing from the original — restate it to keep the handle.
2947
+ * @description Client-assigned correlation handle, echoed back on order reads (detail and list) and on order WebSocket events. At most 64 characters from [A-Za-z0-9._:-]; surrounding whitespace is trimmed before storage, and a blank or whitespace-only value is treated as absent. Uniqueness is enforced only among your orders that are RESTING on the book: an item reusing a value another of your resting orders still holds fails that item alone — the batch itself returns 2xx / OK and the offending item's result slot carries error.code CLIENT_ORDER_ID_CONFLICT; no transport-level 409 / ALREADY_EXISTS is raised. An order that never rests — MARKET, IOC/FOK, or a LIMIT that fills completely on arrival — does not take the handle, and the value is released the moment any order reaches a terminal state. It is therefore NOT an idempotency key, though on this replace path a retry cannot double-execute: the request names the original order id, and the sequencer revalidates that original in memory and on the book at sequence time, so once the first replacement succeeds the original is gone and a retry is rejected with ORDER_NOT_FOUND rather than placing a second order. That code is itself ambiguous — the original may instead have filled or been cancelled — so the risk here is acting on a stale view, not duplicate execution. Reconcile a lost response against the order WebSocket stream, which carries this value on the submit acknowledgement and on fills, including for orders that never rest; order history is replica-backed and can omit an order that did land. The stream is not replayable and has no sequence number to backfill from, and its fan-out is non-persistent Core NATS: the service can re-establish an ended upstream subscription without closing your socket, so events can be missed while your connection still looks healthy. A matching event is therefore positive proof the order was accepted, but silence is NEVER evidence it was not, and no client-observable condition makes it so. Absent positive evidence the outcome is unresolved: hold and escalate rather than resubmitting. A replace item carries no order type or time-in-force and its original must still be RESTING, so the IOC/FOK and MARKET post-acceptance rejection shapes are unreachable here. Failures split by WHEN they occur, and the difference decides whether your original survives. Before sequencing: every validation failure — a malformed value included — fails ITS ITEM alone with a structured error.code (INVALID_CLIENT_ORDER_ID for a malformed handle, the same code batch-create uses) and no mutation and no event, batch-create parity; the whole request 400s only for an empty or oversize batch. (Earlier releases rejected the whole batch for a malformed value here.) A pre-cancel gate then drops two more classes before anything is cancelled — a handle conflict, and a post-only replacement that would cross the book as it will stand once this batch's originals are cancelled — so in the ordinary POST_ONLY_WOULD_CROSS case the item fails with its original still RESTING and untouched. After that the endpoint is CANCEL-FIRST: the original is cancelled in pass 1, so a residual placement failure then — a self-trade rejection, or a crossing that only became apparent in pass 2 — leaves the original CANCELLED and emits its cancellation events (terminal reason 'replaced') while the item reports the placement error and no replacement is placed. Never assume a failed item left your original resting; read results[] and the stream. Single ReplaceOrder differs: it is atomic, and a rejected replacement leaves the original untouched. Where no surface is conclusive, do not resubmit. A replacement is a new order with a new id, so it carries its own value and inherits nothing from the original — restate it to keep the handle.
2909
2948
  * @example quote-btc-1130-a
2910
2949
  */
2911
2950
  clientOrderId?: string | null;
@@ -3930,6 +3969,12 @@ export interface components {
3930
3969
  * @example true
3931
3970
  */
3932
3971
  wrappedNative?: boolean | null;
3972
+ /**
3973
+ * Format: int64
3974
+ * @description Opaque, non-negative producer-owned version for this spot user_balances row. Compare only within the same (user, application, token); higher is newer. 0 is the unranked legacy sentinel and never participates in ordering: it means the row predates this field or came from a producer that does not stamp it, so treat it exactly as an absent version and fall back to a full field comparison rather than ranking it as oldest. This does not order margin collateral.
3975
+ * @example 918342
3976
+ */
3977
+ version?: number | null;
3933
3978
  };
3934
3979
  GetBalancesResponse: {
3935
3980
  balances?: components["schemas"]["AccountBalance"][] | null;
@@ -3962,6 +4007,10 @@ export interface components {
3962
4007
  GetCandlesResponse: {
3963
4008
  candles?: components["schemas"]["Candle"][] | null;
3964
4009
  };
4010
+ GetChainsResponse: {
4011
+ /** @description One entry per chain the sweeper watches */
4012
+ chains?: components["schemas"]["SweeperChain"][] | null;
4013
+ };
3965
4014
  GetConfigResponse: {
3966
4015
  /**
3967
4016
  * @description Application UUID
@@ -4337,7 +4386,7 @@ export interface components {
4337
4386
  */
4338
4387
  tradingPairId?: string | null;
4339
4388
  /**
4340
- * @description Order type: LIMIT or MARKET
4389
+ * @description What kind of order this row is: LIMIT or MARKET for a book order, TWAP for a TWAP parent, CONDITIONAL for a price-triggered order. TWAP and CONDITIONAL appear only in responses — they name a row's kind and cannot be placed through the create-order request, which still takes LIMIT, MARKET or IOC. A row of either kind carries its kind-specific fields in `twap` or `conditional`; the fields shared by every kind (id, side, quantity, status, timestamps) are populated in place as usual.
4341
4390
  * @example LIMIT
4342
4391
  */
4343
4392
  orderType?: string | null;
@@ -4347,7 +4396,7 @@ export interface components {
4347
4396
  */
4348
4397
  side?: string | null;
4349
4398
  /**
4350
- * @description Limit price (null for market orders)
4399
+ * @description Limit price (null for market orders). For a TWAP parent this is its optional parent-level limit price, and for a conditional order the limit price its triggered order will carry (null when it triggers as a market order).
4351
4400
  * @example 35000.00
4352
4401
  */
4353
4402
  price?: string | null;
@@ -4539,6 +4588,10 @@ export interface components {
4539
4588
  * @example false
4540
4589
  */
4541
4590
  postOnly?: boolean | null;
4591
+ /** @description Present only when orderType is TWAP: the full TWAP parent, identical to what GET /api/v1/orders/twap/{twapOrderId} returns — schedule, slice counters, progress, and terminal reason. The row's shared fields mirror it: quantity is the parent's total quantity, filledQuantity its executed quantity, and status maps its state onto the order statuses. */
4592
+ twap?: components["schemas"]["TwapOrder"] | null;
4593
+ /** @description Present only when orderType is CONDITIONAL: the full conditional order, identical to what the conditional-order endpoints return — trigger price and direction, condition type, linked group, and the order it triggers into. The row's shared fields mirror it, with status mapping its state onto the order statuses. */
4594
+ conditional?: components["schemas"]["ConditionalOrder"] | null;
4542
4595
  /**
4543
4596
  * Format: int64
4544
4597
  * @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.
@@ -7169,6 +7222,49 @@ export interface components {
7169
7222
  */
7170
7223
  userId?: string | null;
7171
7224
  };
7225
+ SweeperChain: {
7226
+ /**
7227
+ * Format: int64
7228
+ * @description The chain's EVM chain id, served as a JSON number and always at most 2^53 - 1 (JavaScript's safe-integer range). Every registered deposit address is watched on every listed chain — the address is identical on all of them
7229
+ * @example 1329
7230
+ */
7231
+ chainId?: number | null;
7232
+ /**
7233
+ * @description Short human-readable chain name
7234
+ * @example sei
7235
+ */
7236
+ name?: string | null;
7237
+ /**
7238
+ * @description Whether this is the settlement (hub) chain deposits are forwarded into; deposits on every other listed chain are bridged there automatically
7239
+ * @example true
7240
+ */
7241
+ hub?: boolean | null;
7242
+ /** @description The assets swept on this chain */
7243
+ assets?: components["schemas"]["SweeperChainAsset"][] | null;
7244
+ };
7245
+ SweeperChainAsset: {
7246
+ /**
7247
+ * @description The asset's symbol on this chain
7248
+ * @example USDC
7249
+ */
7250
+ symbol?: string | null;
7251
+ /**
7252
+ * @description The ERC20 contract address to send on this chain
7253
+ * @example 0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392
7254
+ */
7255
+ tokenAddress?: string | null;
7256
+ /**
7257
+ * Format: uint32
7258
+ * @description The token's decimals on this chain; 0 when not published
7259
+ * @example 6
7260
+ */
7261
+ decimals?: number | null;
7262
+ /**
7263
+ * @description Minimum sweepable balance in raw base units; smaller balances wait until a later deposit lifts the total past it
7264
+ * @example 5000000
7265
+ */
7266
+ minSweepRaw?: string | null;
7267
+ };
7172
7268
  TpSlLeg: {
7173
7269
  triggerPrice?: string | null;
7174
7270
  orderType?: string | null;
@@ -7966,6 +8062,13 @@ export interface operations {
7966
8062
  };
7967
8063
  content?: never;
7968
8064
  };
8065
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8066
+ 429: {
8067
+ headers: {
8068
+ [name: string]: unknown;
8069
+ };
8070
+ content?: never;
8071
+ };
7969
8072
  /** @description Internal server error */
7970
8073
  500: {
7971
8074
  headers: {
@@ -8017,6 +8120,13 @@ export interface operations {
8017
8120
  };
8018
8121
  content?: never;
8019
8122
  };
8123
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8124
+ 429: {
8125
+ headers: {
8126
+ [name: string]: unknown;
8127
+ };
8128
+ content?: never;
8129
+ };
8020
8130
  /** @description Internal server error */
8021
8131
  500: {
8022
8132
  headers: {
@@ -8067,6 +8177,13 @@ export interface operations {
8067
8177
  };
8068
8178
  content?: never;
8069
8179
  };
8180
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8181
+ 429: {
8182
+ headers: {
8183
+ [name: string]: unknown;
8184
+ };
8185
+ content?: never;
8186
+ };
8070
8187
  /** @description Internal server error */
8071
8188
  500: {
8072
8189
  headers: {
@@ -8115,6 +8232,13 @@ export interface operations {
8115
8232
  };
8116
8233
  content?: never;
8117
8234
  };
8235
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8236
+ 429: {
8237
+ headers: {
8238
+ [name: string]: unknown;
8239
+ };
8240
+ content?: never;
8241
+ };
8118
8242
  /** @description Internal server error */
8119
8243
  500: {
8120
8244
  headers: {
@@ -8158,6 +8282,13 @@ export interface operations {
8158
8282
  };
8159
8283
  content?: never;
8160
8284
  };
8285
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8286
+ 429: {
8287
+ headers: {
8288
+ [name: string]: unknown;
8289
+ };
8290
+ content?: never;
8291
+ };
8161
8292
  /** @description Internal server error */
8162
8293
  500: {
8163
8294
  headers: {
@@ -8208,6 +8339,13 @@ export interface operations {
8208
8339
  };
8209
8340
  content?: never;
8210
8341
  };
8342
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8343
+ 429: {
8344
+ headers: {
8345
+ [name: string]: unknown;
8346
+ };
8347
+ content?: never;
8348
+ };
8211
8349
  /** @description Internal server error */
8212
8350
  500: {
8213
8351
  headers: {
@@ -8259,6 +8397,13 @@ export interface operations {
8259
8397
  };
8260
8398
  content?: never;
8261
8399
  };
8400
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8401
+ 429: {
8402
+ headers: {
8403
+ [name: string]: unknown;
8404
+ };
8405
+ content?: never;
8406
+ };
8262
8407
  /** @description Internal server error */
8263
8408
  500: {
8264
8409
  headers: {
@@ -8300,6 +8445,13 @@ export interface operations {
8300
8445
  };
8301
8446
  content?: never;
8302
8447
  };
8448
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8449
+ 429: {
8450
+ headers: {
8451
+ [name: string]: unknown;
8452
+ };
8453
+ content?: never;
8454
+ };
8303
8455
  /** @description Internal server error */
8304
8456
  500: {
8305
8457
  headers: {
@@ -8350,6 +8502,13 @@ export interface operations {
8350
8502
  };
8351
8503
  content?: never;
8352
8504
  };
8505
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8506
+ 429: {
8507
+ headers: {
8508
+ [name: string]: unknown;
8509
+ };
8510
+ content?: never;
8511
+ };
8353
8512
  /** @description Internal server error */
8354
8513
  500: {
8355
8514
  headers: {
@@ -8400,6 +8559,13 @@ export interface operations {
8400
8559
  };
8401
8560
  content?: never;
8402
8561
  };
8562
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8563
+ 429: {
8564
+ headers: {
8565
+ [name: string]: unknown;
8566
+ };
8567
+ content?: never;
8568
+ };
8403
8569
  /** @description Internal server error */
8404
8570
  500: {
8405
8571
  headers: {
@@ -8450,6 +8616,13 @@ export interface operations {
8450
8616
  };
8451
8617
  content?: never;
8452
8618
  };
8619
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8620
+ 429: {
8621
+ headers: {
8622
+ [name: string]: unknown;
8623
+ };
8624
+ content?: never;
8625
+ };
8453
8626
  /** @description Internal server error */
8454
8627
  500: {
8455
8628
  headers: {
@@ -8518,6 +8691,13 @@ export interface operations {
8518
8691
  };
8519
8692
  content?: never;
8520
8693
  };
8694
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8695
+ 429: {
8696
+ headers: {
8697
+ [name: string]: unknown;
8698
+ };
8699
+ content?: never;
8700
+ };
8521
8701
  /** @description Internal server error */
8522
8702
  500: {
8523
8703
  headers: {
@@ -8566,6 +8746,13 @@ export interface operations {
8566
8746
  };
8567
8747
  content?: never;
8568
8748
  };
8749
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8750
+ 429: {
8751
+ headers: {
8752
+ [name: string]: unknown;
8753
+ };
8754
+ content?: never;
8755
+ };
8569
8756
  /** @description Internal server error */
8570
8757
  500: {
8571
8758
  headers: {
@@ -8685,6 +8872,13 @@ export interface operations {
8685
8872
  };
8686
8873
  content?: never;
8687
8874
  };
8875
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
8876
+ 429: {
8877
+ headers: {
8878
+ [name: string]: unknown;
8879
+ };
8880
+ content?: never;
8881
+ };
8688
8882
  /** @description Internal server error */
8689
8883
  500: {
8690
8884
  headers: {
@@ -8881,6 +9075,13 @@ export interface operations {
8881
9075
  };
8882
9076
  content?: never;
8883
9077
  };
9078
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
9079
+ 429: {
9080
+ headers: {
9081
+ [name: string]: unknown;
9082
+ };
9083
+ content?: never;
9084
+ };
8884
9085
  /** @description Internal server error */
8885
9086
  500: {
8886
9087
  headers: {
@@ -8979,6 +9180,13 @@ export interface operations {
8979
9180
  };
8980
9181
  content?: never;
8981
9182
  };
9183
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
9184
+ 429: {
9185
+ headers: {
9186
+ [name: string]: unknown;
9187
+ };
9188
+ content?: never;
9189
+ };
8982
9190
  /** @description Internal server error */
8983
9191
  500: {
8984
9192
  headers: {
@@ -9432,6 +9640,13 @@ export interface operations {
9432
9640
  };
9433
9641
  content?: never;
9434
9642
  };
9643
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
9644
+ 429: {
9645
+ headers: {
9646
+ [name: string]: unknown;
9647
+ };
9648
+ content?: never;
9649
+ };
9435
9650
  /** @description Internal server error */
9436
9651
  500: {
9437
9652
  headers: {
@@ -9518,6 +9733,13 @@ export interface operations {
9518
9733
  };
9519
9734
  content?: never;
9520
9735
  };
9736
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
9737
+ 429: {
9738
+ headers: {
9739
+ [name: string]: unknown;
9740
+ };
9741
+ content?: never;
9742
+ };
9521
9743
  /** @description Internal server error */
9522
9744
  500: {
9523
9745
  headers: {
@@ -9662,6 +9884,13 @@ export interface operations {
9662
9884
  };
9663
9885
  content?: never;
9664
9886
  };
9887
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
9888
+ 429: {
9889
+ headers: {
9890
+ [name: string]: unknown;
9891
+ };
9892
+ content?: never;
9893
+ };
9665
9894
  /** @description Internal server error */
9666
9895
  500: {
9667
9896
  headers: {
@@ -9795,6 +10024,13 @@ export interface operations {
9795
10024
  };
9796
10025
  content?: never;
9797
10026
  };
10027
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10028
+ 429: {
10029
+ headers: {
10030
+ [name: string]: unknown;
10031
+ };
10032
+ content?: never;
10033
+ };
9798
10034
  /** @description Internal server error */
9799
10035
  500: {
9800
10036
  headers: {
@@ -9846,6 +10082,13 @@ export interface operations {
9846
10082
  };
9847
10083
  content?: never;
9848
10084
  };
10085
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10086
+ 429: {
10087
+ headers: {
10088
+ [name: string]: unknown;
10089
+ };
10090
+ content?: never;
10091
+ };
9849
10092
  /** @description Internal server error */
9850
10093
  500: {
9851
10094
  headers: {
@@ -9881,6 +10124,13 @@ export interface operations {
9881
10124
  "application/json": components["schemas"]["ListMarginAccountsResponse"];
9882
10125
  };
9883
10126
  };
10127
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10128
+ 429: {
10129
+ headers: {
10130
+ [name: string]: unknown;
10131
+ };
10132
+ content?: never;
10133
+ };
9884
10134
  };
9885
10135
  };
9886
10136
  get_margin_account_summary: {
@@ -9910,6 +10160,13 @@ export interface operations {
9910
10160
  "application/json": components["schemas"]["GetMarginAccountSummaryResponse"];
9911
10161
  };
9912
10162
  };
10163
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10164
+ 429: {
10165
+ headers: {
10166
+ [name: string]: unknown;
10167
+ };
10168
+ content?: never;
10169
+ };
9913
10170
  };
9914
10171
  };
9915
10172
  transfer_collateral_to_margin_account: {
@@ -10016,6 +10273,13 @@ export interface operations {
10016
10273
  "application/json": components["schemas"]["GetMarginAccountMovementsResponse"];
10017
10274
  };
10018
10275
  };
10276
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10277
+ 429: {
10278
+ headers: {
10279
+ [name: string]: unknown;
10280
+ };
10281
+ content?: never;
10282
+ };
10019
10283
  };
10020
10284
  };
10021
10285
  simulate_order_risk: {
@@ -10046,6 +10310,13 @@ export interface operations {
10046
10310
  "application/json": components["schemas"]["SimulateOrderRiskResponse"];
10047
10311
  };
10048
10312
  };
10313
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10314
+ 429: {
10315
+ headers: {
10316
+ [name: string]: unknown;
10317
+ };
10318
+ content?: never;
10319
+ };
10049
10320
  };
10050
10321
  };
10051
10322
  get_available_collateral: {
@@ -10068,6 +10339,13 @@ export interface operations {
10068
10339
  "application/json": components["schemas"]["GetAvailableCollateralResponse"];
10069
10340
  };
10070
10341
  };
10342
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10343
+ 429: {
10344
+ headers: {
10345
+ [name: string]: unknown;
10346
+ };
10347
+ content?: never;
10348
+ };
10071
10349
  };
10072
10350
  };
10073
10351
  get_parent_margin_account_summary: {
@@ -10091,6 +10369,13 @@ export interface operations {
10091
10369
  "application/json": components["schemas"]["GetMarginAccountSummaryResponse"];
10092
10370
  };
10093
10371
  };
10372
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10373
+ 429: {
10374
+ headers: {
10375
+ [name: string]: unknown;
10376
+ };
10377
+ content?: never;
10378
+ };
10094
10379
  };
10095
10380
  };
10096
10381
  transfer_collateral_to_parent_margin_account: {
@@ -10179,6 +10464,13 @@ export interface operations {
10179
10464
  "application/json": components["schemas"]["GetMarginAccountMovementsResponse"];
10180
10465
  };
10181
10466
  };
10467
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10468
+ 429: {
10469
+ headers: {
10470
+ [name: string]: unknown;
10471
+ };
10472
+ content?: never;
10473
+ };
10182
10474
  };
10183
10475
  };
10184
10476
  simulate_parent_margin_order_risk: {
@@ -10203,6 +10495,13 @@ export interface operations {
10203
10495
  "application/json": components["schemas"]["SimulateOrderRiskResponse"];
10204
10496
  };
10205
10497
  };
10498
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10499
+ 429: {
10500
+ headers: {
10501
+ [name: string]: unknown;
10502
+ };
10503
+ content?: never;
10504
+ };
10206
10505
  };
10207
10506
  };
10208
10507
  transfer_collateral_to_risk_bucket: {
@@ -10258,6 +10557,13 @@ export interface operations {
10258
10557
  "application/json": components["schemas"]["SimulateOrderRiskResponse"];
10259
10558
  };
10260
10559
  };
10560
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10561
+ 429: {
10562
+ headers: {
10563
+ [name: string]: unknown;
10564
+ };
10565
+ content?: never;
10566
+ };
10261
10567
  };
10262
10568
  };
10263
10569
  list_all_funding_history: {
@@ -10855,6 +11161,13 @@ export interface operations {
10855
11161
  };
10856
11162
  content?: never;
10857
11163
  };
11164
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11165
+ 429: {
11166
+ headers: {
11167
+ [name: string]: unknown;
11168
+ };
11169
+ content?: never;
11170
+ };
10858
11171
  /** @description Internal server error */
10859
11172
  500: {
10860
11173
  headers: {
@@ -10900,7 +11213,7 @@ export interface operations {
10900
11213
  };
10901
11214
  content?: never;
10902
11215
  };
10903
- /** @description Order rate limit exceeded — the per-account item-weighted budget is spent; retry after the interval in details.retryAfter */
11216
+ /** @description Order rate limit exceeded — the per-account item-weighted budget, or the budget the account family (master and sub-accounts) shares, is spent; retry after the interval in details.retryAfter */
10904
11217
  429: {
10905
11218
  headers: {
10906
11219
  [name: string]: unknown;
@@ -10959,7 +11272,7 @@ export interface operations {
10959
11272
  };
10960
11273
  content?: never;
10961
11274
  };
10962
- /** @description Risk-reduction rate limit exceeded — each id counts against the 2x risk-reduction budget and the whole request is rejected; retry after the interval in details.retryAfter */
11275
+ /** @description Risk-reduction rate limit exceeded — each id counts against the 2x risk-reduction budget (per account, and shared across the account family) and the whole request is rejected; retry after the interval in details.retryAfter */
10963
11276
  429: {
10964
11277
  headers: {
10965
11278
  [name: string]: unknown;
@@ -11000,6 +11313,13 @@ export interface operations {
11000
11313
  };
11001
11314
  content?: never;
11002
11315
  };
11316
+ /** @description Risk-reduction rate limit exceeded — mass exit costs one risk-reduction item per call (per account and account family), however many orders it cancels; retry after the interval in details.retryAfter */
11317
+ 429: {
11318
+ headers: {
11319
+ [name: string]: unknown;
11320
+ };
11321
+ content?: never;
11322
+ };
11003
11323
  /** @description Internal server error or matching engine failure */
11004
11324
  500: {
11005
11325
  headers: {
@@ -11044,6 +11364,13 @@ export interface operations {
11044
11364
  };
11045
11365
  content?: never;
11046
11366
  };
11367
+ /** @description Risk-reduction rate limit exceeded — mass exit costs one risk-reduction item per call (per account and account family), however many orders it cancels; retry after the interval in details.retryAfter */
11368
+ 429: {
11369
+ headers: {
11370
+ [name: string]: unknown;
11371
+ };
11372
+ content?: never;
11373
+ };
11047
11374
  /** @description Internal server error or matching engine failure */
11048
11375
  500: {
11049
11376
  headers: {
@@ -11089,7 +11416,7 @@ export interface operations {
11089
11416
  };
11090
11417
  content?: never;
11091
11418
  };
11092
- /** @description Order rate limit exceeded — each batch item counts against the per-account budget and the whole request is rejected; retry after the interval in details.retryAfter */
11419
+ /** @description Order rate limit exceeded — each batch item counts against the per-account budget (and the account family's shared budget) and the whole request is rejected; retry after the interval in details.retryAfter */
11093
11420
  429: {
11094
11421
  headers: {
11095
11422
  [name: string]: unknown;
@@ -11141,7 +11468,7 @@ export interface operations {
11141
11468
  };
11142
11469
  content?: never;
11143
11470
  };
11144
- /** @description Order rate limit exceeded — each batch item counts against the per-account budget and the whole request is rejected; retry after the interval in details.retryAfter */
11471
+ /** @description Order rate limit exceeded — each batch item counts against the per-account budget (and the account family's shared budget) and the whole request is rejected; retry after the interval in details.retryAfter */
11145
11472
  429: {
11146
11473
  headers: {
11147
11474
  [name: string]: unknown;
@@ -11200,7 +11527,7 @@ export interface operations {
11200
11527
  };
11201
11528
  content?: never;
11202
11529
  };
11203
- /** @description Risk-reduction rate limit exceeded — cancels draw the 2x risk-reduction budget; retry after the interval in details.retryAfter */
11530
+ /** @description Risk-reduction rate limit exceeded — cancels draw the 2x risk-reduction budget (per account, and shared across the account family); retry after the interval in details.retryAfter */
11204
11531
  429: {
11205
11532
  headers: {
11206
11533
  [name: string]: unknown;
@@ -11243,6 +11570,13 @@ export interface operations {
11243
11570
  "application/json": components["schemas"]["ListConditionalOrdersResponse"];
11244
11571
  };
11245
11572
  };
11573
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11574
+ 429: {
11575
+ headers: {
11576
+ [name: string]: unknown;
11577
+ };
11578
+ content?: never;
11579
+ };
11246
11580
  };
11247
11581
  };
11248
11582
  get_conditional_order: {
@@ -11266,6 +11600,13 @@ export interface operations {
11266
11600
  "application/json": components["schemas"]["ConditionalOrder"];
11267
11601
  };
11268
11602
  };
11603
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11604
+ 429: {
11605
+ headers: {
11606
+ [name: string]: unknown;
11607
+ };
11608
+ content?: never;
11609
+ };
11269
11610
  };
11270
11611
  };
11271
11612
  cancel_conditional_order: {
@@ -11289,7 +11630,7 @@ export interface operations {
11289
11630
  "application/json": components["schemas"]["CancelConditionalOrderResponse"];
11290
11631
  };
11291
11632
  };
11292
- /** @description Risk-reduction rate limit exceeded — cancels draw the 2x risk-reduction budget; retry after the interval in details.retryAfter */
11633
+ /** @description Risk-reduction rate limit exceeded — cancels draw the 2x risk-reduction budget (per account, and shared across the account family); retry after the interval in details.retryAfter */
11293
11634
  429: {
11294
11635
  headers: {
11295
11636
  [name: string]: unknown;
@@ -11338,6 +11679,13 @@ export interface operations {
11338
11679
  };
11339
11680
  content?: never;
11340
11681
  };
11682
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11683
+ 429: {
11684
+ headers: {
11685
+ [name: string]: unknown;
11686
+ };
11687
+ content?: never;
11688
+ };
11341
11689
  /** @description Internal server error */
11342
11690
  500: {
11343
11691
  headers: {
@@ -11390,6 +11738,13 @@ export interface operations {
11390
11738
  };
11391
11739
  content?: never;
11392
11740
  };
11741
+ /** @description Order rate limit exceeded — a TWAP parent costs one order-creation item against the per-account budget and the account family's shared budget; retry after the interval in details.retryAfter */
11742
+ 429: {
11743
+ headers: {
11744
+ [name: string]: unknown;
11745
+ };
11746
+ content?: never;
11747
+ };
11393
11748
  /** @description Internal server error or matching engine failure */
11394
11749
  500: {
11395
11750
  headers: {
@@ -11440,6 +11795,13 @@ export interface operations {
11440
11795
  };
11441
11796
  content?: never;
11442
11797
  };
11798
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11799
+ 429: {
11800
+ headers: {
11801
+ [name: string]: unknown;
11802
+ };
11803
+ content?: never;
11804
+ };
11443
11805
  /** @description Internal server error */
11444
11806
  500: {
11445
11807
  headers: {
@@ -11490,7 +11852,7 @@ export interface operations {
11490
11852
  };
11491
11853
  content?: never;
11492
11854
  };
11493
- /** @description Risk-reduction rate limit exceeded — cancels draw the 2x risk-reduction budget; retry after the interval in details.retryAfter */
11855
+ /** @description Risk-reduction rate limit exceeded — cancels draw the 2x risk-reduction budget (per account, and shared across the account family); retry after the interval in details.retryAfter */
11494
11856
  429: {
11495
11857
  headers: {
11496
11858
  [name: string]: unknown;
@@ -11547,6 +11909,13 @@ export interface operations {
11547
11909
  };
11548
11910
  content?: never;
11549
11911
  };
11912
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11913
+ 429: {
11914
+ headers: {
11915
+ [name: string]: unknown;
11916
+ };
11917
+ content?: never;
11918
+ };
11550
11919
  /** @description Internal server error */
11551
11920
  500: {
11552
11921
  headers: {
@@ -11605,6 +11974,13 @@ export interface operations {
11605
11974
  };
11606
11975
  content?: never;
11607
11976
  };
11977
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
11978
+ 429: {
11979
+ headers: {
11980
+ [name: string]: unknown;
11981
+ };
11982
+ content?: never;
11983
+ };
11608
11984
  /** @description Internal server error */
11609
11985
  500: {
11610
11986
  headers: {
@@ -11660,7 +12036,7 @@ export interface operations {
11660
12036
  };
11661
12037
  content?: never;
11662
12038
  };
11663
- /** @description Order rate limit exceeded — the per-account item-weighted budget is spent; retry after the interval in details.retryAfter */
12039
+ /** @description Order rate limit exceeded — the per-account item-weighted budget, or the budget the account family (master and sub-accounts) shares, is spent; retry after the interval in details.retryAfter */
11664
12040
  429: {
11665
12041
  headers: {
11666
12042
  [name: string]: unknown;
@@ -11737,6 +12113,13 @@ export interface operations {
11737
12113
  };
11738
12114
  content?: never;
11739
12115
  };
12116
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12117
+ 429: {
12118
+ headers: {
12119
+ [name: string]: unknown;
12120
+ };
12121
+ content?: never;
12122
+ };
11740
12123
  /** @description Internal server error */
11741
12124
  500: {
11742
12125
  headers: {
@@ -11922,6 +12305,13 @@ export interface operations {
11922
12305
  };
11923
12306
  content?: never;
11924
12307
  };
12308
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12309
+ 429: {
12310
+ headers: {
12311
+ [name: string]: unknown;
12312
+ };
12313
+ content?: never;
12314
+ };
11925
12315
  /** @description Internal server error */
11926
12316
  500: {
11927
12317
  headers: {
@@ -12012,6 +12402,13 @@ export interface operations {
12012
12402
  "application/json": components["schemas"]["ListPositionsResponse"];
12013
12403
  };
12014
12404
  };
12405
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12406
+ 429: {
12407
+ headers: {
12408
+ [name: string]: unknown;
12409
+ };
12410
+ content?: never;
12411
+ };
12015
12412
  };
12016
12413
  };
12017
12414
  batch_close_all_positions: {
@@ -12067,6 +12464,13 @@ export interface operations {
12067
12464
  "application/json": components["schemas"]["ListPositionHistoryResponse"];
12068
12465
  };
12069
12466
  };
12467
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12468
+ 429: {
12469
+ headers: {
12470
+ [name: string]: unknown;
12471
+ };
12472
+ content?: never;
12473
+ };
12070
12474
  };
12071
12475
  };
12072
12476
  get_position: {
@@ -12090,6 +12494,13 @@ export interface operations {
12090
12494
  "application/json": components["schemas"]["GetPositionResponse"];
12091
12495
  };
12092
12496
  };
12497
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12498
+ 429: {
12499
+ headers: {
12500
+ [name: string]: unknown;
12501
+ };
12502
+ content?: never;
12503
+ };
12093
12504
  };
12094
12505
  };
12095
12506
  close_position: {
@@ -12168,6 +12579,13 @@ export interface operations {
12168
12579
  };
12169
12580
  content?: never;
12170
12581
  };
12582
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12583
+ 429: {
12584
+ headers: {
12585
+ [name: string]: unknown;
12586
+ };
12587
+ content?: never;
12588
+ };
12171
12589
  /** @description Internal server error */
12172
12590
  500: {
12173
12591
  headers: {
@@ -12198,6 +12616,13 @@ export interface operations {
12198
12616
  "application/json": components["schemas"]["GetPositionRiskResponse"];
12199
12617
  };
12200
12618
  };
12619
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12620
+ 429: {
12621
+ headers: {
12622
+ [name: string]: unknown;
12623
+ };
12624
+ content?: never;
12625
+ };
12201
12626
  };
12202
12627
  };
12203
12628
  attach_position_tp_sl: {
@@ -12254,6 +12679,40 @@ export interface operations {
12254
12679
  };
12255
12680
  };
12256
12681
  };
12682
+ get_sweeper_chains: {
12683
+ parameters: {
12684
+ query?: never;
12685
+ header?: never;
12686
+ path?: never;
12687
+ cookie?: never;
12688
+ };
12689
+ requestBody?: never;
12690
+ responses: {
12691
+ /** @description OK */
12692
+ 200: {
12693
+ headers: {
12694
+ [name: string]: unknown;
12695
+ };
12696
+ content: {
12697
+ "application/json": components["schemas"]["GetChainsResponse"];
12698
+ };
12699
+ };
12700
+ /** @description Internal server error */
12701
+ 500: {
12702
+ headers: {
12703
+ [name: string]: unknown;
12704
+ };
12705
+ content?: never;
12706
+ };
12707
+ /** @description Sweeper unavailable (not configured or resolver down); safe to retry */
12708
+ 503: {
12709
+ headers: {
12710
+ [name: string]: unknown;
12711
+ };
12712
+ content?: never;
12713
+ };
12714
+ };
12715
+ };
12257
12716
  register_deposit_address: {
12258
12717
  parameters: {
12259
12718
  query?: never;
@@ -12495,6 +12954,13 @@ export interface operations {
12495
12954
  };
12496
12955
  content?: never;
12497
12956
  };
12957
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12958
+ 429: {
12959
+ headers: {
12960
+ [name: string]: unknown;
12961
+ };
12962
+ content?: never;
12963
+ };
12498
12964
  /** @description Internal server error */
12499
12965
  500: {
12500
12966
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
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.55",
19
+ "@0xmonaco/contracts": "1.0.57",
20
20
  "zod": "^4.1.12"
21
21
  },
22
22
  "peerDependencies": {