@drift-labs/sdk 2.91.0-beta.7 → 2.91.0-beta.8
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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.91.0-beta.
|
|
1
|
+
2.91.0-beta.8
|
|
@@ -35,17 +35,17 @@ class OpenbookV2Subscriber {
|
|
|
35
35
|
if (this.subscriptionType === 'websocket') {
|
|
36
36
|
this.marketCallbackId = this.connection.onAccountChange(this.marketAddress, async (accountInfo, _) => {
|
|
37
37
|
const marketRaw = openbookV2Program.coder.accounts.decode('Market', accountInfo.data);
|
|
38
|
-
|
|
39
|
-
await
|
|
38
|
+
const market = new openbook_v2_1.Market(this.client, this.marketAddress, marketRaw);
|
|
39
|
+
await market.loadOrderBook();
|
|
40
|
+
this.market = market;
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
else {
|
|
43
|
-
this.marketCallbackId = await this.accountLoader.addAccount(this.marketAddress, (buffer, _) => {
|
|
44
|
+
this.marketCallbackId = await this.accountLoader.addAccount(this.marketAddress, async (buffer, _) => {
|
|
44
45
|
const marketRaw = openbookV2Program.coder.accounts.decode('Market', buffer);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})();
|
|
46
|
+
const market = new openbook_v2_1.Market(this.client, this.marketAddress, marketRaw);
|
|
47
|
+
await market.loadOrderBook();
|
|
48
|
+
this.market = market;
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
this.subscribed = true;
|
package/package.json
CHANGED
|
@@ -72,22 +72,22 @@ export class OpenbookV2Subscriber implements L2OrderBookGenerator {
|
|
|
72
72
|
'Market',
|
|
73
73
|
accountInfo.data
|
|
74
74
|
);
|
|
75
|
-
|
|
76
|
-
await
|
|
75
|
+
const market = new Market(this.client, this.marketAddress, marketRaw);
|
|
76
|
+
await market.loadOrderBook();
|
|
77
|
+
this.market = market;
|
|
77
78
|
}
|
|
78
79
|
);
|
|
79
80
|
} else {
|
|
80
81
|
this.marketCallbackId = await this.accountLoader.addAccount(
|
|
81
82
|
this.marketAddress,
|
|
82
|
-
(buffer, _) => {
|
|
83
|
+
async (buffer, _) => {
|
|
83
84
|
const marketRaw = openbookV2Program.coder.accounts.decode(
|
|
84
85
|
'Market',
|
|
85
86
|
buffer
|
|
86
87
|
);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})();
|
|
88
|
+
const market = new Market(this.client, this.marketAddress, marketRaw);
|
|
89
|
+
await market.loadOrderBook();
|
|
90
|
+
this.market = market;
|
|
91
91
|
}
|
|
92
92
|
);
|
|
93
93
|
}
|