@scallop-io/sui-scallop-sdk 1.4.18 → 1.4.20

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
@@ -382,7 +382,8 @@ var POOL_ADDRESSES = {
382
382
  coinMetadataId: "0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",
383
383
  coinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
384
384
  sCoinMetadataId: "0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2",
385
- spoolName: "susdc"
385
+ spoolName: "susdc",
386
+ decimals: 6
386
387
  },
387
388
  sbeth: {
388
389
  coinName: "sbeth",
@@ -401,7 +402,8 @@ var POOL_ADDRESSES = {
401
402
  sCoinSymbol: "ssbETH",
402
403
  coinMetadataId: "0x89b04ba87f8832d4d76e17a1c9dce72eb3e64d372cf02012b8d2de5384faeef0",
403
404
  coinType: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH",
404
- sCoinMetadataId: "0xdfdd14d53ed8c7ace7cac8a0eecdfa4c2345e15d9efcbd4e1828f81a107cbe2d"
405
+ sCoinMetadataId: "0xdfdd14d53ed8c7ace7cac8a0eecdfa4c2345e15d9efcbd4e1828f81a107cbe2d",
406
+ decimals: 8
405
407
  },
406
408
  sbusdt: {
407
409
  coinName: "sbusdt",
@@ -420,7 +422,8 @@ var POOL_ADDRESSES = {
420
422
  sCoinSymbol: "ssbUSDT",
421
423
  coinMetadataId: "0xda61b33ac61ed4c084bbda65a2229459ed4eb2185729e70498538f0688bec3cc",
422
424
  coinType: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",
423
- sCoinMetadataId: "0x1ce77b036043c8fdcc5cd050ed06433ae60296b194c2abf7ade8b7b7c8386d36"
425
+ sCoinMetadataId: "0x1ce77b036043c8fdcc5cd050ed06433ae60296b194c2abf7ade8b7b7c8386d36",
426
+ decimals: 6
424
427
  },
425
428
  weth: {
426
429
  coinName: "weth",
@@ -442,7 +445,8 @@ var POOL_ADDRESSES = {
442
445
  coinMetadataId: "0x8900e4ceede3363bef086d6b50ca89d816d0e90bf6bc46efefe1f8455e08f50f",
443
446
  coinType: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
444
447
  sCoinMetadataId: "0x077d0fd835b559e5b4bb52641f7627ddbf8b200f9b2cf4e28b3514da2a32a4dd",
445
- spoolName: "sweth"
448
+ spoolName: "sweth",
449
+ decimals: 8
446
450
  },
447
451
  wbtc: {
448
452
  coinName: "wbtc",
@@ -461,7 +465,8 @@ var POOL_ADDRESSES = {
461
465
  sCoinSymbol: "swBTC",
462
466
  coinMetadataId: "0x5d3c6e60eeff8a05b693b481539e7847dfe33013e7070cdcb387f5c0cac05dfd",
463
467
  coinType: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",
464
- sCoinMetadataId: "0x1ba5904dae41699683da767c7a97785a55c51ec1253498c8fe1980169a96523d"
468
+ sCoinMetadataId: "0x1ba5904dae41699683da767c7a97785a55c51ec1253498c8fe1980169a96523d",
469
+ decimals: 8
465
470
  },
466
471
  wusdc: {
467
472
  coinName: "wusdc",
@@ -483,7 +488,8 @@ var POOL_ADDRESSES = {
483
488
  coinMetadataId: "0x4fbf84f3029bd0c0b77164b587963be957f853eccf834a67bb9ecba6ec80f189",
484
489
  coinType: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
485
490
  sCoinMetadataId: "0xdc0595d068621d630f3c7c364dd257f7e3f8079e00c31c8d18755a033c15ae93",
486
- spoolName: "swusdc"
491
+ spoolName: "swusdc",
492
+ decimals: 6
487
493
  },
488
494
  wusdt: {
489
495
  coinName: "wusdt",
@@ -505,7 +511,8 @@ var POOL_ADDRESSES = {
505
511
  coinMetadataId: "0xfb0e3eb97dd158a5ae979dddfa24348063843c5b20eb8381dd5fa7c93699e45c",
506
512
  coinType: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",
507
513
  sCoinMetadataId: "0x171d0f1ca99d5fefb8b2e40b89899bacdc5417a783906ae119b9cb1c113d59ae",
508
- spoolName: "swusdt"
514
+ spoolName: "swusdt",
515
+ decimals: 6
509
516
  },
510
517
  sui: {
511
518
  coinName: "sui",
@@ -527,7 +534,8 @@ var POOL_ADDRESSES = {
527
534
  coinMetadataId: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
528
535
  coinType: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
529
536
  sCoinMetadataId: "0xac724644f481f4870ecdc29b9549aa8ea5180f10827c0d97b493f9f65a91455d",
530
- spoolName: "ssui"
537
+ spoolName: "ssui",
538
+ decimals: 9
531
539
  },
532
540
  wapt: {
533
541
  coinName: "wapt",
@@ -539,7 +547,8 @@ var POOL_ADDRESSES = {
539
547
  riskModel: "0x7ada83b473af30aed50d187de82a0912878b53ade7ac30e11ce23953cf739d84",
540
548
  borrowFeeKey: "0x768735df587c7e0f141dcd035fbbcbf9d2149a7b23888baed4e2baa160fa2eeb",
541
549
  coinMetadataId: "0xc969c5251f372c0f34c32759f1d315cf1ea0ee5e4454b52aea08778eacfdd0a8",
542
- coinType: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN"
550
+ coinType: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",
551
+ decimals: 8
543
552
  },
544
553
  wsol: {
545
554
  coinName: "wsol",
@@ -558,7 +567,8 @@ var POOL_ADDRESSES = {
558
567
  sCoinSymbol: "swSOL",
559
568
  coinMetadataId: "0x4d2c39082b4477e3e79dc4562d939147ab90c42fc5f3e4acf03b94383cd69b6e",
560
569
  coinType: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",
561
- sCoinMetadataId: "0xee202d2013fc09453d695c640088ee08f14afc8f1ae26284b4ebbc4712ff1ba5"
570
+ sCoinMetadataId: "0xee202d2013fc09453d695c640088ee08f14afc8f1ae26284b4ebbc4712ff1ba5",
571
+ decimals: 8
562
572
  },
563
573
  cetus: {
564
574
  coinName: "cetus",
@@ -580,7 +590,8 @@ var POOL_ADDRESSES = {
580
590
  coinMetadataId: "0x4c0dce55eff2db5419bbd2d239d1aa22b4a400c01bbb648b058a9883989025da",
581
591
  coinType: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",
582
592
  sCoinMetadataId: "0xf022d041455a038d762a091f7a9e9521211f20501bcf8b6913ef5493a023218f",
583
- spoolName: "scetus"
593
+ spoolName: "scetus",
594
+ decimals: 9
584
595
  },
585
596
  afsui: {
586
597
  coinName: "afsui",
@@ -602,7 +613,8 @@ var POOL_ADDRESSES = {
602
613
  coinMetadataId: "0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d",
603
614
  coinType: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI",
604
615
  sCoinMetadataId: "0xfd81c4d1b4d9d1b8c522e91121d22e94759386b29eafe1cc3888ca0ebe369b9e",
605
- spoolName: "safsui"
616
+ spoolName: "safsui",
617
+ decimals: 9
606
618
  },
607
619
  hasui: {
608
620
  coinName: "hasui",
@@ -624,7 +636,8 @@ var POOL_ADDRESSES = {
624
636
  coinMetadataId: "0x2c5f33af93f6511df699aaaa5822d823aac6ed99d4a0de2a4a50b3afa0172e24",
625
637
  coinType: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI",
626
638
  sCoinMetadataId: "0x0a2a4a25aac50ac79210d710f93cb22db58bc6ee22f213364dda9a709cab2189",
627
- spoolName: "shasui"
639
+ spoolName: "shasui",
640
+ decimals: 9
628
641
  },
629
642
  vsui: {
630
643
  coinName: "vsui",
@@ -646,7 +659,8 @@ var POOL_ADDRESSES = {
646
659
  coinMetadataId: "0xabd84a23467b33854ab25cf862006fd97479f8f6f53e50fe732c43a274d939bd",
647
660
  coinType: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",
648
661
  sCoinMetadataId: "0xa96cc21ddfb6486be4a96cda0c58734e4ddea2a8c04984f9e6121d8fae997ddf",
649
- spoolName: "svsui"
662
+ spoolName: "svsui",
663
+ decimals: 9
650
664
  },
651
665
  sca: {
652
666
  coinName: "sca",
@@ -665,7 +679,8 @@ var POOL_ADDRESSES = {
665
679
  sCoinSymbol: "sSCA",
666
680
  coinMetadataId: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
667
681
  coinType: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",
668
- sCoinMetadataId: "0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964"
682
+ sCoinMetadataId: "0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964",
683
+ decimals: 9
669
684
  },
670
685
  fud: {
671
686
  coinName: "fud",
@@ -683,25 +698,8 @@ var POOL_ADDRESSES = {
683
698
  sCoinSymbol: "sFUD",
684
699
  coinMetadataId: "0x01087411ef48aaac1eb6e24803213e3a60a03b147dac930e5e341f17a85e524e",
685
700
  coinType: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
686
- sCoinMetadataId: "0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c"
687
- },
688
- deep: {
689
- coinName: "deep",
690
- symbol: "DEEP",
691
- lendingPoolAddress: "0xf4a67ffb43da1e1c61c049f188f19463ea8dbbf2d5ef4722d6df854ff1b1cc03",
692
- borrowDynamic: "0x95e00d7466f97a100e70f08bd37788dc49335796f6f49fab996d40dd0681c6d3",
693
- interestModel: "0x4143c298506a332d92ea8a995e6f3991ee3215f58f6fc6441752835d275b9a69",
694
- borrowFeeKey: "0xb14ee43f4ad2a2c40bac8c4406a401690e93c982e289cf3802fedf74a159cab2",
695
- supplyLimitKey: "0x599528fdfdc253e90dfd0acf4f4a166b391e2aac1ca6528abbff63225b548fee",
696
- borrowLimitKey: "0xf4217e8ef9d9c32e8992092e910a77535a8124c19b8a762a673f227f5f765a4e",
697
- isolatedAssetKey: "0x208d3a24ba369dcfc8f0387333d1512b98199eb150d2f2a69359ff708cf761e3",
698
- sCoinTreasury: "0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88",
699
- sCoinType: "0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",
700
- sCoinName: "sdeep",
701
- sCoinSymbol: "sDEEP",
702
- coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
703
- coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
704
- sCoinMetadataId: "0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e"
701
+ sCoinMetadataId: "0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c",
702
+ decimals: 5
705
703
  },
706
704
  fdusd: {
707
705
  coinName: "fdusd",
@@ -719,7 +717,27 @@ var POOL_ADDRESSES = {
719
717
  sCoinSymbol: "sFDUSD",
720
718
  coinMetadataId: "0xdebee5265a67c186ed87fe93303d33dfe1de53e3b4fd7d9329c2852860acd3e7",
721
719
  coinType: "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD",
722
- sCoinMetadataId: "0xb1529a3b5e5831d19a722493eec19785f613945d3dc984602d44a418f990d73f"
720
+ sCoinMetadataId: "0xb1529a3b5e5831d19a722493eec19785f613945d3dc984602d44a418f990d73f",
721
+ decimals: 6
722
+ },
723
+ deep: {
724
+ coinName: "deep",
725
+ symbol: "DEEP",
726
+ lendingPoolAddress: "0xf4a67ffb43da1e1c61c049f188f19463ea8dbbf2d5ef4722d6df854ff1b1cc03",
727
+ borrowDynamic: "0x95e00d7466f97a100e70f08bd37788dc49335796f6f49fab996d40dd0681c6d3",
728
+ interestModel: "0x4143c298506a332d92ea8a995e6f3991ee3215f58f6fc6441752835d275b9a69",
729
+ borrowFeeKey: "0xb14ee43f4ad2a2c40bac8c4406a401690e93c982e289cf3802fedf74a159cab2",
730
+ supplyLimitKey: "0x599528fdfdc253e90dfd0acf4f4a166b391e2aac1ca6528abbff63225b548fee",
731
+ borrowLimitKey: "0xf4217e8ef9d9c32e8992092e910a77535a8124c19b8a762a673f227f5f765a4e",
732
+ isolatedAssetKey: "0x208d3a24ba369dcfc8f0387333d1512b98199eb150d2f2a69359ff708cf761e3",
733
+ sCoinTreasury: "0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88",
734
+ sCoinType: "0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",
735
+ sCoinName: "sdeep",
736
+ sCoinSymbol: "sDEEP",
737
+ coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
738
+ coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
739
+ sCoinMetadataId: "0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e",
740
+ decimals: 6
723
741
  }
724
742
  };
725
743
 
@@ -4628,7 +4646,8 @@ var getObligationAccount = async (query, obligation, ownerAddress, indexer = fal
4628
4646
  };
4629
4647
  var getTotalValueLocked = async (query, indexer = false) => {
4630
4648
  const market = await query.getMarketPools(void 0, { indexer });
4631
- let supplyValue = BigNumber5(0);
4649
+ let supplyLendingValue = BigNumber5(0);
4650
+ let supplyCollateralValue = BigNumber5(0);
4632
4651
  let borrowValue = BigNumber5(0);
4633
4652
  if (indexer) {
4634
4653
  const tvlIndexer = await query.indexer.getTotalValueLocked();
@@ -4638,12 +4657,16 @@ var getTotalValueLocked = async (query, indexer = false) => {
4638
4657
  borrowValue: tvlIndexer.borrowValue,
4639
4658
  borrowValueChangeRatio: tvlIndexer.borrowValueChangeRatio,
4640
4659
  totalValue: tvlIndexer.totalValue,
4641
- totalValueChangeRatio: tvlIndexer.totalValueChangeRatio
4660
+ totalValueChangeRatio: tvlIndexer.totalValueChangeRatio,
4661
+ supplyLendingValue: tvlIndexer.supplyLendingValue,
4662
+ supplyLendingValueChangeRatio: tvlIndexer.supplyLendingValueChangeRatio,
4663
+ supplyCollateralValue: tvlIndexer.supplyCollateralValue,
4664
+ supplyCollateralValueChangeRatio: tvlIndexer.supplyCollateralValueChangeRatio
4642
4665
  };
4643
4666
  return tvl2;
4644
4667
  }
4645
4668
  for (const pool of Object.values(market.pools)) {
4646
- supplyValue = supplyValue.plus(
4669
+ supplyLendingValue = supplyLendingValue.plus(
4647
4670
  BigNumber5(pool.supplyCoin).multipliedBy(pool.coinPrice)
4648
4671
  );
4649
4672
  borrowValue = borrowValue.plus(
@@ -4651,14 +4674,16 @@ var getTotalValueLocked = async (query, indexer = false) => {
4651
4674
  );
4652
4675
  }
4653
4676
  for (const collateral of Object.values(market.collaterals)) {
4654
- supplyValue = supplyValue.plus(
4677
+ supplyCollateralValue = supplyCollateralValue.plus(
4655
4678
  BigNumber5(collateral.depositCoin).multipliedBy(collateral.coinPrice)
4656
4679
  );
4657
4680
  }
4658
4681
  const tvl = {
4659
- supplyValue: supplyValue.toNumber(),
4682
+ supplyValue: supplyLendingValue.plus(supplyCollateralValue).toNumber(),
4683
+ supplyLendingValue: supplyLendingValue.toNumber(),
4684
+ supplyCollateralValue: supplyCollateralValue.toNumber(),
4660
4685
  borrowValue: borrowValue.toNumber(),
4661
- totalValue: supplyValue.minus(borrowValue).toNumber()
4686
+ totalValue: supplyLendingValue.plus(supplyCollateralValue).minus(borrowValue).toNumber()
4662
4687
  };
4663
4688
  return tvl;
4664
4689
  };
@@ -5490,10 +5515,26 @@ var getTotalVeScaTreasuryAmount = async (utils, veScaTreasury) => {
5490
5515
  const veScaPkgId = utils.address.get("vesca.id");
5491
5516
  const veScaConfig = utils.address.get("vesca.config");
5492
5517
  veScaTreasury = veScaTreasury ?? utils.address.get("vesca.treasury");
5518
+ const txb = new SuiTxBlock2();
5493
5519
  const refreshQueryTarget = `${veScaPkgId}::treasury::refresh`;
5494
- const refreshArgs = [veScaConfig, veScaTreasury, SUI_CLOCK_OBJECT_ID];
5520
+ const refreshArgs = [
5521
+ veScaConfig,
5522
+ veScaTreasury,
5523
+ txb.sharedObjectRef({
5524
+ objectId: SUI_CLOCK_OBJECT_ID,
5525
+ mutable: false,
5526
+ initialSharedVersion: "1"
5527
+ })
5528
+ ];
5495
5529
  const veScaAmountQueryTarget = `${veScaPkgId}::treasury::total_ve_sca_amount`;
5496
- const veScaAmountArgs = [veScaTreasury, SUI_CLOCK_OBJECT_ID];
5530
+ const veScaAmountArgs = [
5531
+ veScaTreasury,
5532
+ txb.sharedObjectRef({
5533
+ objectId: SUI_CLOCK_OBJECT_ID,
5534
+ mutable: false,
5535
+ initialSharedVersion: "1"
5536
+ })
5537
+ ];
5497
5538
  const resolvedRefreshArgs = await Promise.all(
5498
5539
  refreshArgs.map(async (arg) => {
5499
5540
  if (typeof arg === "string") {
@@ -5510,7 +5551,6 @@ var getTotalVeScaTreasuryAmount = async (utils, veScaTreasury) => {
5510
5551
  return arg;
5511
5552
  })
5512
5553
  );
5513
- const txb = new SuiTxBlock2();
5514
5554
  txb.moveCall(refreshQueryTarget, resolvedRefreshArgs);
5515
5555
  txb.moveCall(veScaAmountQueryTarget, resolvedVeScaAmountArgs);
5516
5556
  const txBytes = await txb.txBlock.build({
@@ -5641,6 +5681,7 @@ var getAllAddresses = async (query) => {
5641
5681
  // @ts-ignore
5642
5682
  `scoin.coins.s${coinName}.metaData`
5643
5683
  );
5684
+ const decimals = query.utils.getCoinDecimal(coinName);
5644
5685
  const spoolName = spool ? `s${coinName}` : void 0;
5645
5686
  results[coinName] = {
5646
5687
  coinName,
@@ -5663,7 +5704,8 @@ var getAllAddresses = async (query) => {
5663
5704
  coinMetadataId,
5664
5705
  coinType: `0x${coinType}`,
5665
5706
  sCoinMetadataId,
5666
- spoolName
5707
+ spoolName,
5708
+ decimals
5667
5709
  };
5668
5710
  await new Promise((resolve) => setTimeout(resolve, 500));
5669
5711
  })
@@ -6272,27 +6314,67 @@ var priceUpdateRequest = (txBlock, packageId, xOracleId, coinType) => {
6272
6314
  var confirmPriceUpdateRequest = (txBlock, packageId, xOracleId, request, coinType) => {
6273
6315
  const target = `${packageId}::x_oracle::confirm_price_update_request`;
6274
6316
  const typeArgs = [coinType];
6275
- txBlock.moveCall(target, [xOracleId, request, SUI_CLOCK_OBJECT_ID2], typeArgs);
6317
+ txBlock.moveCall(
6318
+ target,
6319
+ [
6320
+ xOracleId,
6321
+ request,
6322
+ txBlock.sharedObjectRef({
6323
+ objectId: SUI_CLOCK_OBJECT_ID2,
6324
+ mutable: false,
6325
+ initialSharedVersion: "1"
6326
+ })
6327
+ ],
6328
+ typeArgs
6329
+ );
6276
6330
  return txBlock;
6277
6331
  };
6278
6332
  var updateSupraPrice = (txBlock, packageId, request, holderId, registryId, coinType) => {
6279
6333
  txBlock.moveCall(
6280
6334
  `${packageId}::rule::set_price`,
6281
- [request, holderId, registryId, SUI_CLOCK_OBJECT_ID2],
6335
+ [
6336
+ request,
6337
+ holderId,
6338
+ registryId,
6339
+ txBlock.sharedObjectRef({
6340
+ objectId: SUI_CLOCK_OBJECT_ID2,
6341
+ mutable: false,
6342
+ initialSharedVersion: "1"
6343
+ })
6344
+ ],
6282
6345
  [coinType]
6283
6346
  );
6284
6347
  };
6285
6348
  var updateSwitchboardPrice = (txBlock, packageId, request, aggregatorId, registryId, coinType) => {
6286
6349
  txBlock.moveCall(
6287
6350
  `${packageId}::rule::set_price`,
6288
- [request, aggregatorId, registryId, SUI_CLOCK_OBJECT_ID2],
6351
+ [
6352
+ request,
6353
+ aggregatorId,
6354
+ registryId,
6355
+ txBlock.sharedObjectRef({
6356
+ objectId: SUI_CLOCK_OBJECT_ID2,
6357
+ mutable: false,
6358
+ initialSharedVersion: "1"
6359
+ })
6360
+ ],
6289
6361
  [coinType]
6290
6362
  );
6291
6363
  };
6292
6364
  var updatePythPrice = (txBlock, packageId, request, stateId, feedObjectId, registryId, coinType) => {
6293
6365
  txBlock.moveCall(
6294
6366
  `${packageId}::rule::set_price`,
6295
- [request, stateId, feedObjectId, registryId, SUI_CLOCK_OBJECT_ID2],
6367
+ [
6368
+ request,
6369
+ stateId,
6370
+ feedObjectId,
6371
+ registryId,
6372
+ txBlock.sharedObjectRef({
6373
+ objectId: SUI_CLOCK_OBJECT_ID2,
6374
+ mutable: false,
6375
+ initialSharedVersion: "1"
6376
+ })
6377
+ ],
6296
6378
  [coinType]
6297
6379
  );
6298
6380
  };
@@ -6372,7 +6454,11 @@ var generateCoreNormalMethod = ({
6372
6454
  coreIds.coinDecimalsRegistry,
6373
6455
  txBlock.pure.u64(amount),
6374
6456
  coreIds.xOracle,
6375
- SUI_CLOCK_OBJECT_ID3
6457
+ txBlock.sharedObjectRef({
6458
+ objectId: SUI_CLOCK_OBJECT_ID3,
6459
+ mutable: false,
6460
+ initialSharedVersion: "1"
6461
+ })
6376
6462
  ],
6377
6463
  [coinType]
6378
6464
  );
@@ -6382,7 +6468,16 @@ var generateCoreNormalMethod = ({
6382
6468
  return builder.moveCall(
6383
6469
  txBlock,
6384
6470
  `${coreIds.protocolPkg}::mint::mint`,
6385
- [coreIds.version, coreIds.market, coin, SUI_CLOCK_OBJECT_ID3],
6471
+ [
6472
+ coreIds.version,
6473
+ coreIds.market,
6474
+ coin,
6475
+ txBlock.sharedObjectRef({
6476
+ objectId: SUI_CLOCK_OBJECT_ID3,
6477
+ mutable: false,
6478
+ initialSharedVersion: "1"
6479
+ })
6480
+ ],
6386
6481
  [coinType]
6387
6482
  );
6388
6483
  },
@@ -6391,7 +6486,16 @@ var generateCoreNormalMethod = ({
6391
6486
  return builder.moveCall(
6392
6487
  txBlock,
6393
6488
  `${coreIds.protocolPkg}::mint::mint_entry`,
6394
- [coreIds.version, coreIds.market, coin, SUI_CLOCK_OBJECT_ID3],
6489
+ [
6490
+ coreIds.version,
6491
+ coreIds.market,
6492
+ coin,
6493
+ txBlock.sharedObjectRef({
6494
+ objectId: SUI_CLOCK_OBJECT_ID3,
6495
+ mutable: false,
6496
+ initialSharedVersion: "1"
6497
+ })
6498
+ ],
6395
6499
  [coinType]
6396
6500
  );
6397
6501
  },
@@ -6400,7 +6504,16 @@ var generateCoreNormalMethod = ({
6400
6504
  return builder.moveCall(
6401
6505
  txBlock,
6402
6506
  `${coreIds.protocolPkg}::redeem::redeem`,
6403
- [coreIds.version, coreIds.market, marketCoin, SUI_CLOCK_OBJECT_ID3],
6507
+ [
6508
+ coreIds.version,
6509
+ coreIds.market,
6510
+ marketCoin,
6511
+ txBlock.sharedObjectRef({
6512
+ objectId: SUI_CLOCK_OBJECT_ID3,
6513
+ mutable: false,
6514
+ initialSharedVersion: "1"
6515
+ })
6516
+ ],
6404
6517
  [coinType]
6405
6518
  );
6406
6519
  },
@@ -6409,7 +6522,16 @@ var generateCoreNormalMethod = ({
6409
6522
  return builder.moveCall(
6410
6523
  txBlock,
6411
6524
  `${coreIds.protocolPkg}::redeem::redeem_entry`,
6412
- [coreIds.version, coreIds.market, marketCoin, SUI_CLOCK_OBJECT_ID3],
6525
+ [
6526
+ coreIds.version,
6527
+ coreIds.market,
6528
+ marketCoin,
6529
+ txBlock.sharedObjectRef({
6530
+ objectId: SUI_CLOCK_OBJECT_ID3,
6531
+ mutable: false,
6532
+ initialSharedVersion: "1"
6533
+ })
6534
+ ],
6413
6535
  [coinType]
6414
6536
  );
6415
6537
  },
@@ -6426,7 +6548,11 @@ var generateCoreNormalMethod = ({
6426
6548
  coreIds.coinDecimalsRegistry,
6427
6549
  amount,
6428
6550
  coreIds.xOracle,
6429
- SUI_CLOCK_OBJECT_ID3
6551
+ txBlock.sharedObjectRef({
6552
+ objectId: SUI_CLOCK_OBJECT_ID3,
6553
+ mutable: false,
6554
+ initialSharedVersion: "1"
6555
+ })
6430
6556
  ],
6431
6557
  [coinType]
6432
6558
  );
@@ -6445,7 +6571,11 @@ var generateCoreNormalMethod = ({
6445
6571
  borrowReferral,
6446
6572
  typeof amount === "number" ? txBlock.pure.u64(amount) : amount,
6447
6573
  coreIds.xOracle,
6448
- SUI_CLOCK_OBJECT_ID3
6574
+ txBlock.sharedObjectRef({
6575
+ objectId: SUI_CLOCK_OBJECT_ID3,
6576
+ mutable: false,
6577
+ initialSharedVersion: "1"
6578
+ })
6449
6579
  ],
6450
6580
  [coinType, referralWitnessType]
6451
6581
  );
@@ -6463,7 +6593,11 @@ var generateCoreNormalMethod = ({
6463
6593
  coreIds.coinDecimalsRegistry,
6464
6594
  txBlock.pure.u64(amount),
6465
6595
  coreIds.xOracle,
6466
- SUI_CLOCK_OBJECT_ID3
6596
+ txBlock.sharedObjectRef({
6597
+ objectId: SUI_CLOCK_OBJECT_ID3,
6598
+ mutable: false,
6599
+ initialSharedVersion: "1"
6600
+ })
6467
6601
  ],
6468
6602
  [coinType]
6469
6603
  );
@@ -6478,7 +6612,11 @@ var generateCoreNormalMethod = ({
6478
6612
  obligation,
6479
6613
  coreIds.market,
6480
6614
  coin,
6481
- SUI_CLOCK_OBJECT_ID3
6615
+ txBlock.sharedObjectRef({
6616
+ objectId: SUI_CLOCK_OBJECT_ID3,
6617
+ mutable: false,
6618
+ initialSharedVersion: "1"
6619
+ })
6482
6620
  ],
6483
6621
  [coinType]
6484
6622
  );
@@ -6643,7 +6781,7 @@ var generateCoreQuickMethod = ({
6643
6781
  ) ?? [];
6644
6782
  const updateCoinNames = [...obligationCoinNames, poolCoinName];
6645
6783
  await updateOracles(builder, txBlock, updateCoinNames);
6646
- return await txBlock.borrowWithReferral(
6784
+ return txBlock.borrowWithReferral(
6647
6785
  obligationInfo.obligationId,
6648
6786
  obligationInfo.obligationKey,
6649
6787
  borrowReferral,
@@ -6771,7 +6909,14 @@ var generateSpoolNormalMethod = ({
6771
6909
  return builder.moveCall(
6772
6910
  txBlock,
6773
6911
  `${spoolIds.spoolPkg}::user::new_spool_account`,
6774
- [stakePoolId, SUI_CLOCK_OBJECT_ID4],
6912
+ [
6913
+ stakePoolId,
6914
+ txBlock.sharedObjectRef({
6915
+ objectId: SUI_CLOCK_OBJECT_ID4,
6916
+ mutable: false,
6917
+ initialSharedVersion: "1"
6918
+ })
6919
+ ],
6775
6920
  [marketCoinType]
6776
6921
  );
6777
6922
  },
@@ -6783,7 +6928,16 @@ var generateSpoolNormalMethod = ({
6783
6928
  builder.moveCall(
6784
6929
  txBlock,
6785
6930
  `${spoolIds.spoolPkg}::user::stake`,
6786
- [stakePoolId, stakeAccount, coin, SUI_CLOCK_OBJECT_ID4],
6931
+ [
6932
+ stakePoolId,
6933
+ stakeAccount,
6934
+ coin,
6935
+ txBlock.sharedObjectRef({
6936
+ objectId: SUI_CLOCK_OBJECT_ID4,
6937
+ mutable: false,
6938
+ initialSharedVersion: "1"
6939
+ })
6940
+ ],
6787
6941
  [marketCoinType]
6788
6942
  );
6789
6943
  },
@@ -6795,7 +6949,16 @@ var generateSpoolNormalMethod = ({
6795
6949
  return builder.moveCall(
6796
6950
  txBlock,
6797
6951
  `${spoolIds.spoolPkg}::user::unstake`,
6798
- [stakePoolId, stakeAccount, amount, SUI_CLOCK_OBJECT_ID4],
6952
+ [
6953
+ stakePoolId,
6954
+ stakeAccount,
6955
+ amount,
6956
+ txBlock.sharedObjectRef({
6957
+ objectId: SUI_CLOCK_OBJECT_ID4,
6958
+ mutable: false,
6959
+ initialSharedVersion: "1"
6960
+ })
6961
+ ],
6799
6962
  [marketCoinType]
6800
6963
  );
6801
6964
  },
@@ -6812,7 +6975,16 @@ var generateSpoolNormalMethod = ({
6812
6975
  return builder.moveCall(
6813
6976
  txBlock,
6814
6977
  `${spoolIds.spoolPkg}::user::redeem_rewards`,
6815
- [stakePoolId, rewardPoolId, stakeAccount, SUI_CLOCK_OBJECT_ID4],
6978
+ [
6979
+ stakePoolId,
6980
+ rewardPoolId,
6981
+ stakeAccount,
6982
+ txBlock.sharedObjectRef({
6983
+ objectId: SUI_CLOCK_OBJECT_ID4,
6984
+ mutable: false,
6985
+ initialSharedVersion: "1"
6986
+ })
6987
+ ],
6816
6988
  [marketCoinType, rewardCoinType]
6817
6989
  );
6818
6990
  }
@@ -6947,8 +7119,10 @@ var newSpoolTxBlock = (builder, initTxBlock) => {
6947
7119
 
6948
7120
  // src/builders/borrowIncentiveBuilder.ts
6949
7121
  import { Transaction as Transaction3 } from "@mysten/sui/transactions";
6950
- import { SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID5 } from "@mysten/sui/utils";
6951
- import { SuiTxBlock as SuiKitTxBlock3 } from "@scallop-io/sui-kit";
7122
+ import {
7123
+ SuiTxBlock as SuiKitTxBlock3,
7124
+ SUI_CLOCK_OBJECT_ID as SUI_CLOCK_OBJECT_ID5
7125
+ } from "@scallop-io/sui-kit";
6952
7126
  var requireObligationInfo2 = async (...params) => {
6953
7127
  const [builder, txBlock, obligationId, obligationKey] = params;
6954
7128
  if (params.length === 4 && obligationId && obligationKey && typeof obligationId === "string") {
@@ -7000,7 +7174,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7000
7174
  obligationKey,
7001
7175
  obligationId,
7002
7176
  borrowIncentiveIds.obligationAccessStore,
7003
- SUI_CLOCK_OBJECT_ID5
7177
+ txBlock.sharedObjectRef({
7178
+ objectId: SUI_CLOCK_OBJECT_ID5,
7179
+ mutable: false,
7180
+ initialSharedVersion: "1"
7181
+ })
7004
7182
  ]
7005
7183
  );
7006
7184
  },
@@ -7019,7 +7197,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7019
7197
  veScaIds.treasury,
7020
7198
  veScaIds.table,
7021
7199
  veScaKey,
7022
- SUI_CLOCK_OBJECT_ID5
7200
+ txBlock.sharedObjectRef({
7201
+ objectId: SUI_CLOCK_OBJECT_ID5,
7202
+ mutable: false,
7203
+ initialSharedVersion: "1"
7204
+ })
7023
7205
  ],
7024
7206
  []
7025
7207
  );
@@ -7034,7 +7216,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7034
7216
  borrowIncentiveIds.incentiveAccounts,
7035
7217
  obligationKey,
7036
7218
  obligationId,
7037
- SUI_CLOCK_OBJECT_ID5
7219
+ txBlock.sharedObjectRef({
7220
+ objectId: SUI_CLOCK_OBJECT_ID5,
7221
+ mutable: false,
7222
+ initialSharedVersion: "1"
7223
+ })
7038
7224
  ]
7039
7225
  );
7040
7226
  },
@@ -7049,7 +7235,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7049
7235
  borrowIncentiveIds.incentiveAccounts,
7050
7236
  obligationKey,
7051
7237
  obligationId,
7052
- SUI_CLOCK_OBJECT_ID5
7238
+ txBlock.sharedObjectRef({
7239
+ objectId: SUI_CLOCK_OBJECT_ID5,
7240
+ mutable: false,
7241
+ initialSharedVersion: "1"
7242
+ })
7053
7243
  ],
7054
7244
  [rewardType]
7055
7245
  );
@@ -7064,7 +7254,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7064
7254
  borrowIncentiveIds.incentiveAccounts,
7065
7255
  obligation,
7066
7256
  veScaKey,
7067
- SUI_CLOCK_OBJECT_ID5
7257
+ txBlock.sharedObjectRef({
7258
+ objectId: SUI_CLOCK_OBJECT_ID5,
7259
+ mutable: false,
7260
+ initialSharedVersion: "1"
7261
+ })
7068
7262
  ]
7069
7263
  );
7070
7264
  }
@@ -7219,7 +7413,11 @@ var generateNormalVeScaMethod = ({
7219
7413
  veScaIds.treasury,
7220
7414
  scaCoin,
7221
7415
  unlockAtInSecondTimestamp,
7222
- SUI_CLOCK_OBJECT_ID6
7416
+ txBlock.sharedObjectRef({
7417
+ objectId: SUI_CLOCK_OBJECT_ID6,
7418
+ mutable: false,
7419
+ initialSharedVersion: "1"
7420
+ })
7223
7421
  ],
7224
7422
  []
7225
7423
  );
@@ -7234,7 +7432,11 @@ var generateNormalVeScaMethod = ({
7234
7432
  veScaIds.table,
7235
7433
  veScaIds.treasury,
7236
7434
  newUnlockAtInSecondTimestamp,
7237
- SUI_CLOCK_OBJECT_ID6
7435
+ txBlock.sharedObjectRef({
7436
+ objectId: SUI_CLOCK_OBJECT_ID6,
7437
+ mutable: false,
7438
+ initialSharedVersion: "1"
7439
+ })
7238
7440
  ],
7239
7441
  []
7240
7442
  );
@@ -7249,7 +7451,11 @@ var generateNormalVeScaMethod = ({
7249
7451
  veScaIds.table,
7250
7452
  veScaIds.treasury,
7251
7453
  scaCoin,
7252
- SUI_CLOCK_OBJECT_ID6
7454
+ txBlock.sharedObjectRef({
7455
+ objectId: SUI_CLOCK_OBJECT_ID6,
7456
+ mutable: false,
7457
+ initialSharedVersion: "1"
7458
+ })
7253
7459
  ],
7254
7460
  []
7255
7461
  );
@@ -7265,7 +7471,11 @@ var generateNormalVeScaMethod = ({
7265
7471
  veScaIds.treasury,
7266
7472
  scaCoin,
7267
7473
  newUnlockAtInSecondTimestamp,
7268
- SUI_CLOCK_OBJECT_ID6
7474
+ txBlock.sharedObjectRef({
7475
+ objectId: SUI_CLOCK_OBJECT_ID6,
7476
+ mutable: false,
7477
+ initialSharedVersion: "1"
7478
+ })
7269
7479
  ],
7270
7480
  []
7271
7481
  );
@@ -7279,7 +7489,11 @@ var generateNormalVeScaMethod = ({
7279
7489
  veScaKey,
7280
7490
  veScaIds.table,
7281
7491
  veScaIds.treasury,
7282
- SUI_CLOCK_OBJECT_ID6
7492
+ txBlock.sharedObjectRef({
7493
+ objectId: SUI_CLOCK_OBJECT_ID6,
7494
+ mutable: false,
7495
+ initialSharedVersion: "1"
7496
+ })
7283
7497
  ],
7284
7498
  []
7285
7499
  );
@@ -7492,7 +7706,11 @@ var generateReferralNormalMethod = ({
7492
7706
  referralIds.referralBindings,
7493
7707
  txBlock.pure.id(veScaKeyId),
7494
7708
  veScaTable,
7495
- SUI_CLOCK_OBJECT_ID7
7709
+ txBlock.sharedObjectRef({
7710
+ objectId: SUI_CLOCK_OBJECT_ID7,
7711
+ mutable: false,
7712
+ initialSharedVersion: "1"
7713
+ })
7496
7714
  ],
7497
7715
  []
7498
7716
  );
@@ -7508,7 +7726,11 @@ var generateReferralNormalMethod = ({
7508
7726
  referralIds.referralBindings,
7509
7727
  referralIds.authorizedWitnessList,
7510
7728
  referralIds.referralTiers,
7511
- SUI_CLOCK_OBJECT_ID7
7729
+ txBlock.sharedObjectRef({
7730
+ objectId: SUI_CLOCK_OBJECT_ID7,
7731
+ mutable: false,
7732
+ initialSharedVersion: "1"
7733
+ })
7512
7734
  ],
7513
7735
  [coinType]
7514
7736
  );
@@ -7522,7 +7744,11 @@ var generateReferralNormalMethod = ({
7522
7744
  referralIds.version,
7523
7745
  ticket,
7524
7746
  referralIds.referralRevenuePool,
7525
- SUI_CLOCK_OBJECT_ID7
7747
+ txBlock.sharedObjectRef({
7748
+ objectId: SUI_CLOCK_OBJECT_ID7,
7749
+ mutable: false,
7750
+ initialSharedVersion: "1"
7751
+ })
7526
7752
  ],
7527
7753
  [coinType]
7528
7754
  );
@@ -7536,7 +7762,11 @@ var generateReferralNormalMethod = ({
7536
7762
  referralIds.version,
7537
7763
  referralIds.referralRevenuePool,
7538
7764
  veScaKey,
7539
- SUI_CLOCK_OBJECT_ID7
7765
+ txBlock.sharedObjectRef({
7766
+ objectId: SUI_CLOCK_OBJECT_ID7,
7767
+ mutable: false,
7768
+ initialSharedVersion: "1"
7769
+ })
7540
7770
  ],
7541
7771
  [coinType]
7542
7772
  );