@drift-labs/sdk 2.60.0-beta.14 → 2.60.0-beta.16

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.60.0-beta.14
1
+ 2.60.0-beta.16
@@ -12,6 +12,9 @@ class WebSocketProgramAccountSubscriber {
12
12
  this.program = program;
13
13
  this.decodeBuffer = decodeBufferFn;
14
14
  this.resubTimeoutMs = resubTimeoutMs;
15
+ if (this.resubTimeoutMs < 1000) {
16
+ console.log('resubTimeoutMs should be at least 1000ms to avoid spamming resub');
17
+ }
15
18
  this.options = options;
16
19
  this.receivingData = false;
17
20
  }
@@ -33,6 +36,7 @@ class WebSocketProgramAccountSubscriber {
33
36
  }
34
37
  }, (_a = this.options.commitment) !== null && _a !== void 0 ? _a : this.program.provider.opts.commitment, this.options.filters);
35
38
  if (this.resubTimeoutMs) {
39
+ this.receivingData = true;
36
40
  this.setTimeout();
37
41
  }
38
42
  }
@@ -15,7 +15,7 @@ class AuctionSubscriber {
15
15
  if (!this.subscriber) {
16
16
  this.subscriber = new webSocketProgramAccountSubscriber_1.WebSocketProgramAccountSubscriber('AuctionSubscriber', 'User', this.driftClient.program, this.driftClient.program.account.user.coder.accounts.decode.bind(this.driftClient.program.account.user.coder.accounts), {
17
17
  filters: [(0, memcmp_1.getUserFilter)(), (0, memcmp_1.getUserWithAuctionFilter)()],
18
- commitment: this.driftClient.opts.commitment,
18
+ commitment: this.opts.commitment,
19
19
  }, this.resubTimeoutMs);
20
20
  }
21
21
  await this.subscriber.subscribe((accountId, data, context) => {
@@ -8364,6 +8364,9 @@
8364
8364
  },
8365
8365
  {
8366
8366
  "name": "Borrow"
8367
+ },
8368
+ {
8369
+ "name": "RepayBorrow"
8367
8370
  }
8368
8371
  ]
8369
8372
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.60.0-beta.14",
3
+ "version": "2.60.0-beta.16",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -42,6 +42,11 @@ export class WebSocketProgramAccountSubscriber<T>
42
42
  this.program = program;
43
43
  this.decodeBuffer = decodeBufferFn;
44
44
  this.resubTimeoutMs = resubTimeoutMs;
45
+ if (this.resubTimeoutMs < 1000) {
46
+ console.log(
47
+ 'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
48
+ );
49
+ }
45
50
  this.options = options;
46
51
  this.receivingData = false;
47
52
  }
@@ -73,6 +78,7 @@ export class WebSocketProgramAccountSubscriber<T>
73
78
  );
74
79
 
75
80
  if (this.resubTimeoutMs) {
81
+ this.receivingData = true;
76
82
  this.setTimeout();
77
83
  }
78
84
  }
@@ -33,7 +33,7 @@ export class AuctionSubscriber {
33
33
  ),
34
34
  {
35
35
  filters: [getUserFilter(), getUserWithAuctionFilter()],
36
- commitment: this.driftClient.opts.commitment,
36
+ commitment: this.opts.commitment,
37
37
  },
38
38
  this.resubTimeoutMs
39
39
  );
@@ -8364,6 +8364,9 @@
8364
8364
  },
8365
8365
  {
8366
8366
  "name": "Borrow"
8367
+ },
8368
+ {
8369
+ "name": "RepayBorrow"
8367
8370
  }
8368
8371
  ]
8369
8372
  }