@0xmonaco/core 1.0.58-develop.f12e78b → 1.0.59

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.
@@ -204,6 +204,17 @@ function parsePositionEventData(raw) {
204
204
  liquidationPrice: readOptionalString(data, "liquidationPrice"),
205
205
  isolatedMargin: readString(data, "isolatedMargin"),
206
206
  leverage: readString(data, "leverage"),
207
+ // REST parity fields (0XM-2668). All four are optional here even though
208
+ // the server populates the margin requirements on every frame it builds
209
+ // today: this parser also runs against frames produced by an older
210
+ // deployment during a rolling release, and a `readString` on a key that
211
+ // deployment does not send would throw inside the message handler and drop
212
+ // a risk-critical update. `riskBucketId` and `marginMode` are genuinely
213
+ // optional besides — a legacy unbucketed position has neither.
214
+ riskBucketId: readOptionalString(data, "riskBucketId"),
215
+ marginMode: readOptionalString(data, "marginMode"),
216
+ maintenanceMarginRequired: readOptionalString(data, "maintenanceMarginRequired"),
217
+ initialMarginRequired: readOptionalString(data, "initialMarginRequired"),
207
218
  tradeId: readOptionalString(data, "tradeId"),
208
219
  orderId: readOptionalString(data, "orderId"),
209
220
  reason: readString(data, "reason"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.58-develop.f12e78b",
3
+ "version": "1.0.59",
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.58-develop.f12e78b",
23
- "@0xmonaco/types": "1.0.58-develop.f12e78b",
22
+ "@0xmonaco/contracts": "1.0.59",
23
+ "@0xmonaco/types": "1.0.59",
24
24
  "@noble/curves": "^1.9.1",
25
25
  "@noble/hashes": "^2.4.0",
26
26
  "http-status-codes": "^2.3.0"