@drift-labs/sdk 2.98.0-beta.5 → 2.98.0-beta.7
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.98.0-beta.
|
|
1
|
+
2.98.0-beta.7
|
|
@@ -477,8 +477,8 @@ class DriftClient {
|
|
|
477
477
|
this.authority = authority !== null && authority !== void 0 ? authority : this.authority;
|
|
478
478
|
this.userStatsAccountPublicKey = (0, pda_1.getUserStatsAccountPublicKey)(this.program.programId, this.authority);
|
|
479
479
|
/* If changing the user authority ie switching from delegate to non-delegate account, need to re-subscribe to the user stats account */
|
|
480
|
-
if (authorityChanged) {
|
|
481
|
-
if (this.userStats
|
|
480
|
+
if (authorityChanged && this.userStats) {
|
|
481
|
+
if (this.userStats.isSubscribed) {
|
|
482
482
|
await this.userStats.unsubscribe();
|
|
483
483
|
}
|
|
484
484
|
this.userStats = new userStats_1.UserStats({
|
|
@@ -44,7 +44,7 @@ export type EventMap = {
|
|
|
44
44
|
SwiftOrderRecord: Event<SwiftOrderRecord>;
|
|
45
45
|
};
|
|
46
46
|
export type EventType = keyof EventMap;
|
|
47
|
-
export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord
|
|
47
|
+
export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord>;
|
|
48
48
|
export interface EventSubscriberEvents {
|
|
49
49
|
newEvent: (event: WrappedEvent<EventType>) => void;
|
|
50
50
|
}
|
package/lib/node/driftClient.js
CHANGED
|
@@ -477,8 +477,8 @@ class DriftClient {
|
|
|
477
477
|
this.authority = authority !== null && authority !== void 0 ? authority : this.authority;
|
|
478
478
|
this.userStatsAccountPublicKey = (0, pda_1.getUserStatsAccountPublicKey)(this.program.programId, this.authority);
|
|
479
479
|
/* If changing the user authority ie switching from delegate to non-delegate account, need to re-subscribe to the user stats account */
|
|
480
|
-
if (authorityChanged) {
|
|
481
|
-
if (this.userStats
|
|
480
|
+
if (authorityChanged && this.userStats) {
|
|
481
|
+
if (this.userStats.isSubscribed) {
|
|
482
482
|
await this.userStats.unsubscribe();
|
|
483
483
|
}
|
|
484
484
|
this.userStats = new userStats_1.UserStats({
|
|
@@ -44,7 +44,7 @@ export type EventMap = {
|
|
|
44
44
|
SwiftOrderRecord: Event<SwiftOrderRecord>;
|
|
45
45
|
};
|
|
46
46
|
export type EventType = keyof EventMap;
|
|
47
|
-
export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord
|
|
47
|
+
export type DriftEvent = Event<DepositRecord> | Event<FundingPaymentRecord> | Event<LiquidationRecord> | Event<FundingRateRecord> | Event<OrderRecord> | Event<OrderActionRecord> | Event<SettlePnlRecord> | Event<NewUserRecord> | Event<LPRecord> | Event<InsuranceFundRecord> | Event<SpotInterestRecord> | Event<InsuranceFundStakeRecord> | Event<CurveRecord> | Event<SwapRecord> | Event<SpotMarketVaultDepositRecord>;
|
|
48
48
|
export interface EventSubscriberEvents {
|
|
49
49
|
newEvent: (event: WrappedEvent<EventType>) => void;
|
|
50
50
|
}
|
package/package.json
CHANGED
package/src/driftClient.ts
CHANGED
|
@@ -827,8 +827,8 @@ export class DriftClient {
|
|
|
827
827
|
);
|
|
828
828
|
|
|
829
829
|
/* If changing the user authority ie switching from delegate to non-delegate account, need to re-subscribe to the user stats account */
|
|
830
|
-
if (authorityChanged) {
|
|
831
|
-
if (this.userStats
|
|
830
|
+
if (authorityChanged && this.userStats) {
|
|
831
|
+
if (this.userStats.isSubscribed) {
|
|
832
832
|
await this.userStats.unsubscribe();
|
|
833
833
|
}
|
|
834
834
|
|
package/src/events/types.ts
CHANGED
|
@@ -114,8 +114,7 @@ export type DriftEvent =
|
|
|
114
114
|
| Event<InsuranceFundStakeRecord>
|
|
115
115
|
| Event<CurveRecord>
|
|
116
116
|
| Event<SwapRecord>
|
|
117
|
-
| Event<SpotMarketVaultDepositRecord
|
|
118
|
-
| Event<SwiftOrderRecord>;
|
|
117
|
+
| Event<SpotMarketVaultDepositRecord>;
|
|
119
118
|
|
|
120
119
|
export interface EventSubscriberEvents {
|
|
121
120
|
newEvent: (event: WrappedEvent<EventType>) => void;
|