@drift-labs/sdk 2.62.0-beta.1 → 2.62.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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.62.0-beta.
|
|
1
|
+
2.62.0-beta.2
|
|
@@ -10,6 +10,9 @@ class WebSocketAccountSubscriber {
|
|
|
10
10
|
this.accountPublicKey = accountPublicKey;
|
|
11
11
|
this.decodeBufferFn = decodeBuffer;
|
|
12
12
|
this.resubTimeoutMs = resubTimeoutMs;
|
|
13
|
+
if (this.resubTimeoutMs < 1000) {
|
|
14
|
+
console.log('resubTimeoutMs should be at least 1000ms to avoid spamming resub');
|
|
15
|
+
}
|
|
13
16
|
this.receivingData = false;
|
|
14
17
|
this.commitment =
|
|
15
18
|
commitment !== null && commitment !== void 0 ? commitment : this.program.provider.opts.commitment;
|
|
@@ -34,6 +37,7 @@ class WebSocketAccountSubscriber {
|
|
|
34
37
|
}
|
|
35
38
|
}, this.commitment);
|
|
36
39
|
if (this.resubTimeoutMs) {
|
|
40
|
+
this.receivingData = true;
|
|
37
41
|
this.setTimeout();
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -9,6 +9,9 @@ class SlotSubscriber {
|
|
|
9
9
|
this.receivingData = false;
|
|
10
10
|
this.eventEmitter = new events_1.EventEmitter();
|
|
11
11
|
this.resubTimeoutMs = config === null || config === void 0 ? void 0 : config.resubTimeoutMs;
|
|
12
|
+
if (this.resubTimeoutMs < 1000) {
|
|
13
|
+
console.log('resubTimeoutMs should be at least 1000ms to avoid spamming resub');
|
|
14
|
+
}
|
|
12
15
|
}
|
|
13
16
|
async subscribe() {
|
|
14
17
|
if (this.subscriptionId != null) {
|
|
@@ -27,6 +30,7 @@ class SlotSubscriber {
|
|
|
27
30
|
}
|
|
28
31
|
});
|
|
29
32
|
if (this.resubTimeoutMs) {
|
|
33
|
+
this.receivingData = true;
|
|
30
34
|
this.setTimeout();
|
|
31
35
|
}
|
|
32
36
|
}
|
package/package.json
CHANGED
|
@@ -34,6 +34,11 @@ export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
|
|
|
34
34
|
this.accountPublicKey = accountPublicKey;
|
|
35
35
|
this.decodeBufferFn = decodeBuffer;
|
|
36
36
|
this.resubTimeoutMs = resubTimeoutMs;
|
|
37
|
+
if (this.resubTimeoutMs < 1000) {
|
|
38
|
+
console.log(
|
|
39
|
+
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
|
|
40
|
+
);
|
|
41
|
+
}
|
|
37
42
|
this.receivingData = false;
|
|
38
43
|
this.commitment =
|
|
39
44
|
commitment ?? (this.program.provider as AnchorProvider).opts.commitment;
|
|
@@ -65,6 +70,7 @@ export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
|
|
|
65
70
|
);
|
|
66
71
|
|
|
67
72
|
if (this.resubTimeoutMs) {
|
|
73
|
+
this.receivingData = true;
|
|
68
74
|
this.setTimeout();
|
|
69
75
|
}
|
|
70
76
|
}
|
|
@@ -28,6 +28,11 @@ export class SlotSubscriber {
|
|
|
28
28
|
) {
|
|
29
29
|
this.eventEmitter = new EventEmitter();
|
|
30
30
|
this.resubTimeoutMs = config?.resubTimeoutMs;
|
|
31
|
+
if (this.resubTimeoutMs < 1000) {
|
|
32
|
+
console.log(
|
|
33
|
+
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
|
|
34
|
+
);
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
public async subscribe(): Promise<void> {
|
|
@@ -50,6 +55,7 @@ export class SlotSubscriber {
|
|
|
50
55
|
});
|
|
51
56
|
|
|
52
57
|
if (this.resubTimeoutMs) {
|
|
58
|
+
this.receivingData = true;
|
|
53
59
|
this.setTimeout();
|
|
54
60
|
}
|
|
55
61
|
}
|