@drift-labs/sdk-browser 2.121.0-beta.6 → 2.121.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 +1 -1
- package/lib/browser/constants/spotMarkets.js +2 -2
- package/lib/browser/indicative-quotes/indicativeQuotesSender.d.ts +0 -1
- package/lib/browser/indicative-quotes/indicativeQuotesSender.js +3 -0
- package/lib/node/constants/spotMarkets.js +2 -2
- 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/constants/spotMarkets.ts +2 -2
- package/src/indicative-quotes/indicativeQuotesSender.ts +5 -3
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.121.0-beta.
|
|
1
|
+
2.121.0-beta.8
|
|
@@ -516,12 +516,12 @@ exports.MainnetSpotMarkets = [
|
|
|
516
516
|
symbol: 'JLP-1',
|
|
517
517
|
marketIndex: 33,
|
|
518
518
|
poolId: 1,
|
|
519
|
-
oracle: new web3_js_1.PublicKey('
|
|
519
|
+
oracle: new web3_js_1.PublicKey('3ZLn5XDgSLWhTk2NjqAU44cPkSeC5JAhW5o6w5Nz4p8R'),
|
|
520
520
|
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
521
521
|
mint: new web3_js_1.PublicKey('27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4'),
|
|
522
522
|
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
523
523
|
precisionExp: numericConstants_1.SIX,
|
|
524
|
-
pythFeedId: '
|
|
524
|
+
pythFeedId: '0x6704952e00b6a088b6dcdb8170dcd591eaf64cff9e996ca75ae0ca55bfb96687',
|
|
525
525
|
launchTs: 1735255852000,
|
|
526
526
|
},
|
|
527
527
|
{
|
|
@@ -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() {
|
|
@@ -516,12 +516,12 @@ exports.MainnetSpotMarkets = [
|
|
|
516
516
|
symbol: 'JLP-1',
|
|
517
517
|
marketIndex: 33,
|
|
518
518
|
poolId: 1,
|
|
519
|
-
oracle: new web3_js_1.PublicKey('
|
|
519
|
+
oracle: new web3_js_1.PublicKey('3ZLn5XDgSLWhTk2NjqAU44cPkSeC5JAhW5o6w5Nz4p8R'),
|
|
520
520
|
oracleSource: __1.OracleSource.PYTH_PULL,
|
|
521
521
|
mint: new web3_js_1.PublicKey('27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4'),
|
|
522
522
|
precision: new __1.BN(10).pow(numericConstants_1.SIX),
|
|
523
523
|
precisionExp: numericConstants_1.SIX,
|
|
524
|
-
pythFeedId: '
|
|
524
|
+
pythFeedId: '0x6704952e00b6a088b6dcdb8170dcd591eaf64cff9e996ca75ae0ca55bfb96687',
|
|
525
525
|
launchTs: 1735255852000,
|
|
526
526
|
},
|
|
527
527
|
{
|
|
@@ -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
|
@@ -616,13 +616,13 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
|
|
|
616
616
|
symbol: 'JLP-1',
|
|
617
617
|
marketIndex: 33,
|
|
618
618
|
poolId: 1,
|
|
619
|
-
oracle: new PublicKey('
|
|
619
|
+
oracle: new PublicKey('3ZLn5XDgSLWhTk2NjqAU44cPkSeC5JAhW5o6w5Nz4p8R'),
|
|
620
620
|
oracleSource: OracleSource.PYTH_PULL,
|
|
621
621
|
mint: new PublicKey('27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4'),
|
|
622
622
|
precision: new BN(10).pow(SIX),
|
|
623
623
|
precisionExp: SIX,
|
|
624
624
|
pythFeedId:
|
|
625
|
-
'
|
|
625
|
+
'0x6704952e00b6a088b6dcdb8170dcd591eaf64cff9e996ca75ae0ca55bfb96687',
|
|
626
626
|
launchTs: 1735255852000,
|
|
627
627
|
},
|
|
628
628
|
{
|
|
@@ -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
|
|