@drift-labs/sdk 2.65.0-beta.8 → 2.66.0-beta.0

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.
@@ -73,16 +73,20 @@ class UserMap {
73
73
  await this.subscription.subscribe();
74
74
  }
75
75
  async addPubkey(userAccountPublicKey, userAccount, slot, accountSubscription) {
76
- var _a, _b;
76
+ var _a;
77
77
  const user = new __1.User({
78
78
  driftClient: this.driftClient,
79
79
  userAccountPublicKey,
80
- accountSubscription: accountSubscription !== null && accountSubscription !== void 0 ? accountSubscription : this.driftClient.userAccountSubscriptionConfig,
80
+ accountSubscription: accountSubscription !== null && accountSubscription !== void 0 ? accountSubscription : {
81
+ type: 'custom',
82
+ // OneShotUserAccountSubscriber used here so we don't load up the RPC with AccountSubscribes
83
+ userAccountSubscriber: new __1.OneShotUserAccountSubscriber(this.driftClient.program, userAccountPublicKey, userAccount, slot, this.commitment),
84
+ },
81
85
  });
82
86
  await user.subscribe(userAccount);
83
87
  this.userMap.set(userAccountPublicKey.toString(), {
84
88
  data: user,
85
- slot: (_b = (_a = user.getUserAccountAndSlot().slot) !== null && _a !== void 0 ? _a : slot) !== null && _b !== void 0 ? _b : -1,
89
+ slot: slot !== null && slot !== void 0 ? slot : (_a = user.getUserAccountAndSlot()) === null || _a === void 0 ? void 0 : _a.slot,
86
90
  });
87
91
  }
88
92
  has(key) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.65.0-beta.8",
3
+ "version": "2.66.0-beta.0",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",