@drift-labs/sdk 2.53.0-beta.7 → 2.53.0-beta.8

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.53.0-beta.7
1
+ 2.53.0-beta.8
@@ -213,7 +213,7 @@ export declare class DriftClient {
213
213
  * @param subAccountId subaccountId to deposit
214
214
  * @param reduceOnly if true, deposit must not increase account risk
215
215
  */
216
- deposit(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean): Promise<TransactionSignature>;
216
+ deposit(amount: BN, marketIndex: number, associatedTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, txParams?: TxParams): Promise<TransactionSignature>;
217
217
  getDepositInstruction(amount: BN, marketIndex: number, userTokenAccount: PublicKey, subAccountId?: number, reduceOnly?: boolean, userInitialized?: boolean): Promise<TransactionInstruction>;
218
218
  private checkIfAccountExists;
219
219
  getWrappedSolAccountCreationIxs(amount: BN, includeRent?: boolean): Promise<{
@@ -979,7 +979,7 @@ class DriftClient {
979
979
  * @param subAccountId subaccountId to deposit
980
980
  * @param reduceOnly if true, deposit must not increase account risk
981
981
  */
982
- async deposit(amount, marketIndex, associatedTokenAccount, subAccountId, reduceOnly = false) {
982
+ async deposit(amount, marketIndex, associatedTokenAccount, subAccountId, reduceOnly = false, txParams) {
983
983
  const additionalSigners = [];
984
984
  const spotMarketAccount = this.getSpotMarketAccount(marketIndex);
985
985
  const isSolMarket = spotMarketAccount.mint.equals(spotMarkets_1.WRAPPED_SOL_MINT);
@@ -997,7 +997,7 @@ class DriftClient {
997
997
  if (createWSOLTokenAccount) {
998
998
  instructions.push((0, spl_token_1.createCloseAccountInstruction)(associatedTokenAccount, signerAuthority, signerAuthority, []));
999
999
  }
1000
- const txParams = { ...this.txParams, computeUnits: 600000 };
1000
+ txParams = { ...(txParams !== null && txParams !== void 0 ? txParams : this.txParams), computeUnits: 600000 };
1001
1001
  const tx = await this.buildTransaction(instructions, txParams);
1002
1002
  const { txSig, slot } = await this.sendTransaction(tx, additionalSigners, this.opts);
1003
1003
  this.spotMarketLastSlotCache.set(marketIndex, slot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.53.0-beta.7",
3
+ "version": "2.53.0-beta.8",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -1652,7 +1652,8 @@ export class DriftClient {
1652
1652
  marketIndex: number,
1653
1653
  associatedTokenAccount: PublicKey,
1654
1654
  subAccountId?: number,
1655
- reduceOnly = false
1655
+ reduceOnly = false,
1656
+ txParams?: TxParams
1656
1657
  ): Promise<TransactionSignature> {
1657
1658
  const additionalSigners: Array<Signer> = [];
1658
1659
 
@@ -1701,7 +1702,7 @@ export class DriftClient {
1701
1702
  );
1702
1703
  }
1703
1704
 
1704
- const txParams = { ...this.txParams, computeUnits: 600_000 };
1705
+ txParams = { ...(txParams ?? this.txParams), computeUnits: 600_000 };
1705
1706
 
1706
1707
  const tx = await this.buildTransaction(instructions, txParams);
1707
1708