@drift-labs/sdk 2.42.0-beta.3 → 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 +6 -0
- package/lib/types.js +2 -0
- package/package.json +1 -1
- package/src/driftClient.ts +1 -1
- package/src/types.ts +2 -0
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
|
@@ -316,6 +316,12 @@ export declare class StakeAction {
|
|
|
316
316
|
static readonly UNSTAKE: {
|
|
317
317
|
unstake: {};
|
|
318
318
|
};
|
|
319
|
+
static readonly UNSTAKE_TRANSFER: {
|
|
320
|
+
unstakeTransfer: {};
|
|
321
|
+
};
|
|
322
|
+
static readonly STAKE_TRANSFER: {
|
|
323
|
+
stakeTransfer: {};
|
|
324
|
+
};
|
|
319
325
|
}
|
|
320
326
|
export declare function isVariant(object: unknown, type: string): boolean;
|
|
321
327
|
export declare function isOneOfVariant(object: unknown, types: string[]): boolean;
|
package/lib/types.js
CHANGED
|
@@ -201,6 +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 = { unstakeTransfer: {} };
|
|
205
|
+
StakeAction.STAKE_TRANSFER = { stakeTransfer: {} };
|
|
204
206
|
function isVariant(object, type) {
|
|
205
207
|
return object.hasOwnProperty(type);
|
|
206
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,6 +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 = { unstakeTransfer: {} };
|
|
204
|
+
static readonly STAKE_TRANSFER = { stakeTransfer: {} };
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
export function isVariant(object: unknown, type: string) {
|