@drift-labs/sdk 2.32.1-beta.0 → 2.32.1-beta.2

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.32.1-beta.0
1
+ 2.32.1-beta.2
@@ -2038,7 +2038,10 @@ class DriftClient {
2038
2038
  */
2039
2039
  async getSwapIx({ outMarketIndex, inMarketIndex, amountIn, inTokenAccount, outTokenAccount, limitPrice, reduceOnly, userAccountPublicKey, }) {
2040
2040
  const userAccountPublicKeyToUse = userAccountPublicKey || (await this.getUserAccountPublicKey());
2041
- const userAccounts = this.hasUser() ? [this.getUserAccount()] : [];
2041
+ const userAccounts = [];
2042
+ if (this.hasUser() && this.getUser().getUserAccountAndSlot()) {
2043
+ userAccounts.push(this.getUser().getUserAccountAndSlot().data);
2044
+ }
2042
2045
  const remainingAccounts = this.getRemainingAccounts({
2043
2046
  userAccounts,
2044
2047
  writableSpotMarketIndexes: [outMarketIndex, inMarketIndex],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.32.1-beta.0",
3
+ "version": "2.32.1-beta.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -3573,7 +3573,10 @@ export class DriftClient {
3573
3573
  const userAccountPublicKeyToUse =
3574
3574
  userAccountPublicKey || (await this.getUserAccountPublicKey());
3575
3575
 
3576
- const userAccounts = this.hasUser() ? [this.getUserAccount()] : [];
3576
+ const userAccounts = [];
3577
+ if (this.hasUser() && this.getUser().getUserAccountAndSlot()) {
3578
+ userAccounts.push(this.getUser().getUserAccountAndSlot()!.data);
3579
+ }
3577
3580
  const remainingAccounts = this.getRemainingAccounts({
3578
3581
  userAccounts,
3579
3582
  writableSpotMarketIndexes: [outMarketIndex, inMarketIndex],