@0xmonaco/types 1.0.75 → 1.0.76
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/buildercodes/index.d.ts +3 -4
- package/dist/buildercodes/responses.d.ts +10 -3
- package/dist/buildercodes/responses.js +24 -4
- package/dist/managed-markets/index.d.ts +21 -2
- package/dist/sdk/index.d.ts +12 -4
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/managed-markets.d.ts +17 -0
- package/dist/validation/managed-markets.js +17 -0
- package/dist/validation/market.d.ts +21 -0
- package/dist/validation/market.js +21 -0
- package/dist/validation/vault.d.ts +14 -0
- package/dist/validation/vault.js +14 -0
- package/dist/websocket/events/instrument-events.d.ts +27 -1
- package/dist/websocket/events/instrument-events.js +6 -1
- package/dist/websocket/events/market-stats-events.d.ts +41 -5
- package/dist/websocket/events/market-stats-events.js +3 -2
- package/dist/websocket/events/orders-events.d.ts +30 -3
- package/dist/wire/schema.d.ts +160 -51
- package/dist/withdrawals/index.d.ts +27 -6
- package/package.json +2 -2
|
@@ -51,10 +51,9 @@ export interface BuildercodesAPI extends BaseAPI {
|
|
|
51
51
|
* A wallet that *used to be* a payout address keeps what it accrued back then
|
|
52
52
|
* and can still claim it — payout-address changes are not retroactive.
|
|
53
53
|
*
|
|
54
|
-
* Throws 403 when the
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* rollout state. Throws 409 when the payout balance is insufficient for the
|
|
54
|
+
* Throws 403 when the session is a delegated agent — a permanent
|
|
55
|
+
* restriction on that session type, not a rollout state. No program switch
|
|
56
|
+
* gates the claim, so a balance already credited stays claimable. Throws 409 when the payout balance is insufficient for the
|
|
58
57
|
* requested amount. Throws 503 when the matching engine is unreachable,
|
|
59
58
|
* restarting, or slow to answer — an UNKNOWN outcome, not a rejection: the
|
|
60
59
|
* claim is admitted to the sequencer before its reply is sent, so it may
|
|
@@ -72,10 +72,17 @@ export declare const BuildercodePayoutKindSchema: z.ZodEnum<{
|
|
|
72
72
|
REVENUE_SHARE: "REVENUE_SHARE";
|
|
73
73
|
BUILDER_FEE: "BUILDER_FEE";
|
|
74
74
|
}>;
|
|
75
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Pagination and filter accepted by the per-trade payout history endpoint.
|
|
77
|
+
*
|
|
78
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted, so a caller
|
|
79
|
+
* still looping on it fails loudly instead of being handed the first cursor page
|
|
80
|
+
* on every call.
|
|
81
|
+
*/
|
|
76
82
|
export declare const ListBuildercodePayoutsParamsSchema: z.ZodObject<{
|
|
77
|
-
page: z.ZodOptional<z.
|
|
83
|
+
page: z.ZodOptional<z.ZodNever>;
|
|
78
84
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
79
86
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
80
87
|
REVENUE_SHARE: "REVENUE_SHARE";
|
|
81
88
|
BUILDER_FEE: "BUILDER_FEE";
|
|
@@ -109,9 +116,9 @@ export declare const ListBuildercodePayoutsResponseSchema: z.ZodObject<{
|
|
|
109
116
|
}>>;
|
|
110
117
|
}, z.core.$strip>>;
|
|
111
118
|
total: z.ZodNumber;
|
|
112
|
-
page: z.ZodNumber;
|
|
113
119
|
pageSize: z.ZodNumber;
|
|
114
120
|
totalPages: z.ZodNumber;
|
|
121
|
+
nextPageToken: z.ZodString;
|
|
115
122
|
}, z.core.$strip>;
|
|
116
123
|
/** One token-denominated BuilderCodes earnings total. */
|
|
117
124
|
export declare const BuildercodePayoutTokenTotalSchema: z.ZodObject<{
|
|
@@ -58,10 +58,24 @@ export const ListBuilderFeeChangesResponseSchema = z.object({
|
|
|
58
58
|
* Monaco revenue share; `BUILDER_FEE` records builder fees charged to takers.
|
|
59
59
|
*/
|
|
60
60
|
export const BuildercodePayoutKindSchema = z.enum(["REVENUE_SHARE", "BUILDER_FEE"]);
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Pagination and filter accepted by the per-trade payout history endpoint.
|
|
63
|
+
*
|
|
64
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted, so a caller
|
|
65
|
+
* still looping on it fails loudly instead of being handed the first cursor page
|
|
66
|
+
* on every call.
|
|
67
|
+
*/
|
|
62
68
|
export const ListBuildercodePayoutsParamsSchema = z.object({
|
|
63
|
-
page: z.
|
|
64
|
-
pageSize: z.number().int().min(1).max(
|
|
69
|
+
page: z.never().optional(),
|
|
70
|
+
pageSize: z.number().int().min(1).max(1000).optional(),
|
|
71
|
+
/**
|
|
72
|
+
* Cursor with two states: omitted or `""` starts a walk from the newest
|
|
73
|
+
* credit; a previous response's `nextPageToken` resumes it. The walk seeks on
|
|
74
|
+
* `(createdAt, id)` descending — both NOT NULL and fixed for a credit's
|
|
75
|
+
* lifetime. The filter must match the request that minted the token, or the
|
|
76
|
+
* request is rejected with a `400`.
|
|
77
|
+
*/
|
|
78
|
+
pageToken: z.string().optional(),
|
|
65
79
|
/** Only return credits of this kind; `total` counts the filtered rows. Omit for every kind. */
|
|
66
80
|
kind: BuildercodePayoutKindSchema.optional(),
|
|
67
81
|
});
|
|
@@ -80,9 +94,15 @@ export const BuildercodePayoutSchema = z.object({
|
|
|
80
94
|
export const ListBuildercodePayoutsResponseSchema = z.object({
|
|
81
95
|
payouts: z.array(BuildercodePayoutSchema),
|
|
82
96
|
total: z.number().int().nonnegative(),
|
|
83
|
-
page: z.number().int().positive(),
|
|
84
97
|
pageSize: z.number().int().positive(),
|
|
85
98
|
totalPages: z.number().int().nonnegative(),
|
|
99
|
+
/**
|
|
100
|
+
* Cursor for the next page, minted from the last row of an over-fetched read:
|
|
101
|
+
* this listing is one ordered read, so an empty string is a definitive end.
|
|
102
|
+
* Pass it back as `pageToken`; do not drive the walk off `total` or
|
|
103
|
+
* `totalPages`.
|
|
104
|
+
*/
|
|
105
|
+
nextPageToken: z.string(),
|
|
86
106
|
});
|
|
87
107
|
/** One token-denominated BuilderCodes earnings total. */
|
|
88
108
|
export const BuildercodePayoutTokenTotalSchema = z.object({
|
|
@@ -23,15 +23,34 @@ export interface ManagedMarketAssignment {
|
|
|
23
23
|
quoteEnabled: boolean;
|
|
24
24
|
}
|
|
25
25
|
export interface ListManagedMarketAssignmentsRequest {
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Items per page (1–1000). This listing defaults it to **100**, not the
|
|
28
|
+
* shared 20. A larger value is rejected, not clamped.
|
|
29
|
+
*/
|
|
27
30
|
pageSize?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Pagination cursor with two states: omitted or `""` starts a walk from the
|
|
33
|
+
* OLDEST assignment; a previous response's `nextPageToken` resumes it.
|
|
34
|
+
*
|
|
35
|
+
* The walk seeks on `(createdAt, id)` **ascending** — oldest first, the order
|
|
36
|
+
* this listing already read in — served by
|
|
37
|
+
* `idx_market_launch_maker_inventory (makerUserId, makerApplicationId,
|
|
38
|
+
* createdAt, id)`; both key columns are fixed for an assignment's lifetime.
|
|
39
|
+
* Page-number pagination was removed (0XM-2788).
|
|
40
|
+
*/
|
|
41
|
+
pageToken?: string;
|
|
28
42
|
}
|
|
29
43
|
export interface ListManagedMarketAssignmentsResponse {
|
|
30
44
|
items: ManagedMarketAssignment[];
|
|
31
45
|
total: number;
|
|
32
|
-
page: number;
|
|
33
46
|
pageSize: number;
|
|
34
47
|
inventoryObservedAt: string;
|
|
48
|
+
/**
|
|
49
|
+
* Cursor for the next page, minted from the last row of an over-fetched read:
|
|
50
|
+
* this listing is one ordered read, so an empty string is a definitive end.
|
|
51
|
+
* Pass it back as `pageToken`.
|
|
52
|
+
*/
|
|
53
|
+
nextPageToken: string;
|
|
35
54
|
}
|
|
36
55
|
export interface ClaimManagedMarketLeaseRequest {
|
|
37
56
|
ownerId: string;
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -144,12 +144,20 @@ export interface MonacoSDK {
|
|
|
144
144
|
};
|
|
145
145
|
/** Trades REST API for fetching historical trades */
|
|
146
146
|
trades: {
|
|
147
|
+
/**
|
|
148
|
+
* One page of a pair's trade feed, newest first. Cursor paged (0XM-2821):
|
|
149
|
+
* omit `pageToken` to start, then follow `nextPageToken` until it is empty.
|
|
150
|
+
*/
|
|
147
151
|
getTrades: (tradingPairId: string, options?: {
|
|
148
|
-
/**
|
|
149
|
-
page?: number;
|
|
150
|
-
/** Maximum number of records to return (default: 25, max: 100) */
|
|
152
|
+
/** Maximum number of records to return (default: 25, max: 1000) */
|
|
151
153
|
pageSize?: number;
|
|
152
|
-
|
|
154
|
+
/** Cursor from a previous response's `nextPageToken`; omit to start */
|
|
155
|
+
pageToken?: string;
|
|
156
|
+
}) => Promise<{
|
|
157
|
+
trades: TradeEvent[];
|
|
158
|
+
/** Empty exactly when the walk is finished. */
|
|
159
|
+
nextPageToken: string;
|
|
160
|
+
}>;
|
|
153
161
|
};
|
|
154
162
|
/** WebSocket client for real-time data — the full typed channel surface of {@link MonacoWebSocket} */
|
|
155
163
|
ws: MonacoWebSocket;
|
package/dist/validation/index.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Managed Markets API Validation Schemas
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Managed market assignments listing validation schema.
|
|
7
|
+
*
|
|
8
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted: the client
|
|
9
|
+
* builds the query string field by field, so a stray `page` never reaches the
|
|
10
|
+
* REST guard, and a caller looping `{ page: 1 }`, `{ page: 2 }` would send
|
|
11
|
+
* identical cursorless requests and reread the first page forever.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ListManagedMarketAssignmentsSchema: z.ZodObject<{
|
|
14
|
+
page: z.ZodOptional<z.ZodNever>;
|
|
15
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Managed Markets API Validation Schemas
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Managed market assignments listing validation schema.
|
|
7
|
+
*
|
|
8
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted: the client
|
|
9
|
+
* builds the query string field by field, so a stray `page` never reaches the
|
|
10
|
+
* REST guard, and a caller looping `{ page: 1 }`, `{ page: 2 }` would send
|
|
11
|
+
* identical cursorless requests and reread the first page forever.
|
|
12
|
+
*/
|
|
13
|
+
export const ListManagedMarketAssignmentsSchema = z.object({
|
|
14
|
+
page: z.never().optional(),
|
|
15
|
+
pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(1000, "Page size cannot exceed 1000").optional(),
|
|
16
|
+
pageToken: z.string().optional(),
|
|
17
|
+
});
|
|
@@ -244,3 +244,24 @@ export declare const ListAllFundingHistorySchema: z.ZodObject<{
|
|
|
244
244
|
DESC: "DESC";
|
|
245
245
|
}>>;
|
|
246
246
|
}, z.core.$strip>;
|
|
247
|
+
/**
|
|
248
|
+
* Public trades-feed listing validation schema.
|
|
249
|
+
*
|
|
250
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted, but NOT for
|
|
251
|
+
* the same reason as {@link ListFundingHistorySchema}. That one is built on a
|
|
252
|
+
* query builder that serializes whatever keys the params object carries, so a
|
|
253
|
+
* leftover `page` reaches the wire and comes back as the server's `400`.
|
|
254
|
+
* `getTrades` instead sets `pageSize` and `pageToken` explicitly, so a stray
|
|
255
|
+
* `page` never leaves the client at all — which makes rejecting it more
|
|
256
|
+
* important here, not less. Stripped silently, it would leave the caller
|
|
257
|
+
* requesting page 2, 3, 4 and receiving the FIRST cursor page every time, with
|
|
258
|
+
* no error from either side to reveal the loop. `z.never()` turns that silent
|
|
259
|
+
* non-advancing walk into an immediate `ValidationError`.
|
|
260
|
+
*
|
|
261
|
+
* The ceiling is the cursor-mode 1000; the historical default of 25 stays.
|
|
262
|
+
*/
|
|
263
|
+
export declare const GetTradesSchema: z.ZodObject<{
|
|
264
|
+
page: z.ZodOptional<z.ZodNever>;
|
|
265
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, z.core.$strip>;
|
|
@@ -246,3 +246,24 @@ const FundingHistoryCursorSchema = z.object({
|
|
|
246
246
|
export const ListFundingHistorySchema = FundingHistoryCursorSchema;
|
|
247
247
|
/** All-markets funding history. */
|
|
248
248
|
export const ListAllFundingHistorySchema = FundingHistoryCursorSchema;
|
|
249
|
+
/**
|
|
250
|
+
* Public trades-feed listing validation schema.
|
|
251
|
+
*
|
|
252
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted, but NOT for
|
|
253
|
+
* the same reason as {@link ListFundingHistorySchema}. That one is built on a
|
|
254
|
+
* query builder that serializes whatever keys the params object carries, so a
|
|
255
|
+
* leftover `page` reaches the wire and comes back as the server's `400`.
|
|
256
|
+
* `getTrades` instead sets `pageSize` and `pageToken` explicitly, so a stray
|
|
257
|
+
* `page` never leaves the client at all — which makes rejecting it more
|
|
258
|
+
* important here, not less. Stripped silently, it would leave the caller
|
|
259
|
+
* requesting page 2, 3, 4 and receiving the FIRST cursor page every time, with
|
|
260
|
+
* no error from either side to reveal the loop. `z.never()` turns that silent
|
|
261
|
+
* non-advancing walk into an immediate `ValidationError`.
|
|
262
|
+
*
|
|
263
|
+
* The ceiling is the cursor-mode 1000; the historical default of 25 stays.
|
|
264
|
+
*/
|
|
265
|
+
export const GetTradesSchema = z.object({
|
|
266
|
+
page: z.never().optional(),
|
|
267
|
+
pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(1000, "Page size cannot exceed 1000").optional(),
|
|
268
|
+
pageToken: z.string().optional(),
|
|
269
|
+
});
|
|
@@ -75,3 +75,17 @@ export declare const WithdrawSchema: z.ZodObject<{
|
|
|
75
75
|
export declare const GetBalanceSchema: z.ZodObject<{
|
|
76
76
|
assetId: z.ZodUUID;
|
|
77
77
|
}, z.core.$strip>;
|
|
78
|
+
/**
|
|
79
|
+
* Pending-withdrawals listing validation schema.
|
|
80
|
+
*
|
|
81
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted: the client
|
|
82
|
+
* forwards the params field by field, which would drop a stray `page` before it
|
|
83
|
+
* reached the wire, so a JavaScript or `any` caller looping on `{ page: n }`
|
|
84
|
+
* would be handed the FIRST cursor page on every call and would never advance —
|
|
85
|
+
* the exact failure the REST 400 exists to surface.
|
|
86
|
+
*/
|
|
87
|
+
export declare const ListPendingWithdrawalsSchema: z.ZodObject<{
|
|
88
|
+
page: z.ZodOptional<z.ZodNever>;
|
|
89
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
pageToken: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>;
|
package/dist/validation/vault.js
CHANGED
|
@@ -86,3 +86,17 @@ export const WithdrawSchema = z.object({
|
|
|
86
86
|
export const GetBalanceSchema = z.object({
|
|
87
87
|
assetId: UUIDSchema,
|
|
88
88
|
});
|
|
89
|
+
/**
|
|
90
|
+
* Pending-withdrawals listing validation schema.
|
|
91
|
+
*
|
|
92
|
+
* Cursor paged (0XM-2821). `page` is REJECTED rather than omitted: the client
|
|
93
|
+
* forwards the params field by field, which would drop a stray `page` before it
|
|
94
|
+
* reached the wire, so a JavaScript or `any` caller looping on `{ page: n }`
|
|
95
|
+
* would be handed the FIRST cursor page on every call and would never advance —
|
|
96
|
+
* the exact failure the REST 400 exists to surface.
|
|
97
|
+
*/
|
|
98
|
+
export const ListPendingWithdrawalsSchema = z.object({
|
|
99
|
+
page: z.never().optional(),
|
|
100
|
+
pageSize: z.number().int("Page size must be an integer").min(1, "Page size must be at least 1").max(1000, "Page size cannot exceed 1000").optional(),
|
|
101
|
+
pageToken: z.string().optional(),
|
|
102
|
+
});
|
|
@@ -15,13 +15,18 @@
|
|
|
15
15
|
* A subscriber receives a subscribe-time snapshot of the current active-pair
|
|
16
16
|
* configuration list (each frame a `Listing` baseline) before the live diffs.
|
|
17
17
|
*
|
|
18
|
-
* Perp-only fields (`maxLeverage`, `initialMarginRate`, `maintenanceMarginRate`)
|
|
18
|
+
* Perp-only fields (`minLeverage`, `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
21
|
*
|
|
22
22
|
* Every frame (snapshot and live) carries `baseIconUrl` and `quoteIconUrl` for
|
|
23
23
|
* the market's two assets, each `null` when that asset has no icon configured,
|
|
24
24
|
* so a client can render a position's asset icons from the instrument row alone.
|
|
25
|
+
*
|
|
26
|
+
* Every frame also carries the market's asset identity: `baseAssetId`,
|
|
27
|
+
* `quoteAssetId`, `baseToken`, `quoteToken`, `baseAssetName`, `quoteAssetName`,
|
|
28
|
+
* `baseDecimals` and `quoteDecimals`. Perp frames add `minLeverage`. These are
|
|
29
|
+
* declared optional because a server that predates them omits them.
|
|
25
30
|
*/
|
|
26
31
|
/**
|
|
27
32
|
* The kind of instrument change a frame reports.
|
|
@@ -69,6 +74,25 @@ export interface InstrumentEventData {
|
|
|
69
74
|
marketType: string;
|
|
70
75
|
/** Asset-class category, e.g. "crypto", "equities", "commodities" */
|
|
71
76
|
category: string;
|
|
77
|
+
/**
|
|
78
|
+
* Base asset identifier (UUID). The server sends this on every market (spot
|
|
79
|
+
* and perp); declared optional because an older server omits it.
|
|
80
|
+
*/
|
|
81
|
+
baseAssetId?: string;
|
|
82
|
+
/** Quote asset identifier (UUID). See {@link InstrumentEventData.baseAssetId}. */
|
|
83
|
+
quoteAssetId?: string;
|
|
84
|
+
/** Base asset ticker symbol, e.g. "BTC". Sent on every market. */
|
|
85
|
+
baseToken?: string;
|
|
86
|
+
/** Quote asset ticker symbol, e.g. "USDC". Sent on every market. */
|
|
87
|
+
quoteToken?: string;
|
|
88
|
+
/** Base asset display name, e.g. "Bitcoin". Sent on every market. */
|
|
89
|
+
baseAssetName?: string;
|
|
90
|
+
/** Quote asset display name, e.g. "USD Coin". Sent on every market. */
|
|
91
|
+
quoteAssetName?: string;
|
|
92
|
+
/** Base asset decimals (integer). Sent on every market. */
|
|
93
|
+
baseDecimals?: number;
|
|
94
|
+
/** Quote asset decimals (integer). Sent on every market. */
|
|
95
|
+
quoteDecimals?: number;
|
|
72
96
|
/**
|
|
73
97
|
* Base asset icon URL, or `null` when the asset has no icon configured.
|
|
74
98
|
* The server sends this on every market (spot and perp) as an explicit `null`
|
|
@@ -83,6 +107,8 @@ export interface InstrumentEventData {
|
|
|
83
107
|
* {@link InstrumentEventData.baseIconUrl}.
|
|
84
108
|
*/
|
|
85
109
|
quoteIconUrl?: string | null;
|
|
110
|
+
/** Minimum leverage (decimal string). Perp-only; omitted for spot. */
|
|
111
|
+
minLeverage?: string;
|
|
86
112
|
/** Maximum leverage (decimal string). Perp-only; omitted for spot. */
|
|
87
113
|
maxLeverage?: string;
|
|
88
114
|
/** Initial margin rate (decimal string). Perp-only; omitted for spot. */
|
|
@@ -15,11 +15,16 @@
|
|
|
15
15
|
* A subscriber receives a subscribe-time snapshot of the current active-pair
|
|
16
16
|
* configuration list (each frame a `Listing` baseline) before the live diffs.
|
|
17
17
|
*
|
|
18
|
-
* Perp-only fields (`maxLeverage`, `initialMarginRate`, `maintenanceMarginRate`)
|
|
18
|
+
* Perp-only fields (`minLeverage`, `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
21
|
*
|
|
22
22
|
* Every frame (snapshot and live) carries `baseIconUrl` and `quoteIconUrl` for
|
|
23
23
|
* the market's two assets, each `null` when that asset has no icon configured,
|
|
24
24
|
* so a client can render a position's asset icons from the instrument row alone.
|
|
25
|
+
*
|
|
26
|
+
* Every frame also carries the market's asset identity: `baseAssetId`,
|
|
27
|
+
* `quoteAssetId`, `baseToken`, `quoteToken`, `baseAssetName`, `quoteAssetName`,
|
|
28
|
+
* `baseDecimals` and `quoteDecimals`. Perp frames add `minLeverage`. These are
|
|
29
|
+
* declared optional because a server that predates them omits them.
|
|
25
30
|
*/
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Perp-only fields (index/mark price, open interest, funding) are optional and
|
|
15
15
|
* omitted on the wire for spot markets, which have no positions or funding.
|
|
16
|
-
* All numeric quantities are decimal strings except `fundingTimestamp
|
|
17
|
-
*
|
|
16
|
+
* All numeric quantities are decimal strings except `fundingTimestamp` and
|
|
17
|
+
* `lastFundingTime` (millisecond epoch numbers) and `fundingIntervalSeconds`
|
|
18
|
+
* (whole seconds).
|
|
18
19
|
*/
|
|
19
20
|
/**
|
|
20
21
|
* Market tradability label, derived from the oracle market status. Spot markets
|
|
@@ -23,6 +24,10 @@
|
|
|
23
24
|
export type MarketStatus = "TRADABLE" | "POST_ONLY" | "HALTED" | "NOT_READY" | "UNKNOWN";
|
|
24
25
|
/**
|
|
25
26
|
* Full per-market statistics for the `market_stats:<tradingPairId>` channel.
|
|
27
|
+
*
|
|
28
|
+
* `marketStatus` is typed `MarketStatus | (string & {})` for the same reason as
|
|
29
|
+
* on {@link MarketStatsSummary}: an unrecognized status is passed through
|
|
30
|
+
* rather than dropping the frame. Match it with a `default` branch.
|
|
26
31
|
*/
|
|
27
32
|
export interface MarketStatsData {
|
|
28
33
|
/** Market symbol, e.g. "BTC/USDC" */
|
|
@@ -39,10 +44,24 @@ export interface MarketStatsData {
|
|
|
39
44
|
bestBidPrice?: string;
|
|
40
45
|
/** Best ask price (decimal string) */
|
|
41
46
|
bestAskPrice?: string;
|
|
42
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Open interest (decimal string). Perp-only; omitted for spot, and omitted
|
|
49
|
+
* (never zero) until the market's open interest is known.
|
|
50
|
+
*/
|
|
43
51
|
openInterest?: string;
|
|
44
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* The market's gross open-interest cap, in quote (USD) notional (decimal
|
|
54
|
+
* string). `openInterest` is in base units: multiply it by `markPrice` to
|
|
55
|
+
* compare. Perp-only; omitted for spot.
|
|
56
|
+
*/
|
|
45
57
|
openInterestLimit?: string;
|
|
58
|
+
/**
|
|
59
|
+
* What is left of `openInterestLimit` at the mark, in quote (USD) notional,
|
|
60
|
+
* never below zero (decimal string). At zero, orders that open exposure are
|
|
61
|
+
* refused until open interest or the mark falls. Perp-only; omitted for spot,
|
|
62
|
+
* when there is no mark, and until open interest is known.
|
|
63
|
+
*/
|
|
64
|
+
openInterestHeadroom?: string;
|
|
46
65
|
/** Last trade price (decimal string) */
|
|
47
66
|
lastTradePrice?: string;
|
|
48
67
|
/** 24h base-token volume (decimal string) */
|
|
@@ -71,6 +90,20 @@ export interface MarketStatsData {
|
|
|
71
90
|
fundingClampSmall?: string;
|
|
72
91
|
/** Live funding cap, upper bound (decimal string). Perp-only; omitted for spot. */
|
|
73
92
|
fundingClampBig?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Tradability label, the same value the all-markets summary carries for this
|
|
95
|
+
* market. Perp markets report any {@link MarketStatus}; spot markets report
|
|
96
|
+
* `TRADABLE` or `HALTED`. Always present on frames from current servers.
|
|
97
|
+
*/
|
|
98
|
+
marketStatus?: MarketStatus | (string & {});
|
|
99
|
+
/** Funding settlement interval in whole seconds. Perp-only; omitted for spot. */
|
|
100
|
+
fundingIntervalSeconds?: number;
|
|
101
|
+
/**
|
|
102
|
+
* When the latest funding window settled, as a millisecond epoch number
|
|
103
|
+
* (REST `getFundingState` returns the same instant as an RFC 3339 string).
|
|
104
|
+
* Perp-only; omitted for spot and for a market that has not settled yet.
|
|
105
|
+
*/
|
|
106
|
+
lastFundingTime?: number;
|
|
74
107
|
}
|
|
75
108
|
/**
|
|
76
109
|
* Per-market statistics event on the `market_stats:<tradingPairId>` channel.
|
|
@@ -111,7 +144,10 @@ export interface MarketStatsSummary {
|
|
|
111
144
|
dailyPriceHigh?: string;
|
|
112
145
|
/** 24h low price (decimal string) */
|
|
113
146
|
dailyPriceLow?: string;
|
|
114
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Open interest (decimal string). Perp-only; omitted for spot, and omitted
|
|
149
|
+
* (never zero) until the market's open interest is known.
|
|
150
|
+
*/
|
|
115
151
|
openInterest?: string;
|
|
116
152
|
/** Current (last settled) funding rate (decimal string). Perp-only; omitted for spot. */
|
|
117
153
|
currentFundingRate?: string;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Perp-only fields (index/mark price, open interest, funding) are optional and
|
|
15
15
|
* omitted on the wire for spot markets, which have no positions or funding.
|
|
16
|
-
* All numeric quantities are decimal strings except `fundingTimestamp
|
|
17
|
-
*
|
|
16
|
+
* All numeric quantities are decimal strings except `fundingTimestamp` and
|
|
17
|
+
* `lastFundingTime` (millisecond epoch numbers) and `fundingIntervalSeconds`
|
|
18
|
+
* (whole seconds).
|
|
18
19
|
*/
|
|
@@ -227,6 +227,21 @@ export interface OrderPlacedEvent extends OrderEvent {
|
|
|
227
227
|
* spot. Wire: `reduce_only`.
|
|
228
228
|
*/
|
|
229
229
|
reduceOnly?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* The fill an edit carried over from the original order (decimal string).
|
|
232
|
+
* Sent only when the order is a replacement of a partly filled order; its
|
|
233
|
+
* `quantity` is then the order's total and its `status` is
|
|
234
|
+
* `PARTIALLY_FILLED`, as REST reports the edited order. Omitted on any
|
|
235
|
+
* other `OrderPlaced`. Wire: `filled_quantity`.
|
|
236
|
+
*/
|
|
237
|
+
filledQuantity?: string;
|
|
238
|
+
/** `filledQuantity` in RAW (integer, base-unit) precision. Wire: `filled_quantity_raw`. */
|
|
239
|
+
filledQuantityRaw?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Average fill price of the carried fill (decimal string). Sent with
|
|
242
|
+
* `filledQuantity`, omitted otherwise. Wire: `average_fill_price`.
|
|
243
|
+
*/
|
|
244
|
+
averageFillPrice?: string;
|
|
230
245
|
};
|
|
231
246
|
}
|
|
232
247
|
/**
|
|
@@ -311,7 +326,11 @@ export interface OrderMatchedEvent extends OrderEvent {
|
|
|
311
326
|
tradesCount: number;
|
|
312
327
|
/** Remaining quantity to be filled. */
|
|
313
328
|
remainingQuantity: string;
|
|
314
|
-
/**
|
|
329
|
+
/**
|
|
330
|
+
* The order's cumulative average fill price, across every fill — those an
|
|
331
|
+
* edit carried over from the original order included, matching REST.
|
|
332
|
+
* `null` when there is none. This match's own price is `executionPrice`.
|
|
333
|
+
*/
|
|
315
334
|
averageFillPrice: string | null;
|
|
316
335
|
/** Order status. */
|
|
317
336
|
status: OrderStatus | (string & {});
|
|
@@ -345,7 +364,11 @@ export interface OrderPartiallyFilledEvent extends OrderEvent {
|
|
|
345
364
|
tradesCount?: number;
|
|
346
365
|
/** Remaining quantity (present for both taker and maker) */
|
|
347
366
|
remainingQuantity?: string;
|
|
348
|
-
/**
|
|
367
|
+
/**
|
|
368
|
+
* The order's cumulative average fill price, on both roles: the average
|
|
369
|
+
* across every fill of the order (an edit's carried fills included), as
|
|
370
|
+
* REST reports it — not this trade's price, which is `executionPrice`.
|
|
371
|
+
*/
|
|
349
372
|
averageFillPrice?: string;
|
|
350
373
|
/** Order status (taker orders only) */
|
|
351
374
|
status?: OrderStatus | (string & {});
|
|
@@ -439,7 +462,11 @@ export interface OrderFilledEvent extends OrderEvent {
|
|
|
439
462
|
tradesCount?: number;
|
|
440
463
|
/** Remaining quantity (present for both, should be 0 for filled orders) */
|
|
441
464
|
remainingQuantity?: string;
|
|
442
|
-
/**
|
|
465
|
+
/**
|
|
466
|
+
* The order's cumulative average fill price, on both roles: the average
|
|
467
|
+
* across every fill of the order (an edit's carried fills included), as
|
|
468
|
+
* REST reports it — not this trade's price, which is `executionPrice`.
|
|
469
|
+
*/
|
|
443
470
|
averageFillPrice?: string;
|
|
444
471
|
/** Order status (taker orders only) */
|
|
445
472
|
status?: OrderStatus | (string & {});
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -732,9 +732,10 @@ export interface paths {
|
|
|
732
732
|
* application's behalf do not count. Setting the fee it already has is a
|
|
733
733
|
* no-op that succeeds and does not use up a change.
|
|
734
734
|
*
|
|
735
|
-
* The fee can be set while builder fees are switched
|
|
736
|
-
*
|
|
737
|
-
*
|
|
735
|
+
* The fee can be set while the revenue share or builder fees are switched
|
|
736
|
+
* on, and is refused (**HTTP 403** / **PERMISSION_DENIED**) while both are
|
|
737
|
+
* off. With builder fees off (`builderFeeEnabled` false) it is stored and
|
|
738
|
+
* nothing is charged until they are switched on. A newly stored fee reaches order requests within a few
|
|
738
739
|
* seconds. Sequencer ordering is authoritative for matching-engine policy and
|
|
739
740
|
* enrollment state: an order processed before one of those sequenced changes
|
|
740
741
|
* uses the earlier state, and a later order uses the new state.
|
|
@@ -790,8 +791,7 @@ export interface paths {
|
|
|
790
791
|
*
|
|
791
792
|
* The application is taken from the authenticated session; there is no
|
|
792
793
|
* application id in the request. The caller must be the application's
|
|
793
|
-
* configured payout wallet.
|
|
794
|
-
* like the rest of the service.
|
|
794
|
+
* configured payout wallet.
|
|
795
795
|
*/
|
|
796
796
|
get: operations["get_buildercodes_config"];
|
|
797
797
|
put?: never;
|
|
@@ -912,13 +912,13 @@ export interface paths {
|
|
|
912
912
|
*
|
|
913
913
|
* Delegated-agent sessions are refused: a delegated grant conveys only
|
|
914
914
|
* order-management authority, and this claim converts reserved balance into a
|
|
915
|
-
* tradeable one.
|
|
916
|
-
*
|
|
915
|
+
* tradeable one. No program switch gates the claim: a balance already
|
|
916
|
+
* credited stays claimable whether or not the revenue share is on.
|
|
917
917
|
*
|
|
918
918
|
* Transport contracts differ, and this comment is emitted into the generated
|
|
919
919
|
* gRPC SDK where HTTP statuses do not exist. An insufficient payout balance
|
|
920
920
|
* is **HTTP 409** on REST and **FAILED_PRECONDITION** on gRPC; a refused
|
|
921
|
-
* caller (delegated session
|
|
921
|
+
* caller (delegated session) is **HTTP 403** on
|
|
922
922
|
* REST and **PERMISSION_DENIED** on gRPC.
|
|
923
923
|
*
|
|
924
924
|
* A claim can also fail as **HTTP 503** / **UNAVAILABLE** when the matching
|
|
@@ -5517,7 +5517,7 @@ export interface components {
|
|
|
5517
5517
|
* @example 0x0000000000000000000000000000000000000001
|
|
5518
5518
|
*/
|
|
5519
5519
|
payoutAddress?: string | null;
|
|
5520
|
-
/** @description
|
|
5520
|
+
/** @description Whether the BuilderCodes revenue share is switched on. While false no new share accrues; balances already credited stay readable and claimable. */
|
|
5521
5521
|
buildercodesEnabled?: boolean | null;
|
|
5522
5522
|
/**
|
|
5523
5523
|
* Format: uint32
|
|
@@ -6896,18 +6896,36 @@ export interface components {
|
|
|
6896
6896
|
/** @description Recent trades for a trading pair. */
|
|
6897
6897
|
GetTradesResponse: {
|
|
6898
6898
|
trades?: components["schemas"]["PublicTrade"][] | null;
|
|
6899
|
-
/**
|
|
6900
|
-
* Format: uint32
|
|
6901
|
-
* @description Current page number
|
|
6902
|
-
* @example 1
|
|
6903
|
-
*/
|
|
6904
|
-
page?: number | null;
|
|
6905
6899
|
/**
|
|
6906
6900
|
* Format: uint32
|
|
6907
6901
|
* @description Maximum number of trades returned
|
|
6908
6902
|
* @example 25
|
|
6909
6903
|
*/
|
|
6910
6904
|
pageSize?: number | null;
|
|
6905
|
+
/**
|
|
6906
|
+
* @description Cursor for the next page, under **proven** semantics: the read over-fetches
|
|
6907
|
+
* one row past `page_size`, so an empty token means the walk is finished and
|
|
6908
|
+
* a non-empty token means a further trade was actually seen. Unlike
|
|
6909
|
+
* `ListUserTradesResponse.next_page_token` (AIP-158 "maybe more"), a client
|
|
6910
|
+
* can stop here on the empty token without a confirming extra request — this
|
|
6911
|
+
* listing reads one table, so there is no hot/archive interleave that could
|
|
6912
|
+
* hide rows behind a short page.
|
|
6913
|
+
*
|
|
6914
|
+
* That one table is the hot `trades` table, so a walk reaches the end of the
|
|
6915
|
+
* archiver's retention window rather than the end of the pair's history. This
|
|
6916
|
+
* is the endpoint's long-standing scope, unchanged by the cursor.
|
|
6917
|
+
*
|
|
6918
|
+
* There is no public walk over a pair's ARCHIVED history, and this endpoint is
|
|
6919
|
+
* not a partial one — do not point market-data consumers at the user trade
|
|
6920
|
+
* listings to continue it. `GetUserTrades` / `ListUserTrades` do merge the
|
|
6921
|
+
* archive, but they are authenticated and user-scoped (`auth.user_id` is the
|
|
6922
|
+
* read's first mandatory filter), so they return only trades where the caller
|
|
6923
|
+
* was maker or taker. Following them to extend a public pair tape would
|
|
6924
|
+
* silently drop every fill between two other parties. An individual archived
|
|
6925
|
+
* trade does stay publicly reachable by id: `GetTradeById` falls back to the
|
|
6926
|
+
* archive table on a hot miss.
|
|
6927
|
+
*/
|
|
6928
|
+
nextPageToken?: string | null;
|
|
6911
6929
|
};
|
|
6912
6930
|
/** @description Single trading pair details. */
|
|
6913
6931
|
GetTradingPairResponse: {
|
|
@@ -7442,11 +7460,6 @@ export interface components {
|
|
|
7442
7460
|
* @description Total payout rows for this application.
|
|
7443
7461
|
*/
|
|
7444
7462
|
total?: number | null;
|
|
7445
|
-
/**
|
|
7446
|
-
* Format: uint32
|
|
7447
|
-
* @description Current page number.
|
|
7448
|
-
*/
|
|
7449
|
-
page?: number | null;
|
|
7450
7463
|
/**
|
|
7451
7464
|
* Format: uint32
|
|
7452
7465
|
* @description Items per page.
|
|
@@ -7457,6 +7470,12 @@ export interface components {
|
|
|
7457
7470
|
* @description Total number of pages.
|
|
7458
7471
|
*/
|
|
7459
7472
|
totalPages?: number | null;
|
|
7473
|
+
/**
|
|
7474
|
+
* @description Cursor for the next page, minted from the last row of an over-fetched
|
|
7475
|
+
* page: this listing is one ordered read, so a page shorter than
|
|
7476
|
+
* `page_size` proves the walk is exhausted and this is empty.
|
|
7477
|
+
*/
|
|
7478
|
+
nextPageToken?: string | null;
|
|
7460
7479
|
};
|
|
7461
7480
|
ListConditionalOrdersResponse: {
|
|
7462
7481
|
orders?: components["schemas"]["ConditionalOrder"][] | null;
|
|
@@ -7563,13 +7582,20 @@ export interface components {
|
|
|
7563
7582
|
ListManagedMarketAssignmentsResponse: {
|
|
7564
7583
|
/** @description Expected assignments, including phases currently unable to quote. */
|
|
7565
7584
|
items?: components["schemas"]["ManagedMarketAssignment"][] | null;
|
|
7566
|
-
/**
|
|
7585
|
+
/**
|
|
7586
|
+
* Format: uint32
|
|
7587
|
+
* @description Exact: a maker's assignment inventory is a small bounded set.
|
|
7588
|
+
*/
|
|
7567
7589
|
total?: number | null;
|
|
7568
7590
|
/** Format: uint32 */
|
|
7569
|
-
page?: number | null;
|
|
7570
|
-
/** Format: uint32 */
|
|
7571
7591
|
pageSize?: number | null;
|
|
7572
7592
|
inventoryObservedAt?: string | null;
|
|
7593
|
+
/**
|
|
7594
|
+
* @description Cursor for the next page, minted from the last row of an over-fetched
|
|
7595
|
+
* page: this listing is one ordered read, so a page shorter than
|
|
7596
|
+
* `page_size` proves the walk is exhausted and this is empty.
|
|
7597
|
+
*/
|
|
7598
|
+
nextPageToken?: string | null;
|
|
7573
7599
|
};
|
|
7574
7600
|
ListMarginAccountsResponse: {
|
|
7575
7601
|
accounts?: components["schemas"]["MarginAccountSummary"][] | null;
|
|
@@ -7641,12 +7667,6 @@ export interface components {
|
|
|
7641
7667
|
* @example 3
|
|
7642
7668
|
*/
|
|
7643
7669
|
total?: number | null;
|
|
7644
|
-
/**
|
|
7645
|
-
* Format: uint32
|
|
7646
|
-
* @description Current page number
|
|
7647
|
-
* @example 1
|
|
7648
|
-
*/
|
|
7649
|
-
page?: number | null;
|
|
7650
7670
|
/**
|
|
7651
7671
|
* Format: uint32
|
|
7652
7672
|
* @description Items per page
|
|
@@ -7659,6 +7679,12 @@ export interface components {
|
|
|
7659
7679
|
* @example 1
|
|
7660
7680
|
*/
|
|
7661
7681
|
totalPages?: number | null;
|
|
7682
|
+
/**
|
|
7683
|
+
* @description Cursor for the next page, minted from the last row of an over-fetched
|
|
7684
|
+
* page: this listing is one ordered read, so a page shorter than
|
|
7685
|
+
* `page_size` proves the walk is exhausted and this is empty.
|
|
7686
|
+
*/
|
|
7687
|
+
nextPageToken?: string | null;
|
|
7662
7688
|
};
|
|
7663
7689
|
ListPositionHistoryResponse: {
|
|
7664
7690
|
events?: components["schemas"]["PositionHistoryEvent"][] | null;
|
|
@@ -9215,11 +9241,14 @@ export interface components {
|
|
|
9215
9241
|
*/
|
|
9216
9242
|
maintenanceMarginRatio?: string | null;
|
|
9217
9243
|
/**
|
|
9218
|
-
* @
|
|
9219
|
-
* @
|
|
9244
|
+
* @description The most USD notional a position may hold at this bracket's max leverage: the next bracket's lowerBoundNotional, or the market's position cap on the top bracket. A position is valued at the order's price. Below the top bracket the cap is exclusive, since a notional at the next bound already sits in the next bracket. An order at a given leverage may take its position up to the cap of the highest bracket whose maxLeverage allows that leverage.
|
|
9245
|
+
* @example 100000000
|
|
9220
9246
|
*/
|
|
9221
9247
|
maxPositionNotional?: string | null;
|
|
9222
|
-
/**
|
|
9248
|
+
/**
|
|
9249
|
+
* @deprecated
|
|
9250
|
+
* @description DEPRECATED and no longer set: positions are capped in notional per bracket. Use maxPositionNotional.
|
|
9251
|
+
*/
|
|
9223
9252
|
maxPositionSize?: string | null;
|
|
9224
9253
|
/**
|
|
9225
9254
|
* Format: uint32
|
|
@@ -12802,7 +12831,7 @@ export interface operations {
|
|
|
12802
12831
|
};
|
|
12803
12832
|
content?: never;
|
|
12804
12833
|
};
|
|
12805
|
-
/** @description Refused:
|
|
12834
|
+
/** @description Refused: neither the revenue share nor builder fees are switched on, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
|
|
12806
12835
|
403: {
|
|
12807
12836
|
headers: {
|
|
12808
12837
|
[name: string]: unknown;
|
|
@@ -12872,7 +12901,7 @@ export interface operations {
|
|
|
12872
12901
|
};
|
|
12873
12902
|
content?: never;
|
|
12874
12903
|
};
|
|
12875
|
-
/** @description Refused:
|
|
12904
|
+
/** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
|
|
12876
12905
|
403: {
|
|
12877
12906
|
headers: {
|
|
12878
12907
|
[name: string]: unknown;
|
|
@@ -12920,7 +12949,7 @@ export interface operations {
|
|
|
12920
12949
|
};
|
|
12921
12950
|
content?: never;
|
|
12922
12951
|
};
|
|
12923
|
-
/** @description Refused:
|
|
12952
|
+
/** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
|
|
12924
12953
|
403: {
|
|
12925
12954
|
headers: {
|
|
12926
12955
|
[name: string]: unknown;
|
|
@@ -12946,10 +12975,48 @@ export interface operations {
|
|
|
12946
12975
|
list_buildercode_payouts: {
|
|
12947
12976
|
parameters: {
|
|
12948
12977
|
query?: {
|
|
12949
|
-
/** @description
|
|
12950
|
-
page?: number;
|
|
12951
|
-
/** @description Items per page (max 100) */
|
|
12978
|
+
/** @description Items per page (max 1000) */
|
|
12952
12979
|
pageSize?: number;
|
|
12980
|
+
/**
|
|
12981
|
+
* @description Pagination cursor with two states:
|
|
12982
|
+
* - Omitted or empty string (""): start a cursor walk with no prior
|
|
12983
|
+
* position, from the newest credit.
|
|
12984
|
+
* - Non-empty: an opaque cursor from a previous response's
|
|
12985
|
+
* `next_page_token`; results resume immediately after that position.
|
|
12986
|
+
*
|
|
12987
|
+
* The walk seeks on `(created_at, id)` descending, served by
|
|
12988
|
+
* `idx_buildercode_payouts_application_created_id`, whose leading key is the
|
|
12989
|
+
* caller's own application and whose remaining keys are this seek's, both
|
|
12990
|
+
* descending. Both key columns are NOT NULL and fixed for a credit's
|
|
12991
|
+
* lifetime. (Spelled without the column list on purpose: the read contract
|
|
12992
|
+
* test asserts this request message never mentions a caller-selected
|
|
12993
|
+
* identity.)
|
|
12994
|
+
*
|
|
12995
|
+
* This REPLACES the removed mode's `(sequence, sequence_ordinal, created_at,
|
|
12996
|
+
* id)` order, whose two leading columns are nullable — no backfill exists
|
|
12997
|
+
* for credits written before they did — and a nullable leading key cannot be
|
|
12998
|
+
* a total cursor key: the NULL rows sort together at one end, and a seek
|
|
12999
|
+
* through them would need a COALESCE no index covers.
|
|
13000
|
+
*
|
|
13001
|
+
* ORDERING CHANGE, not just a pagination change. The new key is total and
|
|
13002
|
+
* stable — a page can neither skip nor duplicate a credit — but it is NOT
|
|
13003
|
+
* chronological inside one persistor batch. `created_at` defaults to `NOW()`,
|
|
13004
|
+
* which is transaction-start time, so every credit one batch writes shares an
|
|
13005
|
+
* identical timestamp; the `id` tie-break defaults to `gen_random_uuid()`,
|
|
13006
|
+
* which the persistor leaves alone. So within a batch the order is arbitrary
|
|
13007
|
+
* and a LATER fill can be listed ahead of an earlier one. The removed order
|
|
13008
|
+
* led with `sequence` and `sequence_ordinal` precisely because those carry
|
|
13009
|
+
* the engine's fill order, and one entry routinely holds several credits (a
|
|
13010
|
+
* taker sweeping N makers, or a flattened `BatchCreateOrders`). Preserving
|
|
13011
|
+
* fill chronology would need those columns backfilled first, which is not
|
|
13012
|
+
* possible for credits written before they existed. Across batches the order
|
|
13013
|
+
* is still newest-first.
|
|
13014
|
+
*
|
|
13015
|
+
* `total` and `total_pages` are populated and exact, and count the rows the
|
|
13016
|
+
* `kind` filter selects. Filters must match the request that produced the
|
|
13017
|
+
* token, or the request is rejected 400.
|
|
13018
|
+
*/
|
|
13019
|
+
pageToken?: string;
|
|
12953
13020
|
/** @description Only return BuilderCodes payouts of this payout kind: REVENUE_SHARE (the frontend's share of Monaco's fee) or BUILDER_FEE (ordinary builder fees charged to takers and credited to enrolled applications). Omit for every kind. */
|
|
12954
13021
|
kind?: "REVENUE_SHARE" | "BUILDER_FEE";
|
|
12955
13022
|
};
|
|
@@ -12982,7 +13049,7 @@ export interface operations {
|
|
|
12982
13049
|
};
|
|
12983
13050
|
content?: never;
|
|
12984
13051
|
};
|
|
12985
|
-
/** @description Refused:
|
|
13052
|
+
/** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
|
|
12986
13053
|
403: {
|
|
12987
13054
|
headers: {
|
|
12988
13055
|
[name: string]: unknown;
|
|
@@ -13030,7 +13097,7 @@ export interface operations {
|
|
|
13030
13097
|
};
|
|
13031
13098
|
content?: never;
|
|
13032
13099
|
};
|
|
13033
|
-
/** @description Refused:
|
|
13100
|
+
/** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
|
|
13034
13101
|
403: {
|
|
13035
13102
|
headers: {
|
|
13036
13103
|
[name: string]: unknown;
|
|
@@ -13078,7 +13145,7 @@ export interface operations {
|
|
|
13078
13145
|
};
|
|
13079
13146
|
content?: never;
|
|
13080
13147
|
};
|
|
13081
|
-
/** @description Refused:
|
|
13148
|
+
/** @description Refused: the caller is delegated (gRPC: PERMISSION_DENIED) */
|
|
13082
13149
|
403: {
|
|
13083
13150
|
headers: {
|
|
13084
13151
|
[name: string]: unknown;
|
|
@@ -13130,7 +13197,7 @@ export interface operations {
|
|
|
13130
13197
|
};
|
|
13131
13198
|
content?: never;
|
|
13132
13199
|
};
|
|
13133
|
-
/** @description Refused:
|
|
13200
|
+
/** @description Refused: the caller is a delegated-agent session (gRPC: PERMISSION_DENIED) */
|
|
13134
13201
|
403: {
|
|
13135
13202
|
headers: {
|
|
13136
13203
|
[name: string]: unknown;
|
|
@@ -14678,10 +14745,24 @@ export interface operations {
|
|
|
14678
14745
|
list_managed_market_assignments: {
|
|
14679
14746
|
parameters: {
|
|
14680
14747
|
query?: {
|
|
14681
|
-
/** @description
|
|
14682
|
-
page?: number;
|
|
14683
|
-
/** @description Items per page (max 100) */
|
|
14748
|
+
/** @description Items per page (max 1000) */
|
|
14684
14749
|
pageSize?: number;
|
|
14750
|
+
/**
|
|
14751
|
+
* @description Pagination cursor with two states:
|
|
14752
|
+
* - Omitted or empty string (""): start a cursor walk with no prior
|
|
14753
|
+
* position, from the oldest assignment.
|
|
14754
|
+
* - Non-empty: an opaque cursor from a previous response's
|
|
14755
|
+
* `next_page_token`; results resume immediately after that position.
|
|
14756
|
+
*
|
|
14757
|
+
* The walk seeks on `(created_at, id)` ascending — the order this listing
|
|
14758
|
+
* already read in, and the order
|
|
14759
|
+
* `idx_market_launch_maker_inventory (maker_user_id, maker_application_id,
|
|
14760
|
+
* created_at, id)` is built for, so the seek stays an index scan. Both
|
|
14761
|
+
* columns are NOT NULL and fixed for a launch's lifetime. `total` is
|
|
14762
|
+
* populated and exact: a maker's assignment inventory is a small bounded
|
|
14763
|
+
* set.
|
|
14764
|
+
*/
|
|
14765
|
+
pageToken?: string;
|
|
14685
14766
|
};
|
|
14686
14767
|
header?: never;
|
|
14687
14768
|
path?: never;
|
|
@@ -18034,10 +18115,24 @@ export interface operations {
|
|
|
18034
18115
|
get_trades: {
|
|
18035
18116
|
parameters: {
|
|
18036
18117
|
query?: {
|
|
18037
|
-
/** @description
|
|
18038
|
-
page?: number;
|
|
18039
|
-
/** @description Max trades to return (max 100) */
|
|
18118
|
+
/** @description Max trades to return (max 1000) */
|
|
18040
18119
|
pageSize?: number;
|
|
18120
|
+
/**
|
|
18121
|
+
* @description Pagination cursor with two states:
|
|
18122
|
+
* - Omitted or empty string (""): start a cursor walk with no prior
|
|
18123
|
+
* position, from the most recent trade (this listing always sorts
|
|
18124
|
+
* newest-first).
|
|
18125
|
+
* - Non-empty: an opaque cursor from a previous response's
|
|
18126
|
+
* `next_page_token`; results resume immediately after that position.
|
|
18127
|
+
*
|
|
18128
|
+
* The walk is a keyset seek on `(executed_at, id)`, both immutable once a
|
|
18129
|
+
* trade is written, so a page can neither repeat nor skip a trade when new
|
|
18130
|
+
* fills land mid-walk — the failure the removed page number had by
|
|
18131
|
+
* construction on a table this endpoint appends to continuously.
|
|
18132
|
+
* `trading_pair_id` is pinned inside the token, so a token minted for one
|
|
18133
|
+
* pair is rejected rather than seeking into another pair's history.
|
|
18134
|
+
*/
|
|
18135
|
+
pageToken?: string;
|
|
18041
18136
|
};
|
|
18042
18137
|
header?: never;
|
|
18043
18138
|
path: {
|
|
@@ -18128,10 +18223,24 @@ export interface operations {
|
|
|
18128
18223
|
list_pending_withdrawals: {
|
|
18129
18224
|
parameters: {
|
|
18130
18225
|
query?: {
|
|
18131
|
-
/** @description
|
|
18132
|
-
page?: number;
|
|
18133
|
-
/** @description Items per page (max 100) */
|
|
18226
|
+
/** @description Items per page (max 1000) */
|
|
18134
18227
|
pageSize?: number;
|
|
18228
|
+
/**
|
|
18229
|
+
* @description Pagination cursor with two states:
|
|
18230
|
+
* - Omitted or empty string (""): start a cursor walk with no prior
|
|
18231
|
+
* position, from the newest pending withdrawal.
|
|
18232
|
+
* - Non-empty: an opaque cursor from a previous response's
|
|
18233
|
+
* `next_page_token`; results resume immediately after that position.
|
|
18234
|
+
*
|
|
18235
|
+
* The walk seeks on `(created_at, withdrawal_index)` descending — the order
|
|
18236
|
+
* this listing already read in, served by
|
|
18237
|
+
* `idx_withdrawals_user_created (user_id, created_at DESC)`. `created_at` is
|
|
18238
|
+
* NOT NULL and `withdrawal_index` is the table's primary key, assigned by
|
|
18239
|
+
* the vault in request order, so the key is total and immutable. `total` is
|
|
18240
|
+
* populated and exact: a user's unexecuted withdrawals are a small bounded
|
|
18241
|
+
* set.
|
|
18242
|
+
*/
|
|
18243
|
+
pageToken?: string;
|
|
18135
18244
|
};
|
|
18136
18245
|
header?: never;
|
|
18137
18246
|
path?: never;
|
|
@@ -60,16 +60,32 @@ export interface WithdrawalsAPI extends BaseAPI {
|
|
|
60
60
|
getWithdrawal(withdrawalIndex: number): Promise<WithdrawalResponse>;
|
|
61
61
|
/**
|
|
62
62
|
* List the caller's pending withdrawals (those still awaiting on-chain root
|
|
63
|
-
* confirmation). Authenticated and scoped to the caller. Newest first
|
|
63
|
+
* confirmation). Authenticated and scoped to the caller. Newest first.
|
|
64
|
+
*
|
|
65
|
+
* Cursor-paged: omit `pageToken` (or send `""`) to start, then follow
|
|
66
|
+
* `nextPageToken` until it comes back empty. Page-number pagination was
|
|
67
|
+
* removed (0XM-2788).
|
|
64
68
|
*/
|
|
65
69
|
listPendingWithdrawals(params?: ListPendingWithdrawalsParams): Promise<ListPendingWithdrawalsResponse>;
|
|
66
70
|
}
|
|
67
71
|
/** Query parameters for {@link WithdrawalsAPI.listPendingWithdrawals}. */
|
|
68
72
|
export interface ListPendingWithdrawalsParams {
|
|
69
|
-
/**
|
|
70
|
-
page?: number;
|
|
71
|
-
/** Items per page (1–100). Defaults to 20. */
|
|
73
|
+
/** Items per page (1–1000). Defaults to 20. A larger value is rejected, not clamped. */
|
|
72
74
|
pageSize?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Pagination cursor with two states:
|
|
77
|
+
*
|
|
78
|
+
* - Omitted or `""`: start a walk from the newest pending withdrawal.
|
|
79
|
+
* - Non-empty: an opaque cursor from a previous response's `nextPageToken`;
|
|
80
|
+
* the walk resumes immediately after that position.
|
|
81
|
+
*
|
|
82
|
+
* The walk seeks on `(createdAt, withdrawalIndex)` descending. `createdAt` is
|
|
83
|
+
* always set and `withdrawalIndex` is the row's primary key, so the key is
|
|
84
|
+
* total and immutable and a withdrawal requested mid-walk cannot make the
|
|
85
|
+
* walk repeat or drop a row. The filters must match the request that minted
|
|
86
|
+
* the token, or the request is rejected with a `400`.
|
|
87
|
+
*/
|
|
88
|
+
pageToken?: string;
|
|
73
89
|
}
|
|
74
90
|
/**
|
|
75
91
|
* A single pending withdrawal in a {@link ListPendingWithdrawalsResponse}. A
|
|
@@ -105,10 +121,15 @@ export interface ListPendingWithdrawalsResponse {
|
|
|
105
121
|
withdrawals: PendingWithdrawal[];
|
|
106
122
|
/** Total number of pending withdrawals for the caller. */
|
|
107
123
|
total: number;
|
|
108
|
-
/** Current page number. */
|
|
109
|
-
page: number;
|
|
110
124
|
/** Items per page. */
|
|
111
125
|
pageSize: number;
|
|
112
126
|
/** Total number of pages. */
|
|
113
127
|
totalPages: number;
|
|
128
|
+
/**
|
|
129
|
+
* Cursor for the next page, minted from the last row of an over-fetched read:
|
|
130
|
+
* this listing is one ordered read, so a page shorter than `pageSize` proves
|
|
131
|
+
* the walk is exhausted and an empty string here is definitive. Pass it back
|
|
132
|
+
* as `pageToken`; do not drive the walk off `total` or `totalPages`.
|
|
133
|
+
*/
|
|
134
|
+
nextPageToken: string;
|
|
114
135
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.76",
|
|
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.76",
|
|
20
20
|
"zod": "^4.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|