@0xmonaco/types 0.3.1 → 0.3.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.
@@ -4,6 +4,17 @@
4
4
  import type { TradingMode } from "@0xmonaco/types/trading";
5
5
  import type { BaseWebSocketClient } from "../base";
6
6
  import type { OrderbookEvent } from "../events/orderbook-events";
7
+ /**
8
+ * Quotation mode for orderbook subscription.
9
+ *
10
+ * - "BASE": Prices are displayed in the quote currency per unit of the base currency.
11
+ * For example, for the BTC/USD market, prices are shown as USD per BTC.
12
+ * - "QUOTE": Prices are displayed in the base currency per unit of the quote currency.
13
+ * For example, for the BTC/USD market, prices are shown as BTC per USD.
14
+ *
15
+ * Choose the mode based on how you want to interpret price levels in the orderbook.
16
+ */
17
+ export type OrderbookQuotationMode = "BASE" | "QUOTE";
7
18
  /**
8
19
  * Orderbook WebSocket client interface
9
20
  */
@@ -14,14 +25,16 @@ export interface OrderbookWebSocketClient extends BaseWebSocketClient {
14
25
  * @param tradingMode - Trading mode (TradingMode.SPOT or TradingMode.MARGIN)
15
26
  * @param callback - Callback function for orderbook events
16
27
  * @param magnitude - Optional magnitude for orderbook grouping (0.0001 to 10000, defaults to no grouping)
28
+ * @param quotationMode - Optional quotation mode ("BASE" or "QUOTE"), defaults to "BASE"
17
29
  */
18
- subscribeToOrderbookEvents(market: string, tradingMode: TradingMode, callback: (event: OrderbookEvent) => void, magnitude?: number): void;
30
+ subscribeToOrderbookEvents(market: string, tradingMode: TradingMode, callback: (event: OrderbookEvent) => void, magnitude?: number, quotationMode?: OrderbookQuotationMode): void;
19
31
  /**
20
32
  * Unsubscribe from orderbook events for a specific market and trading mode
21
33
  * @param market - Trading pair symbol
22
34
  * @param tradingMode - Trading mode (TradingMode.SPOT or TradingMode.MARGIN)
23
35
  * @param magnitude - Optional magnitude that was used when subscribing
36
+ * @param quotationMode - Optional quotation mode that was used when subscribing
24
37
  */
25
- unsubscribeFromOrderbookEvents(market: string, tradingMode: TradingMode, magnitude?: number): void;
38
+ unsubscribeFromOrderbookEvents(market: string, tradingMode: TradingMode, magnitude?: number, quotationMode?: OrderbookQuotationMode): void;
26
39
  }
27
40
  //# sourceMappingURL=orderbook-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orderbook-client.d.ts","sourceRoot":"","sources":["../../../src/websocket/clients/orderbook-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE;;;;;;OAMG;IACH,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1I;;;;;OAKG;IACH,8BAA8B,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpG"}
1
+ {"version":3,"file":"orderbook-client.d.ts","sourceRoot":"","sources":["../../../src/websocket/clients/orderbook-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE;;;;;;;OAOG;IACH,0BAA0B,CACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,EACzC,SAAS,CAAC,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,sBAAsB,GACrC,IAAI,CAAC;IAER;;;;;;OAMG;IACH,8BAA8B,CAC5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,SAAS,CAAC,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,sBAAsB,GACrC,IAAI,CAAC;CACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/types",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",