@drift-labs/sdk 2.48.0-beta.12 → 2.48.0-beta.14

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.48.0-beta.12
1
+ 2.48.0-beta.14
@@ -84,7 +84,7 @@ class OrderSubscriber {
84
84
  // @ts-ignore
85
85
  const buffer = buffer_1.Buffer.from(data[0], data[1]);
86
86
  userAccount =
87
- this.driftClient.program.account.user.coder.accounts.decode('User', buffer);
87
+ this.driftClient.program.account.user.coder.accounts.decodeUnchecked('User', buffer);
88
88
  }
89
89
  else {
90
90
  userAccount = data;
@@ -13,8 +13,10 @@ class SlotSubscriber {
13
13
  }
14
14
  this.currentSlot = await this.connection.getSlot('confirmed');
15
15
  this.subscriptionId = this.connection.onSlotChange((slotInfo) => {
16
- this.currentSlot = slotInfo.slot;
17
- this.eventEmitter.emit('newSlot', slotInfo.slot);
16
+ if (!this.currentSlot || this.currentSlot < slotInfo.slot) {
17
+ this.currentSlot = slotInfo.slot;
18
+ this.eventEmitter.emit('newSlot', slotInfo.slot);
19
+ }
18
20
  });
19
21
  }
20
22
  getSlot() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.48.0-beta.12",
3
+ "version": "2.48.0-beta.14",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -124,7 +124,7 @@ export class OrderSubscriber {
124
124
  const buffer = Buffer.from(data[0], data[1]);
125
125
 
126
126
  userAccount =
127
- this.driftClient.program.account.user.coder.accounts.decode(
127
+ this.driftClient.program.account.user.coder.accounts.decodeUnchecked(
128
128
  'User',
129
129
  buffer
130
130
  ) as UserAccount;
@@ -29,8 +29,10 @@ export class SlotSubscriber {
29
29
  this.currentSlot = await this.connection.getSlot('confirmed');
30
30
 
31
31
  this.subscriptionId = this.connection.onSlotChange((slotInfo) => {
32
- this.currentSlot = slotInfo.slot;
33
- this.eventEmitter.emit('newSlot', slotInfo.slot);
32
+ if (!this.currentSlot || this.currentSlot < slotInfo.slot) {
33
+ this.currentSlot = slotInfo.slot;
34
+ this.eventEmitter.emit('newSlot', slotInfo.slot);
35
+ }
34
36
  });
35
37
  }
36
38