@scallop-io/sui-scallop-sdk 0.46.65 → 0.46.66

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/dist/index.mjs CHANGED
@@ -8,6 +8,7 @@ var PROTOCOL_OBJECT_ID = IS_VE_SCA_TEST ? "0xc9f859f98ca352a11b97a038c4b4162bee4
8
8
  var BORROW_FEE_PROTOCOL_ID = IS_VE_SCA_TEST ? "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" : "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
9
9
  var SCA_COIN_TYPE = IS_VE_SCA_TEST ? `0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA` : "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
10
10
  var OLD_BORROW_INCENTIVE_PROTOCOL_ID = "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
11
+ var NATIVE_USDC = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
11
12
  var SUPPORT_POOLS = [
12
13
  "eth",
13
14
  "btc",
@@ -2260,6 +2261,8 @@ var queryMarket = async (query, indexer = false) => {
2260
2261
  const marketData = queryResult?.events[0].parsedJson;
2261
2262
  for (const pool of marketData?.pools ?? []) {
2262
2263
  const coinType = normalizeStructTag3(pool.type.name);
2264
+ if (coinType === NATIVE_USDC)
2265
+ continue;
2263
2266
  const poolCoinName = query.utils.parseCoinNameFromType(coinType);
2264
2267
  const coinPrice = coinPrices[poolCoinName] ?? 0;
2265
2268
  if (!SUPPORT_POOLS.includes(poolCoinName)) {
@@ -2364,7 +2367,7 @@ var getMarketPools = async (query, poolCoinNames = [...SUPPORT_POOLS], indexer =
2364
2367
  const marketObjectResponse = await query.cache.queryGetObject(marketId, {
2365
2368
  showContent: true
2366
2369
  });
2367
- const coinPrices = await query.utils.getCoinPrices(poolCoinNames ?? []);
2370
+ const coinPrices = await query.utils.getCoinPrices(poolCoinNames) ?? {};
2368
2371
  const marketPools = {};
2369
2372
  if (indexer) {
2370
2373
  const marketPoolsIndexer = await query.indexer.getMarketPools();
@@ -2546,7 +2549,7 @@ var getMarketPool = async (query, poolCoinName, indexer = false, marketObject, c
2546
2549
  };
2547
2550
  var getMarketCollaterals = async (query, collateralCoinNames = [...SUPPORT_COLLATERALS], indexer = false) => {
2548
2551
  const marketId = query.address.get("core.market");
2549
- const coinPrices = await query.utils.getCoinPrices(collateralCoinNames ?? []);
2552
+ const coinPrices = await query.utils.getCoinPrices(collateralCoinNames) ?? {};
2550
2553
  const marketCollaterals = {};
2551
2554
  if (indexer) {
2552
2555
  const marketCollateralsIndexer = await query.indexer.getMarketCollaterals();
@@ -2855,9 +2858,9 @@ var getSpools = async (query, stakeMarketCoinNames = [...SUPPORT_SPOOLS], indexe
2855
2858
  const rewardCoinName = query.utils.getSpoolRewardCoinName(stakeMarketCoinName);
2856
2859
  return rewardCoinName;
2857
2860
  });
2858
- const coinPrices = await query.utils.getCoinPrices(
2859
- [.../* @__PURE__ */ new Set([...stakeCoinNames, ...rewardCoinNames])]
2860
- );
2861
+ const coinPrices = await query.utils.getCoinPrices([
2862
+ .../* @__PURE__ */ new Set([...stakeCoinNames, ...rewardCoinNames])
2863
+ ]) ?? {};
2861
2864
  const marketPools = await query.getMarketPools(stakeCoinNames, indexer);
2862
2865
  const spools = {};
2863
2866
  if (indexer) {
@@ -3236,14 +3239,12 @@ var queryBorrowIncentivePools = async (query, borrowIncentiveCoinNames = [
3236
3239
  ...SUPPORT_BORROW_INCENTIVE_POOLS
3237
3240
  ], indexer = false) => {
3238
3241
  const borrowIncentivePools = {};
3239
- const coinPrices = await query.utils.getCoinPrices(
3240
- [
3241
- .../* @__PURE__ */ new Set([
3242
- ...borrowIncentiveCoinNames,
3243
- ...SUPPORT_BORROW_INCENTIVE_REWARDS
3244
- ])
3245
- ]
3246
- );
3242
+ const coinPrices = await query.utils.getCoinPrices([
3243
+ .../* @__PURE__ */ new Set([
3244
+ ...borrowIncentiveCoinNames,
3245
+ ...SUPPORT_BORROW_INCENTIVE_REWARDS
3246
+ ])
3247
+ ]) ?? {};
3247
3248
  if (indexer) {
3248
3249
  const borrowIncentivePoolsIndexer = await query.indexer.getBorrowIncentivePools();
3249
3250
  const updateBorrowIncentivePool = (pool) => {
@@ -5137,7 +5138,7 @@ var generateCoreQuickMethod = ({
5137
5138
  const obligationCoinNames = await builder.utils.getObligationCoinNames(
5138
5139
  obligationInfo.obligationId
5139
5140
  ) ?? [];
5140
- const updateCoinNames = [...obligationCoinNames ?? [], poolCoinName];
5141
+ const updateCoinNames = [...obligationCoinNames, poolCoinName];
5141
5142
  await updateOracles(builder, txBlock, updateCoinNames);
5142
5143
  return txBlock.borrow(
5143
5144
  obligationInfo.obligationId,
@@ -7976,6 +7977,7 @@ export {
7976
7977
  MAX_LOCK_ROUNDS,
7977
7978
  MIN_INITIAL_LOCK_AMOUNT,
7978
7979
  MIN_TOP_UP_AMOUNT,
7980
+ NATIVE_USDC,
7979
7981
  OLD_BORROW_INCENTIVE_PROTOCOL_ID,
7980
7982
  PROTOCOL_OBJECT_ID,
7981
7983
  SCA_COIN_TYPE,