@0xmonaco/types 1.1.5-develop.129b2c6 → 1.1.5
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 +3 -1
- package/dist/applications/requests.d.ts +5 -5
- package/dist/buildercodes/index.d.ts +11 -13
- package/dist/buildercodes/responses.d.ts +0 -1
- package/dist/buildercodes/responses.js +0 -10
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/margin-accounts/index.d.ts +2 -7
- package/dist/market/index.d.ts +20 -0
- package/dist/profile/index.d.ts +17 -10
- package/dist/rfq/responses.d.ts +0 -36
- package/dist/rfq/responses.js +0 -29
- package/dist/sdk/index.d.ts +1 -4
- package/dist/trading/index.d.ts +2 -4
- package/dist/trading/orders.d.ts +0 -11
- package/dist/trading/responses.d.ts +2 -2
- package/dist/validation/margin-accounts.d.ts +2 -2
- package/dist/validation/margin-accounts.js +5 -5
- package/dist/validation/trading.d.ts +0 -15
- package/dist/validation/trading.js +42 -34
- package/dist/websocket/base.d.ts +10 -40
- package/dist/websocket/client.d.ts +4 -32
- package/dist/websocket/events/orderbook-events.d.ts +1 -41
- package/dist/websocket/events/rfq-events.d.ts +1 -30
- package/dist/websocket/events/trade-events.d.ts +0 -31
- package/dist/websocket/index.d.ts +0 -1
- package/dist/websocket/index.js +0 -1
- package/dist/websocket/snapshots.d.ts +1 -23
- package/dist/wire/operations.d.ts +1 -1
- package/dist/wire/operations.js +0 -16
- package/dist/wire/schema.d.ts +295 -2308
- package/package.json +2 -2
- package/dist/analytics/builders.d.ts +0 -131
- package/dist/analytics/builders.js +0 -11
- package/dist/analytics/index.d.ts +0 -151
- package/dist/analytics/index.js +0 -27
- package/dist/analytics/wallets.d.ts +0 -193
- package/dist/analytics/wallets.js +0 -16
- package/dist/websocket/depth.d.ts +0 -142
- package/dist/websocket/depth.js +0 -13
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ interface TradingAPI extends BaseAPI {
|
|
|
170
170
|
type OrderSide = "BUY" | "SELL";
|
|
171
171
|
type OrderType = "LIMIT" | "MARKET";
|
|
172
172
|
type OrderStatus = "SUBMITTED" | "PARTIALLY_FILLED" | "FILLED" | "SETTLED_ON_CHAIN" | "SETTLED" | "CANCELLED" | "REJECTED" | "EXPIRED";
|
|
173
|
-
type TradingMode = "SPOT"
|
|
173
|
+
type TradingMode = "SPOT";
|
|
174
174
|
type TimeInForce = "GTC" | "IOC" | "FOK"; // GTC: Good Till Cancel, IOC: Immediate or Cancel, FOK: Fill or Kill
|
|
175
175
|
|
|
176
176
|
// Trading response types
|
|
@@ -237,6 +237,8 @@ interface TradingPair {
|
|
|
237
237
|
marketType: TradingMode;
|
|
238
238
|
category: string;
|
|
239
239
|
isActive: boolean;
|
|
240
|
+
makerFeeBps: number;
|
|
241
|
+
takerFeeBps: number;
|
|
240
242
|
minOrderSize: string;
|
|
241
243
|
maxOrderSize: string;
|
|
242
244
|
quantityStepSize: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Query parameters for listing application orders.
|
|
9
9
|
*/
|
|
10
10
|
export interface ListAppOrdersParams {
|
|
11
|
-
/** Public client ID of the application to list (required). An unknown
|
|
11
|
+
/** Public client ID of the application to list (required). An unknown or inactive one is a `404`. */
|
|
12
12
|
clientId: string;
|
|
13
13
|
/** Items per page, 1 to 1000 (default 20). Rejected if larger. */
|
|
14
14
|
pageSize?: number;
|
|
@@ -40,7 +40,7 @@ export interface ListAppOrdersParams {
|
|
|
40
40
|
* Query parameters for listing application users.
|
|
41
41
|
*/
|
|
42
42
|
export interface ListAppUsersParams {
|
|
43
|
-
/** Public client ID of the application to list (required). An unknown
|
|
43
|
+
/** Public client ID of the application to list (required). An unknown or inactive one is a `404`. */
|
|
44
44
|
clientId: string;
|
|
45
45
|
/** Items per page, 1 to 1000 (default 20). Rejected if larger. */
|
|
46
46
|
pageSize?: number;
|
|
@@ -69,7 +69,7 @@ export interface ListAppUsersParams {
|
|
|
69
69
|
* Query parameters for listing application movements.
|
|
70
70
|
*/
|
|
71
71
|
export interface ListAppMovementsParams {
|
|
72
|
-
/** Public client ID of the application to list (required). An unknown
|
|
72
|
+
/** Public client ID of the application to list (required). An unknown or inactive one is a `404`. */
|
|
73
73
|
clientId: string;
|
|
74
74
|
/** Items per page, 1 to 1000 (default 20). Rejected if larger. */
|
|
75
75
|
pageSize?: number;
|
|
@@ -99,7 +99,7 @@ export interface ListAppMovementsParams {
|
|
|
99
99
|
* Query parameters for listing application balances.
|
|
100
100
|
*/
|
|
101
101
|
export interface ListAppBalancesParams {
|
|
102
|
-
/** Public client ID of the application to list (required). An unknown
|
|
102
|
+
/** Public client ID of the application to list (required). An unknown or inactive one is a `404`. */
|
|
103
103
|
clientId: string;
|
|
104
104
|
/** Items per page, 1 to 1000 (default 20). Rejected if larger. */
|
|
105
105
|
pageSize?: number;
|
|
@@ -126,7 +126,7 @@ export interface ListAppBalancesParams {
|
|
|
126
126
|
* Query parameters for application stats.
|
|
127
127
|
*/
|
|
128
128
|
export interface GetAppStatsParams {
|
|
129
|
-
/** Public client ID of the application to list (required). An unknown
|
|
129
|
+
/** Public client ID of the application to list (required). An unknown or inactive one is a `404`. */
|
|
130
130
|
clientId: string;
|
|
131
131
|
/** ISO 8601 datetime to filter stats from (e.g. 2026-01-01T00:00:00Z). Omit for all-time. */
|
|
132
132
|
since?: string;
|
|
@@ -56,20 +56,18 @@ export interface BuildercodesAPI extends BaseAPI {
|
|
|
56
56
|
* Throws 403 when the session is a delegated agent — a permanent
|
|
57
57
|
* restriction on that session type, not a rollout state. No program switch
|
|
58
58
|
* gates the claim, so a balance already credited stays claimable. Throws 409 when the payout balance is insufficient for the
|
|
59
|
-
* requested amount
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* rejections stay retryable because they committed nothing: a maintenance
|
|
70
|
-
* block (`OPERATIONS_BLOCKED`) and a sequencer overload (`OVERLOADED`).
|
|
59
|
+
* requested amount. Throws 503 when the matching engine is unreachable,
|
|
60
|
+
* restarting, or slow to answer — an UNKNOWN outcome, not a rejection: the
|
|
61
|
+
* claim is admitted to the sequencer before its reply is sent, so it may
|
|
62
|
+
* still commit, and with no idempotency key a blind retry can claim twice.
|
|
63
|
+
* Do not retry automatically: a balance read cannot settle it, because an
|
|
64
|
+
* admitted claim may still be queued. Ambiguous failures are thrown
|
|
65
|
+
* with `retryable: false` so retry logic driven off that flag cannot claim
|
|
66
|
+
* twice. Two pre-admission rejections stay retryable because they committed
|
|
67
|
+
* nothing: a maintenance block (`OPERATIONS_BLOCKED`) and a sequencer
|
|
68
|
+
* overload (`OVERLOADED`).
|
|
71
69
|
*
|
|
72
|
-
* @param params - Payout token address
|
|
70
|
+
* @param params - Payout token address and raw-unit amount to claim
|
|
73
71
|
* @returns Promise resolving to the post-claim payout and trading balances
|
|
74
72
|
*/
|
|
75
73
|
claimBuildercodeRewards(params: ClaimBuildercodeRewardsParams): Promise<ClaimBuildercodeRewardsResponse>;
|
|
@@ -196,7 +196,6 @@ export declare const GetBuildercodeRewardsBalanceResponseSchema: z.ZodObject<{
|
|
|
196
196
|
export declare const ClaimBuildercodeRewardsParamsSchema: z.ZodObject<{
|
|
197
197
|
token: z.ZodString;
|
|
198
198
|
amount: z.ZodString;
|
|
199
|
-
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
200
199
|
}, z.core.$strip>;
|
|
201
200
|
/** Schema for the claim-BuilderCodes-rewards response. */
|
|
202
201
|
export declare const ClaimBuildercodeRewardsResponseSchema: z.ZodObject<{
|
|
@@ -5,7 +5,6 @@
|
|
|
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";
|
|
9
8
|
/** Schema for this frontend's current BuilderCodes program state. */
|
|
10
9
|
export const GetBuildercodesConfigResponseSchema = z.object({
|
|
11
10
|
applicationId: z.string().uuid(),
|
|
@@ -190,15 +189,6 @@ export const ClaimBuildercodeRewardsParamsSchema = z.object({
|
|
|
190
189
|
.trim()
|
|
191
190
|
.min(1, "amount is required")
|
|
192
191
|
.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(),
|
|
202
192
|
});
|
|
203
193
|
/** Schema for the claim-BuilderCodes-rewards response. */
|
|
204
194
|
export const ClaimBuildercodeRewardsResponseSchema = z.object({
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
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";
|
|
8
7
|
export * from "./api";
|
|
9
8
|
export * from "./applications";
|
|
10
9
|
export * from "./auth";
|
package/dist/index.js
CHANGED
|
@@ -223,7 +223,6 @@ 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). */
|
|
227
226
|
strategyKey?: string;
|
|
228
227
|
/**
|
|
229
228
|
* Risk bucket mode. Defaults to ISOLATED, which is selected by
|
|
@@ -264,7 +263,6 @@ export interface TransferCollateralToIsolatedRiskBucketRequest extends TransferC
|
|
|
264
263
|
/** The margin account whose bucket is funded: omit for the default account, or name an open sub-account. */
|
|
265
264
|
marginAccountId?: string;
|
|
266
265
|
tradingPairId: string;
|
|
267
|
-
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
268
266
|
strategyKey?: string;
|
|
269
267
|
selectedTradingPairIds?: never;
|
|
270
268
|
/**
|
|
@@ -305,8 +303,7 @@ export interface TransferCollateralToCrossRiskBucketRequest extends TransferColl
|
|
|
305
303
|
*/
|
|
306
304
|
selectedTradingPairIds?: never;
|
|
307
305
|
tradingPairId?: never;
|
|
308
|
-
|
|
309
|
-
strategyKey?: string;
|
|
306
|
+
strategyKey?: never;
|
|
310
307
|
/** Cross risk is pooled at bucket equity — there is no per-position margin; an explicit `true` is rejected. */
|
|
311
308
|
applyToPositionMargin?: never;
|
|
312
309
|
}
|
|
@@ -427,7 +424,6 @@ export type SimulateIsolatedRiskBucketOrderRiskRequest = SimulateOrderRiskReques
|
|
|
427
424
|
marginMode?: "ISOLATED";
|
|
428
425
|
/** The margin account previewed: omit for the default account, or name an open sub-account. */
|
|
429
426
|
marginAccountId?: string;
|
|
430
|
-
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
431
427
|
strategyKey?: string;
|
|
432
428
|
selectedTradingPairIds?: never;
|
|
433
429
|
};
|
|
@@ -450,8 +446,7 @@ export type SimulateCrossRiskBucketOrderRiskRequest = SimulateOrderRiskRequest &
|
|
|
450
446
|
* compile time that it does nothing.
|
|
451
447
|
*/
|
|
452
448
|
selectedTradingPairIds?: never;
|
|
453
|
-
|
|
454
|
-
strategyKey?: string;
|
|
449
|
+
strategyKey?: never;
|
|
455
450
|
};
|
|
456
451
|
export type SimulateRiskBucketOrderRiskRequest = SimulateIsolatedRiskBucketOrderRiskRequest | SimulateCrossRiskBucketOrderRiskRequest;
|
|
457
452
|
export interface SimulateOrderRiskResponse {
|
package/dist/market/index.d.ts
CHANGED
|
@@ -54,6 +54,26 @@ 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;
|
|
57
77
|
/** Minimum order size */
|
|
58
78
|
minOrderSize: string;
|
|
59
79
|
/** Maximum order size */
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -326,16 +326,6 @@ 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;
|
|
339
329
|
}
|
|
340
330
|
/**
|
|
341
331
|
* Query parameters for getting user trades
|
|
@@ -612,6 +602,23 @@ export interface UserProfile {
|
|
|
612
602
|
accountType: string;
|
|
613
603
|
/** Whether the user can withdraw funds */
|
|
614
604
|
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;
|
|
615
622
|
/** Account creation timestamp (ISO string) */
|
|
616
623
|
createdAt: string;
|
|
617
624
|
/** Additional taker fee in basis points contributed by the application (if any) */
|
package/dist/rfq/responses.d.ts
CHANGED
|
@@ -37,10 +37,6 @@ 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>>;
|
|
44
40
|
}, z.core.$strip>;
|
|
45
41
|
/** The taker's current view of the quotes. */
|
|
46
42
|
export declare const RfqViewSchema: z.ZodObject<{
|
|
@@ -48,22 +44,12 @@ export declare const RfqViewSchema: z.ZodObject<{
|
|
|
48
44
|
bid: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
45
|
vwap: z.ZodString;
|
|
50
46
|
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>>;
|
|
55
47
|
}, z.core.$strip>>>;
|
|
56
48
|
ask: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
57
49
|
vwap: z.ZodString;
|
|
58
50
|
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>>;
|
|
63
51
|
}, z.core.$strip>>>;
|
|
64
52
|
asOfMs: z.ZodNumber;
|
|
65
|
-
monacoFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
66
|
-
builderFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
67
53
|
}, z.core.$strip>;
|
|
68
54
|
/** One fill of an executed RFQ. */
|
|
69
55
|
export declare const RfqFillSchema: z.ZodObject<{
|
|
@@ -71,8 +57,6 @@ export declare const RfqFillSchema: z.ZodObject<{
|
|
|
71
57
|
price: z.ZodString;
|
|
72
58
|
quantity: z.ZodString;
|
|
73
59
|
fee: z.ZodString;
|
|
74
|
-
monacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
-
builderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
60
|
}, z.core.$strip>;
|
|
77
61
|
/** What an accepted RFQ executed. */
|
|
78
62
|
export declare const RfqOutcomeSchema: z.ZodObject<{
|
|
@@ -84,8 +68,6 @@ export declare const RfqOutcomeSchema: z.ZodObject<{
|
|
|
84
68
|
price: z.ZodString;
|
|
85
69
|
quantity: z.ZodString;
|
|
86
70
|
fee: z.ZodString;
|
|
87
|
-
monacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
-
builderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
71
|
}, z.core.$strip>>;
|
|
90
72
|
}, z.core.$strip>;
|
|
91
73
|
/** A quoted side the venue refused; nothing is reserved for it. */
|
|
@@ -129,9 +111,6 @@ export declare const RfqMakerSelectionSchema: z.ZodObject<{
|
|
|
129
111
|
capacity: z.ZodString;
|
|
130
112
|
}, z.core.$strip>>>;
|
|
131
113
|
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>>;
|
|
135
114
|
}, z.core.$strip>;
|
|
136
115
|
/**
|
|
137
116
|
* Authoritative RFQ status. A taker sees `view` and `outcome`; a maker sees
|
|
@@ -159,22 +138,12 @@ export declare const RfqStatusSchema: z.ZodObject<{
|
|
|
159
138
|
bid: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
160
139
|
vwap: z.ZodString;
|
|
161
140
|
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>>;
|
|
166
141
|
}, z.core.$strip>>>;
|
|
167
142
|
ask: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
168
143
|
vwap: z.ZodString;
|
|
169
144
|
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>>;
|
|
174
145
|
}, z.core.$strip>>>;
|
|
175
146
|
asOfMs: z.ZodNumber;
|
|
176
|
-
monacoFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
177
|
-
builderFeeCbps: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
178
147
|
}, z.core.$strip>>>;
|
|
179
148
|
ownQuote: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
180
149
|
rfqId: z.ZodString;
|
|
@@ -209,9 +178,6 @@ export declare const RfqStatusSchema: z.ZodObject<{
|
|
|
209
178
|
capacity: z.ZodString;
|
|
210
179
|
}, z.core.$strip>>>;
|
|
211
180
|
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>>;
|
|
215
181
|
}, z.core.$strip>>>;
|
|
216
182
|
ownLatestVersion: z.ZodNumber;
|
|
217
183
|
ownQuoteWithdrawn: z.ZodBoolean;
|
|
@@ -224,8 +190,6 @@ export declare const RfqStatusSchema: z.ZodObject<{
|
|
|
224
190
|
price: z.ZodString;
|
|
225
191
|
quantity: z.ZodString;
|
|
226
192
|
fee: z.ZodString;
|
|
227
|
-
monacoFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
-
builderFee: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
193
|
}, z.core.$strip>>;
|
|
230
194
|
}, z.core.$strip>>>;
|
|
231
195
|
durableSequence: z.ZodNumber;
|
package/dist/rfq/responses.js
CHANGED
|
@@ -51,14 +51,6 @@ 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(),
|
|
62
54
|
});
|
|
63
55
|
/** The taker's current view of the quotes. */
|
|
64
56
|
export const RfqViewSchema = z.object({
|
|
@@ -67,20 +59,13 @@ export const RfqViewSchema = z.object({
|
|
|
67
59
|
bid: RfqSideViewSchema.nullish(),
|
|
68
60
|
ask: RfqSideViewSchema.nullish(),
|
|
69
61
|
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(),
|
|
74
62
|
});
|
|
75
63
|
/** One fill of an executed RFQ. */
|
|
76
64
|
export const RfqFillSchema = z.object({
|
|
77
65
|
executionId: z.string(),
|
|
78
66
|
price: z.string(),
|
|
79
67
|
quantity: z.string(),
|
|
80
|
-
/** The taker's whole fee on this fill: monacoFee plus builderFee. */
|
|
81
68
|
fee: z.string(),
|
|
82
|
-
monacoFee: z.string().nullish(),
|
|
83
|
-
builderFee: z.string().nullish(),
|
|
84
69
|
});
|
|
85
70
|
/** What an accepted RFQ executed. */
|
|
86
71
|
export const RfqOutcomeSchema = z.object({
|
|
@@ -126,20 +111,6 @@ export const RfqMakerSelectionSchema = z.object({
|
|
|
126
111
|
quantity: z.string(),
|
|
127
112
|
frozenTerms: RfqQuoteTermsResponseSchema.nullish(),
|
|
128
113
|
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(),
|
|
143
114
|
});
|
|
144
115
|
/**
|
|
145
116
|
* Authoritative RFQ status. A taker sees `view` and `outcome`; a maker sees
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Address, PublicClient, TransactionReceipt, WalletClient } from "viem";
|
|
2
|
-
import type { AnalyticsAPI } from "../analytics";
|
|
3
2
|
import type { ApplicationsAPI } from "../applications";
|
|
4
3
|
import type { AuthAPI, AuthState } from "../auth/index";
|
|
5
4
|
import type { BuildercodesAPI } from "../buildercodes";
|
|
@@ -135,12 +134,10 @@ export interface MonacoSDK {
|
|
|
135
134
|
pulse: PulseAPI;
|
|
136
135
|
/** Public region status API: whether Monaco is available in the caller's region */
|
|
137
136
|
compliance: ComplianceAPI;
|
|
138
|
-
/** Public explorer analytics API: protocol totals and series, market volume, treasury net fees */
|
|
139
|
-
analytics: AnalyticsAPI;
|
|
140
137
|
/** Orderbook REST API for fetching orderbook snapshots */
|
|
141
138
|
orderbook: {
|
|
142
139
|
getOrderbook: (tradingPairId: string, options?: {
|
|
143
|
-
/** Number of price levels
|
|
140
|
+
/** Number of price levels to return (max 100). Defaults to 10. */
|
|
144
141
|
depth?: number;
|
|
145
142
|
/** Trading mode: 'Spot' or 'Margin'. Defaults to 'Spot'. */
|
|
146
143
|
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 ("SPOT"
|
|
23
|
+
* @param options.tradingMode - Trading mode (e.g., "SPOT")
|
|
24
24
|
* @param options.timeInForce - Time in force ("GTC", "IOC", or "FOK")
|
|
25
25
|
* @returns Promise resolving to the order result
|
|
26
26
|
*/
|
|
@@ -42,7 +42,6 @@ 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). */
|
|
46
45
|
strategyKey?: string;
|
|
47
46
|
/** @deprecated Order side is authoritative. */
|
|
48
47
|
positionSide?: PositionSide;
|
|
@@ -85,7 +84,7 @@ export interface TradingAPI extends BaseAPI {
|
|
|
85
84
|
* @param side - Order side ("BUY" or "SELL")
|
|
86
85
|
* @param quantity - Order quantity as string
|
|
87
86
|
* @param options - Optional parameters for the market order
|
|
88
|
-
* @param options.tradingMode - Trading mode ("SPOT"
|
|
87
|
+
* @param options.tradingMode - Trading mode (e.g., "SPOT")
|
|
89
88
|
* @param options.slippageTolerance - Slippage tolerance as decimal (e.g., 0.01 for 1%, 0 for best price only, undefined for unlimited slippage)
|
|
90
89
|
* @returns Promise resolving to the order result
|
|
91
90
|
*/
|
|
@@ -105,7 +104,6 @@ export interface TradingAPI extends BaseAPI {
|
|
|
105
104
|
riskBucketId?: string;
|
|
106
105
|
/** Initial order budget; unfilled funds do not back the isolated position. */
|
|
107
106
|
riskBucketCollateral?: string;
|
|
108
|
-
/** Names the margin account by its sub-account key, like `marginAccountId` (`default` is the default account). */
|
|
109
107
|
strategyKey?: string;
|
|
110
108
|
/** @deprecated Order side is authoritative. */
|
|
111
109
|
positionSide?: PositionSide;
|
package/dist/trading/orders.d.ts
CHANGED
|
@@ -164,17 +164,6 @@ 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;
|
|
178
167
|
/**
|
|
179
168
|
* Opaque, compare-only revision counter for this order's state: a strictly
|
|
180
169
|
* higher value is strictly newer state for that order, and equal values
|
|
@@ -371,7 +371,7 @@ export interface BatchCreateOrderParams {
|
|
|
371
371
|
price?: string;
|
|
372
372
|
/** Order quantity */
|
|
373
373
|
quantity: string;
|
|
374
|
-
/** Trading mode
|
|
374
|
+
/** Trading mode (defaults to "SPOT") */
|
|
375
375
|
tradingMode?: TradingMode;
|
|
376
376
|
/** Maximum slippage for market orders as decimal (e.g., 0.01 for 1%) */
|
|
377
377
|
slippageTolerance?: number;
|
|
@@ -684,7 +684,7 @@ export interface CreateTwapOrderOptions {
|
|
|
684
684
|
executionStyle?: "TAKER" | "PASSIVE";
|
|
685
685
|
/** Whether the TWAP parent is reduce-only (margin only). Child orders inherit it and clamp to the live position. */
|
|
686
686
|
reduceOnly?: boolean;
|
|
687
|
-
/** Trading mode: "SPOT" or "MARGIN"
|
|
687
|
+
/** Trading mode: "SPOT" or "MARGIN" (default: "SPOT"). */
|
|
688
688
|
tradingMode?: TradingMode;
|
|
689
689
|
/** Margin account UUID for margin TWAP orders. Resolved once at creation and reused by every child order. */
|
|
690
690
|
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.ZodNever>;
|
|
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.ZodNever>;
|
|
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,
|
|
5
|
+
import { MarketSlippageToleranceBpsSchema, OrderIdempotencyKeySchema, OrderSideSchema, OrderTypeSchema, PositionSideSchema, PositiveDecimalStringSchema, 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: z.string().trim().min(1, "Strategy key cannot be empty").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: z.string().trim().min(1, "Strategy key cannot be empty").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: z.never().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: z.never().optional(),
|
|
93
93
|
tradingPairId: z.never().optional(),
|
|
94
94
|
});
|
|
95
95
|
export const TransferCollateralSchema = z.object({
|
|
@@ -126,21 +126,6 @@ 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;
|
|
144
129
|
/**
|
|
145
130
|
* Place Limit Order validation schema
|
|
146
131
|
*/
|