@drift-labs/sdk 2.8.0-beta.1 → 2.8.0-beta.2
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.
- package/lib/dlob/DLOB.d.ts +1 -0
- package/lib/dlob/DLOB.js +4 -0
- package/lib/idl/drift.json +1 -1
- package/package.json +1 -1
- package/src/dlob/DLOB.ts +6 -0
- package/src/idl/drift.json +1 -1
package/lib/dlob/DLOB.d.ts
CHANGED
package/lib/dlob/DLOB.js
CHANGED
|
@@ -16,6 +16,9 @@ class DLOB {
|
|
|
16
16
|
this.openOrders = new Map();
|
|
17
17
|
this.orderLists = new Map();
|
|
18
18
|
this.initialized = false;
|
|
19
|
+
this.init();
|
|
20
|
+
}
|
|
21
|
+
init() {
|
|
19
22
|
this.openOrders.set('perp', new Set());
|
|
20
23
|
this.openOrders.set('spot', new Set());
|
|
21
24
|
this.orderLists.set('perp', new Map());
|
|
@@ -39,6 +42,7 @@ class DLOB {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
this.orderLists.clear();
|
|
45
|
+
this.init();
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
48
|
* initializes a new DLOB instance
|
package/lib/idl/drift.json
CHANGED
package/package.json
CHANGED
package/src/dlob/DLOB.ts
CHANGED
|
@@ -77,6 +77,10 @@ export class DLOB {
|
|
|
77
77
|
initialized = false;
|
|
78
78
|
|
|
79
79
|
public constructor() {
|
|
80
|
+
this.init();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private init() {
|
|
80
84
|
this.openOrders.set('perp', new Set<string>());
|
|
81
85
|
this.openOrders.set('spot', new Set<string>());
|
|
82
86
|
this.orderLists.set('perp', new Map<number, MarketNodeLists>());
|
|
@@ -102,6 +106,8 @@ export class DLOB {
|
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
108
|
this.orderLists.clear();
|
|
109
|
+
|
|
110
|
+
this.init();
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
/**
|
package/src/idl/drift.json
CHANGED