@0xmonaco/react 1.0.76 → 1.0.77

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.
@@ -2,25 +2,28 @@ import type { UseInstrumentsReturn } from "./types";
2
2
  /**
3
3
  * Hook for subscribing to real-time instrument configuration via WebSocket (public)
4
4
  *
5
- * On subscribe the channel delivers a snapshot of the current active markets
6
- * (one `listing` frame each), then live listing, delisting, halt/unhalt and
5
+ * On subscribe the channel delivers a snapshot of every listed market (one
6
+ * `listing` frame each, inactive markets flagged `isActive: false`), then live
7
+ * listing, delisting, halt/unhalt and
7
8
  * config-change frames. Every frame carries a market's FULL current
8
9
  * configuration rather than a delta, so state is kept as a terminal-state
9
10
  * entry per trading pair: each event replaces that market's entry outright.
10
11
  *
11
- * A market DELISTED while the socket was up keeps its entry with
12
- * `isActive: false` rather than disappearing, so a consumer can distinguish
13
- * "no longer tradable" from "never seen"; read
12
+ * An inactive market keeps its entry with `isActive: false` rather than
13
+ * disappearing, whether it was delisted while the socket was up or arrived
14
+ * inactive in the snapshot, so a consumer can distinguish "no longer
15
+ * tradable" from "never seen" and still resolve the metadata of positions,
16
+ * orders and history on it; read
14
17
  * `instruments.filter((instrument) => instrument.isActive)` for the tradable
15
18
  * set.
16
19
  *
17
20
  * Reconnect is the exception, and the snapshot boundary is what makes it
18
- * expressible. Each snapshot is the authoritative active-market set at the
19
- * moment it was taken, so it REPLACES the map wholesale rather than merging
20
- * into it: a market delisted while the socket was down is absent from the
21
- * post-reconnect snapshot and leaves this state with it. Merging would have
22
- * stranded that market here forever carrying its pre-outage config, because a
23
- * delisted market emits nothing further to correct it.
21
+ * expressible. Each snapshot is the authoritative market set at the moment it
22
+ * was taken, so it REPLACES the map wholesale rather than merging into it: a
23
+ * market delisted while the socket was down arrives flagged
24
+ * `isActive: false`, and a market no longer listed at all is absent and
25
+ * leaves this state with it. Merging would have stranded either one here
26
+ * carrying its pre-outage config.
24
27
  *
25
28
  * @param tradingPairId - Optional trading pair UUID to filter on; omit to
26
29
  * receive every market. An empty string is rejected by the core helper and is
@@ -12,25 +12,28 @@ const NO_INSTRUMENTS = {};
12
12
  /**
13
13
  * Hook for subscribing to real-time instrument configuration via WebSocket (public)
14
14
  *
15
- * On subscribe the channel delivers a snapshot of the current active markets
16
- * (one `listing` frame each), then live listing, delisting, halt/unhalt and
15
+ * On subscribe the channel delivers a snapshot of every listed market (one
16
+ * `listing` frame each, inactive markets flagged `isActive: false`), then live
17
+ * listing, delisting, halt/unhalt and
17
18
  * config-change frames. Every frame carries a market's FULL current
18
19
  * configuration rather than a delta, so state is kept as a terminal-state
19
20
  * entry per trading pair: each event replaces that market's entry outright.
20
21
  *
21
- * A market DELISTED while the socket was up keeps its entry with
22
- * `isActive: false` rather than disappearing, so a consumer can distinguish
23
- * "no longer tradable" from "never seen"; read
22
+ * An inactive market keeps its entry with `isActive: false` rather than
23
+ * disappearing, whether it was delisted while the socket was up or arrived
24
+ * inactive in the snapshot, so a consumer can distinguish "no longer
25
+ * tradable" from "never seen" and still resolve the metadata of positions,
26
+ * orders and history on it; read
24
27
  * `instruments.filter((instrument) => instrument.isActive)` for the tradable
25
28
  * set.
26
29
  *
27
30
  * Reconnect is the exception, and the snapshot boundary is what makes it
28
- * expressible. Each snapshot is the authoritative active-market set at the
29
- * moment it was taken, so it REPLACES the map wholesale rather than merging
30
- * into it: a market delisted while the socket was down is absent from the
31
- * post-reconnect snapshot and leaves this state with it. Merging would have
32
- * stranded that market here forever carrying its pre-outage config, because a
33
- * delisted market emits nothing further to correct it.
31
+ * expressible. Each snapshot is the authoritative market set at the moment it
32
+ * was taken, so it REPLACES the map wholesale rather than merging into it: a
33
+ * market delisted while the socket was down arrives flagged
34
+ * `isActive: false`, and a market no longer listed at all is absent and
35
+ * leaves this state with it. Merging would have stranded either one here
36
+ * carrying its pre-outage config.
34
37
  *
35
38
  * @param tradingPairId - Optional trading pair UUID to filter on; omit to
36
39
  * receive every market. An empty string is rejected by the core helper and is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/react",
3
- "version": "1.0.76",
3
+ "version": "1.0.77",
4
4
  "type": "module",
5
5
  "homepage": "https://docs.0xmonaco.com/sdk/typescript",
6
6
  "main": "./dist/index.js",
@@ -16,8 +16,8 @@
16
16
  "lint": "biome lint ."
17
17
  },
18
18
  "dependencies": {
19
- "@0xmonaco/core": "1.0.76",
20
- "@0xmonaco/types": "1.0.76"
19
+ "@0xmonaco/core": "1.0.77",
20
+ "@0xmonaco/types": "1.0.77"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/react": "^19.2.18",