@0xmonaco/core 1.0.53 → 1.0.54

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.
@@ -847,10 +847,9 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
847
847
  sendAuthenticate();
848
848
  resubscribeAll();
849
849
  options.onStatusChange?.("connected");
850
- // Resync-join order: resume the live stream first (auth +
851
- // subscribe above), then tell the app to refetch snapshots and
852
- // reconcile by (id, updatedAt) — events racing the snapshot are
853
- // newer than the rows they duplicate.
850
+ // Send auth/subscribe requests before asking the application to
851
+ // reconcile. This callback does not wait for acknowledgements or
852
+ // snapshots, and the SDK does not perform REST recovery itself.
854
853
  if (pendingResyncCode !== null) {
855
854
  const code = pendingResyncCode;
856
855
  pendingResyncCode = null;
@@ -1242,8 +1241,8 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
1242
1241
  * Subscribe to authenticated user's position updates.
1243
1242
  * Requires authentication - user is identified from the signed session-key
1244
1243
  * handshake. Omit `tradingPairId` for all pairs, or pass one to filter.
1245
- * Lag policy is Conflate: a lagging subscriber is fast-forwarded, no gap
1246
- * signal.
1244
+ * Detected broadcast lag closes the connection with 1013; reconcile
1245
+ * missed keys and terminal updates on reconnect.
1247
1246
  */
1248
1247
  const subscribePositions = (handler, tradingPairId, onSnapshot) => {
1249
1248
  if (!handler) {
@@ -1290,8 +1289,8 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
1290
1289
  * Subscribe to the authenticated user's account-level margin health updates
1291
1290
  * (equity, collateral, free collateral, margin ratio, maintenance
1292
1291
  * requirement). Requires authentication - the user is identified from the
1293
- * signed session-key handshake. Lag policy is Conflate: a lagging subscriber
1294
- * is fast-forwarded, no gap signal. Each frame is a terminal-state snapshot
1292
+ * signed session-key handshake. Detected broadcast lag closes the connection
1293
+ * with 1013; reconnect and reconcile missed state. Each frame is a terminal-state snapshot
1295
1294
  * per margin account, not an additive delta.
1296
1295
  */
1297
1296
  const subscribeAccount = (handler, onSnapshot) => {
@@ -1317,8 +1316,8 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
1317
1316
  * of the current active-pair list arrives before the live diffs; a
1318
1317
  * subscriber joining a channel this client already holds is replayed the
1319
1318
  * current baseline from a local cache instead (the server snapshots only
1320
- * genuinely new wire subscriptions). Lag policy is Conflate: a lagging
1321
- * subscriber is fast-forwarded, no gap signal.
1319
+ * genuinely new wire subscriptions). Detected broadcast lag closes the connection
1320
+ * with 1013; a new wire subscription provides a fresh baseline.
1322
1321
  */
1323
1322
  const subscribeInstruments = (handler, tradingPairId, onSnapshot) => {
1324
1323
  if (!handler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "type": "module",
5
5
  "homepage": "https://docs.0xmonaco.com/sdk/typescript",
6
6
  "main": "./dist/index.js",
@@ -19,8 +19,8 @@
19
19
  "viem": "^2.45.2"
20
20
  },
21
21
  "dependencies": {
22
- "@0xmonaco/contracts": "1.0.53",
23
- "@0xmonaco/types": "1.0.53",
22
+ "@0xmonaco/contracts": "1.0.54",
23
+ "@0xmonaco/types": "1.0.54",
24
24
  "@noble/curves": "^1.9.1",
25
25
  "@noble/hashes": "^1.8.0",
26
26
  "http-status-codes": "^2.3.0"