@drift-labs/sdk 2.31.1-beta.4 → 2.31.1-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 CHANGED
@@ -1 +1 @@
1
- 2.31.1-beta.4
1
+ 2.31.1-beta.5
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.31.1-beta.3",
2
+ "version": "2.31.1-beta.4",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
package/lib/userStats.js CHANGED
@@ -7,12 +7,15 @@ const webSocketUserStatsAccountSubsriber_1 = require("./accounts/webSocketUserSt
7
7
  const pda_1 = require("./addresses/pda");
8
8
  class UserStats {
9
9
  constructor(config) {
10
- var _a;
10
+ var _a, _b;
11
11
  this.driftClient = config.driftClient;
12
12
  this.userStatsAccountPublicKey = config.userStatsAccountPublicKey;
13
13
  if (((_a = config.accountSubscription) === null || _a === void 0 ? void 0 : _a.type) === 'polling') {
14
14
  this.accountSubscriber = new pollingUserStatsAccountSubscriber_1.PollingUserStatsAccountSubscriber(config.driftClient.program, config.userStatsAccountPublicKey, config.accountSubscription.accountLoader);
15
15
  }
16
+ else if (((_b = config.accountSubscription) === null || _b === void 0 ? void 0 : _b.type) === 'custom') {
17
+ throw new Error('Custom account subscription not yet implemented for user stats');
18
+ }
16
19
  else {
17
20
  this.accountSubscriber = new webSocketUserStatsAccountSubsriber_1.WebSocketUserStatsAccountSubscriber(config.driftClient.program, config.userStatsAccountPublicKey);
18
21
  }
@@ -11,4 +11,6 @@ export type UserStatsSubscriptionConfig = {
11
11
  } | {
12
12
  type: 'polling';
13
13
  accountLoader: BulkAccountLoader;
14
+ } | {
15
+ type: 'custom';
14
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.31.1-beta.4",
3
+ "version": "2.31.1-beta.5",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.31.1-beta.4",
2
+ "version": "2.31.1-beta.5",
3
3
  "name": "drift",
4
4
  "instructions": [
5
5
  {
package/src/userStats.ts CHANGED
@@ -25,6 +25,10 @@ export class UserStats {
25
25
  config.userStatsAccountPublicKey,
26
26
  config.accountSubscription.accountLoader
27
27
  );
28
+ } else if (config.accountSubscription?.type === 'custom') {
29
+ throw new Error(
30
+ 'Custom account subscription not yet implemented for user stats'
31
+ );
28
32
  } else {
29
33
  this.accountSubscriber = new WebSocketUserStatsAccountSubscriber(
30
34
  config.driftClient.program,
@@ -15,4 +15,7 @@ export type UserStatsSubscriptionConfig =
15
15
  | {
16
16
  type: 'polling';
17
17
  accountLoader: BulkAccountLoader;
18
+ }
19
+ | {
20
+ type: 'custom';
18
21
  };