@0xmonaco/react 1.0.75 → 1.0.76

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.
@@ -19,7 +19,10 @@ export function useTradeFeed(tradingPairId) {
19
19
  if (!sdk?.ws || !sdk?.trades || !tradingPairId) {
20
20
  return;
21
21
  }
22
- const fetchInitialTrades = () => sdk.trades.getTrades(tradingPairId, { pageSize: MAX_TRADES });
22
+ // One page is the whole need here: the provider keeps only the newest
23
+ // MAX_TRADES and the WebSocket feed takes over from there, so the cursor
24
+ // (0XM-2821) is not walked — just unwrapped.
25
+ const fetchInitialTrades = async () => (await sdk.trades.getTrades(tradingPairId, { pageSize: MAX_TRADES })).trades;
23
26
  const subscribeToWs = (handler) => sdk.ws.trades(tradingPairId, handler);
24
27
  return subscribe(tradingPairId, fetchInitialTrades, subscribeToWs);
25
28
  }, [sdk?.ws, sdk?.trades, tradingPairId, subscribe]);
@@ -849,8 +849,11 @@ export function orderFromEvent(event) {
849
849
  side,
850
850
  price: data.price,
851
851
  quantity: data.quantity || "0",
852
- filledQuantity: "0",
853
- averageFillPrice: undefined,
852
+ // An edit's replacement is acknowledged with the fill carried over from
853
+ // the original order and its average, as REST reports the edited order;
854
+ // any other placement omits both and starts unfilled.
855
+ filledQuantity: typeof data.filledQuantity === "string" ? data.filledQuantity : "0",
856
+ averageFillPrice: typeof data.averageFillPrice === "string" ? data.averageFillPrice : undefined,
854
857
  // Not an invented value: an `OrderPlaced` event IS a submitted order by
855
858
  // construction, whatever status string it carries.
856
859
  status: asOrderStatus(data.status) ?? "SUBMITTED",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xmonaco/react",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
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.75",
20
- "@0xmonaco/types": "1.0.75"
19
+ "@0xmonaco/core": "1.0.76",
20
+ "@0xmonaco/types": "1.0.76"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/react": "^19.2.18",