From bc4afed2199332bed609218a287a22f54032a4a6 Mon Sep 17 00:00:00 2001 From: lowkeynicc <85139158+lowkeynicc@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:22:22 -0500 Subject: [PATCH] sdk: add txparams to withdraw (#799) * sdk: add txparams to withdraw * update changelog --- CHANGELOG.md | 2 +- sdk/src/driftClient.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc099a97..b47749ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixes -- sdk: use tx params passed into deposit function +- sdk: use tx params passed into deposit and withdraw functions ### Breaking diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 984792ed2..615df2009 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -2049,7 +2049,8 @@ export class DriftClient { marketIndex: number, associatedTokenAddress: PublicKey, reduceOnly = false, - subAccountId?: number + subAccountId?: number, + txParams?: TxParams ): Promise { const withdrawIxs = []; @@ -2112,6 +2113,7 @@ export class DriftClient { } const tx = await this.buildTransaction(withdrawIxs, { + ...(txParams ?? this.txParams), computeUnits: 1_400_000, }); const { txSig, slot } = await this.sendTransaction(