@drift-labs/sdk-browser 2.128.0-beta.8 → 2.128.0-beta.9
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.128.0-beta.
|
|
1
|
+
2.128.0-beta.9
|
|
@@ -138,7 +138,7 @@ class WebSocketDriftClientAccountSubscriber {
|
|
|
138
138
|
}
|
|
139
139
|
async subscribeToPerpMarketAccount(marketIndex) {
|
|
140
140
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, marketIndex);
|
|
141
|
-
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber(
|
|
141
|
+
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber('perpMarket', this.program, perpMarketPublicKey, undefined, this.resubOpts, this.commitment);
|
|
142
142
|
accountSubscriber.setData(this.initialPerpMarketAccountData.get(marketIndex));
|
|
143
143
|
await accountSubscriber.subscribe((data) => {
|
|
144
144
|
this.eventEmitter.emit('perpMarketAccountUpdate', data);
|
|
@@ -153,7 +153,7 @@ class WebSocketDriftClientAccountSubscriber {
|
|
|
153
153
|
}
|
|
154
154
|
async subscribeToSpotMarketAccount(marketIndex) {
|
|
155
155
|
const marketPublicKey = await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, marketIndex);
|
|
156
|
-
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber(
|
|
156
|
+
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber('spotMarket', this.program, marketPublicKey, undefined, this.resubOpts, this.commitment);
|
|
157
157
|
accountSubscriber.setData(this.initialSpotMarketAccountData.get(marketIndex));
|
|
158
158
|
await accountSubscriber.subscribe((data) => {
|
|
159
159
|
this.eventEmitter.emit('spotMarketAccountUpdate', data);
|
|
@@ -171,7 +171,7 @@ class WebSocketDriftClientAccountSubscriber {
|
|
|
171
171
|
async subscribeToOracle(oracleInfo) {
|
|
172
172
|
const oracleId = (0, oracleId_1.getOracleId)(oracleInfo.publicKey, oracleInfo.source);
|
|
173
173
|
const client = this.oracleClientCache.get(oracleInfo.source, this.program.provider.connection, this.program);
|
|
174
|
-
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber(
|
|
174
|
+
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber('oracle', this.program, oracleInfo.publicKey, (buffer) => {
|
|
175
175
|
return client.getOraclePriceDataFromBuffer(buffer);
|
|
176
176
|
}, this.resubOpts, this.commitment);
|
|
177
177
|
const initialOraclePriceData = this.initialOraclePriceData.get(oracleId);
|
|
@@ -138,7 +138,7 @@ class WebSocketDriftClientAccountSubscriber {
|
|
|
138
138
|
}
|
|
139
139
|
async subscribeToPerpMarketAccount(marketIndex) {
|
|
140
140
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, marketIndex);
|
|
141
|
-
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber(
|
|
141
|
+
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber('perpMarket', this.program, perpMarketPublicKey, undefined, this.resubOpts, this.commitment);
|
|
142
142
|
accountSubscriber.setData(this.initialPerpMarketAccountData.get(marketIndex));
|
|
143
143
|
await accountSubscriber.subscribe((data) => {
|
|
144
144
|
this.eventEmitter.emit('perpMarketAccountUpdate', data);
|
|
@@ -153,7 +153,7 @@ class WebSocketDriftClientAccountSubscriber {
|
|
|
153
153
|
}
|
|
154
154
|
async subscribeToSpotMarketAccount(marketIndex) {
|
|
155
155
|
const marketPublicKey = await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, marketIndex);
|
|
156
|
-
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber(
|
|
156
|
+
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber('spotMarket', this.program, marketPublicKey, undefined, this.resubOpts, this.commitment);
|
|
157
157
|
accountSubscriber.setData(this.initialSpotMarketAccountData.get(marketIndex));
|
|
158
158
|
await accountSubscriber.subscribe((data) => {
|
|
159
159
|
this.eventEmitter.emit('spotMarketAccountUpdate', data);
|
|
@@ -171,7 +171,7 @@ class WebSocketDriftClientAccountSubscriber {
|
|
|
171
171
|
async subscribeToOracle(oracleInfo) {
|
|
172
172
|
const oracleId = (0, oracleId_1.getOracleId)(oracleInfo.publicKey, oracleInfo.source);
|
|
173
173
|
const client = this.oracleClientCache.get(oracleInfo.source, this.program.provider.connection, this.program);
|
|
174
|
-
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber(
|
|
174
|
+
const accountSubscriber = new webSocketAccountSubscriber_1.WebSocketAccountSubscriber('oracle', this.program, oracleInfo.publicKey, (buffer) => {
|
|
175
175
|
return client.getOraclePriceDataFromBuffer(buffer);
|
|
176
176
|
}, this.resubOpts, this.commitment);
|
|
177
177
|
const initialOraclePriceData = this.initialOraclePriceData.get(oracleId);
|
package/package.json
CHANGED
|
@@ -293,7 +293,7 @@ export class WebSocketDriftClientAccountSubscriber
|
|
|
293
293
|
marketIndex
|
|
294
294
|
);
|
|
295
295
|
const accountSubscriber = new WebSocketAccountSubscriber<PerpMarketAccount>(
|
|
296
|
-
|
|
296
|
+
'perpMarket',
|
|
297
297
|
this.program,
|
|
298
298
|
perpMarketPublicKey,
|
|
299
299
|
undefined,
|
|
@@ -326,7 +326,7 @@ export class WebSocketDriftClientAccountSubscriber
|
|
|
326
326
|
marketIndex
|
|
327
327
|
);
|
|
328
328
|
const accountSubscriber = new WebSocketAccountSubscriber<SpotMarketAccount>(
|
|
329
|
-
|
|
329
|
+
'spotMarket',
|
|
330
330
|
this.program,
|
|
331
331
|
marketPublicKey,
|
|
332
332
|
undefined,
|
|
@@ -362,7 +362,7 @@ export class WebSocketDriftClientAccountSubscriber
|
|
|
362
362
|
this.program
|
|
363
363
|
);
|
|
364
364
|
const accountSubscriber = new WebSocketAccountSubscriber<OraclePriceData>(
|
|
365
|
-
|
|
365
|
+
'oracle',
|
|
366
366
|
this.program,
|
|
367
367
|
oracleInfo.publicKey,
|
|
368
368
|
(buffer: Buffer) => {
|