@gearbox-protocol/sdk 3.0.0-vfour.154 → 3.0.0-vfour.156

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.
@@ -56644,15 +56644,15 @@ var toBigInt = (v) => {
56644
56644
  return BigInt(value);
56645
56645
  };
56646
56646
  var percentFmt = (v, raw = true) => `${(Number(v) / 100).toFixed(2)}%` + (raw ? ` [${v}]` : "");
56647
- function formatBNvalue(num, decimals, precision, raw = true) {
56648
- return `${formatBN(num, decimals, precision)}` + (raw ? ` [ ${num} ]` : "");
56647
+ function formatBNvalue(num, decimals2, precision, raw = true) {
56648
+ return `${formatBN(num, decimals2, precision)}` + (raw ? ` [ ${num} ]` : "");
56649
56649
  }
56650
- function formatBN(num, decimals, precision) {
56650
+ function formatBN(num, decimals2, precision) {
56651
56651
  if (num === undefined) {
56652
56652
  return "-";
56653
56653
  }
56654
56654
  const numBInt = BigInt(num);
56655
- const limitedNum = limitNum(numBInt, decimals);
56655
+ const limitedNum = limitNum(numBInt, decimals2);
56656
56656
  const limitedPrecision = limitPrecision(limitedNum, precision);
56657
56657
  return toHumanFormat(limitedNum, limitedPrecision);
56658
56658
  }
@@ -57592,7 +57592,7 @@ var CreditFacadeV300Contract = class extends BaseContract {
57592
57592
  this.underlying = creditManager.underlying;
57593
57593
  }
57594
57594
  stateHuman(raw) {
57595
- const decimals = this.sdk.tokensMeta.decimals(this.underlying);
57595
+ const decimals2 = this.sdk.tokensMeta.decimals(this.underlying);
57596
57596
  return {
57597
57597
  ...super.stateHuman(raw),
57598
57598
  expirable: this.expirable,
@@ -57601,8 +57601,8 @@ var CreditFacadeV300Contract = class extends BaseContract {
57601
57601
  expirationDate: this.expirationDate,
57602
57602
  maxDebtPerBlockMultiplier: this.maxDebtPerBlockMultiplier,
57603
57603
  botList: this.labelAddress(this.botList),
57604
- minDebt: formatBNvalue(this.minDebt, decimals),
57605
- maxDebt: formatBNvalue(this.maxDebt, decimals),
57604
+ minDebt: formatBNvalue(this.minDebt, decimals2),
57605
+ maxDebt: formatBNvalue(this.maxDebt, decimals2),
57606
57606
  currentCumulativeLoss: "0",
57607
57607
  // TODO
57608
57608
  maxCumulativeLoss: "0",
@@ -57728,7 +57728,7 @@ var CreditFacadeV310Contract = class extends BaseContract {
57728
57728
  this.underlying = creditManager.underlying;
57729
57729
  }
57730
57730
  stateHuman(raw) {
57731
- const decimals = this.sdk.tokensMeta.decimals(this.underlying);
57731
+ const decimals2 = this.sdk.tokensMeta.decimals(this.underlying);
57732
57732
  return {
57733
57733
  ...super.stateHuman(raw),
57734
57734
  expirable: this.expirable,
@@ -57737,8 +57737,8 @@ var CreditFacadeV310Contract = class extends BaseContract {
57737
57737
  expirationDate: this.expirationDate,
57738
57738
  maxDebtPerBlockMultiplier: this.maxDebtPerBlockMultiplier,
57739
57739
  botList: this.labelAddress(this.botList),
57740
- minDebt: formatBNvalue(this.minDebt, decimals),
57741
- maxDebt: formatBNvalue(this.maxDebt, decimals),
57740
+ minDebt: formatBNvalue(this.minDebt, decimals2),
57741
+ maxDebt: formatBNvalue(this.maxDebt, decimals2),
57742
57742
  currentCumulativeLoss: "0",
57743
57743
  // TODO
57744
57744
  maxCumulativeLoss: "0",
@@ -58773,7 +58773,7 @@ var Erc4626PriceFeedContract = class extends AbstractLPPriceFeedContract {
58773
58773
  });
58774
58774
  }
58775
58775
  async getValue() {
58776
- const decimals = await this.sdk.provider.publicClient.readContract({
58776
+ const decimals2 = await this.sdk.provider.publicClient.readContract({
58777
58777
  abi: erc20Abi,
58778
58778
  address: this.lpContract,
58779
58779
  functionName: "decimals"
@@ -58782,7 +58782,7 @@ var Erc4626PriceFeedContract = class extends AbstractLPPriceFeedContract {
58782
58782
  abi: viem.erc4626Abi,
58783
58783
  address: this.lpContract,
58784
58784
  functionName: "convertToAssets",
58785
- args: [10n ** BigInt(decimals)]
58785
+ args: [10n ** BigInt(decimals2)]
58786
58786
  });
58787
58787
  return price;
58788
58788
  }
@@ -62249,14 +62249,6 @@ var normalTokens = {
62249
62249
  };
62250
62250
  var isNormalToken = (t) => typeof t === "string" && !!normalTokens[t];
62251
62251
 
62252
- // src/sdk/sdk-gov-legacy/tokens/quoted.ts
62253
- var nonQuoted = {
62254
- Mainnet: ["WETH", "DAI", "USDC", "FRAX"],
62255
- Arbitrum: ["WETH", "DAI", "USDC", "WBTC"],
62256
- Optimism: ["WETH", "USDC", "OP"],
62257
- Base: ["WETH", "USDC", "USDT"]
62258
- };
62259
-
62260
62252
  // src/sdk/sdk-gov-legacy/tokens/stakingRewards.ts
62261
62253
  var stakingRewardsPhantomTokens = {
62262
62254
  stkUSDS: {
@@ -63861,12 +63853,293 @@ var tokenSymbolByAddress = Object.entries(tokenDataByNetwork).reduce(
63861
63853
  }),
63862
63854
  {}
63863
63855
  );
63856
+ var tickerSymbolByAddress = Object.fromEntries(
63857
+ Object.values(tickerTokensByNetwork).map(
63858
+ (en) => Object.entries(en).map(
63859
+ ([symbol, addresses]) => addresses.map((addr) => [addr.toLowerCase(), symbol])
63860
+ ).flat()
63861
+ ).flat()
63862
+ );
63864
63863
  function getTokenSymbol(address) {
63865
63864
  return tokenSymbolByAddress[address.toLowerCase()];
63866
63865
  }
63866
+ function getTokenSymbolOrTicker(address) {
63867
+ return tokenSymbolByAddress[address.toLowerCase()] || tickerSymbolByAddress[address.toLowerCase()];
63868
+ }
63867
63869
  var isSupportedToken = (t) => typeof t === "string" && !!supportedTokens[t];
63868
63870
  var isLPToken = (t) => typeof t === "string" && !!lpTokens[t];
63869
63871
 
63872
+ // src/sdk/sdk-gov-legacy/tokens/decimals.ts
63873
+ var decimals = {
63874
+ "1INCH": 18,
63875
+ AAVE: 18,
63876
+ CRV: 18,
63877
+ DAI: 18,
63878
+ LINK: 18,
63879
+ SNX: 18,
63880
+ UNI: 18,
63881
+ USDC: 6,
63882
+ USDC_e: 6,
63883
+ USDT: 6,
63884
+ DOLA: 18,
63885
+ WBTC: 8,
63886
+ WETH: 18,
63887
+ YFI: 18,
63888
+ STETH: 18,
63889
+ wstETH: 18,
63890
+ CVX: 18,
63891
+ FRAX: 18,
63892
+ FXS: 18,
63893
+ LDO: 18,
63894
+ LUSD: 18,
63895
+ sUSD: 18,
63896
+ GUSD: 2,
63897
+ LQTY: 18,
63898
+ GMX: 18,
63899
+ ARB: 18,
63900
+ BAL: 18,
63901
+ MKR: 18,
63902
+ RPL: 18,
63903
+ APE: 18,
63904
+ AURA: 18,
63905
+ SWISE: 18,
63906
+ SKY: 18,
63907
+ WLD: 18,
63908
+ OP: 18,
63909
+ GHO: 18,
63910
+ LBTC: 8,
63911
+ eBTC: 8,
63912
+ solvBTC: 18,
63913
+ pumpBTC: 8,
63914
+ osETH: 18,
63915
+ weETH: 18,
63916
+ ezETH: 18,
63917
+ rsETH: 18,
63918
+ frxETH: 18,
63919
+ sfrxETH: 18,
63920
+ rswETH: 18,
63921
+ cbETH: 18,
63922
+ USDe: 18,
63923
+ PENDLE: 18,
63924
+ pufETH: 18,
63925
+ USDS: 18,
63926
+ PT_rsETH_26SEP2024: 18,
63927
+ "3Crv": 18,
63928
+ crvFRAX: 18,
63929
+ steCRV: 18,
63930
+ crvPlain3andSUSD: 18,
63931
+ FRAX3CRV: 18,
63932
+ LUSD3CRV: 18,
63933
+ gusd3CRV: 18,
63934
+ crvCRVETH: 18,
63935
+ crvCVXETH: 18,
63936
+ crvUSDTWBTCWETH: 18,
63937
+ LDOETH: 18,
63938
+ USDeUSDC: 18,
63939
+ FRAXUSDe: 18,
63940
+ USDecrvUSD: 18,
63941
+ FRAXsDAI: 18,
63942
+ DOLAsUSDe: 18,
63943
+ DOLAFRAXBP3CRV_f: 18,
63944
+ crvUSDDOLA_f: 18,
63945
+ USDeDAI: 18,
63946
+ MtEthena: 18,
63947
+ GHOUSDe: 18,
63948
+ pufETHwstE: 18,
63949
+ GHOcrvUSD: 18,
63950
+ wstETHCRV: 18,
63951
+ ezETHWETH: 18,
63952
+ ezpzETH: 18,
63953
+ LBTCWBTC: 18,
63954
+ eBTCWBTC: 18,
63955
+ pumpBTCWBTC: 18,
63956
+ TriBTC: 18,
63957
+ crvUSD: 18,
63958
+ crvUSDUSDC: 18,
63959
+ crvUsUSDe: 18,
63960
+ llamathena: 18,
63961
+ crvUSDUSDT: 18,
63962
+ crvUSDETHCRV: 18,
63963
+ crvUSDFRAX: 18,
63964
+ crvUSDC: 18,
63965
+ crvUSDC_e: 18,
63966
+ crvUSDT: 18,
63967
+ USDEUSDC: 18,
63968
+ "2CRV": 18,
63969
+ "3c-crvUSD": 18,
63970
+ "3CRV": 18,
63971
+ cvx3Crv: 18,
63972
+ cvxcrvFRAX: 18,
63973
+ cvxsteCRV: 18,
63974
+ cvxFRAX3CRV: 18,
63975
+ cvxLUSD3CRV: 18,
63976
+ cvxcrvPlain3andSUSD: 18,
63977
+ cvxgusd3CRV: 18,
63978
+ cvxcrvCRVETH: 18,
63979
+ cvxcrvCVXETH: 18,
63980
+ cvxcrvUSDTWBTCWETH: 18,
63981
+ cvxLDOETH: 18,
63982
+ cvxcrvUSDUSDC: 18,
63983
+ cvxcrvUSDUSDT: 18,
63984
+ cvxcrvUSDFRAX: 18,
63985
+ cvxcrvUSDETHCRV: 18,
63986
+ cvxGHOcrvUSD: 18,
63987
+ cvxllamathena: 18,
63988
+ stkcvx3Crv: 18,
63989
+ stkcvxcrvFRAX: 18,
63990
+ stkcvxsteCRV: 18,
63991
+ stkcvxFRAX3CRV: 18,
63992
+ stkcvxLUSD3CRV: 18,
63993
+ stkcvxcrvPlain3andSUSD: 18,
63994
+ stkcvxgusd3CRV: 18,
63995
+ stkcvxcrvCRVETH: 18,
63996
+ stkcvxcrvCVXETH: 18,
63997
+ stkcvxcrvUSDTWBTCWETH: 18,
63998
+ stkcvxLDOETH: 18,
63999
+ stkcvxcrvUSDUSDC: 18,
64000
+ stkcvxcrvUSDUSDT: 18,
64001
+ stkcvxcrvUSDFRAX: 18,
64002
+ stkcvxcrvUSDETHCRV: 18,
64003
+ stkcvxGHOcrvUSD: 18,
64004
+ stkcvxllamathena: 18,
64005
+ cvxcrvUSDT: 18,
64006
+ yvDAI: 18,
64007
+ yvUSDC: 6,
64008
+ yvUSDC_e: 6,
64009
+ yvUSDT: 6,
64010
+ yvOP: 18,
64011
+ yvWETH: 18,
64012
+ yvWBTC: 8,
64013
+ yvCurve_stETH: 18,
64014
+ yvCurve_FRAX: 18,
64015
+ dDAI: 18,
64016
+ dUSDC: 6,
64017
+ dWBTC: 8,
64018
+ dWETH: 18,
64019
+ dFRAX: 18,
64020
+ dwstETH: 18,
64021
+ dUSDCV3: 6,
64022
+ dWBTCV3: 8,
64023
+ dWETHV3: 18,
64024
+ sdUSDCV3: 6,
64025
+ sdWBTCV3: 8,
64026
+ sdWETHV3: 18,
64027
+ sdWETHV3_OLD: 18,
64028
+ dUSDTV3: 6,
64029
+ dGHOV3: 18,
64030
+ dDAIV3: 18,
64031
+ sdUSDTV3: 6,
64032
+ sdGHOV3: 18,
64033
+ sdDAIV3: 18,
64034
+ dcrvUSDV3: 18,
64035
+ sdcrvUSDV3: 18,
64036
+ dDOLAV3: 18,
64037
+ dUSDC_eV3: 6,
64038
+ sdUSDC_eV3: 6,
64039
+ GEAR: 18,
64040
+ USDC_DAI_USDT: 18,
64041
+ BPT_rETH_ETH: 18,
64042
+ BPT_ROAD: 18,
64043
+ BPT_WSTETH_ETH: 18,
64044
+ ECLP_wstETH_WETH: 18,
64045
+ B_rETH_STABLE: 18,
64046
+ weETH_rETH: 18,
64047
+ osETH_wETH_BPT: 18,
64048
+ B_80BAL_20WETH: 18,
64049
+ "50WETH_50AURA": 18,
64050
+ wstETH_rETH_cbETH: 18,
64051
+ cbETH_rETH_wstETH: 18,
64052
+ wstETH_rETH_sfrxETH: 18,
64053
+ wstETH_WETH_BPT: 18,
64054
+ rETH_WETH_BPT_deprecated: 18,
64055
+ rETH_wETH_BPT: 18,
64056
+ trenSTETH: 18,
64057
+ ezETH_WETH_BPT: 18,
64058
+ weETH_ezETH_rswETH: 18,
64059
+ "33AURA_33ARB_33BAL": 18,
64060
+ ezETH_wstETH: 18,
64061
+ GHO_USDT_USDC: 18,
64062
+ rsETH_WETH: 18,
64063
+ rsETH_wETH_Arb: 18,
64064
+ bpt_ethtri: 18,
64065
+ pumpBTC_WBTC_BPT: 18,
64066
+ sUSDe_USDC_BPT: 18,
64067
+ auraB_rETH_STABLE: 18,
64068
+ auraB_rETH_STABLE_vault: 18,
64069
+ auraweETH_rETH: 18,
64070
+ auraweETH_rETH_vault: 18,
64071
+ auraosETH_wETH_BPT: 18,
64072
+ auraosETH_wETH_BPT_vault: 18,
64073
+ auraBPT_rETH_ETH: 18,
64074
+ auraBPT_rETH_ETH_vault: 18,
64075
+ auraBPT_WSTETH_ETH: 18,
64076
+ auraBPT_WSTETH_ETH_vault: 18,
64077
+ aurarETH_wETH_BPT: 18,
64078
+ aurarETH_wETH_BPT_vault: 18,
64079
+ auracbETH_rETH_wstETH: 18,
64080
+ auracbETH_rETH_wstETH_vault: 18,
64081
+ aurawstETH_rETH_sfrxETH: 18,
64082
+ aurawstETH_rETH_sfrxETH_vault: 18,
64083
+ aurawstETH_WETH_BPT: 18,
64084
+ aurawstETH_WETH_BPT_vault: 18,
64085
+ zpufETH: 18,
64086
+ steakLRT: 18,
64087
+ Re7LRT: 18,
64088
+ amphrETH: 18,
64089
+ rstETH: 18,
64090
+ pzETH: 18,
64091
+ aDAI: 18,
64092
+ aUSDC: 6,
64093
+ aUSDT: 6,
64094
+ aWETH: 18,
64095
+ waDAI: 18,
64096
+ waUSDC: 6,
64097
+ waUSDT: 6,
64098
+ waWETH: 18,
64099
+ cDAI: 18,
64100
+ cUSDC: 6,
64101
+ cUSDT: 6,
64102
+ cLINK: 18,
64103
+ cETH: 18,
64104
+ SHIB: 18,
64105
+ fUSDC: 8,
64106
+ sDAI: 18,
64107
+ sUSDe: 18,
64108
+ sUSDS: 18,
64109
+ YieldETH: 18,
64110
+ scrvUSD: 18,
64111
+ rETH: 18,
64112
+ rETH_f: 18,
64113
+ stkUSDS: 18,
64114
+ PT_sUSDe_26DEC2024: 18,
64115
+ PT_eETH_26DEC2024: 18,
64116
+ PT_ezETH_26DEC2024: 18,
64117
+ PT_eBTC_26DEC2024: 8,
64118
+ PT_corn_solvBTC_BBN_26DEC2024: 8,
64119
+ PT_corn_pumpBTC_26DEC2024: 8,
64120
+ PT_cornLBTC_26DEC2024: 8,
64121
+ PT_LBTC_27MAR2025: 8,
64122
+ PT_corn_eBTC_27MAR2025: 8,
64123
+ PT_sUSDe_27MAR2025: 18
64124
+ };
64125
+ function getDecimals(token) {
64126
+ let dec = decimals[token];
64127
+ if (dec) return dec;
64128
+ dec = decimals[tokenSymbolByAddress[token.toLowerCase()]];
64129
+ if (!dec) {
64130
+ throw new Error(`Decimals for ${token} not found`);
64131
+ }
64132
+ return dec;
64133
+ }
64134
+
64135
+ // src/sdk/sdk-gov-legacy/tokens/quoted.ts
64136
+ var nonQuoted = {
64137
+ Mainnet: ["WETH", "DAI", "USDC", "FRAX"],
64138
+ Arbitrum: ["WETH", "DAI", "USDC", "WBTC"],
64139
+ Optimism: ["WETH", "USDC", "OP"],
64140
+ Base: ["WETH", "USDC", "USDT"]
64141
+ };
64142
+
63870
64143
  // src/sdk/sdk-gov-legacy/tokens/tokenData.ts
63871
64144
  var connectors = {
63872
64145
  Mainnet: [
@@ -65703,6 +65976,33 @@ var DUMB_ADDRESS2 = "0x93548eB8453a498222C4FF2C4375b7De8af5A38a";
65703
65976
  var DUMB_ADDRESS3 = "0x822293548EB8453A49c4fF2c4375B7DE8AF5a38A";
65704
65977
  var DUMB_ADDRESS4 = "0x498222C4Ff2C4393548eb8453a75B7dE8AF5A38a";
65705
65978
 
65979
+ // src/sdk/sdk-gov-legacy/oracles/PriceFeedType.ts
65980
+ var PriceFeedType = /* @__PURE__ */ ((PriceFeedType2) => {
65981
+ PriceFeedType2[PriceFeedType2["CHAINLINK_ORACLE"] = 0] = "CHAINLINK_ORACLE";
65982
+ PriceFeedType2[PriceFeedType2["YEARN_ORACLE"] = 1] = "YEARN_ORACLE";
65983
+ PriceFeedType2[PriceFeedType2["CURVE_2LP_ORACLE"] = 2] = "CURVE_2LP_ORACLE";
65984
+ PriceFeedType2[PriceFeedType2["CURVE_3LP_ORACLE"] = 3] = "CURVE_3LP_ORACLE";
65985
+ PriceFeedType2[PriceFeedType2["CURVE_4LP_ORACLE"] = 4] = "CURVE_4LP_ORACLE";
65986
+ PriceFeedType2[PriceFeedType2["ZERO_ORACLE"] = 5] = "ZERO_ORACLE";
65987
+ PriceFeedType2[PriceFeedType2["WSTETH_ORACLE"] = 6] = "WSTETH_ORACLE";
65988
+ PriceFeedType2[PriceFeedType2["BOUNDED_ORACLE"] = 7] = "BOUNDED_ORACLE";
65989
+ PriceFeedType2[PriceFeedType2["COMPOSITE_ORACLE"] = 8] = "COMPOSITE_ORACLE";
65990
+ PriceFeedType2[PriceFeedType2["WRAPPED_AAVE_V2_ORACLE"] = 9] = "WRAPPED_AAVE_V2_ORACLE";
65991
+ PriceFeedType2[PriceFeedType2["COMPOUND_V2_ORACLE"] = 10] = "COMPOUND_V2_ORACLE";
65992
+ PriceFeedType2[PriceFeedType2["BALANCER_STABLE_LP_ORACLE"] = 11] = "BALANCER_STABLE_LP_ORACLE";
65993
+ PriceFeedType2[PriceFeedType2["BALANCER_WEIGHTED_LP_ORACLE"] = 12] = "BALANCER_WEIGHTED_LP_ORACLE";
65994
+ PriceFeedType2[PriceFeedType2["CURVE_CRYPTO_ORACLE"] = 13] = "CURVE_CRYPTO_ORACLE";
65995
+ PriceFeedType2[PriceFeedType2["THE_SAME_AS"] = 14] = "THE_SAME_AS";
65996
+ PriceFeedType2[PriceFeedType2["REDSTONE_ORACLE"] = 15] = "REDSTONE_ORACLE";
65997
+ PriceFeedType2[PriceFeedType2["ERC4626_VAULT_ORACLE"] = 16] = "ERC4626_VAULT_ORACLE";
65998
+ PriceFeedType2[PriceFeedType2["NETWORK_DEPENDENT"] = 17] = "NETWORK_DEPENDENT";
65999
+ PriceFeedType2[PriceFeedType2["CURVE_USD_ORACLE"] = 18] = "CURVE_USD_ORACLE";
66000
+ PriceFeedType2[PriceFeedType2["PYTH_ORACLE"] = 19] = "PYTH_ORACLE";
66001
+ PriceFeedType2[PriceFeedType2["MELLOW_LRT_ORACLE"] = 20] = "MELLOW_LRT_ORACLE";
66002
+ PriceFeedType2[PriceFeedType2["PENDLE_PT_TWAP_ORACLE"] = 21] = "PENDLE_PT_TWAP_ORACLE";
66003
+ return PriceFeedType2;
66004
+ })(PriceFeedType || {});
66005
+
65706
66006
  // src/sdk/router/PathOptionFactory.ts
65707
66007
  var PathOptionFactory = class _PathOptionFactory {
65708
66008
  // TODO: get rid of token data from SDK
@@ -66122,8 +66422,8 @@ var RouterV3Contract = class extends BaseContract {
66122
66422
  const token = t;
66123
66423
  const isEnabled = (mask & ca.enabledTokensMask) !== 0n;
66124
66424
  expectedBalances.upsert(token, { token, balance });
66125
- const decimals = this.sdk.tokensMeta.decimals(token);
66126
- const minBalance = 10n ** BigInt(Math.max(8, decimals) - 8);
66425
+ const decimals2 = this.sdk.tokensMeta.decimals(token);
66426
+ const minBalance = 10n ** BigInt(Math.max(8, decimals2) - 8);
66127
66427
  if (balance < minBalance || !isEnabled) {
66128
66428
  leftoverBalances.upsert(token, { token, balance });
66129
66429
  }
@@ -67354,7 +67654,7 @@ var BigIntMath = class {
67354
67654
 
67355
67655
  // src/sdk/sdk-legacy/utils/price.ts
67356
67656
  var PriceUtils = class {
67357
- static calcTotalPrice = (price, amount, decimals = 18) => amount * WAD * price / 10n ** BigInt(decimals) / PRICE_DECIMALS;
67657
+ static calcTotalPrice = (price, amount, decimals2 = 18) => amount * WAD * price / 10n ** BigInt(decimals2) / PRICE_DECIMALS;
67358
67658
  static convertByPrice(totalMoney, { price: targetPrice, decimals: targetDecimals = 18 }) {
67359
67659
  if (targetPrice <= 0n) return 0n;
67360
67660
  return totalMoney * 10n ** BigInt(targetDecimals) * PRICE_DECIMALS / targetPrice / WAD;
@@ -67363,15 +67663,15 @@ var PriceUtils = class {
67363
67663
  function rayToNumber(num) {
67364
67664
  return Number(toBigInt(num) / 10n ** 21n) / 1e6;
67365
67665
  }
67366
- function toSignificant(num, decimals, precision = 6) {
67666
+ function toSignificant(num, decimals2, precision = 6) {
67367
67667
  if (num === 1n) return "0";
67368
- const divider = new decimal_jsLight.Decimal(10).toPower(decimals);
67668
+ const divider = new decimal_jsLight.Decimal(10).toPower(decimals2);
67369
67669
  const number = new decimal_jsLight.Decimal(num.toString()).div(divider);
67370
67670
  return number.toSignificantDigits(precision, 4).toString();
67371
67671
  }
67372
- function toBN(num, decimals) {
67672
+ function toBN(num, decimals2) {
67373
67673
  if (num === "") return 0n;
67374
- const multiplier = new decimal_jsLight.Decimal(10).toPower(decimals);
67674
+ const multiplier = new decimal_jsLight.Decimal(10).toPower(decimals2);
67375
67675
  const number = new decimal_jsLight.Decimal(num).mul(multiplier);
67376
67676
  return BigInt(number.toFixed(0));
67377
67677
  }
@@ -67381,11 +67681,11 @@ function shortAddress(address) {
67381
67681
  function shortHash(address) {
67382
67682
  return address === undefined ? "" : `${address.slice(0, 5)}...`;
67383
67683
  }
67384
- function formatPercentage(healthFactor, decimals = 2) {
67385
- return (healthFactor / Number(PERCENTAGE_FACTOR)).toFixed(decimals);
67684
+ function formatPercentage(healthFactor, decimals2 = 2) {
67685
+ return (healthFactor / Number(PERCENTAGE_FACTOR)).toFixed(decimals2);
67386
67686
  }
67387
- function formatLeverage(leverage, decimals = 2) {
67388
- return (leverage / Number(LEVERAGE_DECIMALS)).toFixed(decimals);
67687
+ function formatLeverage(leverage, decimals2 = 2) {
67688
+ return (leverage / Number(LEVERAGE_DECIMALS)).toFixed(decimals2);
67389
67689
  }
67390
67690
 
67391
67691
  // src/sdk/sdk-legacy/core/creditAccount.ts
@@ -71822,10 +72122,10 @@ var TxAddLiquidity = class extends EVMTx {
71822
72122
  this.poolName = opts.poolName;
71823
72123
  }
71824
72124
  toString() {
71825
- const { title, decimals = 18 } = this.token;
72125
+ const { title, decimals: decimals2 = 18 } = this.token;
71826
72126
  return `${this.poolName}: Deposit ${formatBN(
71827
72127
  this.amount,
71828
- decimals
72128
+ decimals2
71829
72129
  )} ${title}`;
71830
72130
  }
71831
72131
  serialize() {
@@ -71846,10 +72146,10 @@ var TxRemoveLiquidity = class extends EVMTx {
71846
72146
  this.poolName = opts.poolName;
71847
72147
  }
71848
72148
  toString() {
71849
- const { title, decimals = 18 } = this.token;
72149
+ const { title, decimals: decimals2 = 18 } = this.token;
71850
72150
  return `${this.poolName}: Withdraw ${formatBN(
71851
72151
  this.amount,
71852
- decimals
72152
+ decimals2
71853
72153
  )} ${title}`;
71854
72154
  }
71855
72155
  serialize() {
@@ -72080,8 +72380,8 @@ var TxClaimRewards = class extends EVMTx {
72080
72380
  }
72081
72381
  toString() {
72082
72382
  const rewardsString = this.rewards.length <= 2 ? this.rewards.map(({ token, balance }) => {
72083
- const { title, decimals = 18 } = token;
72084
- return `${formatBN(balance, decimals)} ${title}`;
72383
+ const { title, decimals: decimals2 = 18 } = token;
72384
+ return `${formatBN(balance, decimals2)} ${title}`;
72085
72385
  }).join(", ") : this.rewards.map(({ token }) => {
72086
72386
  const { title } = token;
72087
72387
  return title;
@@ -72270,10 +72570,10 @@ var TxWithdrawCollateral = class extends EVMTx {
72270
72570
  this.creditManagerName = opts.creditManagerName;
72271
72571
  }
72272
72572
  toString() {
72273
- const { title: symbol, decimals } = this.token;
72573
+ const { title: symbol, decimals: decimals2 } = this.token;
72274
72574
  return `Credit Account ${this.creditManagerName}: withdrawn ${formatBN(
72275
72575
  this.amount,
72276
- decimals || 18
72576
+ decimals2 || 18
72277
72577
  )} ${symbol}`;
72278
72578
  }
72279
72579
  serialize() {
@@ -72968,8 +73268,8 @@ var GearboxRewardsExtraApy = class {
72968
73268
  (sum, r) => r.effective_balance + sum,
72969
73269
  0
72970
73270
  );
72971
- const { decimals = 18 } = tokensList[token] || {};
72972
- return { token, balance: toBN(String(balance), decimals) };
73271
+ const { decimals: decimals2 = 18 } = tokensList[token] || {};
73272
+ return { token, balance: toBN(String(balance), decimals2) };
72973
73273
  }
72974
73274
  static getPointsByPool({
72975
73275
  totalTokenBalances,
@@ -73006,8 +73306,8 @@ var GearboxRewardsExtraApy = class {
73006
73306
  static getPoolTokenPoints(tokenBalanceInPool, pool, tokensList, pointsInfo) {
73007
73307
  if (!tokenBalanceInPool) return null;
73008
73308
  if (pool.expectedLiquidity <= 0) return 0n;
73009
- const { decimals = 18 } = tokensList[tokenBalanceInPool.token] || {};
73010
- const targetFactor = 10n ** BigInt(decimals);
73309
+ const { decimals: decimals2 = 18 } = tokensList[tokenBalanceInPool.token] || {};
73310
+ const targetFactor = 10n ** BigInt(decimals2);
73011
73311
  const { decimals: underlyingDecimals = 18 } = tokensList[pool.underlyingToken] || {};
73012
73312
  const underlyingFactor = 10n ** BigInt(underlyingDecimals);
73013
73313
  const defaultPoints = pointsInfo.amount * targetFactor / PERCENTAGE_FACTOR;
@@ -73575,6 +73875,7 @@ exports.PoolQuotaKeeperContract = PoolQuotaKeeperContract;
73575
73875
  exports.PositionUtils = PositionUtils;
73576
73876
  exports.PriceFeedRef = PriceFeedRef;
73577
73877
  exports.PriceFeedRegister = PriceFeedRegister;
73878
+ exports.PriceFeedType = PriceFeedType;
73578
73879
  exports.PriceOracleV300Contract = PriceOracleV300Contract;
73579
73880
  exports.PriceOracleV310Contract = PriceOracleV310Contract;
73580
73881
  exports.PriceUtils = PriceUtils;
@@ -73719,6 +74020,7 @@ exports.curveV1AdapterDepositAbi = curveV1AdapterDepositAbi;
73719
74020
  exports.curveV1AdapterStEthAbi = curveV1AdapterStEthAbi;
73720
74021
  exports.curveV1AdapterStableNgAbi = curveV1AdapterStableNgAbi;
73721
74022
  exports.dataCompressorV3Abi = dataCompressorV3Abi;
74023
+ exports.decimals = decimals;
73722
74024
  exports.degenDistributorV3Abi = degenDistributorV3Abi;
73723
74025
  exports.degenNftv2Abi = degenNftv2Abi;
73724
74026
  exports.detectChain = detectChain;
@@ -73747,9 +74049,11 @@ exports.gearStakingV3Abi = gearStakingV3Abi;
73747
74049
  exports.gearTokens = gearTokens;
73748
74050
  exports.getAddressProvider = getAddressProvider;
73749
74051
  exports.getConnectors = getConnectors;
74052
+ exports.getDecimals = getDecimals;
73750
74053
  exports.getNetworkType = getNetworkType;
73751
74054
  exports.getProtocolData = getProtocolData;
73752
74055
  exports.getTokenSymbol = getTokenSymbol;
74056
+ exports.getTokenSymbolOrTicker = getTokenSymbolOrTicker;
73753
74057
  exports.halfRAY = halfRAY;
73754
74058
  exports.iAdapterAbi = iAdapterAbi;
73755
74059
  exports.iAddressProviderV3Abi = iAddressProviderV3Abi;
@@ -73887,6 +74191,7 @@ exports.supportedTokens = supportedTokens;
73887
74191
  exports.susdeOverriderAbi = susdeOverriderAbi;
73888
74192
  exports.swapAggregatorAbi = swapAggregatorAbi;
73889
74193
  exports.tickerInfoTokensByNetwork = tickerInfoTokensByNetwork;
74194
+ exports.tickerSymbolByAddress = tickerSymbolByAddress;
73890
74195
  exports.tickerTokensByNetwork = tickerTokensByNetwork;
73891
74196
  exports.toBN = toBN;
73892
74197
  exports.toBigInt = toBigInt;