diff --git a/package.json b/package.json index 9cf8d92..2a6fe42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.10.4-rc.0", + "version": "0.10.5", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/services/OrionAggregator/ws/index.ts b/src/services/OrionAggregator/ws/index.ts index 7682d5b..5d26234 100644 --- a/src/services/OrionAggregator/ws/index.ts +++ b/src/services/OrionAggregator/ws/index.ts @@ -14,6 +14,7 @@ import { SwapInfoByAmountIn, SwapInfoByAmountOut, SwapInfoBase, FullOrder, OrderUpdate, AssetPairUpdate, OrderbookItem, Balance, } from '../../../types'; +import { isKeyOfObject, isUnknownObject } from '../../../utils'; // import errorSchema from './schemas/errorSchema'; const mapFullOrder = (o: z.infer): FullOrder => ({ @@ -211,6 +212,11 @@ class OrionAggregatorWS { this.ws.onmessage = (e) => { const { data } = e; const rawJson: unknown = JSON.parse(data.toString()); + if ( + isUnknownObject(rawJson) + && isKeyOfObject('T', rawJson) + && rawJson.T === 'ud' + ) return; const messageSchema = z.union([ initMessageSchema,