@0xmonaco/types 1.1.5 → 1.1.6
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/README.md +1 -3
- package/dist/analytics/builders.d.ts +135 -0
- package/dist/analytics/builders.js +11 -0
- package/dist/analytics/index.d.ts +153 -0
- package/dist/analytics/index.js +27 -0
- package/dist/analytics/wallets.d.ts +197 -0
- package/dist/analytics/wallets.js +16 -0
- package/dist/applications/requests.d.ts +5 -5
- package/dist/buildercodes/index.d.ts +13 -11
- package/dist/buildercodes/responses.d.ts +1 -0
- package/dist/buildercodes/responses.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/margin-accounts/index.d.ts +7 -2
- package/dist/market/index.d.ts +0 -20
- package/dist/profile/index.d.ts +10 -17
- package/dist/rfq/responses.d.ts +36 -0
- package/dist/rfq/responses.js +29 -0
- package/dist/sdk/index.d.ts +4 -1
- package/dist/trading/index.d.ts +7 -3
- package/dist/trading/orders.d.ts +11 -0
- package/dist/trading/responses.d.ts +9 -3
- package/dist/validation/margin-accounts.d.ts +2 -2
- package/dist/validation/margin-accounts.js +5 -5
- package/dist/validation/trading.d.ts +15 -0
- package/dist/validation/trading.js +34 -42
- package/dist/websocket/base.d.ts +40 -10
- package/dist/websocket/client.d.ts +32 -4
- package/dist/websocket/depth.d.ts +142 -0
- package/dist/websocket/depth.js +13 -0
- package/dist/websocket/events/orderbook-events.d.ts +41 -1
- package/dist/websocket/events/rfq-events.d.ts +30 -1
- package/dist/websocket/events/trade-events.d.ts +37 -0
- package/dist/websocket/index.d.ts +1 -0
- package/dist/websocket/index.js +1 -0
- package/dist/websocket/snapshots.d.ts +23 -1
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +16 -0
- package/dist/wire/schema.d.ts +2344 -276
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* All types are derived from Zod schemas for runtime validation.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
import { OrderIdempotencyKeySchema } from "../validation/trading";
|
|
8
9
|
/** Schema for this frontend's current BuilderCodes program state. */
|
|
9
10
|
export const GetBuildercodesConfigResponseSchema = z.object({
|
|
10
11
|
applicationId: z.string().uuid(),
|
|
@@ -189,6 +190,15 @@ export const ClaimBuildercodeRewardsParamsSchema = z.object({
|
|
|
189
190
|
.trim()
|
|
190
191
|
.min(1, "amount is required")
|
|
191
192
|
.refine((v) => /^\d+$/.test(v) && BigInt(v) > 0n, "amount must be a positive integer string"),
|
|
193
|
+
/**
|
|
194
|
+
* Optional submission identity, shared with order create (1-64 characters
|
|
195
|
+
* from `[A-Za-z0-9._:-]`). Retrying the same key and claim within 15 minutes
|
|
196
|
+
* of the original acceptance returns the original claim's result without
|
|
197
|
+
* moving money again; the same key with a different claim is refused with
|
|
198
|
+
* `IDEMPOTENCY_KEY_CONFLICT` (409). Generate a fresh key for each intended
|
|
199
|
+
* claim and keep it across retries of that claim.
|
|
200
|
+
*/
|
|
201
|
+
idempotencyKey: OrderIdempotencyKeySchema.optional(),
|
|
192
202
|
});
|
|
193
203
|
/** Schema for the claim-BuilderCodes-rewards response. */
|
|
194
204
|
export const ClaimBuildercodeRewardsResponseSchema = z.object({
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This package provides TypeScript types for the Monaco protocol.
|
|
5
5
|
* It includes SDK types, vault types, trading types, contract types, and common types.
|
|
6
6
|
*/
|
|
7
|
+
export * from "./analytics";
|
|
7
8
|
export * from "./api";
|
|
8
9
|
export * from "./applications";
|
|
9
10
|
export * from "./auth";
|
package/dist/index.js
CHANGED
|
@@ -223,6 +223,7 @@ export interface TransferCollateralRequest {
|
|
|
223
223
|
asset: string;
|
|
224
224
|
amount: string;
|
|
225
225
|
tradingPairId?: string;
|
|
226
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
226
227
|
strategyKey?: string;
|
|
227
228
|
/**
|
|
228
229
|
* Risk bucket mode. Defaults to ISOLATED, which is selected by
|
|
@@ -263,6 +264,7 @@ export interface TransferCollateralToIsolatedRiskBucketRequest extends TransferC
|
|
|
263
264
|
/** The margin account whose bucket is funded: omit for the default account, or name an open sub-account. */
|
|
264
265
|
marginAccountId?: string;
|
|
265
266
|
tradingPairId: string;
|
|
267
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
266
268
|
strategyKey?: string;
|
|
267
269
|
selectedTradingPairIds?: never;
|
|
268
270
|
/**
|
|
@@ -303,7 +305,8 @@ export interface TransferCollateralToCrossRiskBucketRequest extends TransferColl
|
|
|
303
305
|
*/
|
|
304
306
|
selectedTradingPairIds?: never;
|
|
305
307
|
tradingPairId?: never;
|
|
306
|
-
|
|
308
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
309
|
+
strategyKey?: string;
|
|
307
310
|
/** Cross risk is pooled at bucket equity — there is no per-position margin; an explicit `true` is rejected. */
|
|
308
311
|
applyToPositionMargin?: never;
|
|
309
312
|
}
|
|
@@ -424,6 +427,7 @@ export type SimulateIsolatedRiskBucketOrderRiskRequest = SimulateOrderRiskReques
|
|
|
424
427
|
marginMode?: "ISOLATED";
|
|
425
428
|
/** The margin account previewed: omit for the default account, or name an open sub-account. */
|
|
426
429
|
marginAccountId?: string;
|
|
430
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
427
431
|
strategyKey?: string;
|
|
428
432
|
selectedTradingPairIds?: never;
|
|
429
433
|
};
|
|
@@ -446,7 +450,8 @@ export type SimulateCrossRiskBucketOrderRiskRequest = SimulateOrderRiskRequest &
|
|
|
446
450
|
* compile time that it does nothing.
|
|
447
451
|
*/
|
|
448
452
|
selectedTradingPairIds?: never;
|
|
449
|
-
|
|
453
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
454
|
+
strategyKey?: string;
|
|
450
455
|
};
|
|
451
456
|
export type SimulateRiskBucketOrderRiskRequest = SimulateIsolatedRiskBucketOrderRiskRequest | SimulateCrossRiskBucketOrderRiskRequest;
|
|
452
457
|
export interface SimulateOrderRiskResponse {
|
package/dist/market/index.d.ts
CHANGED
|
@@ -54,26 +54,6 @@ export interface TradingPair {
|
|
|
54
54
|
* `CROSS_MARGIN_NOT_ALLOWED`; open the position with `marginMode: "ISOLATED"`.
|
|
55
55
|
*/
|
|
56
56
|
isolatedOnly: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Flat pair-level maker fee in basis points (negative = rebate).
|
|
59
|
-
*
|
|
60
|
-
* @deprecated Not the rate an order is charged: fees are tiered per account.
|
|
61
|
-
* Use `fees.getFeeSchedule(tradingPairId)` for the pair's tier schedule,
|
|
62
|
-
* `fees.getMyFeeTier({ tradingPairId })` for your own rate, and
|
|
63
|
-
* `placementMakerFeeBps` on an order for the rate it was placed at. This
|
|
64
|
-
* field will be removed in a later release.
|
|
65
|
-
*/
|
|
66
|
-
makerFeeBps: number;
|
|
67
|
-
/**
|
|
68
|
-
* Flat pair-level taker fee in basis points.
|
|
69
|
-
*
|
|
70
|
-
* @deprecated Not the rate an order is charged: fees are tiered per account.
|
|
71
|
-
* Use `fees.getFeeSchedule(tradingPairId)` for the pair's tier schedule,
|
|
72
|
-
* `fees.getMyFeeTier({ tradingPairId })` for your own rate, and
|
|
73
|
-
* `placementTakerFeeBps` on an order for the rate it was placed at. This
|
|
74
|
-
* field will be removed in a later release.
|
|
75
|
-
*/
|
|
76
|
-
takerFeeBps: number;
|
|
77
57
|
/** Minimum order size */
|
|
78
58
|
minOrderSize: string;
|
|
79
59
|
/** Maximum order size */
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -326,6 +326,16 @@ export interface UserTrade {
|
|
|
326
326
|
liquidityRole: "MAKER" | "TAKER";
|
|
327
327
|
/** Timestamp when the trade was executed (RFC 3339). Absent when none is recorded. */
|
|
328
328
|
executedAt?: string;
|
|
329
|
+
/**
|
|
330
|
+
* The RFQ (block trade) this user's own order filled in. Absent on an
|
|
331
|
+
* order-book fill. Read the RFQ with `rfq.getRfq`.
|
|
332
|
+
*/
|
|
333
|
+
rfqId?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Set on a maker's RFQ fill only: the internal engine id of the quote
|
|
336
|
+
* version the maker's order rested for. Not the public `quoteId`.
|
|
337
|
+
*/
|
|
338
|
+
rfqQuoteId?: string;
|
|
329
339
|
}
|
|
330
340
|
/**
|
|
331
341
|
* Query parameters for getting user trades
|
|
@@ -602,23 +612,6 @@ export interface UserProfile {
|
|
|
602
612
|
accountType: string;
|
|
603
613
|
/** Whether the user can withdraw funds */
|
|
604
614
|
canWithdraw: boolean;
|
|
605
|
-
/**
|
|
606
|
-
* Flat taker fee in basis points, echoed from a trading pair.
|
|
607
|
-
*
|
|
608
|
-
* @deprecated Not the rate you are charged: fees are tiered per account. Use
|
|
609
|
-
* `fees.getMyFeeTier({ tradingPairId })` for your own rate. This field will
|
|
610
|
-
* be removed in a later release.
|
|
611
|
-
*/
|
|
612
|
-
takerFeeBps: number;
|
|
613
|
-
/**
|
|
614
|
-
* Flat maker fee in basis points (negative = rebate), echoed from a trading
|
|
615
|
-
* pair.
|
|
616
|
-
*
|
|
617
|
-
* @deprecated Not the rate you are charged: fees are tiered per account. Use
|
|
618
|
-
* `fees.getMyFeeTier({ tradingPairId })` for your own rate. This field will
|
|
619
|
-
* be removed in a later release.
|
|
620
|
-
*/
|
|
621
|
-
makerFeeBps: number;
|
|
622
615
|
/** Account creation timestamp (ISO string) */
|
|
623
616
|
createdAt: string;
|
|
624
617
|
/** Additional taker fee in basis points contributed by the application (if any) */
|
package/dist/rfq/responses.d.ts
CHANGED
|
@@ -37,6 +37,10 @@ export declare const RfqRequestTermsSchema: z.ZodObject<{
|
|
|
37
37
|
export declare const RfqSideViewSchema: z.ZodObject<{
|
|
38
38
|
vwap: z.ZodString;
|
|
39
39
|
availableQuantity: z.ZodString;
|
|
40
|
+
grossVwap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
estimatedMonacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
estimatedBuilderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
estimatedTotalFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
44
|
}, z.core.$strip>;
|
|
41
45
|
/** The taker's current view of the quotes. */
|
|
42
46
|
export declare const RfqViewSchema: z.ZodObject<{
|
|
@@ -44,12 +48,22 @@ export declare const RfqViewSchema: z.ZodObject<{
|
|
|
44
48
|
bid: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
45
49
|
vwap: z.ZodString;
|
|
46
50
|
availableQuantity: z.ZodString;
|
|
51
|
+
grossVwap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
estimatedMonacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
estimatedBuilderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
estimatedTotalFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
55
|
}, z.core.$strip>>>;
|
|
48
56
|
ask: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
57
|
vwap: z.ZodString;
|
|
50
58
|
availableQuantity: z.ZodString;
|
|
59
|
+
grossVwap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
estimatedMonacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
estimatedBuilderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
|
+
estimatedTotalFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
63
|
}, z.core.$strip>>>;
|
|
52
64
|
asOfMs: z.ZodNumber;
|
|
65
|
+
monacoFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
66
|
+
builderFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
53
67
|
}, z.core.$strip>;
|
|
54
68
|
/** One fill of an executed RFQ. */
|
|
55
69
|
export declare const RfqFillSchema: z.ZodObject<{
|
|
@@ -57,6 +71,8 @@ export declare const RfqFillSchema: z.ZodObject<{
|
|
|
57
71
|
price: z.ZodString;
|
|
58
72
|
quantity: z.ZodString;
|
|
59
73
|
fee: z.ZodString;
|
|
74
|
+
monacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
builderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
76
|
}, z.core.$strip>;
|
|
61
77
|
/** What an accepted RFQ executed. */
|
|
62
78
|
export declare const RfqOutcomeSchema: z.ZodObject<{
|
|
@@ -68,6 +84,8 @@ export declare const RfqOutcomeSchema: z.ZodObject<{
|
|
|
68
84
|
price: z.ZodString;
|
|
69
85
|
quantity: z.ZodString;
|
|
70
86
|
fee: z.ZodString;
|
|
87
|
+
monacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
builderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
89
|
}, z.core.$strip>>;
|
|
72
90
|
}, z.core.$strip>;
|
|
73
91
|
/** A quoted side the venue refused; nothing is reserved for it. */
|
|
@@ -111,6 +129,9 @@ export declare const RfqMakerSelectionSchema: z.ZodObject<{
|
|
|
111
129
|
capacity: z.ZodString;
|
|
112
130
|
}, z.core.$strip>>>;
|
|
113
131
|
lastLookDeadlineAtMs: z.ZodNumber;
|
|
132
|
+
monacoFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
133
|
+
maxBuilderFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
134
|
+
estimatedNet: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
135
|
}, z.core.$strip>;
|
|
115
136
|
/**
|
|
116
137
|
* Authoritative RFQ status. A taker sees `view` and `outcome`; a maker sees
|
|
@@ -138,12 +159,22 @@ export declare const RfqStatusSchema: z.ZodObject<{
|
|
|
138
159
|
bid: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
139
160
|
vwap: z.ZodString;
|
|
140
161
|
availableQuantity: z.ZodString;
|
|
162
|
+
grossVwap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
estimatedMonacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
164
|
+
estimatedBuilderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
165
|
+
estimatedTotalFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
166
|
}, z.core.$strip>>>;
|
|
142
167
|
ask: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
143
168
|
vwap: z.ZodString;
|
|
144
169
|
availableQuantity: z.ZodString;
|
|
170
|
+
grossVwap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
171
|
+
estimatedMonacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
estimatedBuilderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
173
|
+
estimatedTotalFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
174
|
}, z.core.$strip>>>;
|
|
146
175
|
asOfMs: z.ZodNumber;
|
|
176
|
+
monacoFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
177
|
+
builderFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
147
178
|
}, z.core.$strip>>>;
|
|
148
179
|
ownQuote: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
149
180
|
rfqId: z.ZodString;
|
|
@@ -178,6 +209,9 @@ export declare const RfqStatusSchema: z.ZodObject<{
|
|
|
178
209
|
capacity: z.ZodString;
|
|
179
210
|
}, z.core.$strip>>>;
|
|
180
211
|
lastLookDeadlineAtMs: z.ZodNumber;
|
|
212
|
+
monacoFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
213
|
+
maxBuilderFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
214
|
+
estimatedNet: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
215
|
}, z.core.$strip>>>;
|
|
182
216
|
ownLatestVersion: z.ZodNumber;
|
|
183
217
|
ownQuoteWithdrawn: z.ZodBoolean;
|
|
@@ -190,6 +224,8 @@ export declare const RfqStatusSchema: z.ZodObject<{
|
|
|
190
224
|
price: z.ZodString;
|
|
191
225
|
quantity: z.ZodString;
|
|
192
226
|
fee: z.ZodString;
|
|
227
|
+
monacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
builderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
229
|
}, z.core.$strip>>;
|
|
194
230
|
}, z.core.$strip>>>;
|
|
195
231
|
durableSequence: z.ZodNumber;
|
package/dist/rfq/responses.js
CHANGED
|
@@ -51,6 +51,14 @@ export const RfqSideViewSchema = z.object({
|
|
|
51
51
|
/** All-in volume-weighted price, fees included. */
|
|
52
52
|
vwap: z.string(),
|
|
53
53
|
availableQuantity: z.string(),
|
|
54
|
+
/** The volume-weighted price before fees. */
|
|
55
|
+
grossVwap: z.string().nullish(),
|
|
56
|
+
/** Estimated Monaco taker fee on availableQuantity, in the quote asset. */
|
|
57
|
+
estimatedMonacoFee: z.string().nullish(),
|
|
58
|
+
/** Estimated builder fee on availableQuantity, in the quote asset. */
|
|
59
|
+
estimatedBuilderFee: z.string().nullish(),
|
|
60
|
+
/** Estimated total taker fee on availableQuantity, in the quote asset. */
|
|
61
|
+
estimatedTotalFee: z.string().nullish(),
|
|
54
62
|
});
|
|
55
63
|
/** The taker's current view of the quotes. */
|
|
56
64
|
export const RfqViewSchema = z.object({
|
|
@@ -59,13 +67,20 @@ export const RfqViewSchema = z.object({
|
|
|
59
67
|
bid: RfqSideViewSchema.nullish(),
|
|
60
68
|
ask: RfqSideViewSchema.nullish(),
|
|
61
69
|
asOfMs: z.number(),
|
|
70
|
+
/** The taker's Monaco fee rate in this view, in centi-bps. */
|
|
71
|
+
monacoFeeCbps: z.number().nullish(),
|
|
72
|
+
/** The taker's builder fee rate in this view, in centi-bps. */
|
|
73
|
+
builderFeeCbps: z.number().nullish(),
|
|
62
74
|
});
|
|
63
75
|
/** One fill of an executed RFQ. */
|
|
64
76
|
export const RfqFillSchema = z.object({
|
|
65
77
|
executionId: z.string(),
|
|
66
78
|
price: z.string(),
|
|
67
79
|
quantity: z.string(),
|
|
80
|
+
/** The taker's whole fee on this fill: monacoFee plus builderFee. */
|
|
68
81
|
fee: z.string(),
|
|
82
|
+
monacoFee: z.string().nullish(),
|
|
83
|
+
builderFee: z.string().nullish(),
|
|
69
84
|
});
|
|
70
85
|
/** What an accepted RFQ executed. */
|
|
71
86
|
export const RfqOutcomeSchema = z.object({
|
|
@@ -111,6 +126,20 @@ export const RfqMakerSelectionSchema = z.object({
|
|
|
111
126
|
quantity: z.string(),
|
|
112
127
|
frozenTerms: RfqQuoteTermsResponseSchema.nullish(),
|
|
113
128
|
lastLookDeadlineAtMs: z.number(),
|
|
129
|
+
/** Your Monaco maker fee rate in centi-bps, frozen at acceptance; negative for a rebate. */
|
|
130
|
+
monacoFeeCbps: z.number().nullish(),
|
|
131
|
+
/**
|
|
132
|
+
* The MOST your frontend's builder add-on charges on this fill, in centi-bps:
|
|
133
|
+
* the rate stored on your quote order. A fill charges it or nothing, never
|
|
134
|
+
* more; an IMPROVE re-places the quote at the rate configured then.
|
|
135
|
+
*/
|
|
136
|
+
maxBuilderFeeCbps: z.number().nullish(),
|
|
137
|
+
/**
|
|
138
|
+
* Estimated net at the selected quantity and frozen price, in the quote
|
|
139
|
+
* asset, at monacoFeeCbps plus the maximum add-on: the least you receive
|
|
140
|
+
* when selling, the most you pay when buying.
|
|
141
|
+
*/
|
|
142
|
+
estimatedNet: z.string().nullish(),
|
|
114
143
|
});
|
|
115
144
|
/**
|
|
116
145
|
* Authoritative RFQ status. A taker sees `view` and `outcome`; a maker sees
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Address, PublicClient, TransactionReceipt, WalletClient } from "viem";
|
|
2
|
+
import type { AnalyticsAPI } from "../analytics";
|
|
2
3
|
import type { ApplicationsAPI } from "../applications";
|
|
3
4
|
import type { AuthAPI, AuthState } from "../auth/index";
|
|
4
5
|
import type { BuildercodesAPI } from "../buildercodes";
|
|
@@ -134,10 +135,12 @@ export interface MonacoSDK {
|
|
|
134
135
|
pulse: PulseAPI;
|
|
135
136
|
/** Public region status API: whether Monaco is available in the caller's region */
|
|
136
137
|
compliance: ComplianceAPI;
|
|
138
|
+
/** Public explorer analytics API: protocol totals and series, market volume, treasury net fees */
|
|
139
|
+
analytics: AnalyticsAPI;
|
|
137
140
|
/** Orderbook REST API for fetching orderbook snapshots */
|
|
138
141
|
orderbook: {
|
|
139
142
|
getOrderbook: (tradingPairId: string, options?: {
|
|
140
|
-
/** Number of price levels
|
|
143
|
+
/** Number of price levels per side (max 1000). Defaults to 10. Above 100 the snapshot comes from the market-data book and carries `bookSeq`. */
|
|
141
144
|
depth?: number;
|
|
142
145
|
/** Trading mode: 'Spot' or 'Margin'. Defaults to 'Spot'. */
|
|
143
146
|
tradingMode?: TradingMode;
|
package/dist/trading/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
20
20
|
* @param quantity - Order quantity as string
|
|
21
21
|
* @param price - Order price as string
|
|
22
22
|
* @param options - Optional parameters for the limit order
|
|
23
|
-
* @param options.tradingMode - Trading mode (
|
|
23
|
+
* @param options.tradingMode - Trading mode ("SPOT" or "MARGIN"). Omit it to use the trading pair market type.
|
|
24
24
|
* @param options.timeInForce - Time in force ("GTC", "IOC", or "FOK")
|
|
25
25
|
* @returns Promise resolving to the order result
|
|
26
26
|
*/
|
|
@@ -42,6 +42,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
42
42
|
riskBucketId?: string;
|
|
43
43
|
/** Initial order budget; unfilled funds do not back the isolated position. */
|
|
44
44
|
riskBucketCollateral?: string;
|
|
45
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
45
46
|
strategyKey?: string;
|
|
46
47
|
/** @deprecated Order side is authoritative. */
|
|
47
48
|
positionSide?: PositionSide;
|
|
@@ -84,7 +85,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
84
85
|
* @param side - Order side ("BUY" or "SELL")
|
|
85
86
|
* @param quantity - Order quantity as string
|
|
86
87
|
* @param options - Optional parameters for the market order
|
|
87
|
-
* @param options.tradingMode - Trading mode (
|
|
88
|
+
* @param options.tradingMode - Trading mode ("SPOT" or "MARGIN"). Omit it to use the trading pair market type.
|
|
88
89
|
* @param options.slippageTolerance - Slippage tolerance as decimal (e.g., 0.01 for 1%, 0 for best price only, undefined for unlimited slippage)
|
|
89
90
|
* @returns Promise resolving to the order result
|
|
90
91
|
*/
|
|
@@ -104,6 +105,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
104
105
|
riskBucketId?: string;
|
|
105
106
|
/** Initial order budget; unfilled funds do not back the isolated position. */
|
|
106
107
|
riskBucketCollateral?: string;
|
|
108
|
+
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
107
109
|
strategyKey?: string;
|
|
108
110
|
/** @deprecated Order side is authoritative. */
|
|
109
111
|
positionSide?: PositionSide;
|
|
@@ -154,7 +156,9 @@ export interface TradingAPI extends BaseAPI {
|
|
|
154
156
|
*/
|
|
155
157
|
listConditionalOrders(params?: ListConditionalOrdersParams): Promise<ListConditionalOrdersResponse>;
|
|
156
158
|
/**
|
|
157
|
-
* Batch cancels specific orders by their IDs.
|
|
159
|
+
* Batch cancels specific orders by their IDs. Every ID gets one result, in
|
|
160
|
+
* request order; an ID that is not one of your live orders fails with
|
|
161
|
+
* `ORDER_NOT_FOUND`.
|
|
158
162
|
* @param orderIds - Array of order IDs to cancel
|
|
159
163
|
* @returns Promise resolving to the batch cancellation result
|
|
160
164
|
*/
|
package/dist/trading/orders.d.ts
CHANGED
|
@@ -164,6 +164,17 @@ export interface Order {
|
|
|
164
164
|
* Wire: `placementMakerFeeBps`.
|
|
165
165
|
*/
|
|
166
166
|
placementMakerFeeBps?: string;
|
|
167
|
+
/**
|
|
168
|
+
* The RFQ (block trade) this order belongs to; set on RFQ orders only
|
|
169
|
+
* (`origin` `RFQ`). Read the RFQ with `rfq.getRfq`. Wire: `rfqId`.
|
|
170
|
+
*/
|
|
171
|
+
rfqId?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Set on a maker's RFQ quote order only: the internal engine id of the quote
|
|
174
|
+
* version the order rested for. Not the public `quoteId`; the taker's order,
|
|
175
|
+
* which fills from several quotes, carries none. Wire: `rfqQuoteId`.
|
|
176
|
+
*/
|
|
177
|
+
rfqQuoteId?: string;
|
|
167
178
|
/**
|
|
168
179
|
* Opaque, compare-only revision counter for this order's state: a strictly
|
|
169
180
|
* higher value is strictly newer state for that order, and equal values
|
|
@@ -284,7 +284,13 @@ export interface BatchCancelResult {
|
|
|
284
284
|
error?: BatchCancelError;
|
|
285
285
|
}
|
|
286
286
|
/**
|
|
287
|
-
* Response from batch cancelling orders
|
|
287
|
+
* Response from batch cancelling orders.
|
|
288
|
+
*
|
|
289
|
+
* For `batchCancel`, `results` holds one entry per requested ID, in request
|
|
290
|
+
* order (a repeated ID is answered at each occurrence), and
|
|
291
|
+
* `totalRequested === totalCancelled + totalFailed === results.length`. An ID
|
|
292
|
+
* that is not one of your live orders (unknown, another user's, or already
|
|
293
|
+
* terminal) is a failed entry with code `ORDER_NOT_FOUND`.
|
|
288
294
|
*/
|
|
289
295
|
export interface BatchCancelOrdersResponse {
|
|
290
296
|
/** Total number of orders requested to cancel */
|
|
@@ -371,7 +377,7 @@ export interface BatchCreateOrderParams {
|
|
|
371
377
|
price?: string;
|
|
372
378
|
/** Order quantity */
|
|
373
379
|
quantity: string;
|
|
374
|
-
/** Trading mode
|
|
380
|
+
/** Trading mode: "SPOT" or "MARGIN". Omit it to use the trading pair market type. */
|
|
375
381
|
tradingMode?: TradingMode;
|
|
376
382
|
/** Maximum slippage for market orders as decimal (e.g., 0.01 for 1%) */
|
|
377
383
|
slippageTolerance?: number;
|
|
@@ -684,7 +690,7 @@ export interface CreateTwapOrderOptions {
|
|
|
684
690
|
executionStyle?: "TAKER" | "PASSIVE";
|
|
685
691
|
/** Whether the TWAP parent is reduce-only (margin only). Child orders inherit it and clamp to the live position. */
|
|
686
692
|
reduceOnly?: boolean;
|
|
687
|
-
/** Trading mode: "SPOT" or "MARGIN"
|
|
693
|
+
/** Trading mode: "SPOT" or "MARGIN". Omit it to use the trading pair market type; a mode that does not match the pair is rejected. */
|
|
688
694
|
tradingMode?: TradingMode;
|
|
689
695
|
/** Margin account UUID for margin TWAP orders. Resolved once at creation and reused by every child order. */
|
|
690
696
|
marginAccountId?: string;
|
|
@@ -64,7 +64,7 @@ export declare const TransferCollateralToRiskBucketSchema: z.ZodObject<{
|
|
|
64
64
|
marginMode: z.ZodLiteral<"CROSS">;
|
|
65
65
|
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
66
66
|
selectedTradingPairIds: z.ZodOptional<z.ZodNever>;
|
|
67
|
-
strategyKey: z.ZodOptional<z.
|
|
67
|
+
strategyKey: z.ZodOptional<z.ZodString>;
|
|
68
68
|
tradingPairId: z.ZodOptional<z.ZodNever>;
|
|
69
69
|
}, z.core.$strict>]>>;
|
|
70
70
|
}, z.core.$strip>;
|
|
@@ -171,7 +171,7 @@ export declare const SimulateRiskBucketOrderRiskSchema: z.ZodObject<{
|
|
|
171
171
|
marginMode: z.ZodLiteral<"CROSS">;
|
|
172
172
|
marginAccountId: z.ZodOptional<z.ZodUUID>;
|
|
173
173
|
selectedTradingPairIds: z.ZodOptional<z.ZodNever>;
|
|
174
|
-
strategyKey: z.ZodOptional<z.
|
|
174
|
+
strategyKey: z.ZodOptional<z.ZodString>;
|
|
175
175
|
tradingPairId: z.ZodUUID;
|
|
176
176
|
side: z.ZodEnum<{
|
|
177
177
|
BUY: "BUY";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Margin Account API Validation Schemas
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { MarketSlippageToleranceBpsSchema, OrderIdempotencyKeySchema, OrderSideSchema, OrderTypeSchema, PositionSideSchema, PositiveDecimalStringSchema, UUIDSchema, } from "./trading";
|
|
5
|
+
import { MarketSlippageToleranceBpsSchema, OrderIdempotencyKeySchema, OrderSideSchema, OrderTypeSchema, PositionSideSchema, PositiveDecimalStringSchema, StrategyKeySchema, UUIDSchema, } from "./trading";
|
|
6
6
|
const CursorPaginationSchema = z.object({
|
|
7
7
|
/**
|
|
8
8
|
* Rejected, not ignored. A non-strict object would let a JS or `any` caller
|
|
@@ -37,7 +37,7 @@ const TransferCollateralRequestSchema = z
|
|
|
37
37
|
asset: z.string().trim().min(1, "Asset cannot be empty"),
|
|
38
38
|
amount: PositiveDecimalStringSchema,
|
|
39
39
|
tradingPairId: UUIDSchema.optional(),
|
|
40
|
-
strategyKey:
|
|
40
|
+
strategyKey: StrategyKeySchema.optional(),
|
|
41
41
|
// A cross risk bucket has no trading pair, so CROSS is the only way to name
|
|
42
42
|
// one on the way out (0XM-2420). The two never combine.
|
|
43
43
|
marginMode: z.enum(["ISOLATED", "CROSS"]).optional(),
|
|
@@ -54,7 +54,7 @@ const ParentMarginAccountCollateralRequestSchema = z.object({
|
|
|
54
54
|
});
|
|
55
55
|
const RiskBucketRequestSchema = z.object({
|
|
56
56
|
tradingPairId: UUIDSchema,
|
|
57
|
-
strategyKey:
|
|
57
|
+
strategyKey: StrategyKeySchema.optional(),
|
|
58
58
|
});
|
|
59
59
|
const IsolatedRiskBucketRequestSchema = RiskBucketRequestSchema.extend({
|
|
60
60
|
marginMode: z.literal("ISOLATED").optional(),
|
|
@@ -78,7 +78,7 @@ const CrossRiskBucketSimulateRequestSchema = z.object({
|
|
|
78
78
|
marginMode: z.literal("CROSS"),
|
|
79
79
|
marginAccountId: UUIDSchema.optional(),
|
|
80
80
|
selectedTradingPairIds: z.never().optional(),
|
|
81
|
-
strategyKey:
|
|
81
|
+
strategyKey: StrategyKeySchema.optional(),
|
|
82
82
|
});
|
|
83
83
|
// A cross transfer-in names no pairs. Cross scope is derived from trading, so
|
|
84
84
|
// funding has nothing to declare; `selectedTradingPairIds` used to REPLACE the
|
|
@@ -89,7 +89,7 @@ const CrossRiskBucketRequestSchema = z.object({
|
|
|
89
89
|
marginMode: z.literal("CROSS"),
|
|
90
90
|
marginAccountId: UUIDSchema.optional(),
|
|
91
91
|
selectedTradingPairIds: z.never().optional(),
|
|
92
|
-
strategyKey:
|
|
92
|
+
strategyKey: StrategyKeySchema.optional(),
|
|
93
93
|
tradingPairId: z.never().optional(),
|
|
94
94
|
});
|
|
95
95
|
export const TransferCollateralSchema = z.object({
|
|
@@ -126,6 +126,21 @@ export declare const ParentTrailingStopLegSchema: z.ZodObject<{
|
|
|
126
126
|
slippageToleranceBps: z.ZodOptional<z.ZodNumber>;
|
|
127
127
|
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
128
128
|
}, z.core.$strip>;
|
|
129
|
+
/**
|
|
130
|
+
* An order's `strategyKey` names one of the caller's margin accounts by its
|
|
131
|
+
* sub-account key (`default` is the default margin account), as
|
|
132
|
+
* `marginAccountId` names it by id; a copy trading account's `copy:` key names
|
|
133
|
+
* it too, for the reduce-only close a copy account admits. The server refuses
|
|
134
|
+
* a key outside the sub-account key alphabet and a key naming none of the
|
|
135
|
+
* caller's open sub-accounts.
|
|
136
|
+
*/
|
|
137
|
+
export declare const OrderStrategyKeySchema: z.ZodString;
|
|
138
|
+
/**
|
|
139
|
+
* A risk-bucket transfer's or preview's `strategyKey`: the order rule, and a
|
|
140
|
+
* reserved `copy:` key is refused (a copy account's risk buckets are funded
|
|
141
|
+
* by its follow only).
|
|
142
|
+
*/
|
|
143
|
+
export declare const StrategyKeySchema: z.ZodString;
|
|
129
144
|
/**
|
|
130
145
|
* Place Limit Order validation schema
|
|
131
146
|
*/
|