@0xmonaco/core 1.0.39-develop.71e039b → 1.0.39-prerelease.19d492d

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.
@@ -133,6 +133,8 @@ function parsePositionEvent(rawData) {
133
133
  liquidationPrice: readOptionalString(data, "liquidationPrice"),
134
134
  isolatedMargin: readString(data, "isolatedMargin"),
135
135
  leverage: readString(data, "leverage"),
136
+ tradeId: readOptionalString(data, "tradeId"),
137
+ orderId: readOptionalString(data, "orderId"),
136
138
  reason: readString(data, "reason"),
137
139
  updatedAt: readString(data, "updatedAt"),
138
140
  },
@@ -488,15 +490,21 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
488
490
  quantity: level.quantity,
489
491
  orderCount: level.order_count || 0,
490
492
  })),
491
- bestBid: orderbookData?.best_bid,
492
- bestAsk: orderbookData?.best_ask,
493
+ // Rust sends `null` for an empty side; normalize the nullable
494
+ // `Option` to `undefined` so it matches the `string | undefined` type
495
+ // rather than leaking `null` past the cast.
496
+ bestBid: orderbookData?.best_bid ?? undefined,
497
+ bestAsk: orderbookData?.best_ask ?? undefined,
493
498
  bidVolume: orderbookData?.bid_volume || undefined,
494
499
  askVolume: orderbookData?.ask_volume || undefined,
495
500
  priceChange: orderbookData?.price_change
496
501
  ? {
497
502
  side: orderbookData.price_change.side,
498
- oldPrice: orderbookData.price_change.old_price,
499
- newPrice: orderbookData.price_change.new_price,
503
+ // Normalize nullable Rust `Option` prices to `undefined` (a
504
+ // level-add has no old price, a level-remove no new price) so
505
+ // neither leaks `null` past the `string | undefined` type.
506
+ oldPrice: orderbookData.price_change.old_price ?? undefined,
507
+ newPrice: orderbookData.price_change.new_price ?? undefined,
500
508
  levelRemoved: orderbookData.price_change.level_removed || false,
501
509
  levelAdded: orderbookData.price_change.level_added || false,
502
510
  }
@@ -584,7 +592,10 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
584
592
  id: movementData.id,
585
593
  entryType: movementData.entry_type,
586
594
  transactionType: movementData.transaction_type,
587
- tokenAddress: movementData.token_address,
595
+ status: movementData.status,
596
+ token: (movementData.token ?? movementData.token_address),
597
+ tokenAddress: (movementData.token ?? movementData.token_address),
598
+ assetId: movementData.asset_id,
588
599
  amount: String(movementData.amount),
589
600
  amountRaw: movementData.amount_raw,
590
601
  balanceBefore: movementData.balance_before != null ? String(movementData.balance_before) : undefined,
@@ -595,6 +606,7 @@ export function createMonacoWebSocket(baseUrl, options = {}) {
595
606
  referenceType: movementData.reference_type,
596
607
  description: movementData.description,
597
608
  txHash: movementData.tx_hash,
609
+ blockNumber: movementData.block_number,
598
610
  createdAt: movementData.created_at,
599
611
  decimals: movementData.decimals,
600
612
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/core",
3
- "version": "1.0.39-develop.71e039b",
3
+ "version": "1.0.39-prerelease.19d492d",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,8 @@
23
23
  "viem": "^2.45.2"
24
24
  },
25
25
  "dependencies": {
26
- "@0xmonaco/contracts": "1.0.39-develop.71e039b",
27
- "@0xmonaco/types": "1.0.39-develop.71e039b",
26
+ "@0xmonaco/contracts": "1.0.39-prerelease.19d492d",
27
+ "@0xmonaco/types": "1.0.39-prerelease.19d492d",
28
28
  "@noble/curves": "^1.9.1",
29
29
  "@noble/hashes": "^1.8.0",
30
30
  "http-status-codes": "^2.3.0"