@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 +1 -1
- package/lib/accounts/webSocketProgramAccountSubscriber.js +4 -0
- package/lib/auctionSubscriber/auctionSubscriber.js +1 -1
- package/lib/idl/drift.json +3 -0
- package/package.json +1 -1
- package/src/accounts/webSocketProgramAccountSubscriber.ts +6 -0
- package/src/auctionSubscriber/auctionSubscriber.ts +1 -1
- package/src/idl/drift.json +3 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.60.0-beta.
|
|
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.
|
|
18
|
+
commitment: this.opts.commitment,
|
|
19
19
|
}, this.resubTimeoutMs);
|
|
20
20
|
}
|
|
21
21
|
await this.subscriber.subscribe((accountId, data, context) => {
|
package/lib/idl/drift.json
CHANGED
package/package.json
CHANGED
|
@@ -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
|
}
|