@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 +1 -1
- package/lib/browser/driftClient.js +2 -2
- package/lib/node/driftClient.js +2 -2
- package/package.json +1 -1
- package/src/driftClient.ts +2 -2
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.115.0-beta.
|
|
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
|
|
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/lib/node/driftClient.js
CHANGED
|
@@ -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
|
|
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
package/src/driftClient.ts
CHANGED
|
@@ -2176,7 +2176,7 @@ export class DriftClient {
|
|
|
2176
2176
|
|
|
2177
2177
|
if (params.useMarketLastSlotCache) {
|
|
2178
2178
|
const lastUserSlot = this.getUserAccountAndSlot(
|
|
2179
|
-
params.userAccounts.length
|
|
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
|
});
|