@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.js CHANGED
@@ -472,7 +472,8 @@ var POOL_ADDRESSES = {
472
472
  coinMetadataId: "0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",
473
473
  coinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
474
474
  sCoinMetadataId: "0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2",
475
- spoolName: "susdc"
475
+ spoolName: "susdc",
476
+ decimals: 6
476
477
  },
477
478
  sbeth: {
478
479
  coinName: "sbeth",
@@ -491,7 +492,8 @@ var POOL_ADDRESSES = {
491
492
  sCoinSymbol: "ssbETH",
492
493
  coinMetadataId: "0x89b04ba87f8832d4d76e17a1c9dce72eb3e64d372cf02012b8d2de5384faeef0",
493
494
  coinType: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH",
494
- sCoinMetadataId: "0xdfdd14d53ed8c7ace7cac8a0eecdfa4c2345e15d9efcbd4e1828f81a107cbe2d"
495
+ sCoinMetadataId: "0xdfdd14d53ed8c7ace7cac8a0eecdfa4c2345e15d9efcbd4e1828f81a107cbe2d",
496
+ decimals: 8
495
497
  },
496
498
  sbusdt: {
497
499
  coinName: "sbusdt",
@@ -510,7 +512,8 @@ var POOL_ADDRESSES = {
510
512
  sCoinSymbol: "ssbUSDT",
511
513
  coinMetadataId: "0xda61b33ac61ed4c084bbda65a2229459ed4eb2185729e70498538f0688bec3cc",
512
514
  coinType: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",
513
- sCoinMetadataId: "0x1ce77b036043c8fdcc5cd050ed06433ae60296b194c2abf7ade8b7b7c8386d36"
515
+ sCoinMetadataId: "0x1ce77b036043c8fdcc5cd050ed06433ae60296b194c2abf7ade8b7b7c8386d36",
516
+ decimals: 6
514
517
  },
515
518
  weth: {
516
519
  coinName: "weth",
@@ -532,7 +535,8 @@ var POOL_ADDRESSES = {
532
535
  coinMetadataId: "0x8900e4ceede3363bef086d6b50ca89d816d0e90bf6bc46efefe1f8455e08f50f",
533
536
  coinType: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",
534
537
  sCoinMetadataId: "0x077d0fd835b559e5b4bb52641f7627ddbf8b200f9b2cf4e28b3514da2a32a4dd",
535
- spoolName: "sweth"
538
+ spoolName: "sweth",
539
+ decimals: 8
536
540
  },
537
541
  wbtc: {
538
542
  coinName: "wbtc",
@@ -551,7 +555,8 @@ var POOL_ADDRESSES = {
551
555
  sCoinSymbol: "swBTC",
552
556
  coinMetadataId: "0x5d3c6e60eeff8a05b693b481539e7847dfe33013e7070cdcb387f5c0cac05dfd",
553
557
  coinType: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",
554
- sCoinMetadataId: "0x1ba5904dae41699683da767c7a97785a55c51ec1253498c8fe1980169a96523d"
558
+ sCoinMetadataId: "0x1ba5904dae41699683da767c7a97785a55c51ec1253498c8fe1980169a96523d",
559
+ decimals: 8
555
560
  },
556
561
  wusdc: {
557
562
  coinName: "wusdc",
@@ -573,7 +578,8 @@ var POOL_ADDRESSES = {
573
578
  coinMetadataId: "0x4fbf84f3029bd0c0b77164b587963be957f853eccf834a67bb9ecba6ec80f189",
574
579
  coinType: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",
575
580
  sCoinMetadataId: "0xdc0595d068621d630f3c7c364dd257f7e3f8079e00c31c8d18755a033c15ae93",
576
- spoolName: "swusdc"
581
+ spoolName: "swusdc",
582
+ decimals: 6
577
583
  },
578
584
  wusdt: {
579
585
  coinName: "wusdt",
@@ -595,7 +601,8 @@ var POOL_ADDRESSES = {
595
601
  coinMetadataId: "0xfb0e3eb97dd158a5ae979dddfa24348063843c5b20eb8381dd5fa7c93699e45c",
596
602
  coinType: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",
597
603
  sCoinMetadataId: "0x171d0f1ca99d5fefb8b2e40b89899bacdc5417a783906ae119b9cb1c113d59ae",
598
- spoolName: "swusdt"
604
+ spoolName: "swusdt",
605
+ decimals: 6
599
606
  },
600
607
  sui: {
601
608
  coinName: "sui",
@@ -617,7 +624,8 @@ var POOL_ADDRESSES = {
617
624
  coinMetadataId: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
618
625
  coinType: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
619
626
  sCoinMetadataId: "0xac724644f481f4870ecdc29b9549aa8ea5180f10827c0d97b493f9f65a91455d",
620
- spoolName: "ssui"
627
+ spoolName: "ssui",
628
+ decimals: 9
621
629
  },
622
630
  wapt: {
623
631
  coinName: "wapt",
@@ -629,7 +637,8 @@ var POOL_ADDRESSES = {
629
637
  riskModel: "0x7ada83b473af30aed50d187de82a0912878b53ade7ac30e11ce23953cf739d84",
630
638
  borrowFeeKey: "0x768735df587c7e0f141dcd035fbbcbf9d2149a7b23888baed4e2baa160fa2eeb",
631
639
  coinMetadataId: "0xc969c5251f372c0f34c32759f1d315cf1ea0ee5e4454b52aea08778eacfdd0a8",
632
- coinType: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN"
640
+ coinType: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",
641
+ decimals: 8
633
642
  },
634
643
  wsol: {
635
644
  coinName: "wsol",
@@ -648,7 +657,8 @@ var POOL_ADDRESSES = {
648
657
  sCoinSymbol: "swSOL",
649
658
  coinMetadataId: "0x4d2c39082b4477e3e79dc4562d939147ab90c42fc5f3e4acf03b94383cd69b6e",
650
659
  coinType: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",
651
- sCoinMetadataId: "0xee202d2013fc09453d695c640088ee08f14afc8f1ae26284b4ebbc4712ff1ba5"
660
+ sCoinMetadataId: "0xee202d2013fc09453d695c640088ee08f14afc8f1ae26284b4ebbc4712ff1ba5",
661
+ decimals: 8
652
662
  },
653
663
  cetus: {
654
664
  coinName: "cetus",
@@ -670,7 +680,8 @@ var POOL_ADDRESSES = {
670
680
  coinMetadataId: "0x4c0dce55eff2db5419bbd2d239d1aa22b4a400c01bbb648b058a9883989025da",
671
681
  coinType: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",
672
682
  sCoinMetadataId: "0xf022d041455a038d762a091f7a9e9521211f20501bcf8b6913ef5493a023218f",
673
- spoolName: "scetus"
683
+ spoolName: "scetus",
684
+ decimals: 9
674
685
  },
675
686
  afsui: {
676
687
  coinName: "afsui",
@@ -692,7 +703,8 @@ var POOL_ADDRESSES = {
692
703
  coinMetadataId: "0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d",
693
704
  coinType: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI",
694
705
  sCoinMetadataId: "0xfd81c4d1b4d9d1b8c522e91121d22e94759386b29eafe1cc3888ca0ebe369b9e",
695
- spoolName: "safsui"
706
+ spoolName: "safsui",
707
+ decimals: 9
696
708
  },
697
709
  hasui: {
698
710
  coinName: "hasui",
@@ -714,7 +726,8 @@ var POOL_ADDRESSES = {
714
726
  coinMetadataId: "0x2c5f33af93f6511df699aaaa5822d823aac6ed99d4a0de2a4a50b3afa0172e24",
715
727
  coinType: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI",
716
728
  sCoinMetadataId: "0x0a2a4a25aac50ac79210d710f93cb22db58bc6ee22f213364dda9a709cab2189",
717
- spoolName: "shasui"
729
+ spoolName: "shasui",
730
+ decimals: 9
718
731
  },
719
732
  vsui: {
720
733
  coinName: "vsui",
@@ -736,7 +749,8 @@ var POOL_ADDRESSES = {
736
749
  coinMetadataId: "0xabd84a23467b33854ab25cf862006fd97479f8f6f53e50fe732c43a274d939bd",
737
750
  coinType: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",
738
751
  sCoinMetadataId: "0xa96cc21ddfb6486be4a96cda0c58734e4ddea2a8c04984f9e6121d8fae997ddf",
739
- spoolName: "svsui"
752
+ spoolName: "svsui",
753
+ decimals: 9
740
754
  },
741
755
  sca: {
742
756
  coinName: "sca",
@@ -755,7 +769,8 @@ var POOL_ADDRESSES = {
755
769
  sCoinSymbol: "sSCA",
756
770
  coinMetadataId: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
757
771
  coinType: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",
758
- sCoinMetadataId: "0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964"
772
+ sCoinMetadataId: "0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964",
773
+ decimals: 9
759
774
  },
760
775
  fud: {
761
776
  coinName: "fud",
@@ -773,25 +788,8 @@ var POOL_ADDRESSES = {
773
788
  sCoinSymbol: "sFUD",
774
789
  coinMetadataId: "0x01087411ef48aaac1eb6e24803213e3a60a03b147dac930e5e341f17a85e524e",
775
790
  coinType: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
776
- sCoinMetadataId: "0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c"
777
- },
778
- deep: {
779
- coinName: "deep",
780
- symbol: "DEEP",
781
- lendingPoolAddress: "0xf4a67ffb43da1e1c61c049f188f19463ea8dbbf2d5ef4722d6df854ff1b1cc03",
782
- borrowDynamic: "0x95e00d7466f97a100e70f08bd37788dc49335796f6f49fab996d40dd0681c6d3",
783
- interestModel: "0x4143c298506a332d92ea8a995e6f3991ee3215f58f6fc6441752835d275b9a69",
784
- borrowFeeKey: "0xb14ee43f4ad2a2c40bac8c4406a401690e93c982e289cf3802fedf74a159cab2",
785
- supplyLimitKey: "0x599528fdfdc253e90dfd0acf4f4a166b391e2aac1ca6528abbff63225b548fee",
786
- borrowLimitKey: "0xf4217e8ef9d9c32e8992092e910a77535a8124c19b8a762a673f227f5f765a4e",
787
- isolatedAssetKey: "0x208d3a24ba369dcfc8f0387333d1512b98199eb150d2f2a69359ff708cf761e3",
788
- sCoinTreasury: "0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88",
789
- sCoinType: "0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",
790
- sCoinName: "sdeep",
791
- sCoinSymbol: "sDEEP",
792
- coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
793
- coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
794
- sCoinMetadataId: "0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e"
791
+ sCoinMetadataId: "0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c",
792
+ decimals: 5
795
793
  },
796
794
  fdusd: {
797
795
  coinName: "fdusd",
@@ -809,7 +807,27 @@ var POOL_ADDRESSES = {
809
807
  sCoinSymbol: "sFDUSD",
810
808
  coinMetadataId: "0xdebee5265a67c186ed87fe93303d33dfe1de53e3b4fd7d9329c2852860acd3e7",
811
809
  coinType: "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD",
812
- sCoinMetadataId: "0xb1529a3b5e5831d19a722493eec19785f613945d3dc984602d44a418f990d73f"
810
+ sCoinMetadataId: "0xb1529a3b5e5831d19a722493eec19785f613945d3dc984602d44a418f990d73f",
811
+ decimals: 6
812
+ },
813
+ deep: {
814
+ coinName: "deep",
815
+ symbol: "DEEP",
816
+ lendingPoolAddress: "0xf4a67ffb43da1e1c61c049f188f19463ea8dbbf2d5ef4722d6df854ff1b1cc03",
817
+ borrowDynamic: "0x95e00d7466f97a100e70f08bd37788dc49335796f6f49fab996d40dd0681c6d3",
818
+ interestModel: "0x4143c298506a332d92ea8a995e6f3991ee3215f58f6fc6441752835d275b9a69",
819
+ borrowFeeKey: "0xb14ee43f4ad2a2c40bac8c4406a401690e93c982e289cf3802fedf74a159cab2",
820
+ supplyLimitKey: "0x599528fdfdc253e90dfd0acf4f4a166b391e2aac1ca6528abbff63225b548fee",
821
+ borrowLimitKey: "0xf4217e8ef9d9c32e8992092e910a77535a8124c19b8a762a673f227f5f765a4e",
822
+ isolatedAssetKey: "0x208d3a24ba369dcfc8f0387333d1512b98199eb150d2f2a69359ff708cf761e3",
823
+ sCoinTreasury: "0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88",
824
+ sCoinType: "0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",
825
+ sCoinName: "sdeep",
826
+ sCoinSymbol: "sDEEP",
827
+ coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
828
+ coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
829
+ sCoinMetadataId: "0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e",
830
+ decimals: 6
813
831
  }
814
832
  };
815
833
 
@@ -2433,7 +2451,7 @@ var ScallopAddress = class {
2433
2451
  };
2434
2452
 
2435
2453
  // src/models/scallopClient.ts
2436
- var import_utils25 = require("@mysten/sui/utils");
2454
+ var import_utils24 = require("@mysten/sui/utils");
2437
2455
 
2438
2456
  // src/models/scallopUtils.ts
2439
2457
  var import_utils10 = require("@mysten/sui/utils");
@@ -4714,7 +4732,8 @@ var getObligationAccount = async (query, obligation, ownerAddress, indexer = fal
4714
4732
  };
4715
4733
  var getTotalValueLocked = async (query, indexer = false) => {
4716
4734
  const market = await query.getMarketPools(void 0, { indexer });
4717
- let supplyValue = (0, import_bignumber5.default)(0);
4735
+ let supplyLendingValue = (0, import_bignumber5.default)(0);
4736
+ let supplyCollateralValue = (0, import_bignumber5.default)(0);
4718
4737
  let borrowValue = (0, import_bignumber5.default)(0);
4719
4738
  if (indexer) {
4720
4739
  const tvlIndexer = await query.indexer.getTotalValueLocked();
@@ -4724,12 +4743,16 @@ var getTotalValueLocked = async (query, indexer = false) => {
4724
4743
  borrowValue: tvlIndexer.borrowValue,
4725
4744
  borrowValueChangeRatio: tvlIndexer.borrowValueChangeRatio,
4726
4745
  totalValue: tvlIndexer.totalValue,
4727
- totalValueChangeRatio: tvlIndexer.totalValueChangeRatio
4746
+ totalValueChangeRatio: tvlIndexer.totalValueChangeRatio,
4747
+ supplyLendingValue: tvlIndexer.supplyLendingValue,
4748
+ supplyLendingValueChangeRatio: tvlIndexer.supplyLendingValueChangeRatio,
4749
+ supplyCollateralValue: tvlIndexer.supplyCollateralValue,
4750
+ supplyCollateralValueChangeRatio: tvlIndexer.supplyCollateralValueChangeRatio
4728
4751
  };
4729
4752
  return tvl2;
4730
4753
  }
4731
4754
  for (const pool of Object.values(market.pools)) {
4732
- supplyValue = supplyValue.plus(
4755
+ supplyLendingValue = supplyLendingValue.plus(
4733
4756
  (0, import_bignumber5.default)(pool.supplyCoin).multipliedBy(pool.coinPrice)
4734
4757
  );
4735
4758
  borrowValue = borrowValue.plus(
@@ -4737,14 +4760,16 @@ var getTotalValueLocked = async (query, indexer = false) => {
4737
4760
  );
4738
4761
  }
4739
4762
  for (const collateral of Object.values(market.collaterals)) {
4740
- supplyValue = supplyValue.plus(
4763
+ supplyCollateralValue = supplyCollateralValue.plus(
4741
4764
  (0, import_bignumber5.default)(collateral.depositCoin).multipliedBy(collateral.coinPrice)
4742
4765
  );
4743
4766
  }
4744
4767
  const tvl = {
4745
- supplyValue: supplyValue.toNumber(),
4768
+ supplyValue: supplyLendingValue.plus(supplyCollateralValue).toNumber(),
4769
+ supplyLendingValue: supplyLendingValue.toNumber(),
4770
+ supplyCollateralValue: supplyCollateralValue.toNumber(),
4746
4771
  borrowValue: borrowValue.toNumber(),
4747
- totalValue: supplyValue.minus(borrowValue).toNumber()
4772
+ totalValue: supplyLendingValue.plus(supplyCollateralValue).minus(borrowValue).toNumber()
4748
4773
  };
4749
4774
  return tvl;
4750
4775
  };
@@ -5576,10 +5601,26 @@ var getTotalVeScaTreasuryAmount = async (utils, veScaTreasury) => {
5576
5601
  const veScaPkgId = utils.address.get("vesca.id");
5577
5602
  const veScaConfig = utils.address.get("vesca.config");
5578
5603
  veScaTreasury = veScaTreasury ?? utils.address.get("vesca.treasury");
5604
+ const txb = new import_sui_kit4.SuiTxBlock();
5579
5605
  const refreshQueryTarget = `${veScaPkgId}::treasury::refresh`;
5580
- const refreshArgs = [veScaConfig, veScaTreasury, import_sui_kit4.SUI_CLOCK_OBJECT_ID];
5606
+ const refreshArgs = [
5607
+ veScaConfig,
5608
+ veScaTreasury,
5609
+ txb.sharedObjectRef({
5610
+ objectId: import_sui_kit4.SUI_CLOCK_OBJECT_ID,
5611
+ mutable: false,
5612
+ initialSharedVersion: "1"
5613
+ })
5614
+ ];
5581
5615
  const veScaAmountQueryTarget = `${veScaPkgId}::treasury::total_ve_sca_amount`;
5582
- const veScaAmountArgs = [veScaTreasury, import_sui_kit4.SUI_CLOCK_OBJECT_ID];
5616
+ const veScaAmountArgs = [
5617
+ veScaTreasury,
5618
+ txb.sharedObjectRef({
5619
+ objectId: import_sui_kit4.SUI_CLOCK_OBJECT_ID,
5620
+ mutable: false,
5621
+ initialSharedVersion: "1"
5622
+ })
5623
+ ];
5583
5624
  const resolvedRefreshArgs = await Promise.all(
5584
5625
  refreshArgs.map(async (arg) => {
5585
5626
  if (typeof arg === "string") {
@@ -5596,7 +5637,6 @@ var getTotalVeScaTreasuryAmount = async (utils, veScaTreasury) => {
5596
5637
  return arg;
5597
5638
  })
5598
5639
  );
5599
- const txb = new import_sui_kit4.SuiTxBlock();
5600
5640
  txb.moveCall(refreshQueryTarget, resolvedRefreshArgs);
5601
5641
  txb.moveCall(veScaAmountQueryTarget, resolvedVeScaAmountArgs);
5602
5642
  const txBytes = await txb.txBlock.build({
@@ -5727,6 +5767,7 @@ var getAllAddresses = async (query) => {
5727
5767
  // @ts-ignore
5728
5768
  `scoin.coins.s${coinName}.metaData`
5729
5769
  );
5770
+ const decimals = query.utils.getCoinDecimal(coinName);
5730
5771
  const spoolName = spool ? `s${coinName}` : void 0;
5731
5772
  results[coinName] = {
5732
5773
  coinName,
@@ -5749,7 +5790,8 @@ var getAllAddresses = async (query) => {
5749
5790
  coinMetadataId,
5750
5791
  coinType: `0x${coinType}`,
5751
5792
  sCoinMetadataId,
5752
- spoolName
5793
+ spoolName,
5794
+ decimals
5753
5795
  };
5754
5796
  await new Promise((resolve) => setTimeout(resolve, 500));
5755
5797
  })
@@ -6231,7 +6273,7 @@ var ScallopUtils = class {
6231
6273
  };
6232
6274
 
6233
6275
  // src/models/scallopBuilder.ts
6234
- var import_utils24 = require("@mysten/sui/utils");
6276
+ var import_utils23 = require("@mysten/sui/utils");
6235
6277
 
6236
6278
  // src/builders/coreBuilder.ts
6237
6279
  var import_transactions = require("@mysten/sui/transactions");
@@ -6355,27 +6397,67 @@ var priceUpdateRequest = (txBlock, packageId, xOracleId, coinType) => {
6355
6397
  var confirmPriceUpdateRequest = (txBlock, packageId, xOracleId, request, coinType) => {
6356
6398
  const target = `${packageId}::x_oracle::confirm_price_update_request`;
6357
6399
  const typeArgs = [coinType];
6358
- txBlock.moveCall(target, [xOracleId, request, import_utils12.SUI_CLOCK_OBJECT_ID], typeArgs);
6400
+ txBlock.moveCall(
6401
+ target,
6402
+ [
6403
+ xOracleId,
6404
+ request,
6405
+ txBlock.sharedObjectRef({
6406
+ objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
6407
+ mutable: false,
6408
+ initialSharedVersion: "1"
6409
+ })
6410
+ ],
6411
+ typeArgs
6412
+ );
6359
6413
  return txBlock;
6360
6414
  };
6361
6415
  var updateSupraPrice = (txBlock, packageId, request, holderId, registryId, coinType) => {
6362
6416
  txBlock.moveCall(
6363
6417
  `${packageId}::rule::set_price`,
6364
- [request, holderId, registryId, import_utils12.SUI_CLOCK_OBJECT_ID],
6418
+ [
6419
+ request,
6420
+ holderId,
6421
+ registryId,
6422
+ txBlock.sharedObjectRef({
6423
+ objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
6424
+ mutable: false,
6425
+ initialSharedVersion: "1"
6426
+ })
6427
+ ],
6365
6428
  [coinType]
6366
6429
  );
6367
6430
  };
6368
6431
  var updateSwitchboardPrice = (txBlock, packageId, request, aggregatorId, registryId, coinType) => {
6369
6432
  txBlock.moveCall(
6370
6433
  `${packageId}::rule::set_price`,
6371
- [request, aggregatorId, registryId, import_utils12.SUI_CLOCK_OBJECT_ID],
6434
+ [
6435
+ request,
6436
+ aggregatorId,
6437
+ registryId,
6438
+ txBlock.sharedObjectRef({
6439
+ objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
6440
+ mutable: false,
6441
+ initialSharedVersion: "1"
6442
+ })
6443
+ ],
6372
6444
  [coinType]
6373
6445
  );
6374
6446
  };
6375
6447
  var updatePythPrice = (txBlock, packageId, request, stateId, feedObjectId, registryId, coinType) => {
6376
6448
  txBlock.moveCall(
6377
6449
  `${packageId}::rule::set_price`,
6378
- [request, stateId, feedObjectId, registryId, import_utils12.SUI_CLOCK_OBJECT_ID],
6450
+ [
6451
+ request,
6452
+ stateId,
6453
+ feedObjectId,
6454
+ registryId,
6455
+ txBlock.sharedObjectRef({
6456
+ objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
6457
+ mutable: false,
6458
+ initialSharedVersion: "1"
6459
+ })
6460
+ ],
6379
6461
  [coinType]
6380
6462
  );
6381
6463
  };
@@ -6455,7 +6537,11 @@ var generateCoreNormalMethod = ({
6455
6537
  coreIds.coinDecimalsRegistry,
6456
6538
  txBlock.pure.u64(amount),
6457
6539
  coreIds.xOracle,
6458
- import_utils13.SUI_CLOCK_OBJECT_ID
6540
+ txBlock.sharedObjectRef({
6541
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6542
+ mutable: false,
6543
+ initialSharedVersion: "1"
6544
+ })
6459
6545
  ],
6460
6546
  [coinType]
6461
6547
  );
@@ -6465,7 +6551,16 @@ var generateCoreNormalMethod = ({
6465
6551
  return builder.moveCall(
6466
6552
  txBlock,
6467
6553
  `${coreIds.protocolPkg}::mint::mint`,
6468
- [coreIds.version, coreIds.market, coin, import_utils13.SUI_CLOCK_OBJECT_ID],
6554
+ [
6555
+ coreIds.version,
6556
+ coreIds.market,
6557
+ coin,
6558
+ txBlock.sharedObjectRef({
6559
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6560
+ mutable: false,
6561
+ initialSharedVersion: "1"
6562
+ })
6563
+ ],
6469
6564
  [coinType]
6470
6565
  );
6471
6566
  },
@@ -6474,7 +6569,16 @@ var generateCoreNormalMethod = ({
6474
6569
  return builder.moveCall(
6475
6570
  txBlock,
6476
6571
  `${coreIds.protocolPkg}::mint::mint_entry`,
6477
- [coreIds.version, coreIds.market, coin, import_utils13.SUI_CLOCK_OBJECT_ID],
6572
+ [
6573
+ coreIds.version,
6574
+ coreIds.market,
6575
+ coin,
6576
+ txBlock.sharedObjectRef({
6577
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6578
+ mutable: false,
6579
+ initialSharedVersion: "1"
6580
+ })
6581
+ ],
6478
6582
  [coinType]
6479
6583
  );
6480
6584
  },
@@ -6483,7 +6587,16 @@ var generateCoreNormalMethod = ({
6483
6587
  return builder.moveCall(
6484
6588
  txBlock,
6485
6589
  `${coreIds.protocolPkg}::redeem::redeem`,
6486
- [coreIds.version, coreIds.market, marketCoin, import_utils13.SUI_CLOCK_OBJECT_ID],
6590
+ [
6591
+ coreIds.version,
6592
+ coreIds.market,
6593
+ marketCoin,
6594
+ txBlock.sharedObjectRef({
6595
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6596
+ mutable: false,
6597
+ initialSharedVersion: "1"
6598
+ })
6599
+ ],
6487
6600
  [coinType]
6488
6601
  );
6489
6602
  },
@@ -6492,7 +6605,16 @@ var generateCoreNormalMethod = ({
6492
6605
  return builder.moveCall(
6493
6606
  txBlock,
6494
6607
  `${coreIds.protocolPkg}::redeem::redeem_entry`,
6495
- [coreIds.version, coreIds.market, marketCoin, import_utils13.SUI_CLOCK_OBJECT_ID],
6608
+ [
6609
+ coreIds.version,
6610
+ coreIds.market,
6611
+ marketCoin,
6612
+ txBlock.sharedObjectRef({
6613
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6614
+ mutable: false,
6615
+ initialSharedVersion: "1"
6616
+ })
6617
+ ],
6496
6618
  [coinType]
6497
6619
  );
6498
6620
  },
@@ -6509,7 +6631,11 @@ var generateCoreNormalMethod = ({
6509
6631
  coreIds.coinDecimalsRegistry,
6510
6632
  amount,
6511
6633
  coreIds.xOracle,
6512
- import_utils13.SUI_CLOCK_OBJECT_ID
6634
+ txBlock.sharedObjectRef({
6635
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6636
+ mutable: false,
6637
+ initialSharedVersion: "1"
6638
+ })
6513
6639
  ],
6514
6640
  [coinType]
6515
6641
  );
@@ -6528,7 +6654,11 @@ var generateCoreNormalMethod = ({
6528
6654
  borrowReferral,
6529
6655
  typeof amount === "number" ? txBlock.pure.u64(amount) : amount,
6530
6656
  coreIds.xOracle,
6531
- import_utils13.SUI_CLOCK_OBJECT_ID
6657
+ txBlock.sharedObjectRef({
6658
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6659
+ mutable: false,
6660
+ initialSharedVersion: "1"
6661
+ })
6532
6662
  ],
6533
6663
  [coinType, referralWitnessType]
6534
6664
  );
@@ -6546,7 +6676,11 @@ var generateCoreNormalMethod = ({
6546
6676
  coreIds.coinDecimalsRegistry,
6547
6677
  txBlock.pure.u64(amount),
6548
6678
  coreIds.xOracle,
6549
- import_utils13.SUI_CLOCK_OBJECT_ID
6679
+ txBlock.sharedObjectRef({
6680
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6681
+ mutable: false,
6682
+ initialSharedVersion: "1"
6683
+ })
6550
6684
  ],
6551
6685
  [coinType]
6552
6686
  );
@@ -6561,7 +6695,11 @@ var generateCoreNormalMethod = ({
6561
6695
  obligation,
6562
6696
  coreIds.market,
6563
6697
  coin,
6564
- import_utils13.SUI_CLOCK_OBJECT_ID
6698
+ txBlock.sharedObjectRef({
6699
+ objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
6700
+ mutable: false,
6701
+ initialSharedVersion: "1"
6702
+ })
6565
6703
  ],
6566
6704
  [coinType]
6567
6705
  );
@@ -6726,7 +6864,7 @@ var generateCoreQuickMethod = ({
6726
6864
  ) ?? [];
6727
6865
  const updateCoinNames = [...obligationCoinNames, poolCoinName];
6728
6866
  await updateOracles(builder, txBlock, updateCoinNames);
6729
- return await txBlock.borrowWithReferral(
6867
+ return txBlock.borrowWithReferral(
6730
6868
  obligationInfo.obligationId,
6731
6869
  obligationInfo.obligationKey,
6732
6870
  borrowReferral,
@@ -6854,7 +6992,14 @@ var generateSpoolNormalMethod = ({
6854
6992
  return builder.moveCall(
6855
6993
  txBlock,
6856
6994
  `${spoolIds.spoolPkg}::user::new_spool_account`,
6857
- [stakePoolId, import_utils15.SUI_CLOCK_OBJECT_ID],
6995
+ [
6996
+ stakePoolId,
6997
+ txBlock.sharedObjectRef({
6998
+ objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
6999
+ mutable: false,
7000
+ initialSharedVersion: "1"
7001
+ })
7002
+ ],
6858
7003
  [marketCoinType]
6859
7004
  );
6860
7005
  },
@@ -6866,7 +7011,16 @@ var generateSpoolNormalMethod = ({
6866
7011
  builder.moveCall(
6867
7012
  txBlock,
6868
7013
  `${spoolIds.spoolPkg}::user::stake`,
6869
- [stakePoolId, stakeAccount, coin, import_utils15.SUI_CLOCK_OBJECT_ID],
7014
+ [
7015
+ stakePoolId,
7016
+ stakeAccount,
7017
+ coin,
7018
+ txBlock.sharedObjectRef({
7019
+ objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
7020
+ mutable: false,
7021
+ initialSharedVersion: "1"
7022
+ })
7023
+ ],
6870
7024
  [marketCoinType]
6871
7025
  );
6872
7026
  },
@@ -6878,7 +7032,16 @@ var generateSpoolNormalMethod = ({
6878
7032
  return builder.moveCall(
6879
7033
  txBlock,
6880
7034
  `${spoolIds.spoolPkg}::user::unstake`,
6881
- [stakePoolId, stakeAccount, amount, import_utils15.SUI_CLOCK_OBJECT_ID],
7035
+ [
7036
+ stakePoolId,
7037
+ stakeAccount,
7038
+ amount,
7039
+ txBlock.sharedObjectRef({
7040
+ objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
7041
+ mutable: false,
7042
+ initialSharedVersion: "1"
7043
+ })
7044
+ ],
6882
7045
  [marketCoinType]
6883
7046
  );
6884
7047
  },
@@ -6895,7 +7058,16 @@ var generateSpoolNormalMethod = ({
6895
7058
  return builder.moveCall(
6896
7059
  txBlock,
6897
7060
  `${spoolIds.spoolPkg}::user::redeem_rewards`,
6898
- [stakePoolId, rewardPoolId, stakeAccount, import_utils15.SUI_CLOCK_OBJECT_ID],
7061
+ [
7062
+ stakePoolId,
7063
+ rewardPoolId,
7064
+ stakeAccount,
7065
+ txBlock.sharedObjectRef({
7066
+ objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
7067
+ mutable: false,
7068
+ initialSharedVersion: "1"
7069
+ })
7070
+ ],
6899
7071
  [marketCoinType, rewardCoinType]
6900
7072
  );
6901
7073
  }
@@ -7030,7 +7202,6 @@ var newSpoolTxBlock = (builder, initTxBlock) => {
7030
7202
 
7031
7203
  // src/builders/borrowIncentiveBuilder.ts
7032
7204
  var import_transactions3 = require("@mysten/sui/transactions");
7033
- var import_utils17 = require("@mysten/sui/utils");
7034
7205
  var import_sui_kit7 = require("@scallop-io/sui-kit");
7035
7206
  var requireObligationInfo2 = async (...params) => {
7036
7207
  const [builder, txBlock, obligationId, obligationKey] = params;
@@ -7083,7 +7254,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7083
7254
  obligationKey,
7084
7255
  obligationId,
7085
7256
  borrowIncentiveIds.obligationAccessStore,
7086
- import_utils17.SUI_CLOCK_OBJECT_ID
7257
+ txBlock.sharedObjectRef({
7258
+ objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
7259
+ mutable: false,
7260
+ initialSharedVersion: "1"
7261
+ })
7087
7262
  ]
7088
7263
  );
7089
7264
  },
@@ -7102,7 +7277,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7102
7277
  veScaIds.treasury,
7103
7278
  veScaIds.table,
7104
7279
  veScaKey,
7105
- import_utils17.SUI_CLOCK_OBJECT_ID
7280
+ txBlock.sharedObjectRef({
7281
+ objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
7282
+ mutable: false,
7283
+ initialSharedVersion: "1"
7284
+ })
7106
7285
  ],
7107
7286
  []
7108
7287
  );
@@ -7117,7 +7296,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7117
7296
  borrowIncentiveIds.incentiveAccounts,
7118
7297
  obligationKey,
7119
7298
  obligationId,
7120
- import_utils17.SUI_CLOCK_OBJECT_ID
7299
+ txBlock.sharedObjectRef({
7300
+ objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
7301
+ mutable: false,
7302
+ initialSharedVersion: "1"
7303
+ })
7121
7304
  ]
7122
7305
  );
7123
7306
  },
@@ -7132,7 +7315,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7132
7315
  borrowIncentiveIds.incentiveAccounts,
7133
7316
  obligationKey,
7134
7317
  obligationId,
7135
- import_utils17.SUI_CLOCK_OBJECT_ID
7318
+ txBlock.sharedObjectRef({
7319
+ objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
7320
+ mutable: false,
7321
+ initialSharedVersion: "1"
7322
+ })
7136
7323
  ],
7137
7324
  [rewardType]
7138
7325
  );
@@ -7147,7 +7334,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
7147
7334
  borrowIncentiveIds.incentiveAccounts,
7148
7335
  obligation,
7149
7336
  veScaKey,
7150
- import_utils17.SUI_CLOCK_OBJECT_ID
7337
+ txBlock.sharedObjectRef({
7338
+ objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
7339
+ mutable: false,
7340
+ initialSharedVersion: "1"
7341
+ })
7151
7342
  ]
7152
7343
  );
7153
7344
  }
@@ -7298,7 +7489,11 @@ var generateNormalVeScaMethod = ({
7298
7489
  veScaIds.treasury,
7299
7490
  scaCoin,
7300
7491
  unlockAtInSecondTimestamp,
7301
- import_sui_kit8.SUI_CLOCK_OBJECT_ID
7492
+ txBlock.sharedObjectRef({
7493
+ objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
7494
+ mutable: false,
7495
+ initialSharedVersion: "1"
7496
+ })
7302
7497
  ],
7303
7498
  []
7304
7499
  );
@@ -7313,7 +7508,11 @@ var generateNormalVeScaMethod = ({
7313
7508
  veScaIds.table,
7314
7509
  veScaIds.treasury,
7315
7510
  newUnlockAtInSecondTimestamp,
7316
- import_sui_kit8.SUI_CLOCK_OBJECT_ID
7511
+ txBlock.sharedObjectRef({
7512
+ objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
7513
+ mutable: false,
7514
+ initialSharedVersion: "1"
7515
+ })
7317
7516
  ],
7318
7517
  []
7319
7518
  );
@@ -7328,7 +7527,11 @@ var generateNormalVeScaMethod = ({
7328
7527
  veScaIds.table,
7329
7528
  veScaIds.treasury,
7330
7529
  scaCoin,
7331
- import_sui_kit8.SUI_CLOCK_OBJECT_ID
7530
+ txBlock.sharedObjectRef({
7531
+ objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
7532
+ mutable: false,
7533
+ initialSharedVersion: "1"
7534
+ })
7332
7535
  ],
7333
7536
  []
7334
7537
  );
@@ -7344,7 +7547,11 @@ var generateNormalVeScaMethod = ({
7344
7547
  veScaIds.treasury,
7345
7548
  scaCoin,
7346
7549
  newUnlockAtInSecondTimestamp,
7347
- import_sui_kit8.SUI_CLOCK_OBJECT_ID
7550
+ txBlock.sharedObjectRef({
7551
+ objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
7552
+ mutable: false,
7553
+ initialSharedVersion: "1"
7554
+ })
7348
7555
  ],
7349
7556
  []
7350
7557
  );
@@ -7358,7 +7565,11 @@ var generateNormalVeScaMethod = ({
7358
7565
  veScaKey,
7359
7566
  veScaIds.table,
7360
7567
  veScaIds.treasury,
7361
- import_sui_kit8.SUI_CLOCK_OBJECT_ID
7568
+ txBlock.sharedObjectRef({
7569
+ objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
7570
+ mutable: false,
7571
+ initialSharedVersion: "1"
7572
+ })
7362
7573
  ],
7363
7574
  []
7364
7575
  );
@@ -7567,7 +7778,11 @@ var generateReferralNormalMethod = ({
7567
7778
  referralIds.referralBindings,
7568
7779
  txBlock.pure.id(veScaKeyId),
7569
7780
  veScaTable,
7570
- import_sui_kit9.SUI_CLOCK_OBJECT_ID
7781
+ txBlock.sharedObjectRef({
7782
+ objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
7783
+ mutable: false,
7784
+ initialSharedVersion: "1"
7785
+ })
7571
7786
  ],
7572
7787
  []
7573
7788
  );
@@ -7583,7 +7798,11 @@ var generateReferralNormalMethod = ({
7583
7798
  referralIds.referralBindings,
7584
7799
  referralIds.authorizedWitnessList,
7585
7800
  referralIds.referralTiers,
7586
- import_sui_kit9.SUI_CLOCK_OBJECT_ID
7801
+ txBlock.sharedObjectRef({
7802
+ objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
7803
+ mutable: false,
7804
+ initialSharedVersion: "1"
7805
+ })
7587
7806
  ],
7588
7807
  [coinType]
7589
7808
  );
@@ -7597,7 +7816,11 @@ var generateReferralNormalMethod = ({
7597
7816
  referralIds.version,
7598
7817
  ticket,
7599
7818
  referralIds.referralRevenuePool,
7600
- import_sui_kit9.SUI_CLOCK_OBJECT_ID
7819
+ txBlock.sharedObjectRef({
7820
+ objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
7821
+ mutable: false,
7822
+ initialSharedVersion: "1"
7823
+ })
7601
7824
  ],
7602
7825
  [coinType]
7603
7826
  );
@@ -7611,7 +7834,11 @@ var generateReferralNormalMethod = ({
7611
7834
  referralIds.version,
7612
7835
  referralIds.referralRevenuePool,
7613
7836
  veScaKey,
7614
- import_sui_kit9.SUI_CLOCK_OBJECT_ID
7837
+ txBlock.sharedObjectRef({
7838
+ objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
7839
+ mutable: false,
7840
+ initialSharedVersion: "1"
7841
+ })
7615
7842
  ],
7616
7843
  [coinType]
7617
7844
  );
@@ -8055,12 +8282,12 @@ var ScallopIndexer = class {
8055
8282
  };
8056
8283
 
8057
8284
  // src/models/scallopQuery.ts
8058
- var import_utils23 = require("@mysten/sui/utils");
8285
+ var import_utils22 = require("@mysten/sui/utils");
8059
8286
  var ScallopQuery = class {
8060
8287
  constructor(params = {}, instance) {
8061
8288
  this.params = params;
8062
8289
  this.suiKit = instance?.suiKit ?? instance?.utils?.suiKit ?? newSuiKit(params);
8063
- this.walletAddress = (0, import_utils23.normalizeSuiAddress)(
8290
+ this.walletAddress = (0, import_utils22.normalizeSuiAddress)(
8064
8291
  params.walletAddress ?? this.suiKit.currentAddress()
8065
8292
  );
8066
8293
  if (instance?.utils) {
@@ -8660,7 +8887,7 @@ var ScallopBuilder = class {
8660
8887
  constructor(params = {}, instance) {
8661
8888
  this.suiKit = instance?.suiKit ?? newSuiKit(params);
8662
8889
  this.params = params;
8663
- this.walletAddress = (0, import_utils24.normalizeSuiAddress)(
8890
+ this.walletAddress = (0, import_utils23.normalizeSuiAddress)(
8664
8891
  params?.walletAddress ?? this.suiKit.currentAddress()
8665
8892
  );
8666
8893
  if (instance?.query) {
@@ -8807,7 +9034,7 @@ var ScallopClient = class {
8807
9034
  constructor(params = {}, instance) {
8808
9035
  this.params = params;
8809
9036
  this.suiKit = instance?.suiKit ?? instance?.builder?.suiKit ?? newSuiKit(params);
8810
- this.walletAddress = (0, import_utils25.normalizeSuiAddress)(
9037
+ this.walletAddress = (0, import_utils24.normalizeSuiAddress)(
8811
9038
  params?.walletAddress ?? this.suiKit.currentAddress()
8812
9039
  );
8813
9040
  if (instance?.builder) {