@drift-labs/sdk 2.121.0-beta.6 → 2.121.0-beta.7
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/browser/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
- package/lib/browser/indicative-quotes/indicativeQuotesSender.js +3 -0
- package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
- package/lib/node/indicative-quotes/indicativeQuotesSender.d.ts.map +1 -1
- package/lib/node/indicative-quotes/indicativeQuotesSender.js +3 -0
- package/package.json +1 -1
- package/src/indicative-quotes/indicativeQuotesSender.ts +5 -3
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.121.0-beta.
|
|
1
|
+
2.121.0-beta.7
|
|
@@ -128,6 +128,9 @@ class IndicativeQuotesSender {
|
|
|
128
128
|
}, this.heartbeatIntervalMs);
|
|
129
129
|
}
|
|
130
130
|
setQuote(quote) {
|
|
131
|
+
if (!this.connected) {
|
|
132
|
+
console.warn('Setting quote before connected to the server, ignoring');
|
|
133
|
+
}
|
|
131
134
|
this.quotes.set(quote.marketIndex, quote);
|
|
132
135
|
}
|
|
133
136
|
reconnect() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indicativeQuotesSender.d.ts","sourceRoot":"","sources":["../../../src/indicative-quotes/indicativeQuotesSender.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"indicativeQuotesSender.d.ts","sourceRoot":"","sources":["../../../src/indicative-quotes/indicativeQuotesSender.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AAOxB,KAAK,KAAK,GAAG;IACZ,QAAQ,EAAE,EAAE,CAAC;IACb,QAAQ,EAAE,EAAE,CAAC;IACb,kBAAkB,EAAE,EAAE,CAAC;IACvB,kBAAkB,EAAE,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,qBAAa,sBAAsB;IAYjC,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO;IAZhB,OAAO,CAAC,gBAAgB,CAA+B;IACvD,OAAO,CAAC,kBAAkB,CAA+B;IAEzD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,MAAM,CAAiC;gBAGtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO;IAGzB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAOhD,iBAAiB,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAmB/B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAqF9B,OAAO,CAAC,mBAAmB;IAU3B,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAO5B,OAAO,CAAC,SAAS;CAuBjB"}
|
|
@@ -128,6 +128,9 @@ class IndicativeQuotesSender {
|
|
|
128
128
|
}, this.heartbeatIntervalMs);
|
|
129
129
|
}
|
|
130
130
|
setQuote(quote) {
|
|
131
|
+
if (!this.connected) {
|
|
132
|
+
console.warn('Setting quote before connected to the server, ignoring');
|
|
133
|
+
}
|
|
131
134
|
this.quotes.set(quote.marketIndex, quote);
|
|
132
135
|
}
|
|
133
136
|
reconnect() {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Keypair } from '@solana/web3.js';
|
|
2
|
-
import { BN
|
|
2
|
+
import { BN } from '..';
|
|
3
3
|
import nacl from 'tweetnacl';
|
|
4
4
|
import { decodeUTF8 } from 'tweetnacl-util';
|
|
5
5
|
import WebSocket from 'ws';
|
|
@@ -22,7 +22,6 @@ export class IndicativeQuotesSender {
|
|
|
22
22
|
private readonly heartbeatIntervalMs = 60000;
|
|
23
23
|
private reconnectDelay = 1000;
|
|
24
24
|
private ws: WebSocket | null = null;
|
|
25
|
-
private driftClient: DriftClient;
|
|
26
25
|
private connected = false;
|
|
27
26
|
|
|
28
27
|
private quotes: Map<number, Quote> = new Map();
|
|
@@ -153,7 +152,10 @@ export class IndicativeQuotesSender {
|
|
|
153
152
|
}, this.heartbeatIntervalMs);
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
setQuote(quote: Quote) {
|
|
155
|
+
setQuote(quote: Quote): void {
|
|
156
|
+
if (!this.connected) {
|
|
157
|
+
console.warn('Setting quote before connected to the server, ignoring');
|
|
158
|
+
}
|
|
157
159
|
this.quotes.set(quote.marketIndex, quote);
|
|
158
160
|
}
|
|
159
161
|
|