@drift-labs/sdk 2.73.0-beta.0 → 2.73.0-beta.2
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.73.0-beta.
|
|
1
|
+
2.73.0-beta.2
|
package/lib/adminClient.js
CHANGED
|
@@ -607,40 +607,52 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
607
607
|
return txSig;
|
|
608
608
|
}
|
|
609
609
|
async updatePerpMarketMinOrderSize(perpMarketIndex, orderSize) {
|
|
610
|
-
|
|
610
|
+
const updatePerpMarketMinOrderSizeIx = await this.program.instruction.updatePerpMarketMinOrderSize(orderSize, {
|
|
611
611
|
accounts: {
|
|
612
612
|
admin: this.wallet.publicKey,
|
|
613
613
|
state: await this.getStatePublicKey(),
|
|
614
614
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
615
615
|
},
|
|
616
616
|
});
|
|
617
|
+
const tx = await this.buildTransaction(updatePerpMarketMinOrderSizeIx);
|
|
618
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
619
|
+
return txSig;
|
|
617
620
|
}
|
|
618
621
|
async updateSpotMarketStepSizeAndTickSize(spotMarketIndex, stepSize, tickSize) {
|
|
619
|
-
|
|
622
|
+
const updateSpotMarketStepSizeAndTickSizeIx = await this.program.instruction.updateSpotMarketStepSizeAndTickSize(stepSize, tickSize, {
|
|
620
623
|
accounts: {
|
|
621
624
|
admin: this.wallet.publicKey,
|
|
622
625
|
state: await this.getStatePublicKey(),
|
|
623
626
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
624
627
|
},
|
|
625
628
|
});
|
|
629
|
+
const tx = await this.buildTransaction(updateSpotMarketStepSizeAndTickSizeIx);
|
|
630
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
631
|
+
return txSig;
|
|
626
632
|
}
|
|
627
633
|
async updateSpotMarketMinOrderSize(spotMarketIndex, orderSize) {
|
|
628
|
-
|
|
634
|
+
const updateSpotMarketMinOrderSizeIx = await this.program.instruction.updateSpotMarketMinOrderSize(orderSize, {
|
|
629
635
|
accounts: {
|
|
630
636
|
admin: this.wallet.publicKey,
|
|
631
637
|
state: await this.getStatePublicKey(),
|
|
632
638
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
633
639
|
},
|
|
634
640
|
});
|
|
641
|
+
const tx = await this.buildTransaction(updateSpotMarketMinOrderSizeIx);
|
|
642
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
643
|
+
return txSig;
|
|
635
644
|
}
|
|
636
645
|
async updatePerpMarketExpiry(perpMarketIndex, expiryTs) {
|
|
637
|
-
|
|
646
|
+
const updatePerpMarketExpiryIx = await this.program.instruction.updatePerpMarketExpiry(expiryTs, {
|
|
638
647
|
accounts: {
|
|
639
648
|
admin: this.wallet.publicKey,
|
|
640
649
|
state: await this.getStatePublicKey(),
|
|
641
650
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
642
651
|
},
|
|
643
652
|
});
|
|
653
|
+
const tx = await this.buildTransaction(updatePerpMarketExpiryIx);
|
|
654
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
655
|
+
return txSig;
|
|
644
656
|
}
|
|
645
657
|
async updateSpotMarketOracle(spotMarketIndex, oracle, oracleSource) {
|
|
646
658
|
return await this.program.rpc.updateSpotMarketOracle(oracle, oracleSource, {
|
|
@@ -992,10 +1004,12 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
992
1004
|
price: price || null,
|
|
993
1005
|
maxPrice: maxPrice || null,
|
|
994
1006
|
};
|
|
1007
|
+
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
995
1008
|
const updatePrelaunchOracleParamsIx = await this.program.instruction.updatePrelaunchOracleParams(params, {
|
|
996
1009
|
accounts: {
|
|
997
1010
|
admin: this.wallet.publicKey,
|
|
998
1011
|
state: await this.getStatePublicKey(),
|
|
1012
|
+
perpMarket: perpMarketPublicKey,
|
|
999
1013
|
prelaunchOracle: await (0, pda_1.getPrelaunchOraclePublicKey)(this.program.programId, perpMarketIndex),
|
|
1000
1014
|
},
|
|
1001
1015
|
});
|
|
@@ -26,6 +26,7 @@ export declare class PriorityFeeSubscriber {
|
|
|
26
26
|
private loadForSolana;
|
|
27
27
|
private loadForHelius;
|
|
28
28
|
getMaxPriorityFee(): number | undefined;
|
|
29
|
+
updateMaxPriorityFee(newMaxFee: number | undefined): void;
|
|
29
30
|
getHeliusPriorityFeeLevel(level?: HeliusPriorityLevel): number;
|
|
30
31
|
getCustomStrategyResult(): number;
|
|
31
32
|
getAvgStrategyResult(): number;
|
|
@@ -84,6 +84,9 @@ class PriorityFeeSubscriber {
|
|
|
84
84
|
getMaxPriorityFee() {
|
|
85
85
|
return this.maxFeeMicroLamports;
|
|
86
86
|
}
|
|
87
|
+
updateMaxPriorityFee(newMaxFee) {
|
|
88
|
+
this.maxFeeMicroLamports = newMaxFee;
|
|
89
|
+
}
|
|
87
90
|
getHeliusPriorityFeeLevel(level = heliusPriorityFeeMethod_1.HeliusPriorityLevel.MEDIUM) {
|
|
88
91
|
if (this.lastHeliusSample === undefined) {
|
|
89
92
|
return 0;
|
package/package.json
CHANGED
package/src/adminClient.ts
CHANGED
|
@@ -1180,16 +1180,23 @@ export class AdminClient extends DriftClient {
|
|
|
1180
1180
|
perpMarketIndex: number,
|
|
1181
1181
|
orderSize: BN
|
|
1182
1182
|
): Promise<TransactionSignature> {
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1183
|
+
const updatePerpMarketMinOrderSizeIx =
|
|
1184
|
+
await this.program.instruction.updatePerpMarketMinOrderSize(orderSize, {
|
|
1185
|
+
accounts: {
|
|
1186
|
+
admin: this.wallet.publicKey,
|
|
1187
|
+
state: await this.getStatePublicKey(),
|
|
1188
|
+
perpMarket: await getPerpMarketPublicKey(
|
|
1189
|
+
this.program.programId,
|
|
1190
|
+
perpMarketIndex
|
|
1191
|
+
),
|
|
1192
|
+
},
|
|
1193
|
+
});
|
|
1194
|
+
|
|
1195
|
+
const tx = await this.buildTransaction(updatePerpMarketMinOrderSizeIx);
|
|
1196
|
+
|
|
1197
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1198
|
+
|
|
1199
|
+
return txSig;
|
|
1193
1200
|
}
|
|
1194
1201
|
|
|
1195
1202
|
public async updateSpotMarketStepSizeAndTickSize(
|
|
@@ -1197,10 +1204,37 @@ export class AdminClient extends DriftClient {
|
|
|
1197
1204
|
stepSize: BN,
|
|
1198
1205
|
tickSize: BN
|
|
1199
1206
|
): Promise<TransactionSignature> {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1207
|
+
const updateSpotMarketStepSizeAndTickSizeIx =
|
|
1208
|
+
await this.program.instruction.updateSpotMarketStepSizeAndTickSize(
|
|
1209
|
+
stepSize,
|
|
1210
|
+
tickSize,
|
|
1211
|
+
{
|
|
1212
|
+
accounts: {
|
|
1213
|
+
admin: this.wallet.publicKey,
|
|
1214
|
+
state: await this.getStatePublicKey(),
|
|
1215
|
+
spotMarket: await getSpotMarketPublicKey(
|
|
1216
|
+
this.program.programId,
|
|
1217
|
+
spotMarketIndex
|
|
1218
|
+
),
|
|
1219
|
+
},
|
|
1220
|
+
}
|
|
1221
|
+
);
|
|
1222
|
+
|
|
1223
|
+
const tx = await this.buildTransaction(
|
|
1224
|
+
updateSpotMarketStepSizeAndTickSizeIx
|
|
1225
|
+
);
|
|
1226
|
+
|
|
1227
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1228
|
+
|
|
1229
|
+
return txSig;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
public async updateSpotMarketMinOrderSize(
|
|
1233
|
+
spotMarketIndex: number,
|
|
1234
|
+
orderSize: BN
|
|
1235
|
+
): Promise<TransactionSignature> {
|
|
1236
|
+
const updateSpotMarketMinOrderSizeIx =
|
|
1237
|
+
await this.program.instruction.updateSpotMarketMinOrderSize(orderSize, {
|
|
1204
1238
|
accounts: {
|
|
1205
1239
|
admin: this.wallet.publicKey,
|
|
1206
1240
|
state: await this.getStatePublicKey(),
|
|
@@ -1209,40 +1243,35 @@ export class AdminClient extends DriftClient {
|
|
|
1209
1243
|
spotMarketIndex
|
|
1210
1244
|
),
|
|
1211
1245
|
},
|
|
1212
|
-
}
|
|
1213
|
-
);
|
|
1214
|
-
}
|
|
1246
|
+
});
|
|
1215
1247
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
return
|
|
1221
|
-
accounts: {
|
|
1222
|
-
admin: this.wallet.publicKey,
|
|
1223
|
-
state: await this.getStatePublicKey(),
|
|
1224
|
-
spotMarket: await getSpotMarketPublicKey(
|
|
1225
|
-
this.program.programId,
|
|
1226
|
-
spotMarketIndex
|
|
1227
|
-
),
|
|
1228
|
-
},
|
|
1229
|
-
});
|
|
1248
|
+
const tx = await this.buildTransaction(updateSpotMarketMinOrderSizeIx);
|
|
1249
|
+
|
|
1250
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1251
|
+
|
|
1252
|
+
return txSig;
|
|
1230
1253
|
}
|
|
1231
1254
|
|
|
1232
1255
|
public async updatePerpMarketExpiry(
|
|
1233
1256
|
perpMarketIndex: number,
|
|
1234
1257
|
expiryTs: BN
|
|
1235
1258
|
): Promise<TransactionSignature> {
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1259
|
+
const updatePerpMarketExpiryIx =
|
|
1260
|
+
await this.program.instruction.updatePerpMarketExpiry(expiryTs, {
|
|
1261
|
+
accounts: {
|
|
1262
|
+
admin: this.wallet.publicKey,
|
|
1263
|
+
state: await this.getStatePublicKey(),
|
|
1264
|
+
perpMarket: await getPerpMarketPublicKey(
|
|
1265
|
+
this.program.programId,
|
|
1266
|
+
perpMarketIndex
|
|
1267
|
+
),
|
|
1268
|
+
},
|
|
1269
|
+
});
|
|
1270
|
+
const tx = await this.buildTransaction(updatePerpMarketExpiryIx);
|
|
1271
|
+
|
|
1272
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
1273
|
+
|
|
1274
|
+
return txSig;
|
|
1246
1275
|
}
|
|
1247
1276
|
|
|
1248
1277
|
public async updateSpotMarketOracle(
|
|
@@ -1945,11 +1974,17 @@ export class AdminClient extends DriftClient {
|
|
|
1945
1974
|
maxPrice: maxPrice || null,
|
|
1946
1975
|
};
|
|
1947
1976
|
|
|
1977
|
+
const perpMarketPublicKey = await getPerpMarketPublicKey(
|
|
1978
|
+
this.program.programId,
|
|
1979
|
+
perpMarketIndex
|
|
1980
|
+
);
|
|
1981
|
+
|
|
1948
1982
|
const updatePrelaunchOracleParamsIx =
|
|
1949
1983
|
await this.program.instruction.updatePrelaunchOracleParams(params, {
|
|
1950
1984
|
accounts: {
|
|
1951
1985
|
admin: this.wallet.publicKey,
|
|
1952
1986
|
state: await this.getStatePublicKey(),
|
|
1987
|
+
perpMarket: perpMarketPublicKey,
|
|
1953
1988
|
prelaunchOracle: await getPrelaunchOraclePublicKey(
|
|
1954
1989
|
this.program.programId,
|
|
1955
1990
|
perpMarketIndex
|
|
@@ -122,6 +122,10 @@ export class PriorityFeeSubscriber {
|
|
|
122
122
|
return this.maxFeeMicroLamports;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
public updateMaxPriorityFee(newMaxFee: number | undefined) {
|
|
126
|
+
this.maxFeeMicroLamports = newMaxFee;
|
|
127
|
+
}
|
|
128
|
+
|
|
125
129
|
public getHeliusPriorityFeeLevel(
|
|
126
130
|
level: HeliusPriorityLevel = HeliusPriorityLevel.MEDIUM
|
|
127
131
|
): number {
|