@drift-labs/sdk 2.115.0-beta.1 → 2.115.0-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.115.0-beta.1
1
+ 2.115.0-beta.2
@@ -1271,7 +1271,7 @@ class DriftClient {
1271
1271
  var _a;
1272
1272
  const { oracleAccountMap, spotMarketAccountMap, perpMarketAccountMap } = this.getRemainingAccountMapsForUsers(params.userAccounts);
1273
1273
  if (params.useMarketLastSlotCache) {
1274
- const lastUserSlot = (_a = this.getUserAccountAndSlot(params.userAccounts.length === 1
1274
+ const lastUserSlot = (_a = this.getUserAccountAndSlot(params.userAccounts.length > 0
1275
1275
  ? params.userAccounts[0].subAccountId
1276
1276
  : this.activeSubAccountId)) === null || _a === void 0 ? void 0 : _a.slot;
1277
1277
  for (const [marketIndex, slot,] of this.perpMarketLastSlotCache.entries()) {
@@ -1471,7 +1471,7 @@ class DriftClient {
1471
1471
  let remainingAccounts = [];
1472
1472
  if (userInitialized) {
1473
1473
  remainingAccounts = this.getRemainingAccounts({
1474
- userAccounts: [await this.forceGetUserAccount()],
1474
+ userAccounts: [await this.forceGetUserAccount(subAccountId)],
1475
1475
  useMarketLastSlotCache: true,
1476
1476
  writableSpotMarketIndexes: [marketIndex],
1477
1477
  });
@@ -1271,7 +1271,7 @@ class DriftClient {
1271
1271
  var _a;
1272
1272
  const { oracleAccountMap, spotMarketAccountMap, perpMarketAccountMap } = this.getRemainingAccountMapsForUsers(params.userAccounts);
1273
1273
  if (params.useMarketLastSlotCache) {
1274
- const lastUserSlot = (_a = this.getUserAccountAndSlot(params.userAccounts.length === 1
1274
+ const lastUserSlot = (_a = this.getUserAccountAndSlot(params.userAccounts.length > 0
1275
1275
  ? params.userAccounts[0].subAccountId
1276
1276
  : this.activeSubAccountId)) === null || _a === void 0 ? void 0 : _a.slot;
1277
1277
  for (const [marketIndex, slot,] of this.perpMarketLastSlotCache.entries()) {
@@ -1471,7 +1471,7 @@ class DriftClient {
1471
1471
  let remainingAccounts = [];
1472
1472
  if (userInitialized) {
1473
1473
  remainingAccounts = this.getRemainingAccounts({
1474
- userAccounts: [await this.forceGetUserAccount()],
1474
+ userAccounts: [await this.forceGetUserAccount(subAccountId)],
1475
1475
  useMarketLastSlotCache: true,
1476
1476
  writableSpotMarketIndexes: [marketIndex],
1477
1477
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.115.0-beta.1",
3
+ "version": "2.115.0-beta.2",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -2176,7 +2176,7 @@ export class DriftClient {
2176
2176
 
2177
2177
  if (params.useMarketLastSlotCache) {
2178
2178
  const lastUserSlot = this.getUserAccountAndSlot(
2179
- params.userAccounts.length === 1
2179
+ params.userAccounts.length > 0
2180
2180
  ? params.userAccounts[0].subAccountId
2181
2181
  : this.activeSubAccountId
2182
2182
  )?.slot;
@@ -2587,7 +2587,7 @@ export class DriftClient {
2587
2587
  let remainingAccounts = [];
2588
2588
  if (userInitialized) {
2589
2589
  remainingAccounts = this.getRemainingAccounts({
2590
- userAccounts: [await this.forceGetUserAccount()],
2590
+ userAccounts: [await this.forceGetUserAccount(subAccountId)],
2591
2591
  useMarketLastSlotCache: true,
2592
2592
  writableSpotMarketIndexes: [marketIndex],
2593
2593
  });