@drift-labs/sdk 2.0.0 → 2.0.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.
@@ -43,8 +43,8 @@ exports.MainnetSpotMarkets = [
43
43
  oracle: web3_js_1.PublicKey.default,
44
44
  oracleSource: __1.OracleSource.QUOTE_ASSET,
45
45
  mint: new web3_js_1.PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
46
- precision: numericConstants_1.SPOT_MARKET_BALANCE_PRECISION,
47
- precisionExp: numericConstants_1.SPOT_MARKET_BALANCE_PRECISION_EXP,
46
+ precision: numericConstants_1.QUOTE_PRECISION,
47
+ precisionExp: numericConstants_1.QUOTE_PRECISION_EXP,
48
48
  },
49
49
  {
50
50
  symbol: 'SOL',
@@ -563,7 +563,7 @@ class DriftClient {
563
563
  }
564
564
  if (!spotPosition.openAsks.eq(numericConstants_1.ZERO) ||
565
565
  !spotPosition.openBids.eq(numericConstants_1.ZERO)) {
566
- spotMarketAccountMap.set(spotPosition.marketIndex, {
566
+ spotMarketAccountMap.set(numericConstants_1.QUOTE_SPOT_MARKET_INDEX, {
567
567
  pubkey: this.getQuoteSpotMarketAccount().pubkey,
568
568
  isSigner: false,
569
569
  isWritable: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
@@ -1,8 +1,8 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  import { BN, DriftEnv, OracleSource } from '../';
3
3
  import {
4
- SPOT_MARKET_BALANCE_PRECISION,
5
- SPOT_MARKET_BALANCE_PRECISION_EXP,
4
+ QUOTE_PRECISION,
5
+ QUOTE_PRECISION_EXP,
6
6
  LAMPORTS_EXP,
7
7
  LAMPORTS_PRECISION,
8
8
  SIX,
@@ -62,8 +62,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
62
62
  oracle: PublicKey.default,
63
63
  oracleSource: OracleSource.QUOTE_ASSET,
64
64
  mint: new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
65
- precision: SPOT_MARKET_BALANCE_PRECISION,
66
- precisionExp: SPOT_MARKET_BALANCE_PRECISION_EXP,
65
+ precision: QUOTE_PRECISION,
66
+ precisionExp: QUOTE_PRECISION_EXP,
67
67
  },
68
68
  {
69
69
  symbol: 'SOL',
@@ -867,7 +867,7 @@ export class DriftClient {
867
867
  !spotPosition.openAsks.eq(ZERO) ||
868
868
  !spotPosition.openBids.eq(ZERO)
869
869
  ) {
870
- spotMarketAccountMap.set(spotPosition.marketIndex, {
870
+ spotMarketAccountMap.set(QUOTE_SPOT_MARKET_INDEX, {
871
871
  pubkey: this.getQuoteSpotMarketAccount().pubkey,
872
872
  isSigner: false,
873
873
  isWritable: false,