@drift-labs/sdk 2.93.0-beta.6 → 2.93.0-beta.7

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.93.0-beta.6
1
+ 2.93.0-beta.7
@@ -640,6 +640,8 @@ export declare class DriftClient {
640
640
  settlePNLIx(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndex: number): Promise<TransactionInstruction>;
641
641
  settleMultiplePNLs(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndexes: number[], mode: SettlePnlMode, txParams?: TxParams): Promise<TransactionSignature>;
642
642
  settleMultiplePNLsIx(settleeUserAccountPublicKey: PublicKey, settleeUserAccount: UserAccount, marketIndexes: number[], mode: SettlePnlMode): Promise<TransactionInstruction>;
643
+ getSetUserStatusToBeingLiquidatedIx(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionInstruction>;
644
+ setUserStatusToBeingLiquidated(userAccountPublicKey: PublicKey, userAccount: UserAccount): Promise<TransactionSignature>;
643
645
  liquidatePerp(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
644
646
  getLiquidatePerpIx(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, maxBaseAssetAmount: BN, limitPrice?: BN, liquidatorSubAccountId?: number): Promise<TransactionInstruction>;
645
647
  liquidatePerpWithFill(userAccountPublicKey: PublicKey, userAccount: UserAccount, marketIndex: number, makerInfos: MakerInfo[], txParams?: TxParams, liquidatorSubAccountId?: number): Promise<TransactionSignature>;
@@ -3210,6 +3210,23 @@ class DriftClient {
3210
3210
  remainingAccounts: remainingAccounts,
3211
3211
  });
3212
3212
  }
3213
+ async getSetUserStatusToBeingLiquidatedIx(userAccountPublicKey, userAccount) {
3214
+ const remainingAccounts = this.getRemainingAccounts({
3215
+ userAccounts: [userAccount],
3216
+ });
3217
+ return await this.program.instruction.setUserStatusToBeingLiquidated({
3218
+ accounts: {
3219
+ state: await this.getStatePublicKey(),
3220
+ user: userAccountPublicKey,
3221
+ authority: this.wallet.publicKey,
3222
+ },
3223
+ remainingAccounts,
3224
+ });
3225
+ }
3226
+ async setUserStatusToBeingLiquidated(userAccountPublicKey, userAccount) {
3227
+ const { txSig } = await this.sendTransaction(await this.buildTransaction(await this.getSetUserStatusToBeingLiquidatedIx(userAccountPublicKey, userAccount)), [], this.opts);
3228
+ return txSig;
3229
+ }
3213
3230
  async liquidatePerp(userAccountPublicKey, userAccount, marketIndex, maxBaseAssetAmount, limitPrice, txParams, liquidatorSubAccountId) {
3214
3231
  const { txSig, slot } = await this.sendTransaction(await this.buildTransaction(await this.getLiquidatePerpIx(userAccountPublicKey, userAccount, marketIndex, maxBaseAssetAmount, limitPrice, liquidatorSubAccountId), txParams), [], this.opts);
3215
3232
  this.perpMarketLastSlotCache.set(marketIndex, slot);
@@ -1881,6 +1881,22 @@
1881
1881
  }
1882
1882
  ]
1883
1883
  },
1884
+ {
1885
+ "name": "setUserStatusToBeingLiquidated",
1886
+ "accounts": [
1887
+ {
1888
+ "name": "state",
1889
+ "isMut": false,
1890
+ "isSigner": false
1891
+ },
1892
+ {
1893
+ "name": "user",
1894
+ "isMut": true,
1895
+ "isSigner": false
1896
+ }
1897
+ ],
1898
+ "args": []
1899
+ },
1884
1900
  {
1885
1901
  "name": "resolvePerpPnlDeficit",
1886
1902
  "accounts": [
@@ -2259,7 +2275,7 @@
2259
2275
  },
2260
2276
  {
2261
2277
  "name": "spotMarket",
2262
- "isMut": false,
2278
+ "isMut": true,
2263
2279
  "isSigner": false
2264
2280
  },
2265
2281
  {
@@ -2295,7 +2311,7 @@
2295
2311
  },
2296
2312
  {
2297
2313
  "name": "spotMarket",
2298
- "isMut": false,
2314
+ "isMut": true,
2299
2315
  "isSigner": false
2300
2316
  },
2301
2317
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.93.0-beta.6",
3
+ "version": "2.93.0-beta.7",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -5946,6 +5946,40 @@ export class DriftClient {
5946
5946
  );
5947
5947
  }
5948
5948
 
5949
+ public async getSetUserStatusToBeingLiquidatedIx(
5950
+ userAccountPublicKey: PublicKey,
5951
+ userAccount: UserAccount
5952
+ ): Promise<TransactionInstruction> {
5953
+ const remainingAccounts = this.getRemainingAccounts({
5954
+ userAccounts: [userAccount],
5955
+ });
5956
+ return await this.program.instruction.setUserStatusToBeingLiquidated({
5957
+ accounts: {
5958
+ state: await this.getStatePublicKey(),
5959
+ user: userAccountPublicKey,
5960
+ authority: this.wallet.publicKey,
5961
+ },
5962
+ remainingAccounts,
5963
+ });
5964
+ }
5965
+
5966
+ public async setUserStatusToBeingLiquidated(
5967
+ userAccountPublicKey: PublicKey,
5968
+ userAccount: UserAccount
5969
+ ): Promise<TransactionSignature> {
5970
+ const { txSig } = await this.sendTransaction(
5971
+ await this.buildTransaction(
5972
+ await this.getSetUserStatusToBeingLiquidatedIx(
5973
+ userAccountPublicKey,
5974
+ userAccount
5975
+ )
5976
+ ),
5977
+ [],
5978
+ this.opts
5979
+ );
5980
+ return txSig;
5981
+ }
5982
+
5949
5983
  public async liquidatePerp(
5950
5984
  userAccountPublicKey: PublicKey,
5951
5985
  userAccount: UserAccount,
@@ -1881,6 +1881,22 @@
1881
1881
  }
1882
1882
  ]
1883
1883
  },
1884
+ {
1885
+ "name": "setUserStatusToBeingLiquidated",
1886
+ "accounts": [
1887
+ {
1888
+ "name": "state",
1889
+ "isMut": false,
1890
+ "isSigner": false
1891
+ },
1892
+ {
1893
+ "name": "user",
1894
+ "isMut": true,
1895
+ "isSigner": false
1896
+ }
1897
+ ],
1898
+ "args": []
1899
+ },
1884
1900
  {
1885
1901
  "name": "resolvePerpPnlDeficit",
1886
1902
  "accounts": [
@@ -2259,7 +2275,7 @@
2259
2275
  },
2260
2276
  {
2261
2277
  "name": "spotMarket",
2262
- "isMut": false,
2278
+ "isMut": true,
2263
2279
  "isSigner": false
2264
2280
  },
2265
2281
  {
@@ -2295,7 +2311,7 @@
2295
2311
  },
2296
2312
  {
2297
2313
  "name": "spotMarket",
2298
- "isMut": false,
2314
+ "isMut": true,
2299
2315
  "isSigner": false
2300
2316
  },
2301
2317
  {