@drift-labs/sdk 2.48.0-beta.0 → 2.48.0-beta.1

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.48.0-beta.0
1
+ 2.48.0-beta.1
@@ -3143,6 +3143,11 @@ class DriftClient {
3143
3143
  }
3144
3144
  else {
3145
3145
  tokenAccount = collateralAccountPublicKey;
3146
+ const tokenAccountExists = await this.checkIfAccountExists(tokenAccount);
3147
+ if (!tokenAccountExists) {
3148
+ const createTokenAccountIx = await this.createAssociatedTokenAccountIdempotentInstruction(tokenAccount, this.wallet.publicKey, this.wallet.publicKey, spotMarketAccount.mint);
3149
+ removeIfStakeIxs.push(createTokenAccountIx);
3150
+ }
3146
3151
  }
3147
3152
  const remainingAccounts = this.getRemainingAccounts({
3148
3153
  userAccounts: [this.getUserAccount()],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.48.0-beta.0",
3
+ "version": "2.48.0-beta.1",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -5699,6 +5699,17 @@ export class DriftClient {
5699
5699
  });
5700
5700
  } else {
5701
5701
  tokenAccount = collateralAccountPublicKey;
5702
+ const tokenAccountExists = await this.checkIfAccountExists(tokenAccount);
5703
+ if (!tokenAccountExists) {
5704
+ const createTokenAccountIx =
5705
+ await this.createAssociatedTokenAccountIdempotentInstruction(
5706
+ tokenAccount,
5707
+ this.wallet.publicKey,
5708
+ this.wallet.publicKey,
5709
+ spotMarketAccount.mint
5710
+ );
5711
+ removeIfStakeIxs.push(createTokenAccountIx);
5712
+ }
5702
5713
  }
5703
5714
 
5704
5715
  const remainingAccounts = this.getRemainingAccounts({