@drift-labs/sdk 2.42.0-beta.4 → 2.42.0-beta.5
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.js +1 -1
- package/lib/types.d.ts +2 -2
- package/lib/types.js +2 -2
- package/package.json +1 -1
- package/src/driftClient.ts +1 -1
- package/src/types.ts +2 -2
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.42.0-beta.
|
|
1
|
+
2.42.0-beta.5
|
package/lib/driftClient.js
CHANGED
|
@@ -341,7 +341,7 @@ class DriftClient {
|
|
|
341
341
|
}
|
|
342
342
|
async switchActiveUser(subAccountId, authority) {
|
|
343
343
|
var _a;
|
|
344
|
-
const authorityChanged = !((_a = this.authority) === null || _a === void 0 ? void 0 : _a.equals(authority));
|
|
344
|
+
const authorityChanged = authority && !((_a = this.authority) === null || _a === void 0 ? void 0 : _a.equals(authority));
|
|
345
345
|
this.activeSubAccountId = subAccountId;
|
|
346
346
|
this.authority = authority !== null && authority !== void 0 ? authority : this.authority;
|
|
347
347
|
this.userStatsAccountPublicKey = (0, pda_1.getUserStatsAccountPublicKey)(this.program.programId, this.authority);
|
package/lib/types.d.ts
CHANGED
|
@@ -317,10 +317,10 @@ export declare class StakeAction {
|
|
|
317
317
|
unstake: {};
|
|
318
318
|
};
|
|
319
319
|
static readonly UNSTAKE_TRANSFER: {
|
|
320
|
-
|
|
320
|
+
unstakeTransfer: {};
|
|
321
321
|
};
|
|
322
322
|
static readonly STAKE_TRANSFER: {
|
|
323
|
-
|
|
323
|
+
stakeTransfer: {};
|
|
324
324
|
};
|
|
325
325
|
}
|
|
326
326
|
export declare function isVariant(object: unknown, type: string): boolean;
|
package/lib/types.js
CHANGED
|
@@ -201,8 +201,8 @@ StakeAction.STAKE = { stake: {} };
|
|
|
201
201
|
StakeAction.UNSTAKE_REQUEST = { unstakeRequest: {} };
|
|
202
202
|
StakeAction.UNSTAKE_CANCEL_REQUEST = { unstakeCancelRequest: {} };
|
|
203
203
|
StakeAction.UNSTAKE = { unstake: {} };
|
|
204
|
-
StakeAction.UNSTAKE_TRANSFER = {
|
|
205
|
-
StakeAction.STAKE_TRANSFER = {
|
|
204
|
+
StakeAction.UNSTAKE_TRANSFER = { unstakeTransfer: {} };
|
|
205
|
+
StakeAction.STAKE_TRANSFER = { stakeTransfer: {} };
|
|
206
206
|
function isVariant(object, type) {
|
|
207
207
|
return object.hasOwnProperty(type);
|
|
208
208
|
}
|
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -589,7 +589,7 @@ export class DriftClient {
|
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
public async switchActiveUser(subAccountId: number, authority?: PublicKey) {
|
|
592
|
-
const authorityChanged = !this.authority?.equals(authority);
|
|
592
|
+
const authorityChanged = authority && !this.authority?.equals(authority);
|
|
593
593
|
|
|
594
594
|
this.activeSubAccountId = subAccountId;
|
|
595
595
|
this.authority = authority ?? this.authority;
|
package/src/types.ts
CHANGED
|
@@ -200,8 +200,8 @@ export class StakeAction {
|
|
|
200
200
|
static readonly UNSTAKE_REQUEST = { unstakeRequest: {} };
|
|
201
201
|
static readonly UNSTAKE_CANCEL_REQUEST = { unstakeCancelRequest: {} };
|
|
202
202
|
static readonly UNSTAKE = { unstake: {} };
|
|
203
|
-
static readonly UNSTAKE_TRANSFER = {
|
|
204
|
-
static readonly STAKE_TRANSFER = {
|
|
203
|
+
static readonly UNSTAKE_TRANSFER = { unstakeTransfer: {} };
|
|
204
|
+
static readonly STAKE_TRANSFER = { stakeTransfer: {} };
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
export function isVariant(object: unknown, type: string) {
|