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

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.13
1
+ 2.48.0-beta.15
@@ -120,6 +120,16 @@ exports.MainnetSpotMarkets = [
120
120
  serumMarket: new web3_js_1.PublicKey('4E17F3BxtNVqzVsirxguuqkpYLtFgCR6NfTpccPh82WE'),
121
121
  phoenixMarket: new web3_js_1.PublicKey('2sTMN9A1D1qeZLF95XQgJCUPiKe5DiV52jLfZGqMP46m'),
122
122
  },
123
+ {
124
+ symbol: 'bSOL',
125
+ marketIndex: 8,
126
+ oracle: new web3_js_1.PublicKey('AFrYBhb5wKQtxRS9UA9YRS4V3dwFm7SqmS6DHKq6YVgo'),
127
+ oracleSource: __1.OracleSource.PYTH,
128
+ mint: new web3_js_1.PublicKey('bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1'),
129
+ precision: new __1.BN(10).pow(numericConstants_1.NINE),
130
+ precisionExp: numericConstants_1.NINE,
131
+ serumMarket: new web3_js_1.PublicKey('ARjaHVxGCQfTvvKjLd7U7srvk6orthZSE6uqWchCczZc'),
132
+ },
123
133
  ];
124
134
  exports.SpotMarkets = {
125
135
  devnet: exports.DevnetSpotMarkets,
@@ -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.13",
3
+ "version": "2.48.0-beta.15",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -150,6 +150,16 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
150
150
  '2sTMN9A1D1qeZLF95XQgJCUPiKe5DiV52jLfZGqMP46m'
151
151
  ),
152
152
  },
153
+ {
154
+ symbol: 'bSOL',
155
+ marketIndex: 8,
156
+ oracle: new PublicKey('AFrYBhb5wKQtxRS9UA9YRS4V3dwFm7SqmS6DHKq6YVgo'),
157
+ oracleSource: OracleSource.PYTH,
158
+ mint: new PublicKey('bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1'),
159
+ precision: new BN(10).pow(NINE),
160
+ precisionExp: NINE,
161
+ serumMarket: new PublicKey('ARjaHVxGCQfTvvKjLd7U7srvk6orthZSE6uqWchCczZc'),
162
+ },
153
163
  ];
154
164
 
155
165
  export const SpotMarkets: { [key in DriftEnv]: SpotMarketConfig[] } = {
@@ -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