@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.7
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
- this.market = new openbook_v2_1.Market(this.client, this.marketAddress, marketRaw);
39
- await this.market.loadOrderBook();
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
- this.market = new openbook_v2_1.Market(this.client, this.marketAddress, marketRaw);
46
- (async () => {
47
- await this.market.loadOrderBook();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.91.0-beta.7",
3
+ "version": "2.91.0-beta.8",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -72,22 +72,22 @@ export class OpenbookV2Subscriber implements L2OrderBookGenerator {
72
72
  'Market',
73
73
  accountInfo.data
74
74
  );
75
- this.market = new Market(this.client, this.marketAddress, marketRaw);
76
- await this.market.loadOrderBook();
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
- this.market = new Market(this.client, this.marketAddress, marketRaw);
88
- (async () => {
89
- await this.market.loadOrderBook();
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
  }