@drift-labs/sdk 2.40.0-beta.10 → 2.40.0-beta.12

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.40.0-beta.10
1
+ 2.40.0-beta.12
@@ -174,7 +174,7 @@ const getJitoSolHistoricalPriceMap = async (timestamps) => {
174
174
  const jitoSolHistoricalPriceInSol = [];
175
175
  for (let i = 0; i < data.data.getStakePoolStats.supply.length; i++) {
176
176
  const priceInSol = data.data.getStakePoolStats.tvl[i].data /
177
- new anchor_1.BN(10).pow(numericConstants_1.NINE) /
177
+ 10 ** 9 /
178
178
  data.data.getStakePoolStats.supply[i].data;
179
179
  jitoSolHistoricalPriceInSol.push({
180
180
  price: priceInSol,
@@ -25,6 +25,8 @@ class WebsocketSubscription {
25
25
  }
26
26
  }
27
27
  async unsubscribe() {
28
+ if (!this.subscriber)
29
+ return;
28
30
  this.subscriber.unsubscribe();
29
31
  }
30
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.40.0-beta.10",
3
+ "version": "2.40.0-beta.12",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -10,7 +10,7 @@ import { getMarinadeFinanceProgram, getMarinadeMSolPrice } from '../marinade';
10
10
  import { BN } from '@coral-xyz/anchor';
11
11
  import { User } from '../user';
12
12
  import { DepositRecord, isVariant } from '../types';
13
- import { LAMPORTS_PRECISION, ZERO, NINE } from '../constants/numericConstants';
13
+ import { LAMPORTS_PRECISION, ZERO } from '../constants/numericConstants';
14
14
  import fetch from 'node-fetch';
15
15
  import { checkSameDate } from './utils';
16
16
 
@@ -266,7 +266,7 @@ const getJitoSolHistoricalPriceMap = async (timestamps: number[]) => {
266
266
  for (let i = 0; i < data.data.getStakePoolStats.supply.length; i++) {
267
267
  const priceInSol =
268
268
  data.data.getStakePoolStats.tvl[i].data /
269
- new BN(10).pow(NINE) /
269
+ 10 ** 9 /
270
270
  data.data.getStakePoolStats.supply[i].data;
271
271
  jitoSolHistoricalPriceInSol.push({
272
272
  price: priceInSol,
@@ -59,6 +59,7 @@ export class WebsocketSubscription {
59
59
  }
60
60
 
61
61
  public async unsubscribe(): Promise<void> {
62
+ if (!this.subscriber) return;
62
63
  this.subscriber.unsubscribe();
63
64
  }
64
65
  }