@0xmonaco/types 1.0.62 → 1.0.65
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.
- package/dist/margin-accounts/index.d.ts +6 -0
- package/dist/positions/index.d.ts +12 -0
- package/dist/profile/index.d.ts +5 -2
- package/dist/trading/responses.d.ts +32 -15
- package/dist/websocket/events/instrument-events.d.ts +18 -0
- package/dist/websocket/events/instrument-events.js +4 -0
- package/dist/wire/schema.d.ts +38 -18
- package/package.json +2 -2
|
@@ -230,6 +230,12 @@ export interface MarginAccountMovement {
|
|
|
230
230
|
}
|
|
231
231
|
export interface GetMarginAccountMovementsResponse {
|
|
232
232
|
movements: MarginAccountMovement[];
|
|
233
|
+
/**
|
|
234
|
+
* Matching movements. Exact up to 10,000 pages of the requested page size
|
|
235
|
+
* (`pageSize` x 10,000 rows) and saturates there, so a caller with more
|
|
236
|
+
* movements than the listing can page through reads the cap, not its
|
|
237
|
+
* lifetime total. `page` is capped at 10,000.
|
|
238
|
+
*/
|
|
233
239
|
total: number;
|
|
234
240
|
page: number;
|
|
235
241
|
pageSize: number;
|
|
@@ -149,6 +149,12 @@ export interface ListPositionsParams {
|
|
|
149
149
|
}
|
|
150
150
|
export interface ListPositionsResponse {
|
|
151
151
|
positions: Position[];
|
|
152
|
+
/**
|
|
153
|
+
* Matching positions. Exact up to 10,000 pages of the requested page size
|
|
154
|
+
* (`pageSize` x 10,000 rows) and saturates there, so a caller with more
|
|
155
|
+
* matching positions than the listing can page through reads the cap, not
|
|
156
|
+
* its lifetime total. `page` is capped at 10,000.
|
|
157
|
+
*/
|
|
152
158
|
total: number;
|
|
153
159
|
page: number;
|
|
154
160
|
pageSize: number;
|
|
@@ -304,6 +310,12 @@ export interface PositionHistoryEvent {
|
|
|
304
310
|
}
|
|
305
311
|
export interface ListPositionHistoryResponse {
|
|
306
312
|
events: PositionHistoryEvent[];
|
|
313
|
+
/**
|
|
314
|
+
* Matching position-history events. Exact up to 10,000 pages of the
|
|
315
|
+
* requested page size (`pageSize` x 10,000 rows) and saturates there, so a
|
|
316
|
+
* caller with more history than the listing can page through reads the cap,
|
|
317
|
+
* not its lifetime total. `page` is capped at 10,000.
|
|
318
|
+
*/
|
|
307
319
|
total: number;
|
|
308
320
|
page: number;
|
|
309
321
|
pageSize: number;
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -292,14 +292,17 @@ export interface GetUserTradesResponse {
|
|
|
292
292
|
/** Items per page */
|
|
293
293
|
pageSize: number;
|
|
294
294
|
/**
|
|
295
|
-
* Total number
|
|
295
|
+
* Total matching trades. In page-number mode it is exact up to
|
|
296
|
+
* `pageSize` × 10,000 rows and saturates there, so a wallet with more history
|
|
297
|
+
* than legacy mode can page through reads the cap, not its lifetime total.
|
|
296
298
|
*
|
|
297
299
|
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
298
300
|
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
299
301
|
*/
|
|
300
302
|
total: number;
|
|
301
303
|
/**
|
|
302
|
-
* Total number
|
|
304
|
+
* Total pages at this `pageSize`. Exact up to 10,000 in page-number mode and
|
|
305
|
+
* saturates there, the last page legacy mode can reach.
|
|
303
306
|
*
|
|
304
307
|
* @deprecated Only populated by legacy page-number (offset) responses; 0 in
|
|
305
308
|
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
@@ -170,12 +170,13 @@ export interface GetPaginatedOrdersParams {
|
|
|
170
170
|
* - Non-empty: an opaque cursor from a previous response's
|
|
171
171
|
* `nextPageToken`; results resume immediately after that position.
|
|
172
172
|
*
|
|
173
|
-
* In either cursor-walk state (empty or non-empty), `page` is ignored
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* unlike page-number mode, which
|
|
177
|
-
*
|
|
178
|
-
* start, then follow `nextPageToken`)
|
|
173
|
+
* In either cursor-walk state (empty or non-empty), `page` is ignored (it
|
|
174
|
+
* comes back as 0), but `total` and `totalPages` ARE populated — bounded by
|
|
175
|
+
* the server count ceiling, see `totalCapped`. Results cover full order
|
|
176
|
+
* history — hot and archived rows merged — unlike page-number mode, which
|
|
177
|
+
* only ever sees recent history. Clients that need complete order history
|
|
178
|
+
* must use the cursor form (pass `""` to start, then follow `nextPageToken`)
|
|
179
|
+
* rather than `page`.
|
|
179
180
|
*/
|
|
180
181
|
pageToken?: string;
|
|
181
182
|
}
|
|
@@ -186,10 +187,9 @@ export interface GetPaginatedOrdersResponse {
|
|
|
186
187
|
/** Array of historical orders from PostgreSQL (paginated) */
|
|
187
188
|
orders: Order[];
|
|
188
189
|
/**
|
|
189
|
-
* Total number of orders matching the query
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
190
|
+
* Total number of orders matching the query, populated in BOTH pagination
|
|
191
|
+
* modes and bounded by the server count ceiling — see `totalCapped`. When
|
|
192
|
+
* `totalCapped` is `true` this is a lower bound (at least this many exist).
|
|
193
193
|
*/
|
|
194
194
|
total: number;
|
|
195
195
|
/**
|
|
@@ -202,10 +202,9 @@ export interface GetPaginatedOrdersResponse {
|
|
|
202
202
|
/** Number of orders per page */
|
|
203
203
|
pageSize: number;
|
|
204
204
|
/**
|
|
205
|
-
* Total number of pages
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
* cursor mode, which has no exact total. Walk `nextPageToken` instead.
|
|
205
|
+
* Total number of pages at this `pageSize`, populated in BOTH pagination
|
|
206
|
+
* modes and bounded by the server count ceiling — see `totalCapped`. A lower
|
|
207
|
+
* bound when `totalCapped` is `true`.
|
|
209
208
|
*/
|
|
210
209
|
totalPages: number;
|
|
211
210
|
/**
|
|
@@ -223,6 +222,13 @@ export interface GetPaginatedOrdersResponse {
|
|
|
223
222
|
* history.
|
|
224
223
|
*/
|
|
225
224
|
nextPageToken: string;
|
|
225
|
+
/**
|
|
226
|
+
* `true` when MORE than the server ceiling of orders matched, so the count
|
|
227
|
+
* stopped at the ceiling and `total` / `totalPages` are a lower bound (more
|
|
228
|
+
* than `total` orders exist). `false` when `total` is the exact count —
|
|
229
|
+
* including exactly the ceiling, which is still reported exactly.
|
|
230
|
+
*/
|
|
231
|
+
totalCapped: boolean;
|
|
226
232
|
}
|
|
227
233
|
/**
|
|
228
234
|
* Response from getting a single order by ID
|
|
@@ -550,6 +556,12 @@ export interface ConditionalOrder {
|
|
|
550
556
|
}
|
|
551
557
|
export interface ListConditionalOrdersResponse {
|
|
552
558
|
orders: ConditionalOrder[];
|
|
559
|
+
/**
|
|
560
|
+
* Matching conditional orders. Exact up to 10,000 pages of the requested
|
|
561
|
+
* page size (`pageSize` x 10,000 rows) and saturates there, so a caller with
|
|
562
|
+
* more matching conditional orders than the listing can page through reads
|
|
563
|
+
* the cap, not its lifetime total. `page` is capped at 10,000.
|
|
564
|
+
*/
|
|
553
565
|
total: number;
|
|
554
566
|
page: number;
|
|
555
567
|
pageSize: number;
|
|
@@ -818,7 +830,12 @@ export interface ListTwapOrdersParams {
|
|
|
818
830
|
*/
|
|
819
831
|
export interface ListTwapOrdersResponse {
|
|
820
832
|
orders: TwapOrder[];
|
|
821
|
-
/**
|
|
833
|
+
/**
|
|
834
|
+
* Matching TWAP orders. Exact up to 10,000 pages of the requested page size
|
|
835
|
+
* (`pageSize` x 10,000 rows) and saturates there, so a caller with more
|
|
836
|
+
* matching TWAP orders than the listing can page through reads the cap, not
|
|
837
|
+
* its lifetime total. `page` is capped at 10,000.
|
|
838
|
+
*/
|
|
822
839
|
total: number;
|
|
823
840
|
/** Current page number */
|
|
824
841
|
page: number;
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* Perp-only fields (`maxLeverage`, `initialMarginRate`, `maintenanceMarginRate`)
|
|
19
19
|
* are optional and omitted on the wire for spot markets, which have no leverage
|
|
20
20
|
* or margin parameters. All numeric quantities are decimal strings.
|
|
21
|
+
*
|
|
22
|
+
* Every frame (snapshot and live) carries `baseIconUrl` and `quoteIconUrl` for
|
|
23
|
+
* the market's two assets, each `null` when that asset has no icon configured,
|
|
24
|
+
* so a client can render a position's asset icons from the instrument row alone.
|
|
21
25
|
*/
|
|
22
26
|
/**
|
|
23
27
|
* The kind of instrument change a frame reports.
|
|
@@ -65,6 +69,20 @@ export interface InstrumentEventData {
|
|
|
65
69
|
marketType: string;
|
|
66
70
|
/** Asset-class category, e.g. "crypto", "equities", "commodities" */
|
|
67
71
|
category: string;
|
|
72
|
+
/**
|
|
73
|
+
* Base asset icon URL, or `null` when the asset has no icon configured.
|
|
74
|
+
* The server sends this on every market (spot and perp) as an explicit `null`
|
|
75
|
+
* when absent, unlike the perp-only fields that are omitted — but the property
|
|
76
|
+
* is declared **optional** so that adding it stays a non-breaking change for
|
|
77
|
+
* code that constructs or mocks this shape. Never a synthesized URL. Join a
|
|
78
|
+
* position's `tradingPairId` to this row to render the icon without a REST call.
|
|
79
|
+
*/
|
|
80
|
+
baseIconUrl?: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Quote asset icon URL, or `null` when the asset has no icon configured. See
|
|
83
|
+
* {@link InstrumentEventData.baseIconUrl}.
|
|
84
|
+
*/
|
|
85
|
+
quoteIconUrl?: string | null;
|
|
68
86
|
/** Maximum leverage (decimal string). Perp-only; omitted for spot. */
|
|
69
87
|
maxLeverage?: string;
|
|
70
88
|
/** Initial margin rate (decimal string). Perp-only; omitted for spot. */
|
|
@@ -18,4 +18,8 @@
|
|
|
18
18
|
* Perp-only fields (`maxLeverage`, `initialMarginRate`, `maintenanceMarginRate`)
|
|
19
19
|
* are optional and omitted on the wire for spot markets, which have no leverage
|
|
20
20
|
* or margin parameters. All numeric quantities are decimal strings.
|
|
21
|
+
*
|
|
22
|
+
* Every frame (snapshot and live) carries `baseIconUrl` and `quoteIconUrl` for
|
|
23
|
+
* the market's two assets, each `null` when that asset has no icon configured,
|
|
24
|
+
* so a client can render a position's asset icons from the instrument row alone.
|
|
21
25
|
*/
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -4624,7 +4624,11 @@ export interface components {
|
|
|
4624
4624
|
};
|
|
4625
4625
|
GetMarginAccountMovementsResponse: {
|
|
4626
4626
|
movements?: components["schemas"]["MarginAccountMovement"][] | null;
|
|
4627
|
-
/**
|
|
4627
|
+
/**
|
|
4628
|
+
* Format: uint32
|
|
4629
|
+
* @description Matching movements. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more movements than the listing can page through reads the cap, not its lifetime total.
|
|
4630
|
+
* @example 150
|
|
4631
|
+
*/
|
|
4628
4632
|
total?: number | null;
|
|
4629
4633
|
/** Format: uint32 */
|
|
4630
4634
|
page?: number | null;
|
|
@@ -5882,13 +5886,13 @@ export interface components {
|
|
|
5882
5886
|
pageSize?: string | null;
|
|
5883
5887
|
/**
|
|
5884
5888
|
* @deprecated
|
|
5885
|
-
* @description Deprecated: total
|
|
5889
|
+
* @description Deprecated: total matching trades (legacy page-number mode only; 0 in cursor mode). Exact up to pageSize x 10,000 rows and saturates there. Use pageToken cursor pagination instead.
|
|
5886
5890
|
* @example 150
|
|
5887
5891
|
*/
|
|
5888
5892
|
total?: string | null;
|
|
5889
5893
|
/**
|
|
5890
5894
|
* @deprecated
|
|
5891
|
-
* @description Deprecated: total
|
|
5895
|
+
* @description Deprecated: total pages at this pageSize (legacy page-number mode only; 0 in cursor mode). Exact up to 10,000 and saturates there. Use pageToken cursor pagination instead.
|
|
5892
5896
|
* @example 8
|
|
5893
5897
|
*/
|
|
5894
5898
|
totalPages?: string | null;
|
|
@@ -6213,7 +6217,11 @@ export interface components {
|
|
|
6213
6217
|
};
|
|
6214
6218
|
ListConditionalOrdersResponse: {
|
|
6215
6219
|
orders?: components["schemas"]["ConditionalOrder"][] | null;
|
|
6216
|
-
/**
|
|
6220
|
+
/**
|
|
6221
|
+
* Format: uint32
|
|
6222
|
+
* @description Matching conditional orders. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more matching conditional orders than the listing can page through reads the cap, not its lifetime total.
|
|
6223
|
+
* @example 3
|
|
6224
|
+
*/
|
|
6217
6225
|
total?: number | null;
|
|
6218
6226
|
/** Format: uint32 */
|
|
6219
6227
|
page?: number | null;
|
|
@@ -6288,8 +6296,7 @@ export interface components {
|
|
|
6288
6296
|
orders?: components["schemas"]["GetOrderResponse"][] | null;
|
|
6289
6297
|
/**
|
|
6290
6298
|
* Format: uint32
|
|
6291
|
-
* @
|
|
6292
|
-
* @description Deprecated: total number of orders matching the filter (legacy offset mode only; 0 in cursor mode)
|
|
6299
|
+
* @description Total number of orders matching the filter, populated in both pagination modes; bounded by the server ceiling — a lower bound when totalCapped is true.
|
|
6293
6300
|
* @example 150
|
|
6294
6301
|
*/
|
|
6295
6302
|
total?: number | null;
|
|
@@ -6308,8 +6315,7 @@ export interface components {
|
|
|
6308
6315
|
pageSize?: number | null;
|
|
6309
6316
|
/**
|
|
6310
6317
|
* Format: uint32
|
|
6311
|
-
* @
|
|
6312
|
-
* @description Deprecated: total number of pages (legacy offset mode only; 0 in cursor mode)
|
|
6318
|
+
* @description Total number of pages at this pageSize, populated in both pagination modes; bounded by the server ceiling — a lower bound when totalCapped is true.
|
|
6313
6319
|
* @example 8
|
|
6314
6320
|
*/
|
|
6315
6321
|
totalPages?: number | null;
|
|
@@ -6329,6 +6335,11 @@ export interface components {
|
|
|
6329
6335
|
* means page-number mode does not participate in cursor continuation.
|
|
6330
6336
|
*/
|
|
6331
6337
|
nextPageToken?: string | null;
|
|
6338
|
+
/**
|
|
6339
|
+
* @description True when more than the server ceiling of orders matched, so the count stopped at the ceiling and total/totalPages are a lower bound (more than total exist). False when total is the exact count, including exactly the ceiling.
|
|
6340
|
+
* @example false
|
|
6341
|
+
*/
|
|
6342
|
+
totalCapped?: boolean | null;
|
|
6332
6343
|
};
|
|
6333
6344
|
ListPendingWithdrawalsResponse: {
|
|
6334
6345
|
withdrawals?: components["schemas"]["PendingWithdrawal"][] | null;
|
|
@@ -6359,7 +6370,11 @@ export interface components {
|
|
|
6359
6370
|
};
|
|
6360
6371
|
ListPositionHistoryResponse: {
|
|
6361
6372
|
events?: components["schemas"]["PositionHistoryEvent"][] | null;
|
|
6362
|
-
/**
|
|
6373
|
+
/**
|
|
6374
|
+
* Format: uint32
|
|
6375
|
+
* @description Matching position-history events. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more history than the listing can page through reads the cap, not its lifetime total.
|
|
6376
|
+
* @example 150
|
|
6377
|
+
*/
|
|
6363
6378
|
total?: number | null;
|
|
6364
6379
|
/** Format: uint32 */
|
|
6365
6380
|
page?: number | null;
|
|
@@ -6368,7 +6383,11 @@ export interface components {
|
|
|
6368
6383
|
};
|
|
6369
6384
|
ListPositionsResponse: {
|
|
6370
6385
|
positions?: components["schemas"]["Position"][] | null;
|
|
6371
|
-
/**
|
|
6386
|
+
/**
|
|
6387
|
+
* Format: uint32
|
|
6388
|
+
* @description Matching positions. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more matching positions than the listing can page through reads the cap, not its lifetime total.
|
|
6389
|
+
* @example 150
|
|
6390
|
+
*/
|
|
6372
6391
|
total?: number | null;
|
|
6373
6392
|
/** Format: uint32 */
|
|
6374
6393
|
page?: number | null;
|
|
@@ -6416,7 +6435,7 @@ export interface components {
|
|
|
6416
6435
|
orders?: components["schemas"]["TwapOrder"][] | null;
|
|
6417
6436
|
/**
|
|
6418
6437
|
* Format: uint32
|
|
6419
|
-
* @description
|
|
6438
|
+
* @description Matching TWAP orders. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more matching TWAP orders than the listing can page through reads the cap, not its lifetime total.
|
|
6420
6439
|
* @example 3
|
|
6421
6440
|
*/
|
|
6422
6441
|
total?: number | null;
|
|
@@ -12650,13 +12669,14 @@ export interface operations {
|
|
|
12650
12669
|
* - Non-empty: an opaque cursor from a previous response's
|
|
12651
12670
|
* `next_page_token`; results resume immediately after that position.
|
|
12652
12671
|
*
|
|
12653
|
-
* In either cursor-walk state (empty or non-empty), `page` is ignored
|
|
12654
|
-
*
|
|
12655
|
-
*
|
|
12656
|
-
*
|
|
12657
|
-
*
|
|
12658
|
-
*
|
|
12659
|
-
*
|
|
12672
|
+
* In either cursor-walk state (empty or non-empty), `page` is ignored (it
|
|
12673
|
+
* comes back as 0), but `total` and `total_pages` ARE populated — bounded by
|
|
12674
|
+
* the server count ceiling, see `total_capped`. Results cover full order
|
|
12675
|
+
* history — hot and archived rows merged — unlike page-number mode, which
|
|
12676
|
+
* only ever sees recent history. Clients that need complete order history
|
|
12677
|
+
* must use the cursor form (start with an empty string, then follow
|
|
12678
|
+
* next_page_token) rather than `page`. Filters and orderBy must match the
|
|
12679
|
+
* request that produced the token.
|
|
12660
12680
|
*/
|
|
12661
12681
|
pageToken?: string;
|
|
12662
12682
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.65",
|
|
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.
|
|
19
|
+
"@0xmonaco/contracts": "1.0.65",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|