@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 +1 -1
- package/lib/driftClient.d.ts +1 -1
- package/lib/driftClient.js +2 -2
- package/package.json +1 -1
- package/src/driftClient.ts +3 -2
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.53.0-beta.
|
|
1
|
+
2.53.0-beta.8
|
package/lib/driftClient.d.ts
CHANGED
|
@@ -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<{
|
package/lib/driftClient.js
CHANGED
|
@@ -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
|
-
|
|
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
package/src/driftClient.ts
CHANGED
|
@@ -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
|
-
|
|
1705
|
+
txParams = { ...(txParams ?? this.txParams), computeUnits: 600_000 };
|
|
1705
1706
|
|
|
1706
1707
|
const tx = await this.buildTransaction(instructions, txParams);
|
|
1707
1708
|
|