@drift-labs/sdk 2.48.0-beta.15 → 2.48.0-beta.16

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.15
1
+ 2.48.0-beta.16
@@ -139,7 +139,7 @@ class BulkAccountLoader {
139
139
  accountsToLoad.forEach((accountToLoad, j) => {
140
140
  const key = accountToLoad.publicKey.toBase58();
141
141
  const oldRPCResponse = this.bufferAndSlotMap.get(key);
142
- if (oldRPCResponse && newSlot <= oldRPCResponse.slot) {
142
+ if (oldRPCResponse && newSlot < oldRPCResponse.slot) {
143
143
  return;
144
144
  }
145
145
  let newBuffer = undefined;
@@ -89,7 +89,7 @@ class WebSocketAccountSubscriber {
89
89
  }
90
90
  return;
91
91
  }
92
- if (newSlot <= this.bufferAndSlot.slot) {
92
+ if (newSlot < this.bufferAndSlot.slot) {
93
93
  return;
94
94
  }
95
95
  const oldBuffer = this.bufferAndSlot.buffer;
@@ -75,7 +75,7 @@ class WebSocketProgramAccountSubscriber {
75
75
  }
76
76
  return;
77
77
  }
78
- if (newSlot <= this.bufferAndSlot.slot) {
78
+ if (newSlot < this.bufferAndSlot.slot) {
79
79
  return;
80
80
  }
81
81
  const oldBuffer = this.bufferAndSlot.buffer;
@@ -51,7 +51,7 @@ class WebSocketUserAccountSubscriber {
51
51
  updateData(userAccount, slot) {
52
52
  var _a;
53
53
  const currentDataSlot = ((_a = this.userDataAccountSubscriber.dataAndSlot) === null || _a === void 0 ? void 0 : _a.slot) || 0;
54
- if (currentDataSlot < slot) {
54
+ if (currentDataSlot <= slot) {
55
55
  this.userDataAccountSubscriber.setData(userAccount, slot);
56
56
  this.eventEmitter.emit('userAccountUpdate', userAccount);
57
57
  this.eventEmitter.emit('update');
@@ -77,7 +77,7 @@ class OrderSubscriber {
77
77
  this.mostRecentSlot = slot;
78
78
  }
79
79
  const slotAndUserAccount = this.usersAccounts.get(key);
80
- if (!slotAndUserAccount || slotAndUserAccount.slot < slot) {
80
+ if (!slotAndUserAccount || slotAndUserAccount.slot <= slot) {
81
81
  let userAccount;
82
82
  // Polling leads to a lot of redundant decoding, so we only decode if data is from a fresh slot
83
83
  if (dataType === 'raw') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.48.0-beta.15",
3
+ "version": "2.48.0-beta.16",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -193,7 +193,7 @@ export class BulkAccountLoader {
193
193
  const key = accountToLoad.publicKey.toBase58();
194
194
  const oldRPCResponse = this.bufferAndSlotMap.get(key);
195
195
 
196
- if (oldRPCResponse && newSlot <= oldRPCResponse.slot) {
196
+ if (oldRPCResponse && newSlot < oldRPCResponse.slot) {
197
197
  return;
198
198
  }
199
199
 
@@ -134,7 +134,7 @@ export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
134
134
  return;
135
135
  }
136
136
 
137
- if (newSlot <= this.bufferAndSlot.slot) {
137
+ if (newSlot < this.bufferAndSlot.slot) {
138
138
  return;
139
139
  }
140
140
 
@@ -125,7 +125,7 @@ export class WebSocketProgramAccountSubscriber<T>
125
125
  return;
126
126
  }
127
127
 
128
- if (newSlot <= this.bufferAndSlot.slot) {
128
+ if (newSlot < this.bufferAndSlot.slot) {
129
129
  return;
130
130
  }
131
131
 
@@ -94,7 +94,7 @@ export class WebSocketUserAccountSubscriber implements UserAccountSubscriber {
94
94
  public updateData(userAccount: UserAccount, slot: number) {
95
95
  const currentDataSlot =
96
96
  this.userDataAccountSubscriber.dataAndSlot?.slot || 0;
97
- if (currentDataSlot < slot) {
97
+ if (currentDataSlot <= slot) {
98
98
  this.userDataAccountSubscriber.setData(userAccount, slot);
99
99
  this.eventEmitter.emit('userAccountUpdate', userAccount);
100
100
  this.eventEmitter.emit('update');
@@ -116,7 +116,7 @@ export class OrderSubscriber {
116
116
  }
117
117
 
118
118
  const slotAndUserAccount = this.usersAccounts.get(key);
119
- if (!slotAndUserAccount || slotAndUserAccount.slot < slot) {
119
+ if (!slotAndUserAccount || slotAndUserAccount.slot <= slot) {
120
120
  let userAccount: UserAccount;
121
121
  // Polling leads to a lot of redundant decoding, so we only decode if data is from a fresh slot
122
122
  if (dataType === 'raw') {