Skip to content

Commit

Permalink
sdk: add txparams param to deposit (#796)
Browse files Browse the repository at this point in the history
* add txparams param to deposit

* update changelog
  • Loading branch information
lowkeynicc authored Dec 27, 2023
1 parent ce32144 commit b744d01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixes

- sdk: use tx params passed into deposit function

### Breaking

## [2.52.0] - 2023-12-22
Expand Down
5 changes: 3 additions & 2 deletions sdk/src/driftClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,8 @@ export class DriftClient {
marketIndex: number,
associatedTokenAccount: PublicKey,
subAccountId?: number,
reduceOnly = false
reduceOnly = false,
txParams?: TxParams
): Promise<TransactionSignature> {
const additionalSigners: Array<Signer> = [];

Expand Down Expand Up @@ -1701,7 +1702,7 @@ export class DriftClient {
);
}

const txParams = { ...this.txParams, computeUnits: 600_000 };
txParams = { ...(txParams ?? this.txParams), computeUnits: 600_000 };

const tx = await this.buildTransaction(instructions, txParams);

Expand Down

0 comments on commit b744d01

Please sign in to comment.