Agg no id

This commit is contained in:
Aleksandr Kraiz
2022-08-02 23:32:49 +04:00
parent 37484f4b5e
commit 333f7a4e98
3 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.13.0",
"version": "0.13.1",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -210,7 +210,9 @@ class OrionAggregatorWS {
throw new Error(`Subscription '${type}' already exists. Please unsubscribe first.`);
}
const id = uuidv4();
const id = type === 'aobus'
? ((subscription as any).payload as string) // TODO: Refactor!!!
: uuidv4();
const subRequest: Partial<Record<string, unknown>> = {};
subRequest.T = type;
subRequest.id = id;
@@ -413,7 +415,7 @@ class OrionAggregatorWS {
}, []);
this.subscriptions[
SubscriptionType.AGGREGATED_ORDER_BOOK_UPDATES_SUBSCRIBE
]?.[json.id]?.callback(
]?.[json.S]?.callback(
mapOrderbookItems(ob.a),
mapOrderbookItems(ob.b),
S,

View File

@@ -13,7 +13,7 @@ export const orderBookItemSchema = z.tuple([
]);
export const orderBookSchema = baseMessageSchema.extend({
id: z.string(),
// id: z.string(),
T: z.literal(MessageType.AGGREGATED_ORDER_BOOK_UPDATE),
S: z.string(),
ob: z.object({