@drift-labs/sdk 2.73.0-beta.1 → 2.74.0-beta.0
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/adminClient.js +106 -26
- package/lib/idl/drift.json +1 -1
- package/package.json +1 -1
- package/src/adminClient.ts +488 -279
- package/src/idl/drift.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.74.0-beta.0
|
package/lib/adminClient.js
CHANGED
|
@@ -216,13 +216,16 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
216
216
|
return txSig;
|
|
217
217
|
}
|
|
218
218
|
async updatePerpMarketConcentrationScale(perpMarketIndex, concentrationScale) {
|
|
219
|
-
|
|
219
|
+
const updatePerpMarketConcentrationCoefIx = await this.program.instruction.updatePerpMarketConcentrationCoef(concentrationScale, {
|
|
220
220
|
accounts: {
|
|
221
221
|
state: await this.getStatePublicKey(),
|
|
222
222
|
admin: this.wallet.publicKey,
|
|
223
223
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
224
224
|
},
|
|
225
225
|
});
|
|
226
|
+
const tx = await this.buildTransaction(updatePerpMarketConcentrationCoefIx);
|
|
227
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
228
|
+
return txSig;
|
|
226
229
|
}
|
|
227
230
|
async moveAmmToPrice(perpMarketIndex, targetPrice) {
|
|
228
231
|
const perpMarket = this.getPerpMarketAccount(perpMarketIndex);
|
|
@@ -259,7 +262,7 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
259
262
|
async updatePerpMarketAmmOracleTwap(perpMarketIndex) {
|
|
260
263
|
const ammData = this.getPerpMarketAccount(perpMarketIndex).amm;
|
|
261
264
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
262
|
-
|
|
265
|
+
const updatePerpMarketAmmOracleTwapIx = await this.program.instruction.updatePerpMarketAmmOracleTwap({
|
|
263
266
|
accounts: {
|
|
264
267
|
state: await this.getStatePublicKey(),
|
|
265
268
|
admin: this.wallet.publicKey,
|
|
@@ -267,11 +270,14 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
267
270
|
perpMarket: perpMarketPublicKey,
|
|
268
271
|
},
|
|
269
272
|
});
|
|
273
|
+
const tx = await this.buildTransaction(updatePerpMarketAmmOracleTwapIx);
|
|
274
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
275
|
+
return txSig;
|
|
270
276
|
}
|
|
271
277
|
async resetPerpMarketAmmOracleTwap(perpMarketIndex) {
|
|
272
278
|
const ammData = this.getPerpMarketAccount(perpMarketIndex).amm;
|
|
273
279
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
274
|
-
|
|
280
|
+
const resetPerpMarketAmmOracleTwapIx = await this.program.instruction.resetPerpMarketAmmOracleTwap({
|
|
275
281
|
accounts: {
|
|
276
282
|
state: await this.getStatePublicKey(),
|
|
277
283
|
admin: this.wallet.publicKey,
|
|
@@ -279,6 +285,9 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
279
285
|
perpMarket: perpMarketPublicKey,
|
|
280
286
|
},
|
|
281
287
|
});
|
|
288
|
+
const tx = await this.buildTransaction(resetPerpMarketAmmOracleTwapIx);
|
|
289
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
290
|
+
return txSig;
|
|
282
291
|
}
|
|
283
292
|
async depositIntoPerpMarketFeePool(perpMarketIndex, amount, sourceVault) {
|
|
284
293
|
const spotMarket = this.getQuoteSpotMarketAccount();
|
|
@@ -312,22 +321,28 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
312
321
|
async updatePerpMarketCurveUpdateIntensity(perpMarketIndex, curveUpdateIntensity) {
|
|
313
322
|
// assert(curveUpdateIntensity >= 0 && curveUpdateIntensity <= 100);
|
|
314
323
|
// assert(Number.isInteger(curveUpdateIntensity));
|
|
315
|
-
|
|
324
|
+
const updatePerpMarketCurveUpdateIntensityIx = await this.program.instruction.updatePerpMarketCurveUpdateIntensity(curveUpdateIntensity, {
|
|
316
325
|
accounts: {
|
|
317
326
|
admin: this.wallet.publicKey,
|
|
318
327
|
state: await this.getStatePublicKey(),
|
|
319
328
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
320
329
|
},
|
|
321
330
|
});
|
|
331
|
+
const tx = await this.buildTransaction(updatePerpMarketCurveUpdateIntensityIx);
|
|
332
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
333
|
+
return txSig;
|
|
322
334
|
}
|
|
323
335
|
async updatePerpMarketTargetBaseAssetAmountPerLp(perpMarketIndex, targetBaseAssetAmountPerLP) {
|
|
324
|
-
|
|
336
|
+
const updatePerpMarketTargetBaseAssetAmountPerLpIx = await this.program.instruction.updatePerpMarketTargetBaseAssetAmountPerLp(targetBaseAssetAmountPerLP, {
|
|
325
337
|
accounts: {
|
|
326
338
|
admin: this.wallet.publicKey,
|
|
327
339
|
state: await this.getStatePublicKey(),
|
|
328
340
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
329
341
|
},
|
|
330
342
|
});
|
|
343
|
+
const tx = await this.buildTransaction(updatePerpMarketTargetBaseAssetAmountPerLpIx);
|
|
344
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
345
|
+
return txSig;
|
|
331
346
|
}
|
|
332
347
|
async updatePerpMarketMarginRatio(perpMarketIndex, marginRatioInitial, marginRatioMaintenance) {
|
|
333
348
|
const updatePerpMarketMarginRatioIx = await this.program.instruction.updatePerpMarketMarginRatio(marginRatioInitial, marginRatioMaintenance, {
|
|
@@ -342,13 +357,16 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
342
357
|
return txSig;
|
|
343
358
|
}
|
|
344
359
|
async updatePerpMarketImfFactor(perpMarketIndex, imfFactor, unrealizedPnlImfFactor) {
|
|
345
|
-
|
|
360
|
+
const updatePerpMarketImfFactorIx = await this.program.instruction.updatePerpMarketImfFactor(imfFactor, unrealizedPnlImfFactor, {
|
|
346
361
|
accounts: {
|
|
347
362
|
admin: this.wallet.publicKey,
|
|
348
363
|
state: await this.getStatePublicKey(),
|
|
349
364
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
350
365
|
},
|
|
351
366
|
});
|
|
367
|
+
const tx = await this.buildTransaction(updatePerpMarketImfFactorIx);
|
|
368
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
369
|
+
return txSig;
|
|
352
370
|
}
|
|
353
371
|
async updatePerpMarketBaseSpread(perpMarketIndex, baseSpread) {
|
|
354
372
|
const updatePerpMarketBaseSpreadIx = await this.program.instruction.updatePerpMarketBaseSpread(baseSpread, {
|
|
@@ -389,33 +407,42 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
389
407
|
}
|
|
390
408
|
async updateSpotMarketName(spotMarketIndex, name) {
|
|
391
409
|
const nameBuffer = (0, userName_1.encodeName)(name);
|
|
392
|
-
|
|
410
|
+
const updateSpotMarketNameIx = await this.program.instruction.updateSpotMarketName(nameBuffer, {
|
|
393
411
|
accounts: {
|
|
394
412
|
admin: this.wallet.publicKey,
|
|
395
413
|
state: await this.getStatePublicKey(),
|
|
396
414
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
397
415
|
},
|
|
398
416
|
});
|
|
417
|
+
const tx = await this.buildTransaction(updateSpotMarketNameIx);
|
|
418
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
419
|
+
return txSig;
|
|
399
420
|
}
|
|
400
421
|
async updatePerpMarketPerLpBase(perpMarketIndex, perLpBase) {
|
|
401
422
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
402
|
-
|
|
423
|
+
const updatePerpMarketPerLpBaseIx = await this.program.instruction.updatePerpMarketPerLpBase(perLpBase, {
|
|
403
424
|
accounts: {
|
|
404
425
|
admin: this.wallet.publicKey,
|
|
405
426
|
state: await this.getStatePublicKey(),
|
|
406
427
|
perpMarket: perpMarketPublicKey,
|
|
407
428
|
},
|
|
408
429
|
});
|
|
430
|
+
const tx = await this.buildTransaction(updatePerpMarketPerLpBaseIx);
|
|
431
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
432
|
+
return txSig;
|
|
409
433
|
}
|
|
410
434
|
async updatePerpMarketMaxSpread(perpMarketIndex, maxSpread) {
|
|
411
435
|
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
412
|
-
|
|
436
|
+
const updatePerpMarketMaxSpreadIx = await this.program.instruction.updatePerpMarketMaxSpread(maxSpread, {
|
|
413
437
|
accounts: {
|
|
414
438
|
admin: this.wallet.publicKey,
|
|
415
439
|
state: await this.getStatePublicKey(),
|
|
416
440
|
perpMarket: perpMarketPublicKey,
|
|
417
441
|
},
|
|
418
442
|
});
|
|
443
|
+
const tx = await this.buildTransaction(updatePerpMarketMaxSpreadIx);
|
|
444
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
445
|
+
return txSig;
|
|
419
446
|
}
|
|
420
447
|
async updatePerpFeeStructure(feeStructure) {
|
|
421
448
|
const updatePerpFeeStructureIx = this.program.instruction.updatePerpFeeStructure(feeStructure, {
|
|
@@ -440,28 +467,37 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
440
467
|
return txSig;
|
|
441
468
|
}
|
|
442
469
|
async updateInitialPctToLiquidate(initialPctToLiquidate) {
|
|
443
|
-
|
|
470
|
+
const updateInitialPctToLiquidateIx = await this.program.instruction.updateInitialPctToLiquidate(initialPctToLiquidate, {
|
|
444
471
|
accounts: {
|
|
445
472
|
admin: this.wallet.publicKey,
|
|
446
473
|
state: await this.getStatePublicKey(),
|
|
447
474
|
},
|
|
448
475
|
});
|
|
476
|
+
const tx = await this.buildTransaction(updateInitialPctToLiquidateIx);
|
|
477
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
478
|
+
return txSig;
|
|
449
479
|
}
|
|
450
480
|
async updateLiquidationDuration(liquidationDuration) {
|
|
451
|
-
|
|
481
|
+
const updateLiquidationDurationIx = await this.program.instruction.updateLiquidationDuration(liquidationDuration, {
|
|
452
482
|
accounts: {
|
|
453
483
|
admin: this.wallet.publicKey,
|
|
454
484
|
state: await this.getStatePublicKey(),
|
|
455
485
|
},
|
|
456
486
|
});
|
|
487
|
+
const tx = await this.buildTransaction(updateLiquidationDurationIx);
|
|
488
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
489
|
+
return txSig;
|
|
457
490
|
}
|
|
458
491
|
async updateLiquidationMarginBufferRatio(updateLiquidationMarginBufferRatio) {
|
|
459
|
-
|
|
492
|
+
const updateLiquidationMarginBufferRatioIx = await this.program.instruction.updateLiquidationMarginBufferRatio(updateLiquidationMarginBufferRatio, {
|
|
460
493
|
accounts: {
|
|
461
494
|
admin: this.wallet.publicKey,
|
|
462
495
|
state: await this.getStatePublicKey(),
|
|
463
496
|
},
|
|
464
497
|
});
|
|
498
|
+
const tx = await this.buildTransaction(updateLiquidationMarginBufferRatioIx);
|
|
499
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
500
|
+
return txSig;
|
|
465
501
|
}
|
|
466
502
|
async updateOracleGuardRails(oracleGuardRails) {
|
|
467
503
|
const updateOracleGuardRailsIx = await this.program.instruction.updateOracleGuardRails(oracleGuardRails, {
|
|
@@ -475,28 +511,37 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
475
511
|
return txSig;
|
|
476
512
|
}
|
|
477
513
|
async updateStateSettlementDuration(settlementDuration) {
|
|
478
|
-
|
|
514
|
+
const updateStateSettlementDurationIx = await this.program.instruction.updateStateSettlementDuration(settlementDuration, {
|
|
479
515
|
accounts: {
|
|
480
516
|
admin: this.wallet.publicKey,
|
|
481
517
|
state: await this.getStatePublicKey(),
|
|
482
518
|
},
|
|
483
519
|
});
|
|
520
|
+
const tx = await this.buildTransaction(updateStateSettlementDurationIx);
|
|
521
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
522
|
+
return txSig;
|
|
484
523
|
}
|
|
485
524
|
async updateStateMaxNumberOfSubAccounts(maxNumberOfSubAccounts) {
|
|
486
|
-
|
|
525
|
+
const updateStateMaxNumberOfSubAccountsIx = await this.program.instruction.updateStateMaxNumberOfSubAccounts(maxNumberOfSubAccounts, {
|
|
487
526
|
accounts: {
|
|
488
527
|
admin: this.wallet.publicKey,
|
|
489
528
|
state: await this.getStatePublicKey(),
|
|
490
529
|
},
|
|
491
530
|
});
|
|
531
|
+
const tx = await this.buildTransaction(updateStateMaxNumberOfSubAccountsIx);
|
|
532
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
533
|
+
return txSig;
|
|
492
534
|
}
|
|
493
535
|
async updateStateMaxInitializeUserFee(maxInitializeUserFee) {
|
|
494
|
-
|
|
536
|
+
const updateStateMaxInitializeUserFeeIx = await this.program.instruction.updateStateMaxInitializeUserFee(maxInitializeUserFee, {
|
|
495
537
|
accounts: {
|
|
496
538
|
admin: this.wallet.publicKey,
|
|
497
539
|
state: await this.getStatePublicKey(),
|
|
498
540
|
},
|
|
499
541
|
});
|
|
542
|
+
const tx = await this.buildTransaction(updateStateMaxInitializeUserFeeIx);
|
|
543
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
544
|
+
return txSig;
|
|
500
545
|
}
|
|
501
546
|
async updateWithdrawGuardThreshold(spotMarketIndex, withdrawGuardThreshold) {
|
|
502
547
|
const updateWithdrawGuardThresholdIx = await this.program.instruction.updateWithdrawGuardThreshold(withdrawGuardThreshold, {
|
|
@@ -607,43 +652,55 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
607
652
|
return txSig;
|
|
608
653
|
}
|
|
609
654
|
async updatePerpMarketMinOrderSize(perpMarketIndex, orderSize) {
|
|
610
|
-
|
|
655
|
+
const updatePerpMarketMinOrderSizeIx = await this.program.instruction.updatePerpMarketMinOrderSize(orderSize, {
|
|
611
656
|
accounts: {
|
|
612
657
|
admin: this.wallet.publicKey,
|
|
613
658
|
state: await this.getStatePublicKey(),
|
|
614
659
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
615
660
|
},
|
|
616
661
|
});
|
|
662
|
+
const tx = await this.buildTransaction(updatePerpMarketMinOrderSizeIx);
|
|
663
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
664
|
+
return txSig;
|
|
617
665
|
}
|
|
618
666
|
async updateSpotMarketStepSizeAndTickSize(spotMarketIndex, stepSize, tickSize) {
|
|
619
|
-
|
|
667
|
+
const updateSpotMarketStepSizeAndTickSizeIx = await this.program.instruction.updateSpotMarketStepSizeAndTickSize(stepSize, tickSize, {
|
|
620
668
|
accounts: {
|
|
621
669
|
admin: this.wallet.publicKey,
|
|
622
670
|
state: await this.getStatePublicKey(),
|
|
623
671
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
624
672
|
},
|
|
625
673
|
});
|
|
674
|
+
const tx = await this.buildTransaction(updateSpotMarketStepSizeAndTickSizeIx);
|
|
675
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
676
|
+
return txSig;
|
|
626
677
|
}
|
|
627
678
|
async updateSpotMarketMinOrderSize(spotMarketIndex, orderSize) {
|
|
628
|
-
|
|
679
|
+
const updateSpotMarketMinOrderSizeIx = await this.program.instruction.updateSpotMarketMinOrderSize(orderSize, {
|
|
629
680
|
accounts: {
|
|
630
681
|
admin: this.wallet.publicKey,
|
|
631
682
|
state: await this.getStatePublicKey(),
|
|
632
683
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
633
684
|
},
|
|
634
685
|
});
|
|
686
|
+
const tx = await this.buildTransaction(updateSpotMarketMinOrderSizeIx);
|
|
687
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
688
|
+
return txSig;
|
|
635
689
|
}
|
|
636
690
|
async updatePerpMarketExpiry(perpMarketIndex, expiryTs) {
|
|
637
|
-
|
|
691
|
+
const updatePerpMarketExpiryIx = await this.program.instruction.updatePerpMarketExpiry(expiryTs, {
|
|
638
692
|
accounts: {
|
|
639
693
|
admin: this.wallet.publicKey,
|
|
640
694
|
state: await this.getStatePublicKey(),
|
|
641
695
|
perpMarket: await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex),
|
|
642
696
|
},
|
|
643
697
|
});
|
|
698
|
+
const tx = await this.buildTransaction(updatePerpMarketExpiryIx);
|
|
699
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
700
|
+
return txSig;
|
|
644
701
|
}
|
|
645
702
|
async updateSpotMarketOracle(spotMarketIndex, oracle, oracleSource) {
|
|
646
|
-
|
|
703
|
+
const updateSpotMarketOracleIx = await this.program.instruction.updateSpotMarketOracle(oracle, oracleSource, {
|
|
647
704
|
accounts: {
|
|
648
705
|
admin: this.wallet.publicKey,
|
|
649
706
|
state: await this.getStatePublicKey(),
|
|
@@ -651,42 +708,57 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
651
708
|
oracle: oracle,
|
|
652
709
|
},
|
|
653
710
|
});
|
|
711
|
+
const tx = await this.buildTransaction(updateSpotMarketOracleIx);
|
|
712
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
713
|
+
return txSig;
|
|
654
714
|
}
|
|
655
715
|
async updateSpotMarketOrdersEnabled(spotMarketIndex, ordersEnabled) {
|
|
656
|
-
|
|
716
|
+
const updateSpotMarketOrdersEnabledIx = await this.program.instruction.updateSpotMarketOrdersEnabled(ordersEnabled, {
|
|
657
717
|
accounts: {
|
|
658
718
|
admin: this.wallet.publicKey,
|
|
659
719
|
state: await this.getStatePublicKey(),
|
|
660
720
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
661
721
|
},
|
|
662
722
|
});
|
|
723
|
+
const tx = await this.buildTransaction(updateSpotMarketOrdersEnabledIx);
|
|
724
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
725
|
+
return txSig;
|
|
663
726
|
}
|
|
664
727
|
async updateSerumFulfillmentConfigStatus(serumFulfillmentConfig, status) {
|
|
665
|
-
|
|
728
|
+
const updateSerumFulfillmentConfigStatusIx = await this.program.instruction.updateSerumFulfillmentConfigStatus(status, {
|
|
666
729
|
accounts: {
|
|
667
730
|
admin: this.wallet.publicKey,
|
|
668
731
|
state: await this.getStatePublicKey(),
|
|
669
732
|
serumFulfillmentConfig,
|
|
670
733
|
},
|
|
671
734
|
});
|
|
735
|
+
const tx = await this.buildTransaction(updateSerumFulfillmentConfigStatusIx);
|
|
736
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
737
|
+
return txSig;
|
|
672
738
|
}
|
|
673
739
|
async updatePhoenixFulfillmentConfigStatus(phoenixFulfillmentConfig, status) {
|
|
674
|
-
|
|
740
|
+
const updatePhoenixFulfillmentConfigStatusIx = await this.program.instruction.phoenixFulfillmentConfigStatus(status, {
|
|
675
741
|
accounts: {
|
|
676
742
|
admin: this.wallet.publicKey,
|
|
677
743
|
state: await this.getStatePublicKey(),
|
|
678
744
|
phoenixFulfillmentConfig,
|
|
679
745
|
},
|
|
680
746
|
});
|
|
747
|
+
const tx = await this.buildTransaction(updatePhoenixFulfillmentConfigStatusIx);
|
|
748
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
749
|
+
return txSig;
|
|
681
750
|
}
|
|
682
751
|
async updateSpotMarketExpiry(spotMarketIndex, expiryTs) {
|
|
683
|
-
|
|
752
|
+
const updateSpotMarketExpiryIx = await this.program.instruction.updateSpotMarketExpiry(expiryTs, {
|
|
684
753
|
accounts: {
|
|
685
754
|
admin: this.wallet.publicKey,
|
|
686
755
|
state: await this.getStatePublicKey(),
|
|
687
756
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
688
757
|
},
|
|
689
758
|
});
|
|
759
|
+
const tx = await this.buildTransaction(updateSpotMarketExpiryIx);
|
|
760
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
761
|
+
return txSig;
|
|
690
762
|
}
|
|
691
763
|
async updateWhitelistMint(whitelistMint) {
|
|
692
764
|
const updateWhitelistMintIx = await this.program.instruction.updateWhitelistMint(whitelistMint, {
|
|
@@ -711,22 +783,28 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
711
783
|
return txSig;
|
|
712
784
|
}
|
|
713
785
|
async updateSpotMarketMarginWeights(spotMarketIndex, initialAssetWeight, maintenanceAssetWeight, initialLiabilityWeight, maintenanceLiabilityWeight, imfFactor = 0) {
|
|
714
|
-
|
|
786
|
+
const updateSpotMarketMarginWeightsIx = await this.program.instruction.updateSpotMarketMarginWeights(initialAssetWeight, maintenanceAssetWeight, initialLiabilityWeight, maintenanceLiabilityWeight, imfFactor, {
|
|
715
787
|
accounts: {
|
|
716
788
|
admin: this.wallet.publicKey,
|
|
717
789
|
state: await this.getStatePublicKey(),
|
|
718
790
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
719
791
|
},
|
|
720
792
|
});
|
|
793
|
+
const tx = await this.buildTransaction(updateSpotMarketMarginWeightsIx);
|
|
794
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
795
|
+
return txSig;
|
|
721
796
|
}
|
|
722
797
|
async updateSpotMarketBorrowRate(spotMarketIndex, optimalUtilization, optimalBorrowRate, optimalMaxRate) {
|
|
723
|
-
|
|
798
|
+
const updateSpotMarketBorrowRateIx = await this.program.instruction.updateSpotMarketBorrowRate(optimalUtilization, optimalBorrowRate, optimalMaxRate, {
|
|
724
799
|
accounts: {
|
|
725
800
|
admin: this.wallet.publicKey,
|
|
726
801
|
state: await this.getStatePublicKey(),
|
|
727
802
|
spotMarket: await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, spotMarketIndex),
|
|
728
803
|
},
|
|
729
804
|
});
|
|
805
|
+
const tx = await this.buildTransaction(updateSpotMarketBorrowRateIx);
|
|
806
|
+
const { txSig } = await this.sendTransaction(tx, [], this.opts);
|
|
807
|
+
return txSig;
|
|
730
808
|
}
|
|
731
809
|
async updateSpotMarketAssetTier(spotMarketIndex, assetTier) {
|
|
732
810
|
const updateSpotMarketAssetTierIx = await this.program.instruction.updateSpotMarketAssetTier(assetTier, {
|
|
@@ -992,10 +1070,12 @@ class AdminClient extends driftClient_1.DriftClient {
|
|
|
992
1070
|
price: price || null,
|
|
993
1071
|
maxPrice: maxPrice || null,
|
|
994
1072
|
};
|
|
1073
|
+
const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
|
|
995
1074
|
const updatePrelaunchOracleParamsIx = await this.program.instruction.updatePrelaunchOracleParams(params, {
|
|
996
1075
|
accounts: {
|
|
997
1076
|
admin: this.wallet.publicKey,
|
|
998
1077
|
state: await this.getStatePublicKey(),
|
|
1078
|
+
perpMarket: perpMarketPublicKey,
|
|
999
1079
|
prelaunchOracle: await (0, pda_1.getPrelaunchOraclePublicKey)(this.program.programId, perpMarketIndex),
|
|
1000
1080
|
},
|
|
1001
1081
|
});
|
package/lib/idl/drift.json
CHANGED