@0xmonaco/types 1.0.41 → 1.0.42

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.
@@ -123,6 +123,13 @@ export interface GetCandlesticksParams {
123
123
  endTime?: number;
124
124
  /** Maximum number of bars to return (max: 500, server defaults to 350 if omitted) */
125
125
  limit?: number;
126
+ /**
127
+ * Price series to chart. `"trade"` (default) returns the trade-derived OHLCV
128
+ * series; `"mark"` returns the mark-price series (margin pairs only), where
129
+ * each candle's open/high/low/close are the bucket's closing mark and volume
130
+ * is 0. Omit for the trade series.
131
+ */
132
+ priceType?: "trade" | "mark";
126
133
  }
127
134
  /**
128
135
  * Query parameters for fetching trading pairs
@@ -171,6 +171,10 @@ export declare const GetCandlesticksByPairIdSchema: z.ZodObject<{
171
171
  startTime: z.ZodOptional<z.ZodNumber>;
172
172
  endTime: z.ZodOptional<z.ZodNumber>;
173
173
  limit: z.ZodOptional<z.ZodNumber>;
174
+ priceType: z.ZodOptional<z.ZodEnum<{
175
+ trade: "trade";
176
+ mark: "mark";
177
+ }>>;
174
178
  }, z.core.$strip>;
175
179
  /**
176
180
  * @deprecated Use GetCandlesticksByPairIdSchema instead. Symbol-based lookups are no longer supported.
@@ -191,6 +195,10 @@ export declare const GetCandlesticksBySymbolSchema: z.ZodObject<{
191
195
  startTime: z.ZodOptional<z.ZodNumber>;
192
196
  endTime: z.ZodOptional<z.ZodNumber>;
193
197
  limit: z.ZodOptional<z.ZodNumber>;
198
+ priceType: z.ZodOptional<z.ZodEnum<{
199
+ trade: "trade";
200
+ mark: "mark";
201
+ }>>;
194
202
  }, z.core.$strip>;
195
203
  /**
196
204
  * Get Trading Pair validation schema
@@ -188,6 +188,7 @@ export const GetCandlesticksByPairIdSchema = z
188
188
  startTime: TimestampSchema.optional(),
189
189
  endTime: TimestampSchema.optional(),
190
190
  limit: CandlestickLimitSchema,
191
+ priceType: z.enum(["trade", "mark"]).optional(),
191
192
  })
192
193
  .refine((data) => {
193
194
  // Only validate startTime < endTime if both are provided
@@ -2,6 +2,7 @@ export * from "./account-events";
2
2
  export * from "./balance-events";
3
3
  export * from "./conditional-order-events";
4
4
  export * from "./liquidation-events";
5
+ export * from "./market-stats-events";
5
6
  export * from "./movement-events";
6
7
  export * from "./ohlcv-events";
7
8
  export * from "./orderbook-events";
@@ -2,6 +2,7 @@ export * from "./account-events";
2
2
  export * from "./balance-events";
3
3
  export * from "./conditional-order-events";
4
4
  export * from "./liquidation-events";
5
+ export * from "./market-stats-events";
5
6
  export * from "./movement-events";
6
7
  export * from "./ohlcv-events";
7
8
  export * from "./orderbook-events";
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Market-stats WebSocket Event Types
3
+ *
4
+ * Types for the two real-time market statistics channels:
5
+ * - per-market (`market_stats:<tradingPairId>`): a full stats frame for one
6
+ * market, carried by `MarketStatsEvent`.
7
+ * - all-markets (`market_stats`): one summary row per market in a single frame,
8
+ * carried by `MarketStatsAllEvent`.
9
+ *
10
+ * Both are public channels (no authentication). Lag policy is Conflate: a
11
+ * lagging subscriber is fast-forwarded to the latest frame rather than
12
+ * disconnected. Each frame carries the market's full current stats, so consume
13
+ * it as a terminal-state snapshot, never as an additive delta.
14
+ *
15
+ * Perp-only fields (index/mark price, open interest, funding) are optional and
16
+ * omitted on the wire for spot markets, which have no positions or funding.
17
+ * All numeric quantities are decimal strings except `fundingTimestamp`, which
18
+ * is a millisecond epoch number.
19
+ */
20
+ /**
21
+ * Market tradability label, derived from the oracle market status. Spot markets
22
+ * only emit `TRADABLE` or `HALTED`.
23
+ */
24
+ export type MarketStatus = "TRADABLE" | "POST_ONLY" | "HALTED" | "NOT_READY" | "UNKNOWN";
25
+ /**
26
+ * Full per-market statistics for the `market_stats:<tradingPairId>` channel.
27
+ */
28
+ export interface MarketStatsData {
29
+ /** Market symbol, e.g. "BTC/USDC" */
30
+ symbol: string;
31
+ /** Trading pair identifier (UUID) */
32
+ tradingPairId: string;
33
+ /** Oracle index price (decimal string). Perp-only; omitted for spot. */
34
+ indexPrice?: string;
35
+ /** Mark price (decimal string). Perp-only; omitted for spot. */
36
+ markPrice?: string;
37
+ /** Mid price between best bid and best ask (decimal string) */
38
+ midPrice?: string;
39
+ /** Best bid price (decimal string) */
40
+ bestBidPrice?: string;
41
+ /** Best ask price (decimal string) */
42
+ bestAskPrice?: string;
43
+ /** Open interest (decimal string). Perp-only; omitted for spot. */
44
+ openInterest?: string;
45
+ /** Open interest limit (decimal string). Perp-only; omitted for spot. */
46
+ openInterestLimit?: string;
47
+ /** Last trade price (decimal string) */
48
+ lastTradePrice?: string;
49
+ /** 24h base-token volume (decimal string) */
50
+ dailyBaseTokenVolume?: string;
51
+ /** 24h quote-token volume (decimal string) */
52
+ dailyQuoteTokenVolume?: string;
53
+ /** 24h low price (decimal string) */
54
+ dailyPriceLow?: string;
55
+ /** 24h high price (decimal string) */
56
+ dailyPriceHigh?: string;
57
+ /** 24h absolute price change, `latestClose - open24hAgo` (decimal string) */
58
+ dailyPriceChange?: string;
59
+ /** 24h percentage price change, two decimals (decimal string) */
60
+ dailyPriceChangePercent?: string;
61
+ /** Current (last settled) funding rate (decimal string). Perp-only; omitted for spot. */
62
+ currentFundingRate?: string;
63
+ /** Estimated next-window funding rate (decimal string). Perp-only; omitted for spot. */
64
+ fundingRate?: string;
65
+ /** Next funding time as a millisecond epoch. Perp-only; omitted for spot. */
66
+ fundingTimestamp?: number;
67
+ /** Funding premium (decimal string). Perp-only; omitted for spot. */
68
+ premium?: string;
69
+ /** Base interest rate for the funding formula (decimal string). Perp-only; omitted for spot. */
70
+ baseInterestRate?: string;
71
+ /** Live funding cap, lower bound (decimal string). Perp-only; omitted for spot. */
72
+ fundingClampSmall?: string;
73
+ /** Live funding cap, upper bound (decimal string). Perp-only; omitted for spot. */
74
+ fundingClampBig?: string;
75
+ }
76
+ /**
77
+ * Per-market statistics event on the `market_stats:<tradingPairId>` channel.
78
+ */
79
+ export interface MarketStatsEvent {
80
+ /** Trading pair identifier (UUID) */
81
+ tradingPairId: string;
82
+ /** Market statistics for this pair */
83
+ data: MarketStatsData;
84
+ }
85
+ /**
86
+ * A single market's row in the all-markets summary frame. A lighter shape than
87
+ * {@link MarketStatsData}: enough to render a markets table.
88
+ */
89
+ export interface MarketStatsSummary {
90
+ /** Trading pair identifier (UUID) */
91
+ tradingPairId: string;
92
+ /** Market symbol, e.g. "BTC/USDC" */
93
+ symbol: string;
94
+ /** Last trade price (decimal string) */
95
+ lastTradePrice?: string;
96
+ /** Mark price (decimal string). Perp-only; omitted for spot. */
97
+ markPrice?: string;
98
+ /** 24h absolute price change (decimal string) */
99
+ dailyPriceChange?: string;
100
+ /** 24h percentage price change, two decimals (decimal string) */
101
+ dailyPriceChangePercent?: string;
102
+ /** 24h base-token volume (decimal string) */
103
+ dailyBaseTokenVolume?: string;
104
+ /** 24h quote-token volume (decimal string) */
105
+ dailyQuoteTokenVolume?: string;
106
+ /** 24h high price (decimal string) */
107
+ dailyPriceHigh?: string;
108
+ /** 24h low price (decimal string) */
109
+ dailyPriceLow?: string;
110
+ /** Open interest (decimal string). Perp-only; omitted for spot. */
111
+ openInterest?: string;
112
+ /** Current (last settled) funding rate (decimal string). Perp-only; omitted for spot. */
113
+ currentFundingRate?: string;
114
+ /** Next funding time as a millisecond epoch. Perp-only; omitted for spot. */
115
+ fundingTimestamp?: number;
116
+ /** Tradability label (always present) */
117
+ marketStatus: MarketStatus;
118
+ }
119
+ /**
120
+ * All-markets summary event on the `market_stats` channel: one
121
+ * {@link MarketStatsSummary} per market, in a single frame per push.
122
+ */
123
+ export interface MarketStatsAllEvent {
124
+ /** One summary row per market */
125
+ markets: MarketStatsSummary[];
126
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Market-stats WebSocket Event Types
3
+ *
4
+ * Types for the two real-time market statistics channels:
5
+ * - per-market (`market_stats:<tradingPairId>`): a full stats frame for one
6
+ * market, carried by `MarketStatsEvent`.
7
+ * - all-markets (`market_stats`): one summary row per market in a single frame,
8
+ * carried by `MarketStatsAllEvent`.
9
+ *
10
+ * Both are public channels (no authentication). Lag policy is Conflate: a
11
+ * lagging subscriber is fast-forwarded to the latest frame rather than
12
+ * disconnected. Each frame carries the market's full current stats, so consume
13
+ * it as a terminal-state snapshot, never as an additive delta.
14
+ *
15
+ * Perp-only fields (index/mark price, open interest, funding) are optional and
16
+ * omitted on the wire for spot markets, which have no positions or funding.
17
+ * All numeric quantities are decimal strings except `fundingTimestamp`, which
18
+ * is a millisecond epoch number.
19
+ */
@@ -9397,6 +9397,8 @@ export interface operations {
9397
9397
  endTime?: number;
9398
9398
  /** @description Max candles to return (max 1000) */
9399
9399
  limit?: number;
9400
+ /** @description Price series to chart: trade (default, trade-derived OHLCV) or mark (mark-price series, margin pairs only; each candle's open/high/low/close are the bucket's closing mark and volume is 0) */
9401
+ priceType?: "trade" | "mark";
9400
9402
  };
9401
9403
  header?: never;
9402
9404
  path: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "lint": "biome lint ."
21
21
  },
22
22
  "dependencies": {
23
- "@0xmonaco/contracts": "1.0.41",
23
+ "@0xmonaco/contracts": "1.0.42",
24
24
  "zod": "^4.1.12"
25
25
  },
26
26
  "peerDependencies": {