@0xmonaco/types 1.1.0 → 1.1.2-develop.3a25169

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 CHANGED
@@ -237,8 +237,6 @@ interface TradingPair {
237
237
  marketType: TradingMode;
238
238
  category: string;
239
239
  isActive: boolean;
240
- makerFeeBps: number;
241
- takerFeeBps: number;
242
240
  minOrderSize: string;
243
241
  maxOrderSize: string;
244
242
  quantityStepSize: string;
@@ -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(2),
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(2),
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 derived from trading — a pair joins the bucket when a
284
- * cross order on it succeeds and leaves when its positions close — so funding
285
- * has nothing to declare. Read the current scope from the cross bucket's row
286
- * in `listMarginAccounts()` (`selectedTradingPairIds`) or from this call's
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 derived from trading — a pair joins the bucket when
430
- * a cross order on it succeeds and, once its positions close, stays listed
431
- * until a later successful cross order on another pair reconciles the bucket —
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. From `simulateRiskBucketOrderRisk` in CROSS mode it
470
- * is the DERIVED scope: the active cross bucket's recorded pairs (a pair
471
- * whose positions have closed stays recorded until a later cross order on
472
- * another pair reconciles the bucket), every pair with an open position in
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;
@@ -54,10 +54,6 @@ export interface TradingPair {
54
54
  * `CROSS_MARGIN_NOT_ALLOWED`; open the position with `marginMode: "ISOLATED"`.
55
55
  */
56
56
  isolatedOnly: boolean;
57
- /** Maker fee in basis points */
58
- makerFeeBps: number;
59
- /** Taker fee in basis points */
60
- takerFeeBps: number;
61
57
  /** Minimum order size */
62
58
  minOrderSize: string;
63
59
  /** Maximum order size */
@@ -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 pairs selected into it and is scoped to none of them individually.
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
@@ -602,10 +602,6 @@ export interface UserProfile {
602
602
  accountType: string;
603
603
  /** Whether the user can withdraw funds */
604
604
  canWithdraw: boolean;
605
- /** Taker fee rate in basis points */
606
- takerFeeBps: number;
607
- /** Maker fee rate in basis points */
608
- makerFeeBps: number;
609
605
  /** Account creation timestamp (ISO string) */
610
606
  createdAt: string;
611
607
  /** Additional taker fee in basis points contributed by the application (if any) */
@@ -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 derived from trading, so a funding call has nothing to declare"
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 derived from trading, so a preview has nothing to declare"
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. `fee` and `rebate` accompany a
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
@@ -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. At most two changes are allowed in any
737
- * rolling 24 hours, and one call that sets both sides is one change; changes
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 2).
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
@@ -7237,20 +7243,6 @@ export interface components {
7237
7243
  * @example 2023-11-13T10:30:00Z
7238
7244
  */
7239
7245
  createdAt?: string | null;
7240
- /**
7241
- * Format: int32
7242
- * @deprecated
7243
- * @description DEPRECATED: legacy flat maker fee in bps echoed from the trading pair. Does NOT reflect the tiered fee actually charged, which is per-user and fractional. Call GET /api/v1/fees/tier for the caller's real rate.
7244
- * @example -1
7245
- */
7246
- makerFeeBps?: number | null;
7247
- /**
7248
- * Format: int32
7249
- * @deprecated
7250
- * @description DEPRECATED: legacy flat taker fee in bps echoed from the trading pair. Does NOT reflect the tiered fee actually charged, which is per-user and fractional. Call GET /api/v1/fees/tier for the caller's real rate.
7251
- * @example 5
7252
- */
7253
- takerFeeBps?: number | null;
7254
7246
  /**
7255
7247
  * Format: int32
7256
7248
  * @description Additional taker fee in basis points from application
@@ -8610,7 +8602,13 @@ export interface components {
8610
8602
  riskBucketId?: string | null;
8611
8603
  /** @description Present only for risk-bucket summary rows. Values: ISOLATED, CROSS. */
8612
8604
  marginMode?: string | null;
8613
- /** @description Present for cross risk-bucket summary rows. */
8605
+ /**
8606
+ * @description Present for cross risk-bucket summary rows: the markets where the cross
8607
+ * bucket has an open position, sorted by trading pair id. A market joins
8608
+ * once a fill's position is persisted and leaves once its last position's
8609
+ * close is persisted, so a position still being liquidated counts; resting
8610
+ * orders alone do not.
8611
+ */
8614
8612
  selectedTradingPairIds?: string[] | null;
8615
8613
  /**
8616
8614
  * @description The collateral still available to open NEW orders in this risk bucket:
@@ -9142,12 +9140,12 @@ export interface components {
9142
9140
  /**
9143
9141
  * Format: uuid
9144
9142
  * @description Trading pair UUID this bucket is scoped to. Present for ISOLATED buckets;
9145
- * absent for CROSS, which spans the pairs selected into it and is scoped to
9146
- * none of them individually — the same invariant the transfer-in endpoint
9147
- * enforces by rejecting a `trading_pair_id` in CROSS mode. Read the cross
9148
- * bucket's membership from `MarginAccountSummary.selected_trading_pair_ids`;
9149
- * it is not carried here because it lives in a separate table and would cost
9150
- * this endpoint an extra query per request.
9143
+ * absent for CROSS, which spans the markets where it has an open position and
9144
+ * is scoped to none of them individually — the same invariant the
9145
+ * transfer-in endpoint enforces by rejecting a `trading_pair_id` in CROSS
9146
+ * mode. Read the cross bucket's membership from
9147
+ * `MarginAccountSummary.selected_trading_pair_ids`; it is not carried here
9148
+ * because deriving it would cost this endpoint an extra query per request.
9151
9149
  *
9152
9150
  * These labels do NOT make this response row-for-row joinable with the
9153
9151
  * margin-accounts surface on (mode, pair). That surface emits rows this one
@@ -10322,7 +10320,7 @@ export interface components {
10322
10320
  previousBuilderFeeBps?: number | null;
10323
10321
  /**
10324
10322
  * Format: uint32
10325
- * @description Builder-fee changes this application can still make in the current rolling 24 hours (at most 2).
10323
+ * @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
10324
  * @example 1
10327
10325
  */
10328
10326
  changesRemaining?: number | null;
@@ -10523,14 +10521,10 @@ export interface components {
10523
10521
  marginMode?: string | null;
10524
10522
  /**
10525
10523
  * @description The cross scope the preview ran against; absent for isolated previews and
10526
- * never a request's deprecated list. `SimulateRiskBucketOrderRisk` in CROSS
10527
- * mode reports the DERIVED scope: the active cross bucket's recorded pairs
10528
- * (a pair whose positions have closed stays recorded until a later cross
10529
- * order on another pair reconciles the bucket), every pair with an open
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.
10524
+ * never a request's deprecated list: the markets where the active cross
10525
+ * bucket has an open position, sorted by trading pair id, then the previewed
10526
+ * pair when it is not already among them — the previewed pair alone when no
10527
+ * cross bucket is active yet.
10534
10528
  */
10535
10529
  selectedTradingPairIds?: string[] | null;
10536
10530
  /**
@@ -10634,7 +10628,7 @@ export interface components {
10634
10628
  marginMode?: string | null;
10635
10629
  /**
10636
10630
  * @deprecated
10637
- * @description Deprecated: accepted and ignored. Cross scope is derived from trading (a pair joins the cross bucket when a cross order on it succeeds; after its positions close it stays listed until a later successful cross order on another pair reconciles the bucket), 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 the derived scope (recorded pairs, pairs with open positions in the bucket, and the previewed pair), never this list.
10631
+ * @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
10632
  */
10639
10633
  selectedTradingPairIds?: string[] | null;
10640
10634
  /**
@@ -11016,13 +11010,6 @@ export interface components {
11016
11010
  * @example true
11017
11011
  */
11018
11012
  isActive?: boolean | null;
11019
- /**
11020
- * Format: int32
11021
- * @deprecated
11022
- * @description DEPRECATED: legacy flat maker fee in bps (negative = rebate). This is the pre-tiered pair-level rate and does NOT reflect the tiered fee actually charged, which is per-user and fractional. Do not display this as the user's fee — call GET /api/v1/fees/tier for the caller's real rate.
11023
- * @example -2
11024
- */
11025
- makerFeeBps?: number | null;
11026
11013
  /**
11027
11014
  * @description Market type: SPOT or MARGIN
11028
11015
  * @example SPOT
@@ -11070,13 +11057,6 @@ export interface components {
11070
11057
  * @example BTC/USDC
11071
11058
  */
11072
11059
  symbol?: string | null;
11073
- /**
11074
- * Format: int32
11075
- * @deprecated
11076
- * @description DEPRECATED: legacy flat taker fee in bps. This is the pre-tiered pair-level rate and does NOT reflect the tiered fee actually charged, which is per-user and fractional. Do not display this as the user's fee — call GET /api/v1/fees/tier for the caller's real rate.
11077
- * @example 10
11078
- */
11079
- takerFeeBps?: number | null;
11080
11060
  /**
11081
11061
  * @description Minimum price increment
11082
11062
  * @example 0.01
@@ -11265,11 +11245,9 @@ export interface components {
11265
11245
  /** @description Present when collateral was allocated to a risk bucket. Values: ISOLATED, CROSS. */
11266
11246
  marginMode?: string | null;
11267
11247
  /**
11268
- * @description The cross bucket's recorded pair scope: what trading has recorded (a pair
11269
- * joins when a cross order on it fills and leaves when its positions close),
11270
- * plus any pair declared before scope became derived, until it trades and
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.
11248
+ * @description The cross bucket's scope: the markets where it has an open position,
11249
+ * sorted by trading pair id. Only on cross risk-bucket transfers, and
11250
+ * omitted while empty — i.e. while the bucket has no open position.
11273
11251
  */
11274
11252
  selectedTradingPairIds?: string[] | null;
11275
11253
  /**
@@ -11301,14 +11279,13 @@ export interface components {
11301
11279
  strategyKey?: string | null;
11302
11280
  /**
11303
11281
  * @description Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS. A CROSS
11304
- * transfer names no pairs: the cross bucket's scope is derived from trading —
11305
- * a pair joins when a cross order on it succeeds and leaves when its positions
11306
- * close — so funding the bucket has nothing to declare.
11282
+ * transfer names no pairs: the cross bucket's scope is the markets where it
11283
+ * has an open position, so funding the bucket has nothing to declare.
11307
11284
  */
11308
11285
  marginMode?: string | null;
11309
11286
  /**
11310
11287
  * @deprecated
11311
- * @description Deprecated: accepted and ignored. Cross scope is derived from trading (a pair joins the cross bucket when a cross order on it succeeds; after its positions close it stays listed until a later successful cross order on another pair reconciles the bucket), 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. Pairs declared before scope became derived stay recorded until they trade and their positions close.
11288
+ * @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
11289
  */
11313
11290
  selectedTradingPairIds?: string[] | null;
11314
11291
  /**
@@ -13929,7 +13906,7 @@ export interface operations {
13929
13906
  };
13930
13907
  content?: never;
13931
13908
  };
13932
- /** @description The application is not enrolled in BuilderCodes with a payout address, or it has already made two changes in the last 24 hours; the latter carries `details.nextChangeAllowedAt` (gRPC: FAILED_PRECONDITION) */
13909
+ /** @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
13910
  409: {
13934
13911
  headers: {
13935
13912
  [name: string]: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.1.0",
3
+ "version": "1.1.2-develop.3a25169",
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.0",
19
+ "@0xmonaco/contracts": "1.1.2-develop.3a25169",
20
20
  "zod": "^4.6.7"
21
21
  },
22
22
  "peerDependencies": {