@drift-labs/sdk 2.130.0-beta.0 → 2.130.0-beta.2

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.130.0-beta.0
1
+ 2.130.0-beta.2
@@ -7,6 +7,7 @@ export declare class WebSocketAccountSubscriber<T> implements AccountSubscriber<
7
7
  dataAndSlot?: DataAndSlot<T>;
8
8
  bufferAndSlot?: BufferAndSlot;
9
9
  accountName: string;
10
+ logAccountName: string;
10
11
  program: Program;
11
12
  accountPublicKey: PublicKey;
12
13
  decodeBufferFn: (buffer: Buffer) => T;
@@ -7,12 +7,13 @@ class WebSocketAccountSubscriber {
7
7
  var _a;
8
8
  this.isUnsubscribing = false;
9
9
  this.accountName = accountName;
10
+ this.logAccountName = `${accountName}-${accountPublicKey.toBase58()}`;
10
11
  this.program = program;
11
12
  this.accountPublicKey = accountPublicKey;
12
13
  this.decodeBufferFn = decodeBuffer;
13
14
  this.resubOpts = resubOpts;
14
15
  if (((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.resubTimeoutMs) < 1000) {
15
- console.log('resubTimeoutMs should be at least 1000ms to avoid spamming resub');
16
+ console.log(`resubTimeoutMs should be at least 1000ms to avoid spamming resub ${this.logAccountName}`);
16
17
  }
17
18
  this.receivingData = false;
18
19
  this.commitment =
@@ -67,7 +68,7 @@ class WebSocketAccountSubscriber {
67
68
  }
68
69
  if (this.receivingData) {
69
70
  if ((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.logResubMessages) {
70
- console.log(`No ws data from ${this.accountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`);
71
+ console.log(`No ws data from ${this.logAccountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`);
71
72
  }
72
73
  await this.unsubscribe(true);
73
74
  this.receivingData = false;
@@ -7,6 +7,7 @@ export declare class WebSocketAccountSubscriber<T> implements AccountSubscriber<
7
7
  dataAndSlot?: DataAndSlot<T>;
8
8
  bufferAndSlot?: BufferAndSlot;
9
9
  accountName: string;
10
+ logAccountName: string;
10
11
  program: Program;
11
12
  accountPublicKey: PublicKey;
12
13
  decodeBufferFn: (buffer: Buffer) => T;
@@ -1 +1 @@
1
- {"version":3,"file":"webSocketAccountSubscriber.d.ts","sourceRoot":"","sources":["../../../src/accounts/webSocketAccountSubscriber.ts"],"names":[],"mappings":";;AAAA,OAAO,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAkB,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI9E,qBAAa,0BAA0B,CAAC,CAAC,CAAE,YAAW,iBAAiB,CAAC,CAAC,CAAC;IACzE,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,SAAS,CAAC;IAC5B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,eAAe,UAAS;IAExB,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAE1C,aAAa,EAAE,OAAO,CAAC;gBAGtB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,SAAS,EAC3B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,EACpC,SA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C,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,eAAe,UAAS;IAExB,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAE1C,aAAa,EAAE,OAAO,CAAC;gBAGtB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,SAAS,EAC3B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,EACpC,SAAS,CAAC,EAAE,SAAS,EACrB,UAAU,CAAC,EAAE,UAAU;IAkBlB,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B3D,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAYrC,SAAS,CAAC,UAAU,IAAI,IAAI;IA0BtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5B,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI;IA0C5E,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC;IAW/B,WAAW,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB3C"}
@@ -7,12 +7,13 @@ class WebSocketAccountSubscriber {
7
7
  var _a;
8
8
  this.isUnsubscribing = false;
9
9
  this.accountName = accountName;
10
+ this.logAccountName = `${accountName}-${accountPublicKey.toBase58()}`;
10
11
  this.program = program;
11
12
  this.accountPublicKey = accountPublicKey;
12
13
  this.decodeBufferFn = decodeBuffer;
13
14
  this.resubOpts = resubOpts;
14
15
  if (((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.resubTimeoutMs) < 1000) {
15
- console.log('resubTimeoutMs should be at least 1000ms to avoid spamming resub');
16
+ console.log(`resubTimeoutMs should be at least 1000ms to avoid spamming resub ${this.logAccountName}`);
16
17
  }
17
18
  this.receivingData = false;
18
19
  this.commitment =
@@ -67,7 +68,7 @@ class WebSocketAccountSubscriber {
67
68
  }
68
69
  if (this.receivingData) {
69
70
  if ((_a = this.resubOpts) === null || _a === void 0 ? void 0 : _a.logResubMessages) {
70
- console.log(`No ws data from ${this.accountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`);
71
+ console.log(`No ws data from ${this.logAccountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`);
71
72
  }
72
73
  await this.unsubscribe(true);
73
74
  this.receivingData = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.130.0-beta.0",
3
+ "version": "2.130.0-beta.2",
4
4
  "main": "lib/node/index.js",
5
5
  "types": "lib/node/index.d.ts",
6
6
  "browser": "./lib/browser/index.js",
@@ -13,6 +13,7 @@ export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
13
13
  dataAndSlot?: DataAndSlot<T>;
14
14
  bufferAndSlot?: BufferAndSlot;
15
15
  accountName: string;
16
+ logAccountName: string;
16
17
  program: Program;
17
18
  accountPublicKey: PublicKey;
18
19
  decodeBufferFn: (buffer: Buffer) => T;
@@ -37,13 +38,14 @@ export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
37
38
  commitment?: Commitment
38
39
  ) {
39
40
  this.accountName = accountName;
41
+ this.logAccountName = `${accountName}-${accountPublicKey.toBase58()}`;
40
42
  this.program = program;
41
43
  this.accountPublicKey = accountPublicKey;
42
44
  this.decodeBufferFn = decodeBuffer;
43
45
  this.resubOpts = resubOpts;
44
46
  if (this.resubOpts?.resubTimeoutMs < 1000) {
45
47
  console.log(
46
- 'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
48
+ `resubTimeoutMs should be at least 1000ms to avoid spamming resub ${this.logAccountName}`
47
49
  );
48
50
  }
49
51
  this.receivingData = false;
@@ -108,7 +110,7 @@ export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
108
110
  if (this.receivingData) {
109
111
  if (this.resubOpts?.logResubMessages) {
110
112
  console.log(
111
- `No ws data from ${this.accountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`
113
+ `No ws data from ${this.logAccountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`
112
114
  );
113
115
  }
114
116
  await this.unsubscribe(true);
@@ -8,7 +8,7 @@
8
8
  "resolveJsonModule": true,
9
9
  "skipLibCheck": true,
10
10
  "paths": {
11
- "@solana/web3.js": ["./node_modules/@solana/web3.js/lib/index.d.ts"]
11
+ "@solana/web3.js": ["./node_modules/@solana/web3.js"]
12
12
  }
13
13
  },
14
14
  "include": ["src"],
package/tsconfig.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "skipLibCheck": true,
10
10
  "declarationMap": true,
11
11
  "paths": {
12
- "@solana/web3.js": ["./node_modules/@solana/web3.js/lib/index.d.ts"]
12
+ "@solana/web3.js": ["./node_modules/@solana/web3.js"]
13
13
  }
14
14
  },
15
15
  "include": ["src"],