@drift-labs/sdk 2.67.0-beta.5 → 2.67.0-beta.6

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.67.0-beta.5
1
+ 2.67.0-beta.6
@@ -50,8 +50,8 @@ export declare class PollingDriftClientAccountSubscriber implements DriftClientA
50
50
  addPerpMarket(marketIndex: number): Promise<boolean>;
51
51
  addOracle(oracleInfo: OracleInfo): Promise<boolean>;
52
52
  private pauseForOracleToBeAdded;
53
- private setPerpOracleMap;
54
- private setSpotOracleMap;
53
+ setPerpOracleMap(): Promise<void>;
54
+ setSpotOracleMap(): Promise<void>;
55
55
  assertIsSubscribed(): void;
56
56
  getStateAccountAndSlot(): DataAndSlot<StateAccount>;
57
57
  getMarketAccountAndSlot(marketIndex: number): DataAndSlot<PerpMarketAccount> | undefined;
@@ -41,6 +41,8 @@ export interface DriftClientAccountSubscriber {
41
41
  addPerpMarket(marketIndex: number): Promise<boolean>;
42
42
  addSpotMarket(marketIndex: number): Promise<boolean>;
43
43
  addOracle(oracleInfo: OracleInfo): Promise<boolean>;
44
+ setPerpOracleMap(): Promise<void>;
45
+ setSpotOracleMap(): Promise<void>;
44
46
  getStateAccountAndSlot(): DataAndSlot<StateAccount>;
45
47
  getMarketAccountAndSlot(marketIndex: number): DataAndSlot<PerpMarketAccount> | undefined;
46
48
  getMarketAccountsAndSlots(): DataAndSlot<PerpMarketAccount>[];
@@ -44,8 +44,8 @@ export declare class WebSocketDriftClientAccountSubscriber implements DriftClien
44
44
  addSpotMarket(marketIndex: number): Promise<boolean>;
45
45
  addPerpMarket(marketIndex: number): Promise<boolean>;
46
46
  addOracle(oracleInfo: OracleInfo): Promise<boolean>;
47
- private setPerpOracleMap;
48
- private setSpotOracleMap;
47
+ setPerpOracleMap(): Promise<void>;
48
+ setSpotOracleMap(): Promise<void>;
49
49
  assertIsSubscribed(): void;
50
50
  getStateAccountAndSlot(): DataAndSlot<StateAccount>;
51
51
  getMarketAccountAndSlot(marketIndex: number): DataAndSlot<PerpMarketAccount> | undefined;
@@ -88,6 +88,7 @@ class AdminClient extends driftClient_1.DriftClient {
88
88
  source: oracleSource,
89
89
  publicKey: oracle,
90
90
  });
91
+ await this.accountSubscriber.setSpotOracleMap();
91
92
  return txSig;
92
93
  }
93
94
  async initializeSerumFulfillmentConfig(marketIndex, serumMarket, serumProgram) {
@@ -156,6 +157,7 @@ class AdminClient extends driftClient_1.DriftClient {
156
157
  source: oracleSource,
157
158
  publicKey: priceOracle,
158
159
  });
160
+ await this.accountSubscriber.setPerpOracleMap();
159
161
  return txSig;
160
162
  }
161
163
  async deleteInitializedPerpMarket(marketIndex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.67.0-beta.5",
3
+ "version": "2.67.0-beta.6",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -432,7 +432,7 @@ export class PollingDriftClientAccountSubscriber
432
432
  console.log(`Pausing to find oracle ${oracle} failed`);
433
433
  }
434
434
 
435
- private async setPerpOracleMap() {
435
+ async setPerpOracleMap() {
436
436
  const perpMarkets = this.getMarketAccountsAndSlots();
437
437
  for (const perpMarket of perpMarkets) {
438
438
  const perpMarketAccount = perpMarket.data;
@@ -448,7 +448,7 @@ export class PollingDriftClientAccountSubscriber
448
448
  }
449
449
  }
450
450
 
451
- private async setSpotOracleMap() {
451
+ async setSpotOracleMap() {
452
452
  const spotMarkets = this.getSpotMarketAccountsAndSlots();
453
453
  for (const spotMarket of spotMarkets) {
454
454
  const spotMarketAccount = spotMarket.data;
@@ -58,6 +58,8 @@ export interface DriftClientAccountSubscriber {
58
58
  addPerpMarket(marketIndex: number): Promise<boolean>;
59
59
  addSpotMarket(marketIndex: number): Promise<boolean>;
60
60
  addOracle(oracleInfo: OracleInfo): Promise<boolean>;
61
+ setPerpOracleMap(): Promise<void>;
62
+ setSpotOracleMap(): Promise<void>;
61
63
 
62
64
  getStateAccountAndSlot(): DataAndSlot<StateAccount>;
63
65
  getMarketAccountAndSlot(
@@ -311,7 +311,7 @@ export class WebSocketDriftClientAccountSubscriber
311
311
  return this.subscribeToOracle(oracleInfo);
312
312
  }
313
313
 
314
- private async setPerpOracleMap() {
314
+ async setPerpOracleMap() {
315
315
  const perpMarkets = this.getMarketAccountsAndSlots();
316
316
  for (const perpMarket of perpMarkets) {
317
317
  if (!perpMarket) {
@@ -330,7 +330,7 @@ export class WebSocketDriftClientAccountSubscriber
330
330
  }
331
331
  }
332
332
 
333
- private async setSpotOracleMap() {
333
+ async setSpotOracleMap() {
334
334
  const spotMarkets = this.getSpotMarketAccountsAndSlots();
335
335
  for (const spotMarket of spotMarkets) {
336
336
  if (!spotMarket) {
@@ -144,6 +144,7 @@ export class AdminClient extends DriftClient {
144
144
  source: oracleSource,
145
145
  publicKey: oracle,
146
146
  });
147
+ await this.accountSubscriber.setSpotOracleMap();
147
148
 
148
149
  return txSig;
149
150
  }
@@ -283,6 +284,7 @@ export class AdminClient extends DriftClient {
283
284
  source: oracleSource,
284
285
  publicKey: priceOracle,
285
286
  });
287
+ await this.accountSubscriber.setPerpOracleMap();
286
288
 
287
289
  return txSig;
288
290
  }