@0xmonaco/types 1.1.0 → 1.1.2
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/responses.js +2 -2
- package/dist/margin-accounts/index.d.ts +18 -19
- package/dist/portfolio/index.d.ts +2 -1
- package/dist/validation/margin-accounts.js +2 -2
- package/dist/websocket/events/balance-events.d.ts +5 -1
- package/dist/wire/schema.d.ts +35 -30
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ export const GetBuildercodesConfigResponseSchema = z.object({
|
|
|
19
19
|
builderFeeEnabled: z.boolean(),
|
|
20
20
|
builderFeeBps: z.number().int().min(0).max(100),
|
|
21
21
|
builderFeeCapBps: z.number().int().min(0).max(100),
|
|
22
|
-
changesRemaining: z.number().int().min(0).max(
|
|
22
|
+
changesRemaining: z.number().int().min(0).max(100),
|
|
23
23
|
nextChangeAllowedAt: z.string().nullable().optional(),
|
|
24
24
|
/**
|
|
25
25
|
* The stored maker add-on in basis points: the additional fee this frontend
|
|
@@ -44,7 +44,7 @@ export const SetBuilderFeeParamsSchema = z.object({
|
|
|
44
44
|
export const SetBuilderFeeResponseSchema = z.object({
|
|
45
45
|
builderFeeBps: z.number().int().min(0).max(100),
|
|
46
46
|
previousBuilderFeeBps: z.number().int().min(0).max(100),
|
|
47
|
-
changesRemaining: z.number().int().min(0).max(
|
|
47
|
+
changesRemaining: z.number().int().min(0).max(100),
|
|
48
48
|
nextChangeAllowedAt: z.string().nullable().optional(),
|
|
49
49
|
/** The maker add-on now stored. Absent from servers older than this field. */
|
|
50
50
|
builderMakerFeeBps: z.number().int().min(0).max(100).optional(),
|
|
@@ -6,6 +6,12 @@ export interface MarginAccountSummary {
|
|
|
6
6
|
label?: string;
|
|
7
7
|
riskBucketId?: string;
|
|
8
8
|
marginMode?: MarginMode;
|
|
9
|
+
/**
|
|
10
|
+
* On a cross risk-bucket row: the markets where the bucket has an open
|
|
11
|
+
* position, sorted by trading pair id. A market joins once a fill's position
|
|
12
|
+
* is persisted and leaves once its last position's close is persisted, so a
|
|
13
|
+
* position still being liquidated counts; resting orders alone do not.
|
|
14
|
+
*/
|
|
9
15
|
selectedTradingPairIds?: string[];
|
|
10
16
|
tradingPairId?: string;
|
|
11
17
|
strategyKey?: string;
|
|
@@ -280,13 +286,10 @@ export interface TransferCollateralToIsolatedRiskBucketRequest extends TransferC
|
|
|
280
286
|
/**
|
|
281
287
|
* Fund the account's cross risk bucket from the parent's unallocated
|
|
282
288
|
* collateral (the bucket is created if needed). A cross transfer names no
|
|
283
|
-
* pairs: cross scope is
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* response; the parent summary row carries no scope. Pairs declared before
|
|
288
|
-
* scope became derived stay recorded until they trade and their positions
|
|
289
|
-
* close.
|
|
289
|
+
* pairs: cross scope is the markets where the bucket has an open position, so
|
|
290
|
+
* funding has nothing to declare. Read the current scope from the cross
|
|
291
|
+
* bucket's row in `listMarginAccounts()` (`selectedTradingPairIds`) or from
|
|
292
|
+
* this call's response; the parent summary row carries no scope.
|
|
290
293
|
*/
|
|
291
294
|
export interface TransferCollateralToCrossRiskBucketRequest extends TransferCollateralToParentMarginAccountRequest {
|
|
292
295
|
marginMode: "CROSS";
|
|
@@ -323,6 +326,7 @@ export interface TransferCollateralResponse {
|
|
|
323
326
|
strategyKey?: string;
|
|
324
327
|
riskBucketId?: string;
|
|
325
328
|
marginMode?: MarginMode;
|
|
329
|
+
/** On a cross risk-bucket transfer: the markets where the bucket has an open position, sorted by trading pair id. */
|
|
326
330
|
selectedTradingPairIds?: string[];
|
|
327
331
|
asset: string;
|
|
328
332
|
amount: string;
|
|
@@ -426,11 +430,9 @@ export type SimulateIsolatedRiskBucketOrderRiskRequest = SimulateOrderRiskReques
|
|
|
426
430
|
/**
|
|
427
431
|
* Preview an order against the account's cross risk bucket, or the
|
|
428
432
|
* deterministic bucket a first cross order would create. A cross preview names
|
|
429
|
-
* no pairs: cross scope is
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
* so the previewed pair is in scope by construction. Read the derived scope
|
|
433
|
-
* the preview ran against from the response's `selectedTradingPairIds`.
|
|
433
|
+
* no pairs: cross scope is the markets where the bucket has an open position,
|
|
434
|
+
* and the previewed pair is in scope by construction. Read the scope the
|
|
435
|
+
* preview ran against from the response's `selectedTradingPairIds`.
|
|
434
436
|
*/
|
|
435
437
|
export type SimulateCrossRiskBucketOrderRiskRequest = SimulateOrderRiskRequest & {
|
|
436
438
|
marginMode: "CROSS";
|
|
@@ -466,13 +468,10 @@ export interface SimulateOrderRiskResponse {
|
|
|
466
468
|
marginMode?: MarginMode;
|
|
467
469
|
/**
|
|
468
470
|
* The cross scope the preview ran against; absent for isolated previews and
|
|
469
|
-
* never a caller's list
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
* that bucket, and the previewed pair — the previewed pair alone before the
|
|
474
|
-
* first cross order. `simulateOrderRisk` and `simulateParentMarginOrderRisk`
|
|
475
|
-
* report the recorded pairs plus the previewed pair.
|
|
471
|
+
* never a caller's list: the markets where the active cross bucket has an
|
|
472
|
+
* open position, sorted by trading pair id, then the previewed pair when it
|
|
473
|
+
* is not already among them — the previewed pair alone when no cross bucket
|
|
474
|
+
* is active yet.
|
|
476
475
|
*/
|
|
477
476
|
selectedTradingPairIds?: string[];
|
|
478
477
|
equityAfter: string;
|
|
@@ -273,7 +273,8 @@ export interface PortfolioRiskBucket {
|
|
|
273
273
|
/**
|
|
274
274
|
* The trading pair this bucket is scoped to. Present for `ISOLATED`
|
|
275
275
|
* buckets; absent (the key is omitted, never null) for `CROSS`, which spans
|
|
276
|
-
* the
|
|
276
|
+
* the markets where it has an open position and is scoped to none of them
|
|
277
|
+
* individually.
|
|
277
278
|
*
|
|
278
279
|
* For a cross bucket's membership read
|
|
279
280
|
* `MarginAccountSummary.selectedTradingPairIds` — it is not carried here
|
|
@@ -117,7 +117,7 @@ const CrossTransferNamesNoPairsSchema = z
|
|
|
117
117
|
code: "custom",
|
|
118
118
|
path: ["selectedTradingPairIds"],
|
|
119
119
|
message: request.marginMode === "CROSS"
|
|
120
|
-
? "selectedTradingPairIds is not accepted on a CROSS transfer: cross scope is
|
|
120
|
+
? "selectedTradingPairIds is not accepted on a CROSS transfer: cross scope is the markets where the bucket has an open position, so a funding call has nothing to declare"
|
|
121
121
|
: "selectedTradingPairIds is not supported for ISOLATED risk buckets",
|
|
122
122
|
});
|
|
123
123
|
});
|
|
@@ -207,7 +207,7 @@ const CrossSimulateNamesNoPairsSchema = z
|
|
|
207
207
|
code: "custom",
|
|
208
208
|
path: ["selectedTradingPairIds"],
|
|
209
209
|
message: request.marginMode === "CROSS"
|
|
210
|
-
? "selectedTradingPairIds is not accepted on a CROSS preview: cross scope is
|
|
210
|
+
? "selectedTradingPairIds is not accepted on a CROSS preview: cross scope is the markets where the bucket has an open position, so a preview has nothing to declare"
|
|
211
211
|
: "selectedTradingPairIds is not supported for ISOLATED risk buckets",
|
|
212
212
|
});
|
|
213
213
|
});
|
|
@@ -10,7 +10,11 @@ import type { Address } from "viem";
|
|
|
10
10
|
*
|
|
11
11
|
* Every `balance_update` carries one spot `user_balances` row. Its
|
|
12
12
|
* producer-owned `version`, when present, is scoped to the authenticated
|
|
13
|
-
* user/application and token: higher is newer, equal is idempotent. `
|
|
13
|
+
* user/application and token: higher is newer, equal is idempotent. `lock`
|
|
14
|
+
* is sent when a spot order's remainder rests on the book, and `unlock` when
|
|
15
|
+
* that lock is released (cancel, partial cancel, expiry, a replace whose
|
|
16
|
+
* replacement doesn't rest on the same row, batch cancel). Market, IOC and FOK orders never rest and send neither; a step
|
|
17
|
+
* that also fills on the row sends only its `trade` frame. `fee` and `rebate` accompany a
|
|
14
18
|
* spot fill: `fee` when a taker/application fee is charged, `rebate` when a
|
|
15
19
|
* maker rebate is credited. A collateral transfer that moves the spot wallet
|
|
16
20
|
* row (`margin_transfer_in` / `margin_transfer_out`) sends a versioned spot
|
package/dist/wire/schema.d.ts
CHANGED
|
@@ -733,8 +733,10 @@ export interface paths {
|
|
|
733
733
|
* maker add-on unchanged. Each must be between 0 and the current builder-fee
|
|
734
734
|
* cap (`builderFeeCapBps` on `GetBuildercodesConfig`) inclusive; the cap and
|
|
735
735
|
* the switches are shared by both sides. The application must be enrolled in
|
|
736
|
-
* BuilderCodes with a payout address.
|
|
737
|
-
* rolling 24 hours
|
|
736
|
+
* BuilderCodes with a payout address. The number of changes allowed in any
|
|
737
|
+
* rolling 24 hours is a limit Monaco sets (10 by default, never below 1);
|
|
738
|
+
* `changesRemaining` on `GetBuildercodesConfig` reports what is left. One
|
|
739
|
+
* call that sets both sides is one change; changes
|
|
738
740
|
* Monaco makes on the application's behalf do not count. Setting the values
|
|
739
741
|
* it already has is a no-op that succeeds and does not use up a change.
|
|
740
742
|
*
|
|
@@ -5892,7 +5894,7 @@ export interface components {
|
|
|
5892
5894
|
builderFeeCapBps?: number | null;
|
|
5893
5895
|
/**
|
|
5894
5896
|
* Format: uint32
|
|
5895
|
-
* @description Builder-fee changes this application can still make in the current rolling 24 hours (at most
|
|
5897
|
+
* @description Builder-fee changes this application can still make in the current rolling 24 hours, under the limit Monaco sets (10 by default, at most 100).
|
|
5896
5898
|
* @example 2
|
|
5897
5899
|
*/
|
|
5898
5900
|
changesRemaining?: number | null;
|
|
@@ -6144,6 +6146,10 @@ export interface components {
|
|
|
6144
6146
|
strategyKey?: string | null;
|
|
6145
6147
|
riskBucketId?: string | null;
|
|
6146
6148
|
marginMode?: string | null;
|
|
6149
|
+
/**
|
|
6150
|
+
* @description Present for cross risk-bucket summary rows: the markets where the cross
|
|
6151
|
+
* bucket has an open position, sorted by trading pair id.
|
|
6152
|
+
*/
|
|
6147
6153
|
selectedTradingPairIds?: string[] | null;
|
|
6148
6154
|
/**
|
|
6149
6155
|
* @description See `MarginAccountSummary.available_order_collateral`: the collateral
|
|
@@ -8610,7 +8616,13 @@ export interface components {
|
|
|
8610
8616
|
riskBucketId?: string | null;
|
|
8611
8617
|
/** @description Present only for risk-bucket summary rows. Values: ISOLATED, CROSS. */
|
|
8612
8618
|
marginMode?: string | null;
|
|
8613
|
-
/**
|
|
8619
|
+
/**
|
|
8620
|
+
* @description Present for cross risk-bucket summary rows: the markets where the cross
|
|
8621
|
+
* bucket has an open position, sorted by trading pair id. A market joins
|
|
8622
|
+
* once a fill's position is persisted and leaves once its last position's
|
|
8623
|
+
* close is persisted, so a position still being liquidated counts; resting
|
|
8624
|
+
* orders alone do not.
|
|
8625
|
+
*/
|
|
8614
8626
|
selectedTradingPairIds?: string[] | null;
|
|
8615
8627
|
/**
|
|
8616
8628
|
* @description The collateral still available to open NEW orders in this risk bucket:
|
|
@@ -9142,12 +9154,12 @@ export interface components {
|
|
|
9142
9154
|
/**
|
|
9143
9155
|
* Format: uuid
|
|
9144
9156
|
* @description Trading pair UUID this bucket is scoped to. Present for ISOLATED buckets;
|
|
9145
|
-
* absent for CROSS, which spans the
|
|
9146
|
-
* none of them individually — the same invariant the
|
|
9147
|
-
* enforces by rejecting a `trading_pair_id` in CROSS
|
|
9148
|
-
* bucket's membership from
|
|
9149
|
-
* it is not carried here
|
|
9150
|
-
* this endpoint an extra query per request.
|
|
9157
|
+
* absent for CROSS, which spans the markets where it has an open position and
|
|
9158
|
+
* is scoped to none of them individually — the same invariant the
|
|
9159
|
+
* transfer-in endpoint enforces by rejecting a `trading_pair_id` in CROSS
|
|
9160
|
+
* mode. Read the cross bucket's membership from
|
|
9161
|
+
* `MarginAccountSummary.selected_trading_pair_ids`; it is not carried here
|
|
9162
|
+
* because deriving it would cost this endpoint an extra query per request.
|
|
9151
9163
|
*
|
|
9152
9164
|
* These labels do NOT make this response row-for-row joinable with the
|
|
9153
9165
|
* margin-accounts surface on (mode, pair). That surface emits rows this one
|
|
@@ -10322,7 +10334,7 @@ export interface components {
|
|
|
10322
10334
|
previousBuilderFeeBps?: number | null;
|
|
10323
10335
|
/**
|
|
10324
10336
|
* Format: uint32
|
|
10325
|
-
* @description Builder-fee changes this application can still make in the current rolling 24 hours (at most
|
|
10337
|
+
* @description Builder-fee changes this application can still make in the current rolling 24 hours, under the limit Monaco sets (10 by default, at most 100).
|
|
10326
10338
|
* @example 1
|
|
10327
10339
|
*/
|
|
10328
10340
|
changesRemaining?: number | null;
|
|
@@ -10523,14 +10535,10 @@ export interface components {
|
|
|
10523
10535
|
marginMode?: string | null;
|
|
10524
10536
|
/**
|
|
10525
10537
|
* @description The cross scope the preview ran against; absent for isolated previews and
|
|
10526
|
-
* never a request's deprecated list
|
|
10527
|
-
*
|
|
10528
|
-
*
|
|
10529
|
-
*
|
|
10530
|
-
* position in that bucket, and the previewed pair — the previewed pair alone
|
|
10531
|
-
* before the first cross order. `SimulateOrderRisk` and
|
|
10532
|
-
* `SimulateParentMarginOrderRisk` report the recorded pairs plus the
|
|
10533
|
-
* previewed pair.
|
|
10538
|
+
* never a request's deprecated list: the markets where the active cross
|
|
10539
|
+
* bucket has an open position, sorted by trading pair id, then the previewed
|
|
10540
|
+
* pair when it is not already among them — the previewed pair alone when no
|
|
10541
|
+
* cross bucket is active yet.
|
|
10534
10542
|
*/
|
|
10535
10543
|
selectedTradingPairIds?: string[] | null;
|
|
10536
10544
|
/**
|
|
@@ -10634,7 +10642,7 @@ export interface components {
|
|
|
10634
10642
|
marginMode?: string | null;
|
|
10635
10643
|
/**
|
|
10636
10644
|
* @deprecated
|
|
10637
|
-
* @description Deprecated: accepted and ignored. Cross scope is
|
|
10645
|
+
* @description Deprecated: accepted and ignored. Cross scope is the markets where the cross bucket has an open position, so a cross preview has nothing to declare: it runs against the account's active cross bucket — or the deterministic bucket a first cross order would create — and the previewed pair is in scope by construction. Rejected for ISOLATED, as before. The response's selectedTradingPairIds reports that scope plus the previewed pair, never this list.
|
|
10638
10646
|
*/
|
|
10639
10647
|
selectedTradingPairIds?: string[] | null;
|
|
10640
10648
|
/**
|
|
@@ -11265,11 +11273,9 @@ export interface components {
|
|
|
11265
11273
|
/** @description Present when collateral was allocated to a risk bucket. Values: ISOLATED, CROSS. */
|
|
11266
11274
|
marginMode?: string | null;
|
|
11267
11275
|
/**
|
|
11268
|
-
* @description The cross bucket's
|
|
11269
|
-
*
|
|
11270
|
-
*
|
|
11271
|
-
* its positions close. Only on cross risk-bucket transfers, and omitted
|
|
11272
|
-
* while empty — i.e. until a cross order on the bucket has filled.
|
|
11276
|
+
* @description The cross bucket's scope: the markets where it has an open position,
|
|
11277
|
+
* sorted by trading pair id. Only on cross risk-bucket transfers, and
|
|
11278
|
+
* omitted while empty — i.e. while the bucket has no open position.
|
|
11273
11279
|
*/
|
|
11274
11280
|
selectedTradingPairIds?: string[] | null;
|
|
11275
11281
|
/**
|
|
@@ -11301,14 +11307,13 @@ export interface components {
|
|
|
11301
11307
|
strategyKey?: string | null;
|
|
11302
11308
|
/**
|
|
11303
11309
|
* @description Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS. A CROSS
|
|
11304
|
-
* transfer names no pairs: the cross bucket's scope is
|
|
11305
|
-
*
|
|
11306
|
-
* close — so funding the bucket has nothing to declare.
|
|
11310
|
+
* transfer names no pairs: the cross bucket's scope is the markets where it
|
|
11311
|
+
* has an open position, so funding the bucket has nothing to declare.
|
|
11307
11312
|
*/
|
|
11308
11313
|
marginMode?: string | null;
|
|
11309
11314
|
/**
|
|
11310
11315
|
* @deprecated
|
|
11311
|
-
* @description Deprecated: accepted and ignored. Cross scope is
|
|
11316
|
+
* @description Deprecated: accepted and ignored. Cross scope is the markets where the cross bucket has an open position, so a cross transfer-in has nothing to declare and can no longer replace the scope. Rejected for ISOLATED, as before. Read the current scope from the cross bucket's row in the margin-accounts list or from this response's selectedTradingPairIds; the parent row carries no scope.
|
|
11312
11317
|
*/
|
|
11313
11318
|
selectedTradingPairIds?: string[] | null;
|
|
11314
11319
|
/**
|
|
@@ -13929,7 +13934,7 @@ export interface operations {
|
|
|
13929
13934
|
};
|
|
13930
13935
|
content?: never;
|
|
13931
13936
|
};
|
|
13932
|
-
/** @description The application is not enrolled in BuilderCodes with a payout address, or it has already
|
|
13937
|
+
/** @description The application is not enrolled in BuilderCodes with a payout address, or it has already used every change the limit allows in the last 24 hours; the latter carries `details.nextChangeAllowedAt` (gRPC: FAILED_PRECONDITION) */
|
|
13933
13938
|
409: {
|
|
13934
13939
|
headers: {
|
|
13935
13940
|
[name: string]: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xmonaco/types",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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.1.
|
|
19
|
+
"@0xmonaco/contracts": "1.1.2",
|
|
20
20
|
"zod": "^4.6.7"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|