@drift-labs/sdk 2.97.0-beta.1 → 2.97.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.97.0-beta.1
1
+ 2.97.0-beta.2
@@ -354,7 +354,8 @@ export declare class DriftClient {
354
354
  getUpdateAMMsIx(marketIndexes: number[]): Promise<TransactionInstruction>;
355
355
  settleExpiredMarket(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
356
356
  getSettleExpiredMarketIx(marketIndex: number): Promise<TransactionInstruction>;
357
- settleExpiredMarketPoolsToRevenuePool(perpMarketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
357
+ settleExpiredMarketPoolsToRevenuePool(marketIndex: number, txParams?: TxParams): Promise<TransactionSignature>;
358
+ getSettleExpiredMarketPoolsToRevenuePoolIx(perpMarketIndex: number): Promise<TransactionInstruction>;
358
359
  cancelOrder(orderId?: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
359
360
  getCancelOrderIx(orderId?: number, subAccountId?: number): Promise<TransactionInstruction>;
360
361
  cancelOrderByUserId(userOrderId: number, txParams?: TxParams, subAccountId?: number): Promise<TransactionSignature>;
@@ -1761,10 +1761,14 @@ class DriftClient {
1761
1761
  remainingAccounts,
1762
1762
  });
1763
1763
  }
1764
- async settleExpiredMarketPoolsToRevenuePool(perpMarketIndex, txParams) {
1764
+ async settleExpiredMarketPoolsToRevenuePool(marketIndex, txParams) {
1765
+ const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getSettleExpiredMarketPoolsToRevenuePoolIx(marketIndex), txParams), [], this.opts);
1766
+ return txSig;
1767
+ }
1768
+ async getSettleExpiredMarketPoolsToRevenuePoolIx(perpMarketIndex) {
1765
1769
  const perpMarketPublicKey = await (0, pda_1.getPerpMarketPublicKey)(this.program.programId, perpMarketIndex);
1766
1770
  const spotMarketPublicKey = await (0, pda_1.getSpotMarketPublicKey)(this.program.programId, numericConstants_1.QUOTE_SPOT_MARKET_INDEX);
1767
- const ix = await this.program.instruction.settleExpiredMarketPoolsToRevenuePool({
1771
+ return await this.program.instruction.settleExpiredMarketPoolsToRevenuePool({
1768
1772
  accounts: {
1769
1773
  state: await this.getStatePublicKey(),
1770
1774
  admin: this.isSubscribed
@@ -1774,8 +1778,6 @@ class DriftClient {
1774
1778
  perpMarket: perpMarketPublicKey,
1775
1779
  },
1776
1780
  });
1777
- const { txSig } = await this.sendTransaction(await this.buildTransaction(ix, txParams), [], this.opts);
1778
- return txSig;
1779
1781
  }
1780
1782
  async cancelOrder(orderId, txParams, subAccountId) {
1781
1783
  const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getCancelOrderIx(orderId, subAccountId), txParams), [], this.opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.97.0-beta.1",
3
+ "version": "2.97.0-beta.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -3333,9 +3333,23 @@ export class DriftClient {
3333
3333
  }
3334
3334
 
3335
3335
  public async settleExpiredMarketPoolsToRevenuePool(
3336
- perpMarketIndex: number,
3336
+ marketIndex: number,
3337
3337
  txParams?: TxParams
3338
3338
  ): Promise<TransactionSignature> {
3339
+ const { txSig } = await this.sendTransaction(
3340
+ await this.buildTransaction(
3341
+ await this.getSettleExpiredMarketPoolsToRevenuePoolIx(marketIndex),
3342
+ txParams
3343
+ ),
3344
+ [],
3345
+ this.opts
3346
+ );
3347
+ return txSig;
3348
+ }
3349
+
3350
+ public async getSettleExpiredMarketPoolsToRevenuePoolIx(
3351
+ perpMarketIndex: number
3352
+ ): Promise<TransactionInstruction> {
3339
3353
  const perpMarketPublicKey = await getPerpMarketPublicKey(
3340
3354
  this.program.programId,
3341
3355
  perpMarketIndex
@@ -3346,8 +3360,8 @@ export class DriftClient {
3346
3360
  QUOTE_SPOT_MARKET_INDEX
3347
3361
  );
3348
3362
 
3349
- const ix =
3350
- await this.program.instruction.settleExpiredMarketPoolsToRevenuePool({
3363
+ return await this.program.instruction.settleExpiredMarketPoolsToRevenuePool(
3364
+ {
3351
3365
  accounts: {
3352
3366
  state: await this.getStatePublicKey(),
3353
3367
  admin: this.isSubscribed
@@ -3356,15 +3370,8 @@ export class DriftClient {
3356
3370
  spotMarket: spotMarketPublicKey,
3357
3371
  perpMarket: perpMarketPublicKey,
3358
3372
  },
3359
- });
3360
-
3361
- const { txSig } = await this.sendTransaction(
3362
- await this.buildTransaction(ix, txParams),
3363
- [],
3364
- this.opts
3373
+ }
3365
3374
  );
3366
-
3367
- return txSig;
3368
3375
  }
3369
3376
 
3370
3377
  public async cancelOrder(