@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 +1 -1
- package/lib/accounts/pollingDriftClientAccountSubscriber.d.ts +2 -2
- package/lib/accounts/types.d.ts +2 -0
- package/lib/accounts/webSocketDriftClientAccountSubscriber.d.ts +2 -2
- package/lib/adminClient.js +2 -0
- package/package.json +1 -1
- package/src/accounts/pollingDriftClientAccountSubscriber.ts +2 -2
- package/src/accounts/types.ts +2 -0
- package/src/accounts/webSocketDriftClientAccountSubscriber.ts +2 -2
- package/src/adminClient.ts +2 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.67.0-beta.
|
|
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
|
-
|
|
54
|
-
|
|
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;
|
package/lib/accounts/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
48
|
-
|
|
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;
|
package/lib/adminClient.js
CHANGED
|
@@ -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
|
@@ -432,7 +432,7 @@ export class PollingDriftClientAccountSubscriber
|
|
|
432
432
|
console.log(`Pausing to find oracle ${oracle} failed`);
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
-
|
|
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
|
-
|
|
451
|
+
async setSpotOracleMap() {
|
|
452
452
|
const spotMarkets = this.getSpotMarketAccountsAndSlots();
|
|
453
453
|
for (const spotMarket of spotMarkets) {
|
|
454
454
|
const spotMarketAccount = spotMarket.data;
|
package/src/accounts/types.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
333
|
+
async setSpotOracleMap() {
|
|
334
334
|
const spotMarkets = this.getSpotMarketAccountsAndSlots();
|
|
335
335
|
for (const spotMarket of spotMarkets) {
|
|
336
336
|
if (!spotMarket) {
|
package/src/adminClient.ts
CHANGED
|
@@ -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
|
}
|