@0xmonaco/react 1.0.76 → 1.0.80
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
|
|
6
|
-
*
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
|
|
16
|
-
*
|
|
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
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
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.
|
|
3
|
+
"version": "1.0.80",
|
|
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.
|
|
20
|
-
"@0xmonaco/types": "1.0.
|
|
19
|
+
"@0xmonaco/core": "1.0.80",
|
|
20
|
+
"@0xmonaco/types": "1.0.80"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/react": "^19.2.18",
|