@0xmonaco/types 1.0.44 → 1.0.45

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.
@@ -89,6 +89,18 @@ export interface Position {
89
89
  * included. Terminal rows only; absent when unavailable.
90
90
  */
91
91
  feesPaid?: string;
92
+ /**
93
+ * Total lifetime trading fees for the position: opening-fill fees plus every
94
+ * reducing execution's fees — decreases, close, and any liquidation penalty.
95
+ * Signed; negative means net rebated, inclusive of the application-fee
96
+ * component. Unlike `feesPaid` (the closing-side reducing-execution portion,
97
+ * which omits opening fills) this is the whole-life figure, on open and
98
+ * terminal rows alike. Null when the opening-fill fees are unavailable —
99
+ * before the position's first PnL sample flushes, after its samples age out
100
+ * of PnL retention, or for positions predating the PnL service — rather than
101
+ * an understated partial.
102
+ */
103
+ cumFees?: string;
92
104
  }
93
105
  export interface ListPositionsParams {
94
106
  marginAccountId?: string;
@@ -1,6 +1,7 @@
1
1
  export * from "./account-events";
2
2
  export * from "./balance-events";
3
3
  export * from "./conditional-order-events";
4
+ export * from "./instrument-events";
4
5
  export * from "./liquidation-events";
5
6
  export * from "./market-stats-events";
6
7
  export * from "./movement-events";
@@ -1,6 +1,7 @@
1
1
  export * from "./account-events";
2
2
  export * from "./balance-events";
3
3
  export * from "./conditional-order-events";
4
+ export * from "./instrument-events";
4
5
  export * from "./liquidation-events";
5
6
  export * from "./market-stats-events";
6
7
  export * from "./movement-events";
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Instrument WebSocket Event Types
3
+ *
4
+ * Types for the public `instrument` channel: trading-pair lifecycle and
5
+ * configuration changes — new listings, delistings, halts/unhalts, and edits to
6
+ * tick size, quantity step, order-size bounds, or (for perp markets) leverage
7
+ * and margin-rate bounds.
8
+ *
9
+ * This is a public channel (no authentication). Lag policy is Conflate: a
10
+ * lagging subscriber is fast-forwarded to the latest frame rather than
11
+ * disconnected. Every frame carries the market's FULL current configuration
12
+ * (not just the changed fields), so consume it as a terminal-state snapshot per
13
+ * market and never as an additive delta; `changedFields` names which fields the
14
+ * mutation touched, for callers that want to react selectively.
15
+ *
16
+ * A subscriber receives a subscribe-time snapshot of the current active-pair
17
+ * configuration list (each frame a `Listing` baseline) before the live diffs.
18
+ *
19
+ * Perp-only fields (`maxLeverage`, `initialMarginRate`, `maintenanceMarginRate`)
20
+ * are optional and omitted on the wire for spot markets, which have no leverage
21
+ * or margin parameters. All numeric quantities are decimal strings.
22
+ */
23
+ /**
24
+ * The kind of instrument change a frame reports.
25
+ *
26
+ * - `listing`: a market became tradable (created active, or re-activated).
27
+ * - `delisting`: a market was deactivated (`isActive` toggled false, or created
28
+ * inactive).
29
+ * - `halt` / `unhalt`: trading was halted / resumed. Reserved for a future
30
+ * market-regime producer; not emitted by admin trading-pair mutations.
31
+ * - `config_change`: a non-activation config edit (tick size, step size,
32
+ * order-size bounds, category, or leverage/margin bounds).
33
+ */
34
+ export type InstrumentChangeKind = "listing" | "delisting" | "halt" | "unhalt" | "config_change";
35
+ /**
36
+ * Full current configuration for a market on the `instrument` channel.
37
+ */
38
+ export interface InstrumentEventData {
39
+ /** What changed for this market */
40
+ change: InstrumentChangeKind;
41
+ /** Trading pair identifier (UUID) */
42
+ tradingPairId: string;
43
+ /** Market symbol, e.g. "BTC/USDC" */
44
+ symbol: string;
45
+ /** Whether the market is currently active (tradable) */
46
+ isActive: boolean;
47
+ /** Price tick size (decimal string) */
48
+ tickSize: string;
49
+ /** Quantity step size (decimal string) */
50
+ quantityStepSize: string;
51
+ /** Minimum order size (decimal string) */
52
+ minOrderSize: string;
53
+ /** Maximum order size (decimal string) */
54
+ maxOrderSize: string;
55
+ /** Market type, e.g. "spot" or "margin" */
56
+ marketType: string;
57
+ /** Asset-class category, e.g. "crypto", "equities", "commodities" */
58
+ category: string;
59
+ /** Maximum leverage (decimal string). Perp-only; omitted for spot. */
60
+ maxLeverage?: string;
61
+ /** Initial margin rate (decimal string). Perp-only; omitted for spot. */
62
+ initialMarginRate?: string;
63
+ /** Maintenance margin rate (decimal string). Perp-only; omitted for spot. */
64
+ maintenanceMarginRate?: string;
65
+ /** Names of the fields this mutation touched (snake_case wire field names) */
66
+ changedFields: string[];
67
+ /** Timestamp when the configuration was last updated (ISO 8601) */
68
+ updatedAt: string;
69
+ }
70
+ /**
71
+ * Instrument event on the `instrument:<tradingPairId>` channel (or the
72
+ * all-markets `instrument` channel, which streams one event per market).
73
+ */
74
+ export interface InstrumentEvent {
75
+ /** Trading pair identifier (UUID) */
76
+ tradingPairId: string;
77
+ /** Current market configuration */
78
+ data: InstrumentEventData;
79
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Instrument WebSocket Event Types
3
+ *
4
+ * Types for the public `instrument` channel: trading-pair lifecycle and
5
+ * configuration changes — new listings, delistings, halts/unhalts, and edits to
6
+ * tick size, quantity step, order-size bounds, or (for perp markets) leverage
7
+ * and margin-rate bounds.
8
+ *
9
+ * This is a public channel (no authentication). Lag policy is Conflate: a
10
+ * lagging subscriber is fast-forwarded to the latest frame rather than
11
+ * disconnected. Every frame carries the market's FULL current configuration
12
+ * (not just the changed fields), so consume it as a terminal-state snapshot per
13
+ * market and never as an additive delta; `changedFields` names which fields the
14
+ * mutation touched, for callers that want to react selectively.
15
+ *
16
+ * A subscriber receives a subscribe-time snapshot of the current active-pair
17
+ * configuration list (each frame a `Listing` baseline) before the live diffs.
18
+ *
19
+ * Perp-only fields (`maxLeverage`, `initialMarginRate`, `maintenanceMarginRate`)
20
+ * are optional and omitted on the wire for spot markets, which have no leverage
21
+ * or margin parameters. All numeric quantities are decimal strings.
22
+ */
@@ -4775,6 +4775,19 @@ export interface components {
4775
4775
  * executions do not account for its whole lifetime.
4776
4776
  */
4777
4777
  feesPaid?: string | null;
4778
+ /**
4779
+ * @description Total lifetime trading fees for the position: opening-fill fees (from the
4780
+ * PnL cost-basis engine) plus every reducing execution's fees — decreases,
4781
+ * close, and any liquidation penalty. Signed; negative means net rebated,
4782
+ * inclusive of the application-fee component. Unlike the closing-side
4783
+ * reducing-execution fee field above, which omits opening fills, this is the
4784
+ * whole-life figure, on open and terminal rows alike.
4785
+ * Null when the opening-fill fees are unavailable — before the position's
4786
+ * first PnL sample flushes, after its samples age out of PnL retention, or
4787
+ * for positions predating the PnL service — rather than an understated
4788
+ * partial.
4789
+ */
4790
+ cumFees?: string | null;
4778
4791
  };
4779
4792
  GetPositionRiskResponse: {
4780
4793
  positionId?: string | null;
@@ -6075,6 +6088,19 @@ export interface components {
6075
6088
  * executions do not account for its whole lifetime.
6076
6089
  */
6077
6090
  feesPaid?: string | null;
6091
+ /**
6092
+ * @description Total lifetime trading fees for the position: opening-fill fees (from the
6093
+ * PnL cost-basis engine) plus every reducing execution's fees — decreases,
6094
+ * close, and any liquidation penalty. Signed; negative means net rebated,
6095
+ * inclusive of the application-fee component. Unlike the closing-side
6096
+ * reducing-execution fee field above, which omits opening fills, this is the
6097
+ * whole-life figure, on open and terminal rows alike.
6098
+ * Null when the opening-fill fees are unavailable — before the position's
6099
+ * first PnL sample flushes, after its samples age out of PnL retention, or
6100
+ * for positions predating the PnL service — rather than an understated
6101
+ * partial.
6102
+ */
6103
+ cumFees?: string | null;
6078
6104
  };
6079
6105
  PositionHistoryEvent: {
6080
6106
  id?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "type": "module",
5
5
  "homepage": "https://docs.0xmonaco.com/sdk/typescript",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "lint": "biome lint ."
17
17
  },
18
18
  "dependencies": {
19
- "@0xmonaco/contracts": "1.0.44",
19
+ "@0xmonaco/contracts": "1.0.45",
20
20
  "zod": "^4.1.12"
21
21
  },
22
22
  "peerDependencies": {