@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.
@@ -7,6 +7,7 @@ export declare const PROTOCOL_OBJECT_ID: "0xc9f859f98ca352a11b97a038c4b4162bee43
7
7
  export declare const BORROW_FEE_PROTOCOL_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
8
8
  export declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
9
9
  export declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
10
+ export declare const NATIVE_USDC: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
10
11
  export declare const SUPPORT_POOLS: readonly ["eth", "btc", "usdc", "usdt", "sui", "apt", "sol", "cetus", "afsui", "hasui", "vsui", "sca"];
11
12
  export declare const SUPPORT_COLLATERALS: readonly ["eth", "btc", "usdc", "usdt", "sui", "apt", "sol", "cetus", "afsui", "hasui", "vsui", "sca"];
12
13
  export declare const SUPPORT_SPOOLS: readonly ["seth", "ssui", "susdc", "susdt", "scetus", "safsui", "shasui", "svsui"];
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ __export(src_exports, {
39
39
  MAX_LOCK_ROUNDS: () => MAX_LOCK_ROUNDS,
40
40
  MIN_INITIAL_LOCK_AMOUNT: () => MIN_INITIAL_LOCK_AMOUNT,
41
41
  MIN_TOP_UP_AMOUNT: () => MIN_TOP_UP_AMOUNT,
42
+ NATIVE_USDC: () => NATIVE_USDC,
42
43
  OLD_BORROW_INCENTIVE_PROTOCOL_ID: () => OLD_BORROW_INCENTIVE_PROTOCOL_ID,
43
44
  PROTOCOL_OBJECT_ID: () => PROTOCOL_OBJECT_ID,
44
45
  SCA_COIN_TYPE: () => SCA_COIN_TYPE,
@@ -86,6 +87,7 @@ var PROTOCOL_OBJECT_ID = IS_VE_SCA_TEST ? "0xc9f859f98ca352a11b97a038c4b4162bee4
86
87
  var BORROW_FEE_PROTOCOL_ID = IS_VE_SCA_TEST ? "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" : "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
87
88
  var SCA_COIN_TYPE = IS_VE_SCA_TEST ? `0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA` : "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
88
89
  var OLD_BORROW_INCENTIVE_PROTOCOL_ID = "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
90
+ var NATIVE_USDC = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC";
89
91
  var SUPPORT_POOLS = [
90
92
  "eth",
91
93
  "btc",
@@ -2334,6 +2336,8 @@ var queryMarket = async (query, indexer = false) => {
2334
2336
  const marketData = queryResult?.events[0].parsedJson;
2335
2337
  for (const pool of marketData?.pools ?? []) {
2336
2338
  const coinType = (0, import_utils3.normalizeStructTag)(pool.type.name);
2339
+ if (coinType === NATIVE_USDC)
2340
+ continue;
2337
2341
  const poolCoinName = query.utils.parseCoinNameFromType(coinType);
2338
2342
  const coinPrice = coinPrices[poolCoinName] ?? 0;
2339
2343
  if (!SUPPORT_POOLS.includes(poolCoinName)) {
@@ -2438,7 +2442,7 @@ var getMarketPools = async (query, poolCoinNames = [...SUPPORT_POOLS], indexer =
2438
2442
  const marketObjectResponse = await query.cache.queryGetObject(marketId, {
2439
2443
  showContent: true
2440
2444
  });
2441
- const coinPrices = await query.utils.getCoinPrices(poolCoinNames ?? []);
2445
+ const coinPrices = await query.utils.getCoinPrices(poolCoinNames) ?? {};
2442
2446
  const marketPools = {};
2443
2447
  if (indexer) {
2444
2448
  const marketPoolsIndexer = await query.indexer.getMarketPools();
@@ -2620,7 +2624,7 @@ var getMarketPool = async (query, poolCoinName, indexer = false, marketObject, c
2620
2624
  };
2621
2625
  var getMarketCollaterals = async (query, collateralCoinNames = [...SUPPORT_COLLATERALS], indexer = false) => {
2622
2626
  const marketId = query.address.get("core.market");
2623
- const coinPrices = await query.utils.getCoinPrices(collateralCoinNames ?? []);
2627
+ const coinPrices = await query.utils.getCoinPrices(collateralCoinNames) ?? {};
2624
2628
  const marketCollaterals = {};
2625
2629
  if (indexer) {
2626
2630
  const marketCollateralsIndexer = await query.indexer.getMarketCollaterals();
@@ -2929,9 +2933,9 @@ var getSpools = async (query, stakeMarketCoinNames = [...SUPPORT_SPOOLS], indexe
2929
2933
  const rewardCoinName = query.utils.getSpoolRewardCoinName(stakeMarketCoinName);
2930
2934
  return rewardCoinName;
2931
2935
  });
2932
- const coinPrices = await query.utils.getCoinPrices(
2933
- [.../* @__PURE__ */ new Set([...stakeCoinNames, ...rewardCoinNames])]
2934
- );
2936
+ const coinPrices = await query.utils.getCoinPrices([
2937
+ .../* @__PURE__ */ new Set([...stakeCoinNames, ...rewardCoinNames])
2938
+ ]) ?? {};
2935
2939
  const marketPools = await query.getMarketPools(stakeCoinNames, indexer);
2936
2940
  const spools = {};
2937
2941
  if (indexer) {
@@ -3310,14 +3314,12 @@ var queryBorrowIncentivePools = async (query, borrowIncentiveCoinNames = [
3310
3314
  ...SUPPORT_BORROW_INCENTIVE_POOLS
3311
3315
  ], indexer = false) => {
3312
3316
  const borrowIncentivePools = {};
3313
- const coinPrices = await query.utils.getCoinPrices(
3314
- [
3315
- .../* @__PURE__ */ new Set([
3316
- ...borrowIncentiveCoinNames,
3317
- ...SUPPORT_BORROW_INCENTIVE_REWARDS
3318
- ])
3319
- ]
3320
- );
3317
+ const coinPrices = await query.utils.getCoinPrices([
3318
+ .../* @__PURE__ */ new Set([
3319
+ ...borrowIncentiveCoinNames,
3320
+ ...SUPPORT_BORROW_INCENTIVE_REWARDS
3321
+ ])
3322
+ ]) ?? {};
3321
3323
  if (indexer) {
3322
3324
  const borrowIncentivePoolsIndexer = await query.indexer.getBorrowIncentivePools();
3323
3325
  const updateBorrowIncentivePool = (pool) => {
@@ -5208,7 +5210,7 @@ var generateCoreQuickMethod = ({
5208
5210
  const obligationCoinNames = await builder.utils.getObligationCoinNames(
5209
5211
  obligationInfo.obligationId
5210
5212
  ) ?? [];
5211
- const updateCoinNames = [...obligationCoinNames ?? [], poolCoinName];
5213
+ const updateCoinNames = [...obligationCoinNames, poolCoinName];
5212
5214
  await updateOracles(builder, txBlock, updateCoinNames);
5213
5215
  return txBlock.borrow(
5214
5216
  obligationInfo.obligationId,
@@ -8037,6 +8039,7 @@ var Scallop = class {
8037
8039
  MAX_LOCK_ROUNDS,
8038
8040
  MIN_INITIAL_LOCK_AMOUNT,
8039
8041
  MIN_TOP_UP_AMOUNT,
8042
+ NATIVE_USDC,
8040
8043
  OLD_BORROW_INCENTIVE_PROTOCOL_ID,
8041
8044
  PROTOCOL_OBJECT_ID,
8042
8045
  SCA_COIN_TYPE,