@jup-ag/lend 0.0.10 → 0.0.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.
@@ -1,6 +1,6 @@
1
1
  import { PublicKey, SystemProgram } from '@solana/web3.js';
2
2
  import BN from 'bn.js';
3
- import { BN as BN$1, Program } from '@coral-xyz/anchor';
3
+ import { Program } from '@coral-xyz/anchor';
4
4
  import { g as getTick, a as getTickIdLiquidation, c as getVaultState, d as getVaultConfig, e as getBranch, f as getTickHasDebt, h as getVaultMetadata, i as getPosition, j as getLiquidity, k as getClaimAccount, l as getRateModel, m as getUserBorrowPosition, n as getUserSupplyPosition, o as getLiquidityReserve, p as getPositionTokenAccount, v as vaults } from '../shared/lend.CzIu1Y5n.mjs';
5
5
  import { l as liquidity } from '../shared/lend.D5fnz2Fg.mjs';
6
6
  import { getMint, getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
@@ -612,19 +612,19 @@ function getTickAtRatio(ratioX48) {
612
612
 
613
613
  const COEFFICIENT_SIZE_DEBT_FACTOR = 35;
614
614
  const EXPONENT_SIZE_DEBT_FACTOR = 15;
615
- const EXPONENT_MAX_DEBT_FACTOR = new BN$1(1).shln(EXPONENT_SIZE_DEBT_FACTOR).subn(1);
616
- const DECIMALS_DEBT_FACTOR = new BN$1(16384);
617
- const MAX_MASK_DEBT_FACTOR$1 = new BN$1(1).shln(COEFFICIENT_SIZE_DEBT_FACTOR + EXPONENT_SIZE_DEBT_FACTOR).subn(1);
615
+ const EXPONENT_MAX_DEBT_FACTOR = new BN(1).shln(EXPONENT_SIZE_DEBT_FACTOR).subn(1);
616
+ const DECIMALS_DEBT_FACTOR = new BN(16384);
617
+ const MAX_MASK_DEBT_FACTOR$1 = new BN(1).shln(COEFFICIENT_SIZE_DEBT_FACTOR + EXPONENT_SIZE_DEBT_FACTOR).subn(1);
618
618
  const PRECISION = 64;
619
- const TWO_POWER_64 = new BN$1("18446744073709551615");
620
- const TWO_POWER_69_MINUS_1 = new BN$1(1).shln(69).subn(1);
619
+ const TWO_POWER_64 = new BN("18446744073709551615");
620
+ const TWO_POWER_69_MINUS_1 = new BN(1).shln(69).subn(1);
621
621
  const COEFFICIENT_PLUS_PRECISION = COEFFICIENT_SIZE_DEBT_FACTOR + PRECISION;
622
622
  const COEFFICIENT_PLUS_PRECISION_MINUS_1 = COEFFICIENT_PLUS_PRECISION - 1;
623
- new BN$1(1).shln(COEFFICIENT_PLUS_PRECISION_MINUS_1).subn(1);
624
- new BN$1(1).shln(COEFFICIENT_PLUS_PRECISION_MINUS_1 - 1).subn(1);
623
+ new BN(1).shln(COEFFICIENT_PLUS_PRECISION_MINUS_1).subn(1);
624
+ new BN(1).shln(COEFFICIENT_PLUS_PRECISION_MINUS_1 - 1).subn(1);
625
625
  function mulDivNormal(normal, bigNumber1, bigNumber2) {
626
626
  if (bigNumber1.isZero() || bigNumber2.isZero()) {
627
- return new BN$1(0);
627
+ return new BN(0);
628
628
  }
629
629
  const exponent1 = bigNumber1.and(EXPONENT_MAX_DEBT_FACTOR);
630
630
  const exponent2 = bigNumber2.and(EXPONENT_MAX_DEBT_FACTOR);
@@ -632,7 +632,7 @@ function mulDivNormal(normal, bigNumber1, bigNumber2) {
632
632
  throw new Error("LibraryBnError: exponent2 should be >= exponent1");
633
633
  }
634
634
  const netExponent = exponent2.sub(exponent1);
635
- if (netExponent.lt(new BN$1(129))) {
635
+ if (netExponent.lt(new BN(129))) {
636
636
  const coefficient1 = bigNumber1.shrn(EXPONENT_SIZE_DEBT_FACTOR);
637
637
  const coefficient2 = bigNumber2.shrn(EXPONENT_SIZE_DEBT_FACTOR);
638
638
  const numerator = normal.mul(coefficient1);
@@ -646,7 +646,7 @@ function mulDivNormal(normal, bigNumber1, bigNumber2) {
646
646
  }
647
647
  return result;
648
648
  } else {
649
- return new BN$1(0);
649
+ return new BN(0);
650
650
  }
651
651
  }
652
652
  function mulBigNumber(bigNumber1, bigNumber2) {
@@ -657,7 +657,7 @@ function mulBigNumber(bigNumber1, bigNumber2) {
657
657
  const resCoefficient = coefficient1.mul(coefficient2);
658
658
  const overflowLen = resCoefficient.gt(TWO_POWER_69_MINUS_1) ? COEFFICIENT_SIZE_DEBT_FACTOR : COEFFICIENT_SIZE_DEBT_FACTOR - 1;
659
659
  const adjustedCoefficient = resCoefficient.shrn(overflowLen);
660
- const resExponent = exponent1.add(exponent2).add(new BN$1(overflowLen));
660
+ const resExponent = exponent1.add(exponent2).add(new BN(overflowLen));
661
661
  if (resExponent.lt(DECIMALS_DEBT_FACTOR)) {
662
662
  throw new Error("LibraryBnError: exponent underflow");
663
663
  }
@@ -1334,10 +1334,6 @@ const getOperateIx = async ({
1334
1334
  connection,
1335
1335
  publicKey: signer
1336
1336
  });
1337
- console.log(
1338
- getVaultConfig(vaultId),
1339
- await program.account.vaultConfig.fetch(getVaultConfig(vaultId))
1340
- );
1341
1337
  const {
1342
1338
  accounts,
1343
1339
  remainingAccounts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",