@scallop-io/sui-scallop-sdk 1.4.23 → 1.5.0-alpha.1
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/constants/index.d.ts +1 -0
- package/dist/constants/xoracle.d.ts +2 -0
- package/dist/index.js +564 -619
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +574 -630
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopIndexer.d.ts +1 -0
- package/dist/models/scallopPrice.d.ts +0 -0
- package/dist/models/scallopQuery.d.ts +25 -3
- package/dist/queries/coreQuery.d.ts +1 -1
- package/dist/queries/index.d.ts +1 -0
- package/dist/queries/poolAddressesQuery.d.ts +2 -2
- package/dist/queries/priceQuery.d.ts +1 -1
- package/dist/queries/xOracleQuery.d.ts +13 -0
- package/dist/types/address.d.ts +1 -0
- package/dist/types/constant/index.d.ts +1 -0
- package/dist/types/constant/xOracle.d.ts +9 -0
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +11 -25
- package/src/builders/coreBuilder.ts +15 -72
- package/src/builders/oracle.ts +73 -46
- package/src/builders/referralBuilder.ts +9 -20
- package/src/builders/spoolBuilder.ts +10 -38
- package/src/builders/vescaBuilder.ts +11 -26
- package/src/constants/enum.ts +10 -5
- package/src/constants/index.ts +1 -0
- package/src/constants/poolAddress.ts +343 -184
- package/src/constants/testAddress.ts +35 -252
- package/src/constants/xoracle.ts +25 -0
- package/src/models/scallopIndexer.ts +11 -0
- package/src/models/scallopPrice.ts +0 -0
- package/src/models/scallopQuery.ts +58 -11
- package/src/models/scallopUtils.ts +1 -1
- package/src/queries/coreQuery.ts +16 -6
- package/src/queries/index.ts +1 -0
- package/src/queries/poolAddressesQuery.ts +5 -2
- package/src/queries/priceQuery.ts +10 -3
- package/src/queries/vescaQuery.ts +8 -17
- package/src/queries/xOracleQuery.ts +124 -0
- package/src/types/address.ts +1 -0
- package/src/types/constant/index.ts +1 -0
- package/src/types/constant/xOracle.ts +11 -0
- package/src/utils/util.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -84,7 +84,8 @@ __export(src_exports, {
|
|
|
84
84
|
stakeMarketCoins: () => stakeMarketCoins,
|
|
85
85
|
suiBridgeCoins: () => suiBridgeCoins,
|
|
86
86
|
voloCoinIds: () => voloCoinIds,
|
|
87
|
-
wormholeCoinIds: () => wormholeCoinIds
|
|
87
|
+
wormholeCoinIds: () => wormholeCoinIds,
|
|
88
|
+
xOracleList: () => xOracleList
|
|
88
89
|
});
|
|
89
90
|
module.exports = __toCommonJS(src_exports);
|
|
90
91
|
|
|
@@ -418,8 +419,10 @@ var voloCoinIds = {
|
|
|
418
419
|
vsui: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55"
|
|
419
420
|
};
|
|
420
421
|
var sCoinIds = {
|
|
421
|
-
ssui:
|
|
422
|
-
|
|
422
|
+
// ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI', // @TODO: restore on prod
|
|
423
|
+
ssui: "0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI",
|
|
424
|
+
// ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA', // @TODO: restore on prod
|
|
425
|
+
ssca: "0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA",
|
|
423
426
|
scetus: "0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS",
|
|
424
427
|
// Wormhole assets
|
|
425
428
|
sweth: "0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH",
|
|
@@ -430,13 +433,20 @@ var sCoinIds = {
|
|
|
430
433
|
shasui: "0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI",
|
|
431
434
|
svsui: "0xe1a1cc6bcf0001a015eab84bcc6713393ce20535f55b8b6f35c142e057a25fbe::scallop_v_sui::SCALLOP_V_SUI",
|
|
432
435
|
// stable coins
|
|
433
|
-
susdc:
|
|
436
|
+
susdc: (
|
|
437
|
+
// '0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC', // @TODO: restore on prod
|
|
438
|
+
"0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC"
|
|
439
|
+
),
|
|
434
440
|
swusdc: "0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC",
|
|
435
441
|
swusdt: "0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT",
|
|
436
442
|
sfdusd: "0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD",
|
|
437
443
|
// isolated assets
|
|
438
|
-
sdeep:
|
|
439
|
-
|
|
444
|
+
sdeep: (
|
|
445
|
+
// '0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP', // @TODO: restore on prod
|
|
446
|
+
"0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP"
|
|
447
|
+
),
|
|
448
|
+
// sfud: '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD', // @TODO: restore on prod
|
|
449
|
+
sfud: "0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD",
|
|
440
450
|
sblub: "0xe72f65446eabfad2103037af2d49d24599106fb44bf4c046c1e7e9acf6844dd0::scallop_blub::SCALLOP_BLUB",
|
|
441
451
|
// Sui bridge assets
|
|
442
452
|
ssbeth: "0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH",
|
|
@@ -543,30 +553,54 @@ var POOL_ADDRESSES = {
|
|
|
543
553
|
pythFeedObjectId: "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2"
|
|
544
554
|
},
|
|
545
555
|
usdc: {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
556
|
+
...{
|
|
557
|
+
coinName: "usdc",
|
|
558
|
+
symbol: "USDC",
|
|
559
|
+
lendingPoolAddress: "0xd3be98bf540f7603eeb550c0c0a19dbfc78822f25158b5fa84ebd9609def415f",
|
|
560
|
+
collateralPoolAddress: "0x8f0d529ba179c5b3d508213003eab813aaae31f78226099639b9a69d1aec17af",
|
|
561
|
+
borrowDynamic: "0x77837ecd4f26fac9a410fff594f2c0bd3288904a15492ca77cb8a52684dbb866",
|
|
562
|
+
interestModel: "0xaae3f179d63009380cbdcb9acb12907afc9c3cb79cc3460be296a9c6d28f3ff3",
|
|
563
|
+
riskModel: "0x198b24db213bfeb8b3c80ae63dde92e32fd24984d25da8233ff777b851edd574",
|
|
564
|
+
borrowFeeKey: "0xd37c5316cfe0a5967d14264fa6b423f880518b294a1ee6581ccbb49ccc401fb8",
|
|
565
|
+
supplyLimitKey: "0x4be9ae54ac4d320f4f9c14cae78cb85c8e0e67791dd9bdba6d2db20614a28a24",
|
|
566
|
+
borrowLimitKey: "0x6b01093cba95b835181f00e3a2c31ed8dfc8d64fe3db0fb80933a09f66e1ccf1",
|
|
567
|
+
spool: "0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918",
|
|
568
|
+
spoolReward: "0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166",
|
|
569
|
+
sCoinTreasury: "0xbe6b63021f3d82e0e7e977cdd718ed7c019cf2eba374b7b546220402452f938e",
|
|
570
|
+
sCoinType: "0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC",
|
|
571
|
+
sCoinName: "susdc",
|
|
572
|
+
sCoinSymbol: "sUSDC",
|
|
573
|
+
coinMetadataId: "0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",
|
|
574
|
+
coinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
575
|
+
sCoinMetadataId: "0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2",
|
|
576
|
+
spoolName: "susdc",
|
|
577
|
+
decimals: 6,
|
|
578
|
+
pythFeed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
579
|
+
pythFeedObjectId: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
|
|
580
|
+
},
|
|
581
|
+
...{
|
|
582
|
+
coinName: "usdc",
|
|
583
|
+
symbol: "USDC",
|
|
584
|
+
lendingPoolAddress: "0x13319d295914b390b22484373f20f822bca10314c34c227ae6e28df3d9aa8e01",
|
|
585
|
+
collateralPoolAddress: "0x2fdcf63682577f6bfdd4296500067543ba9877d5d5e41ebd9e51b97ab071ce69",
|
|
586
|
+
borrowDynamic: "0x7fd0660f0102789ad039542165c6cbc2d90ba3c1d9dbd4ac4ae8804d80817542",
|
|
587
|
+
interestModel: "0xd4e7b06a79f63706523167f055296db641b0f8ddd6734c05e205f2de0fcefdd0",
|
|
588
|
+
riskModel: "0x19e5993350186f192ffeb2cba0650b04c291390e149c8ac9b324ecf394daaa1a",
|
|
589
|
+
spool: "0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918",
|
|
590
|
+
spoolReward: "0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166",
|
|
591
|
+
sCoinTreasury: "0x6ef82ef94472dcb8c2cdeac8df38874024c08570ca165986ba56d1e38fe0c0a3",
|
|
592
|
+
sCoinType: "0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC",
|
|
593
|
+
sCoinName: "susdc",
|
|
594
|
+
sCoinSymbol: "sUSDC",
|
|
595
|
+
coinMetadataId: "0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",
|
|
596
|
+
coinType: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
|
|
597
|
+
spoolName: "susdc",
|
|
598
|
+
decimals: 6,
|
|
599
|
+
pythFeed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
600
|
+
pythFeedObjectId: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
|
|
601
|
+
}
|
|
569
602
|
},
|
|
603
|
+
// @TODO: restore on prod
|
|
570
604
|
weth: {
|
|
571
605
|
coinName: "weth",
|
|
572
606
|
symbol: "wETH",
|
|
@@ -665,30 +699,54 @@ var POOL_ADDRESSES = {
|
|
|
665
699
|
pythFeedObjectId: "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572"
|
|
666
700
|
},
|
|
667
701
|
sui: {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
702
|
+
...{
|
|
703
|
+
coinName: "sui",
|
|
704
|
+
symbol: "SUI",
|
|
705
|
+
lendingPoolAddress: "0x9c9077abf7a29eebce41e33addbcd6f5246a5221dd733e56ea0f00ae1b25c9e8",
|
|
706
|
+
collateralPoolAddress: "0x75aacfb7dcbf92ee0111fc1bf975b12569e4ba632e81ed7ae5ac090d40cd3acb",
|
|
707
|
+
borrowDynamic: "0xbf68e6159c99dcaf87717385f1143d2891c2d19663bd51f0bc9b6909e4bb7c27",
|
|
708
|
+
interestModel: "0x0dad9baa89b863c15a0487575de7cc428b01f1aa3998ad7a9e9752d96e83ffa9",
|
|
709
|
+
riskModel: "0xcd6675864690b5648a6e309f2f02a66914b2b2bd9c31936f4e0f7fc0f792bc86",
|
|
710
|
+
borrowFeeKey: "0xda5ede87a05c0677b17511c859b22d0a2b0229ee374d5d7a1274cb836b9fe5f8",
|
|
711
|
+
supplyLimitKey: "0x0602418e66fb7a73fa997077bd66f248ad5b090d43344a14b9f1db598ecc1d47",
|
|
712
|
+
borrowLimitKey: "0x2b33a7efdcf6a6df24f4d8a356dd52f58d75bc023c3f171d99502d4d008b53f0",
|
|
713
|
+
spool: "0x4f0ba970d3c11db05c8f40c64a15b6a33322db3702d634ced6536960ab6f3ee4",
|
|
714
|
+
spoolReward: "0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9",
|
|
715
|
+
sCoinTreasury: "0x5c1678c8261ac9eec024d4d630006a9f55c80dc0b1aa38a003fcb1d425818c6b",
|
|
716
|
+
sCoinType: "0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI",
|
|
717
|
+
sCoinName: "ssui",
|
|
718
|
+
sCoinSymbol: "sSUI",
|
|
719
|
+
coinMetadataId: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
|
|
720
|
+
coinType: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
|
|
721
|
+
sCoinMetadataId: "0xac724644f481f4870ecdc29b9549aa8ea5180f10827c0d97b493f9f65a91455d",
|
|
722
|
+
spoolName: "ssui",
|
|
723
|
+
decimals: 9,
|
|
724
|
+
pythFeed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
725
|
+
pythFeedObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
726
|
+
},
|
|
727
|
+
...{
|
|
728
|
+
coinName: "sui",
|
|
729
|
+
symbol: "SUI",
|
|
730
|
+
lendingPoolAddress: "0xeb86ad67543c1ac2c4cbaf178d38a45ab27c2e69d60f0f8badd83f563f012c3c",
|
|
731
|
+
collateralPoolAddress: "0xcba7bb07d4d3ce01d81e71d9def680aa8b417347bfd7834aee8fc3b85b61c9a1",
|
|
732
|
+
borrowDynamic: "0xd47c2fd3dbb95ed06e5da92f6b99611ba94a36efa6a13d9b33b02519761cc84e",
|
|
733
|
+
interestModel: "0x4742bb49aa49ab4e5d9dfa119cddc027d1b7811ac42ca1ce794818d4a4da68e7",
|
|
734
|
+
riskModel: "0x6dc356e829cfca2d79f0d68a79b5ddd5296ad0c955a38e2fc397485e2b629367",
|
|
735
|
+
spool: "0xb9617f83c06ebdeac0a8834782b1015e1cc7ea23739e30c132c4bfb95c37a579",
|
|
736
|
+
spoolReward: "0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a",
|
|
737
|
+
sCoinTreasury: "0x03f1d94a40bd9f5d556bacb5c5245732b185572f6a29b36ad8b555d9a8a24f09",
|
|
738
|
+
sCoinType: "0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI",
|
|
739
|
+
sCoinName: "ssui",
|
|
740
|
+
sCoinSymbol: "sSUI",
|
|
741
|
+
coinMetadataId: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
|
|
742
|
+
coinType: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
|
|
743
|
+
spoolName: "ssui",
|
|
744
|
+
decimals: 9,
|
|
745
|
+
pythFeed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
746
|
+
pythFeedObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
747
|
+
}
|
|
691
748
|
},
|
|
749
|
+
// @TODO: restore on prod
|
|
692
750
|
wapt: {
|
|
693
751
|
coinName: "wapt",
|
|
694
752
|
symbol: "wAPT",
|
|
@@ -827,48 +885,88 @@ var POOL_ADDRESSES = {
|
|
|
827
885
|
pythFeedObjectId: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
828
886
|
},
|
|
829
887
|
sca: {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
888
|
+
...{
|
|
889
|
+
coinName: "sca",
|
|
890
|
+
symbol: "SCA",
|
|
891
|
+
lendingPoolAddress: "0x6fc7d4211fc7018b6c75e7b908b88f2e0536443239804a3d32af547637bd28d7",
|
|
892
|
+
collateralPoolAddress: "0xff677a5d9e9dc8f08f0a8681ebfc7481d1c7d57bc441f2881974adcdd7b13c31",
|
|
893
|
+
borrowDynamic: "0x4e24f52edd739dab59ca4c6353ca430b7ce57e7f333abd0957958570a7cd09ca",
|
|
894
|
+
interestModel: "0xbdcd48cf5b1a814911dc2d5c72d393a980c87820199fe5d799289ce94f4c47df",
|
|
895
|
+
riskModel: "0xc437c24b67b8e2676907700fa395af337ad6463d2c0b4f4fa2e9276414026089",
|
|
896
|
+
borrowFeeKey: "0xee55ba0f9800a62d9e7aef667f87e658258f41814d2c9fa02e25590671b4e5ad",
|
|
897
|
+
supplyLimitKey: "0x8dd938856b972a10ea27ecab2af7ed78e48fc5f6ccedaf2b2119959f747dc2e3",
|
|
898
|
+
borrowLimitKey: "0x04c7de61c5b42972f9bf6a8b1848e5fea2d037ee8deba81741ecd4a70aa80d30",
|
|
899
|
+
sCoinTreasury: "0xe04bfc95e00252bd654ee13c08edef9ac5e4b6ae4074e8390db39e9a0109c529",
|
|
900
|
+
sCoinType: "0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA",
|
|
901
|
+
sCoinName: "ssca",
|
|
902
|
+
sCoinSymbol: "sSCA",
|
|
903
|
+
coinMetadataId: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
|
|
904
|
+
coinType: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",
|
|
905
|
+
sCoinMetadataId: "0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964",
|
|
906
|
+
decimals: 9,
|
|
907
|
+
pythFeed: "7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",
|
|
908
|
+
pythFeedObjectId: "0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985"
|
|
909
|
+
},
|
|
910
|
+
...{
|
|
911
|
+
coinName: "sca",
|
|
912
|
+
symbol: "SCA",
|
|
913
|
+
lendingPoolAddress: "0xd08ef85bc753616ce0f1e3ac01bbc8bd1ee53e03b1e82aaa9690db5cd285ef4c",
|
|
914
|
+
collateralPoolAddress: "0x4f59b8ef2cdd195830890cf0c01e29c159e48a6a6c766c64fd4b26cfa9ee58c6",
|
|
915
|
+
borrowDynamic: "0x7f6e11fbd32b5d0223f03bfda67a5b48c551a09cfff88edc187591f9a4b0ab10",
|
|
916
|
+
interestModel: "0xcb10daf0fee6f416463444f5b47aac0f0197a889bc60be2c4f90916f6a8d2faa",
|
|
917
|
+
riskModel: "0x043f21a35bd1e1060a7c579db46e10cfd039d0b75d6bfd758de97b60434ae708",
|
|
918
|
+
sCoinTreasury: "0x1b05d2cd8b20dba19da073a54195fc52d2f438ea19dea0713bae7a7dab308199",
|
|
919
|
+
sCoinType: "0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA",
|
|
920
|
+
sCoinName: "ssca",
|
|
921
|
+
sCoinSymbol: "sSCA",
|
|
922
|
+
coinMetadataId: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
|
|
923
|
+
coinType: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",
|
|
924
|
+
decimals: 9,
|
|
925
|
+
pythFeed: "7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",
|
|
926
|
+
pythFeedObjectId: "0xf6de1d3279a269a597d813cbaca59aa906543ab9a8c64e84a4722f1a20863985"
|
|
927
|
+
}
|
|
850
928
|
},
|
|
929
|
+
// @TODO: restore on prod
|
|
851
930
|
fud: {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
931
|
+
...{
|
|
932
|
+
coinName: "fud",
|
|
933
|
+
symbol: "FUD",
|
|
934
|
+
lendingPoolAddress: "0xefed2cbe76b344792ac724523c8b2236740d1cea2100d46a0ed0dc760c7f4231",
|
|
935
|
+
borrowDynamic: "0x14367ddca30e2860cb89ed4eaca20c7ece260c5d59dd9990d2c85a8321326acb",
|
|
936
|
+
interestModel: "0x2600ac100ef154eb2329ffd3aad47aca308ff9f9348de3e8e94aaeb906ec2303",
|
|
937
|
+
borrowFeeKey: "0xa87e8b26e07ff35ac9fb57adcc779be2883080fc7d12de2d9e7e16d8d8d5e529",
|
|
938
|
+
supplyLimitKey: "0xf98419aecc37a3c5de716f8ec590f8991a5be34da72ce1a2da09531ff45adf7d",
|
|
939
|
+
borrowLimitKey: "0x3d928a001c453c50004baa54e14b0a0e1b0907d9c613dfd76064fd7ed4e8beb8",
|
|
940
|
+
isolatedAssetKey: "0xfcb533e9e4e31f9c9f32d6cbf7fbb3425f1d60474e229a363a2dc7f835d587e2",
|
|
941
|
+
sCoinTreasury: "0xf25212f11d182decff7a86165699a73e3d5787aced203ca539f43cfbc10db867",
|
|
942
|
+
sCoinType: "0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD",
|
|
943
|
+
sCoinName: "sfud",
|
|
944
|
+
sCoinSymbol: "sFUD",
|
|
945
|
+
coinMetadataId: "0x01087411ef48aaac1eb6e24803213e3a60a03b147dac930e5e341f17a85e524e",
|
|
946
|
+
coinType: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
|
|
947
|
+
sCoinMetadataId: "0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c",
|
|
948
|
+
decimals: 5,
|
|
949
|
+
pythFeed: "6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75",
|
|
950
|
+
pythFeedObjectId: "0x4531c3ed0d22f21f5fce882905372006c9aafa30f01db03b789e95a6c50de7b2"
|
|
951
|
+
},
|
|
952
|
+
...{
|
|
953
|
+
coinName: "fud",
|
|
954
|
+
symbol: "FUD",
|
|
955
|
+
lendingPoolAddress: "0xc8a078d15ee7bbff49a14835f36951833d2d55c91ffd2972251dadbff8045ca8",
|
|
956
|
+
borrowDynamic: "0x345a2fa0fe5d5d704fd8ad609a9b7529f22e3cda738ad26756ad2a85e5d43777",
|
|
957
|
+
interestModel: "0xc84a22d8bca58e5f05673d1de2a7406b1b7bc9dcd15fd848ba6555c7ecab9d83",
|
|
958
|
+
sCoinTreasury: "0x858c492d51425b922c040c1a389e185b3b00d565e7d72ead1a81dc733104660d",
|
|
959
|
+
sCoinType: "0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD",
|
|
960
|
+
sCoinName: "sfud",
|
|
961
|
+
sCoinSymbol: "sFUD",
|
|
962
|
+
coinMetadataId: "0x01087411ef48aaac1eb6e24803213e3a60a03b147dac930e5e341f17a85e524e",
|
|
963
|
+
coinType: "0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",
|
|
964
|
+
decimals: 5,
|
|
965
|
+
pythFeed: "6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75",
|
|
966
|
+
pythFeedObjectId: "0x4531c3ed0d22f21f5fce882905372006c9aafa30f01db03b789e95a6c50de7b2"
|
|
967
|
+
}
|
|
871
968
|
},
|
|
969
|
+
// @TODO: restore on prod
|
|
872
970
|
blub: {
|
|
873
971
|
coinName: "blub",
|
|
874
972
|
symbol: "BLUB",
|
|
@@ -889,26 +987,45 @@ var POOL_ADDRESSES = {
|
|
|
889
987
|
pythFeedObjectId: "0x246658c3324f2477568c78cca622518fbc6969a004b841d81409d24a7ec39b18"
|
|
890
988
|
},
|
|
891
989
|
deep: {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
990
|
+
...{
|
|
991
|
+
coinName: "deep",
|
|
992
|
+
symbol: "DEEP",
|
|
993
|
+
lendingPoolAddress: "0xf4a67ffb43da1e1c61c049f188f19463ea8dbbf2d5ef4722d6df854ff1b1cc03",
|
|
994
|
+
borrowDynamic: "0x95e00d7466f97a100e70f08bd37788dc49335796f6f49fab996d40dd0681c6d3",
|
|
995
|
+
interestModel: "0x4143c298506a332d92ea8a995e6f3991ee3215f58f6fc6441752835d275b9a69",
|
|
996
|
+
borrowFeeKey: "0xb14ee43f4ad2a2c40bac8c4406a401690e93c982e289cf3802fedf74a159cab2",
|
|
997
|
+
supplyLimitKey: "0x599528fdfdc253e90dfd0acf4f4a166b391e2aac1ca6528abbff63225b548fee",
|
|
998
|
+
borrowLimitKey: "0xf4217e8ef9d9c32e8992092e910a77535a8124c19b8a762a673f227f5f765a4e",
|
|
999
|
+
isolatedAssetKey: "0x208d3a24ba369dcfc8f0387333d1512b98199eb150d2f2a69359ff708cf761e3",
|
|
1000
|
+
sCoinTreasury: "0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88",
|
|
1001
|
+
sCoinType: "0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",
|
|
1002
|
+
sCoinName: "sdeep",
|
|
1003
|
+
sCoinSymbol: "sDEEP",
|
|
1004
|
+
coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
|
|
1005
|
+
coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
|
|
1006
|
+
sCoinMetadataId: "0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e",
|
|
1007
|
+
decimals: 6,
|
|
1008
|
+
pythFeed: "29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
|
|
1009
|
+
pythFeedObjectId: "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed"
|
|
1010
|
+
},
|
|
1011
|
+
...{
|
|
1012
|
+
coinName: "deep",
|
|
1013
|
+
symbol: "DEEP",
|
|
1014
|
+
lendingPoolAddress: "0xfb8e4f68c9b14034da7f1f4703013dda69ebbb4578f835825bcf92ab89c3b5ae",
|
|
1015
|
+
borrowDynamic: "0xbf983b12a8707b174c0b037096ba2fbf1b30e6efb9cce14fc35207de0a696f79",
|
|
1016
|
+
interestModel: "0xb7f04cd3aaaefe671a79f9aed8646ae085a7e6812c1604044977c9355e0769c8",
|
|
1017
|
+
sCoinTreasury: "0x71d41465cf2d16fa0206126526bebdf65c8871d1fcfbd0c2237db2306afd67ba",
|
|
1018
|
+
sCoinType: "0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP",
|
|
1019
|
+
sCoinName: "sdeep",
|
|
1020
|
+
sCoinSymbol: "sDEEP",
|
|
1021
|
+
coinMetadataId: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
|
|
1022
|
+
coinType: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
|
|
1023
|
+
decimals: 6,
|
|
1024
|
+
pythFeed: "29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
|
|
1025
|
+
pythFeedObjectId: "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed"
|
|
1026
|
+
}
|
|
911
1027
|
},
|
|
1028
|
+
// @TODO: restore on prod
|
|
912
1029
|
fdusd: {
|
|
913
1030
|
coinName: "fdusd",
|
|
914
1031
|
symbol: "FDUSD",
|
|
@@ -1065,21 +1182,13 @@ var RPC_PROVIDERS = [
|
|
|
1065
1182
|
// src/constants/testAddress.ts
|
|
1066
1183
|
var TEST_ADDRESSES = {
|
|
1067
1184
|
core: {
|
|
1068
|
-
|
|
1069
|
-
// '0x07871c4b3c847a0f674510d4978d5cf6f960452795e8ff6f189fd2088a3f6ac7',
|
|
1070
|
-
version: "0xd318de9b0f6873879a82cbfcc2daa1d1591a8b54e7cea9f4b567da63c692a52b",
|
|
1185
|
+
version: "0xee15d07800e2ad4852505c57cd86afea774af02c17388f8bd907de75f915b4f4",
|
|
1071
1186
|
versionCap: "0x590a4011cb649b3878f3ea14b3a78674642a9548d79b7e091ef679574b158a07",
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
object: "0x6c23585e940a989588432509107e98bae06dbca4e333f26d0635d401b3c7c76d",
|
|
1075
|
-
// market:
|
|
1076
|
-
// '0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9',
|
|
1077
|
-
market: "0x9d6434e97f3f98fd9b0c0e1dca22632073985abcd22541feae7ee1e34cbe3af2",
|
|
1187
|
+
object: "0xb03fa00e2d9f17d78a9d48bd94d8852abec68c19d55e819096b1e062e69bfad1",
|
|
1188
|
+
market: "0xa7f41efe3b551c20ad6d6cea6ccd0fd68d2e2eaaacdca5e62d956209f6a51312",
|
|
1078
1189
|
adminCap: "0x09689d018e71c337d9db6d67cbca06b74ed92196103624028ccc3ecea411777c",
|
|
1079
1190
|
coinDecimalsRegistry: "0x200abe9bf19751cc566ae35aa58e2b7e4ff688fc1130f8d8909ea09bc137d668",
|
|
1080
|
-
|
|
1081
|
-
// '0x733e30b7c94d619d78cb8f5bc4bfbb759ced9a531239028caabb2474e5be59c9',
|
|
1082
|
-
obligationAccessStore: "0x46e9b44a77ee9c9d33cc2689ecdfbb8f681935cbc6bdf6ac3df048e396c36c82",
|
|
1191
|
+
obligationAccessStore: "0xb7d7e1464936fbdcdd4913308b40335e662401029635289bdb317c7dde9d6c68",
|
|
1083
1192
|
coins: {
|
|
1084
1193
|
usdc: {
|
|
1085
1194
|
id: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7",
|
|
@@ -1094,97 +1203,6 @@ var TEST_ADDRESSES = {
|
|
|
1094
1203
|
}
|
|
1095
1204
|
}
|
|
1096
1205
|
},
|
|
1097
|
-
cetus: {
|
|
1098
|
-
id: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b",
|
|
1099
|
-
metaData: "0x4c0dce55eff2db5419bbd2d239d1aa22b4a400c01bbb648b058a9883989025da",
|
|
1100
|
-
treasury: "",
|
|
1101
|
-
oracle: {
|
|
1102
|
-
supra: "",
|
|
1103
|
-
switchboard: "",
|
|
1104
|
-
pyth: {
|
|
1105
|
-
feed: "e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef",
|
|
1106
|
-
feedObject: "0x24c0247fb22457a719efac7f670cdc79be321b521460bd6bd2ccfa9f80713b14"
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
},
|
|
1110
|
-
wapt: {
|
|
1111
|
-
id: "0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37",
|
|
1112
|
-
metaData: "0xc969c5251f372c0f34c32759f1d315cf1ea0ee5e4454b52aea08778eacfdd0a8",
|
|
1113
|
-
treasury: "",
|
|
1114
|
-
oracle: {
|
|
1115
|
-
supra: "",
|
|
1116
|
-
switchboard: "",
|
|
1117
|
-
pyth: {
|
|
1118
|
-
feed: "03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5",
|
|
1119
|
-
feedObject: "0x7c5b7837c44a69b469325463ac0673ac1aa8435ff44ddb4191c9ae380463647f"
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
},
|
|
1123
|
-
wsol: {
|
|
1124
|
-
id: "0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8",
|
|
1125
|
-
metaData: "0x4d2c39082b4477e3e79dc4562d939147ab90c42fc5f3e4acf03b94383cd69b6e",
|
|
1126
|
-
treasury: "",
|
|
1127
|
-
oracle: {
|
|
1128
|
-
supra: "",
|
|
1129
|
-
switchboard: "",
|
|
1130
|
-
pyth: {
|
|
1131
|
-
feed: "ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
|
|
1132
|
-
feedObject: "0x9d0d275efbd37d8a8855f6f2c761fa5983293dd8ce202ee5196626de8fcd4469"
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
},
|
|
1136
|
-
wbtc: {
|
|
1137
|
-
id: "0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881",
|
|
1138
|
-
metaData: "0x5d3c6e60eeff8a05b693b481539e7847dfe33013e7070cdcb387f5c0cac05dfd",
|
|
1139
|
-
treasury: "",
|
|
1140
|
-
oracle: {
|
|
1141
|
-
supra: "",
|
|
1142
|
-
switchboard: "",
|
|
1143
|
-
pyth: {
|
|
1144
|
-
feed: "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
1145
|
-
feedObject: "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2"
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
},
|
|
1149
|
-
weth: {
|
|
1150
|
-
id: "0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5",
|
|
1151
|
-
metaData: "0x8900e4ceede3363bef086d6b50ca89d816d0e90bf6bc46efefe1f8455e08f50f",
|
|
1152
|
-
treasury: "",
|
|
1153
|
-
oracle: {
|
|
1154
|
-
supra: "",
|
|
1155
|
-
switchboard: "",
|
|
1156
|
-
pyth: {
|
|
1157
|
-
feed: "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
1158
|
-
feedObject: "0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab"
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
},
|
|
1162
|
-
wusdc: {
|
|
1163
|
-
id: "0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf",
|
|
1164
|
-
metaData: "0x4fbf84f3029bd0c0b77164b587963be957f853eccf834a67bb9ecba6ec80f189",
|
|
1165
|
-
treasury: "",
|
|
1166
|
-
oracle: {
|
|
1167
|
-
supra: "",
|
|
1168
|
-
switchboard: "",
|
|
1169
|
-
pyth: {
|
|
1170
|
-
feed: "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
1171
|
-
feedObject: "0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab"
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
},
|
|
1175
|
-
wusdt: {
|
|
1176
|
-
id: "0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c",
|
|
1177
|
-
metaData: "0xfb0e3eb97dd158a5ae979dddfa24348063843c5b20eb8381dd5fa7c93699e45c",
|
|
1178
|
-
treasury: "",
|
|
1179
|
-
oracle: {
|
|
1180
|
-
supra: "",
|
|
1181
|
-
switchboard: "",
|
|
1182
|
-
pyth: {
|
|
1183
|
-
feed: "2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
|
|
1184
|
-
feedObject: "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572"
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
},
|
|
1188
1206
|
sui: {
|
|
1189
1207
|
id: "0x0000000000000000000000000000000000000000000000000000000000000002",
|
|
1190
1208
|
metaData: "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",
|
|
@@ -1198,45 +1216,6 @@ var TEST_ADDRESSES = {
|
|
|
1198
1216
|
}
|
|
1199
1217
|
}
|
|
1200
1218
|
},
|
|
1201
|
-
afsui: {
|
|
1202
|
-
id: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc",
|
|
1203
|
-
metaData: "0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d",
|
|
1204
|
-
treasury: "",
|
|
1205
|
-
oracle: {
|
|
1206
|
-
supra: "",
|
|
1207
|
-
switchboard: "",
|
|
1208
|
-
pyth: {
|
|
1209
|
-
feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
1210
|
-
feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
},
|
|
1214
|
-
hasui: {
|
|
1215
|
-
id: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d",
|
|
1216
|
-
metaData: "0x2c5f33af93f6511df699aaaa5822d823aac6ed99d4a0de2a4a50b3afa0172e24",
|
|
1217
|
-
treasury: "",
|
|
1218
|
-
oracle: {
|
|
1219
|
-
supra: "",
|
|
1220
|
-
switchboard: "",
|
|
1221
|
-
pyth: {
|
|
1222
|
-
feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
1223
|
-
feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
},
|
|
1227
|
-
vsui: {
|
|
1228
|
-
id: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55",
|
|
1229
|
-
metaData: "0xabd84a23467b33854ab25cf862006fd97479f8f6f53e50fe732c43a274d939bd",
|
|
1230
|
-
treasury: "",
|
|
1231
|
-
oracle: {
|
|
1232
|
-
supra: "",
|
|
1233
|
-
switchboard: "",
|
|
1234
|
-
pyth: {
|
|
1235
|
-
feed: "23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
|
|
1236
|
-
feedObject: "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37"
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
},
|
|
1240
1219
|
sca: {
|
|
1241
1220
|
id: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6",
|
|
1242
1221
|
metaData: "0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844",
|
|
@@ -1250,39 +1229,6 @@ var TEST_ADDRESSES = {
|
|
|
1250
1229
|
}
|
|
1251
1230
|
}
|
|
1252
1231
|
},
|
|
1253
|
-
sbeth: {
|
|
1254
|
-
id: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29",
|
|
1255
|
-
metaData: "0x89b04ba87f8832d4d76e17a1c9dce72eb3e64d372cf02012b8d2de5384faeef0",
|
|
1256
|
-
treasury: "",
|
|
1257
|
-
oracle: {
|
|
1258
|
-
supra: "",
|
|
1259
|
-
switchboard: "",
|
|
1260
|
-
pyth: {
|
|
1261
|
-
feed: "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
1262
|
-
feedObject: "0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab"
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
},
|
|
1266
|
-
// @TODO: add test address
|
|
1267
|
-
// @ts-ignore
|
|
1268
|
-
sbusdt: {},
|
|
1269
|
-
// @ts-ignore
|
|
1270
|
-
sbwbtc: {},
|
|
1271
|
-
// @ts-ignore
|
|
1272
|
-
blub: {},
|
|
1273
|
-
fdusd: {
|
|
1274
|
-
id: "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a",
|
|
1275
|
-
metaData: "0xdebee5265a67c186ed87fe93303d33dfe1de53e3b4fd7d9329c2852860acd3e7",
|
|
1276
|
-
treasury: "",
|
|
1277
|
-
oracle: {
|
|
1278
|
-
supra: "",
|
|
1279
|
-
switchboard: "",
|
|
1280
|
-
pyth: {
|
|
1281
|
-
feed: "0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979",
|
|
1282
|
-
feedObject: "0x5f6583b2b0fe1ecf94aaffeaab8a838794693960cea48c0da282d5f4a24be027"
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
1232
|
deep: {
|
|
1287
1233
|
id: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270",
|
|
1288
1234
|
metaData: "0x6e60b051a08fa836f5a7acd7c464c8d9825bc29c44657fe170fe9b8e1e4770c0",
|
|
@@ -1311,12 +1257,12 @@ var TEST_ADDRESSES = {
|
|
|
1311
1257
|
}
|
|
1312
1258
|
},
|
|
1313
1259
|
oracles: {
|
|
1314
|
-
xOracle: "
|
|
1260
|
+
xOracle: "0x0c09daac413e834f2fe69601c41e836022fa9a185df6b56a80f6bcd8a3ecb8a2",
|
|
1315
1261
|
xOracleCap: "0x1edeae568fde99e090dbdec4bcdbd33a15f53a1ce1f87aeef1a560dedf4b4a90",
|
|
1316
1262
|
supra: { registry: "", registryCap: "", holder: "" },
|
|
1317
1263
|
switchboard: { registry: "", registryCap: "" },
|
|
1318
1264
|
pyth: {
|
|
1319
|
-
registry: "
|
|
1265
|
+
registry: "0xdcf813893649521abd27816ba8d946b0cb7fc98d776cc9adcecba54688ccc109",
|
|
1320
1266
|
registryCap: "0xbcb07141eb1f7e01fbda4130ecf5f5adaeabb77f5d9c32158b7532bcd2197acd",
|
|
1321
1267
|
state: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8",
|
|
1322
1268
|
wormhole: "0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a",
|
|
@@ -1341,46 +1287,36 @@ var TEST_ADDRESSES = {
|
|
|
1341
1287
|
upgradeCap: "0x3f203f6fff6a69d151e4f1cd931f22b68c489ef2759765662fc7baf673943c9e"
|
|
1342
1288
|
},
|
|
1343
1289
|
protocol: {
|
|
1344
|
-
id: "
|
|
1290
|
+
id: "0xb03fa00e2d9f17d78a9d48bd94d8852abec68c19d55e819096b1e062e69bfad1",
|
|
1345
1291
|
upgradeCap: "0x38527d154618d1fd5a644b90717fe07cf0e9f26b46b63e9568e611a3f86d5c1a"
|
|
1346
1292
|
},
|
|
1347
|
-
// protocol: {
|
|
1348
|
-
// id: '0x6e641f0dca8aedab3101d047e96439178f16301bf0b57fe8745086ff1195eb3e',
|
|
1349
|
-
// upgradeCap:
|
|
1350
|
-
// '0x38527d154618d1fd5a644b90717fe07cf0e9f26b46b63e9568e611a3f86d5c1a',
|
|
1351
|
-
// },
|
|
1352
1293
|
protocolWhitelist: {
|
|
1353
1294
|
id: "0x4c262d9343dac53ecb28f482a2a3f62c73d0ebac5b5f03d57383d56ff219acdf",
|
|
1354
1295
|
upgradeCap: "0x4a5e88a75039b00988f633f811f58117f31b8627a46bf822aa114d9010049449"
|
|
1355
1296
|
},
|
|
1356
|
-
// query: {
|
|
1357
|
-
// id: '0xb8d603a39114a5efef3dd0bf84df0bed1be1fbd39b78b7dd6e8a61ccc5e6006f',
|
|
1358
|
-
// upgradeCap:
|
|
1359
|
-
// '0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f',
|
|
1360
|
-
// },
|
|
1361
1297
|
query: {
|
|
1362
|
-
id: "
|
|
1298
|
+
id: "0x3a0dbce719fc56a96bf8e8dd53cd57eb9c313642a88d99b86f51208762eba258",
|
|
1299
|
+
object: "",
|
|
1363
1300
|
upgradeCap: "0x0d535c35f608b9b01b7ccce11acf43b1dd80c1b72bf8b541744a6e28e8d2745f"
|
|
1364
1301
|
},
|
|
1365
|
-
supra: { id: "", upgradeCap: "" },
|
|
1302
|
+
supra: { id: "", object: "", upgradeCap: "" },
|
|
1366
1303
|
pyth: {
|
|
1367
|
-
id: "
|
|
1304
|
+
id: "0xe622909f9252d4ef1737c41ea430ef44203d8f5dc8e01e1b3950a31405bc54eb",
|
|
1305
|
+
object: "0xe622909f9252d4ef1737c41ea430ef44203d8f5dc8e01e1b3950a31405bc54eb",
|
|
1368
1306
|
upgradeCap: "0xdf0ffbae1ea5bb25fbca5efba433dcf00c7cced65679af2f04728901275c6157"
|
|
1369
1307
|
},
|
|
1370
1308
|
switchboard: { id: "", upgradeCap: "" },
|
|
1371
1309
|
xOracle: {
|
|
1372
|
-
id: "
|
|
1310
|
+
id: "0xe7511600c924f1d0ac4b3fa5de3ae26b8845545902b015dc5fc7894307365d7b",
|
|
1311
|
+
object: "0xe7511600c924f1d0ac4b3fa5de3ae26b8845545902b015dc5fc7894307365d7b",
|
|
1373
1312
|
upgradeCap: "0x0f928a6b2e26b73330fecaf9b44acfc9800a4a9794d6415c2a3153bc70e3c1f0"
|
|
1374
1313
|
},
|
|
1375
1314
|
testCoin: { id: "", upgradeCap: "" }
|
|
1376
1315
|
}
|
|
1377
1316
|
},
|
|
1378
1317
|
spool: {
|
|
1379
|
-
// id: '0x7c4fdabe81c31b19a45d1e572a52a539997a90903fbb5bfab71480abe0fa62c3',
|
|
1380
1318
|
id: "0x1742655fe5872dfa6456673f9e38612a4965e6979e6cd7696a7f1225f28bae21",
|
|
1381
1319
|
adminCap: "0xdd8a047cbbf802bfcde5288b8ef1910965d789cc614da11d39af05fca0bd020a",
|
|
1382
|
-
// object:
|
|
1383
|
-
// '0xe87f1b2d498106a2c61421cec75b7b5c5e348512b0dc263949a0e7a3c256571a',
|
|
1384
1320
|
object: "0x1742655fe5872dfa6456673f9e38612a4965e6979e6cd7696a7f1225f28bae21",
|
|
1385
1321
|
pools: {
|
|
1386
1322
|
sweth: {
|
|
@@ -1388,72 +1324,48 @@ var TEST_ADDRESSES = {
|
|
|
1388
1324
|
rewardPoolId: "0x957de68a18d87817de8309b30c1ec269a4d87ae513abbeed86b5619cb9ce1077"
|
|
1389
1325
|
},
|
|
1390
1326
|
ssui: {
|
|
1391
|
-
// id: '0x4f0ba970d3c11db05c8f40c64a15b6a33322db3702d634ced6536960ab6f3ee4',
|
|
1392
1327
|
id: "0xb9617f83c06ebdeac0a8834782b1015e1cc7ea23739e30c132c4bfb95c37a579",
|
|
1393
|
-
rewardPoolId:
|
|
1394
|
-
// '0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9',
|
|
1395
|
-
"0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a"
|
|
1396
|
-
)
|
|
1328
|
+
rewardPoolId: "0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a"
|
|
1397
1329
|
},
|
|
1398
1330
|
susdc: {
|
|
1399
1331
|
id: "0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918",
|
|
1400
1332
|
rewardPoolId: "0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166"
|
|
1401
1333
|
},
|
|
1402
1334
|
swusdc: {
|
|
1403
|
-
// id: '0x4ace6648ddc64e646ba47a957c562c32c9599b3bba8f5ac1aadb2ae23a2f8ca0',
|
|
1404
1335
|
id: "0xf1b383b9cf2e9f515fc69567df1053098f273849d09cd84b0278a773429bd2b2",
|
|
1405
|
-
rewardPoolId:
|
|
1406
|
-
// '0xf4268cc9b9413b9bfe09e8966b8de650494c9e5784bf0930759cfef4904daff8',
|
|
1407
|
-
"0xc71c53ee6505d928ba15bea4fe4f45d98c9c31eced94b72d00a7827d4b7ba3ff"
|
|
1408
|
-
)
|
|
1336
|
+
rewardPoolId: "0xc71c53ee6505d928ba15bea4fe4f45d98c9c31eced94b72d00a7827d4b7ba3ff"
|
|
1409
1337
|
},
|
|
1410
1338
|
swusdt: {
|
|
1411
|
-
// id: '0xcb328f7ffa7f9342ed85af3fdb2f22919e1a06dfb2f713c04c73543870d7548f',
|
|
1412
1339
|
id: "0xb5567dfa5c7fc17a249e959732664c50713dd8c23db1a11376b27df800c17418",
|
|
1413
|
-
rewardPoolId:
|
|
1414
|
-
// '0x2c9f934d67a5baa586ceec2cc24163a2f049a6af3d5ba36b84d8ac40f25c4080',
|
|
1415
|
-
"0x60768b0687ff0235e376a039709a683e4c436098785e473b67b32dbab47b69ab"
|
|
1416
|
-
)
|
|
1340
|
+
rewardPoolId: "0x60768b0687ff0235e376a039709a683e4c436098785e473b67b32dbab47b69ab"
|
|
1417
1341
|
},
|
|
1418
1342
|
scetus: {
|
|
1419
1343
|
id: "0xac1bb13bf4472a637c18c2415fb0e3c1227ea2bcf35242e50563c98215bd298e",
|
|
1420
1344
|
rewardPoolId: "0x6835c1224126a45086fc6406adc249e3f30df18d779ca4f4e570e38716a17f3f"
|
|
1421
1345
|
},
|
|
1422
1346
|
safsui: {
|
|
1423
|
-
// id: '0xeedf438abcaa6ce4d9625ffca110920592d5867e4c5637d84ad9f466c4feb800',
|
|
1424
1347
|
id: "0xc568bb4c991258e839aa54802ecda04fcd9838c826bc3b42b40af81b23c458c8",
|
|
1425
|
-
rewardPoolId:
|
|
1426
|
-
// '0x89255a2f86ed7fbfef35ab8b7be48cc7667015975be2685dd9a55a9a64baf76e',
|
|
1427
|
-
"0x389a3cbeda742b918941bb24fd00e077bad3367484394d6234f8209b9a6aa03d"
|
|
1428
|
-
)
|
|
1348
|
+
rewardPoolId: "0x389a3cbeda742b918941bb24fd00e077bad3367484394d6234f8209b9a6aa03d"
|
|
1429
1349
|
},
|
|
1430
1350
|
shasui: {
|
|
1431
|
-
// id: '0xa6148bc1b623e936d39a952ceb5bea79e8b37228a8f595067bf1852efd3c34aa',
|
|
1432
1351
|
id: "0x93f3f4499bf89f2d05ddc1f8b15f51701a7c6c4d0ac0b9c3bc99462cbbd8e321",
|
|
1433
|
-
rewardPoolId:
|
|
1434
|
-
// '0x6f3563644d3e2ef13176dbf9d865bd93479df60ccbe07b7e66db57f6309f5a66',
|
|
1435
|
-
"0x94cee1be7f5ff34193f3aabef0b14142cb28af4d905fe487a9a7d85a15edb6aa"
|
|
1436
|
-
)
|
|
1352
|
+
rewardPoolId: "0x94cee1be7f5ff34193f3aabef0b14142cb28af4d905fe487a9a7d85a15edb6aa"
|
|
1437
1353
|
},
|
|
1438
1354
|
svsui: {
|
|
1439
|
-
// id: '0x69ce8e537e750a95381e6040794afa5ab1758353a1a2e1de7760391b01f91670',
|
|
1440
1355
|
id: "0xa970e9087f80cb59e9299b8e7af7175d977ad6c9af0322aa4440e138fbd7ae00",
|
|
1441
|
-
rewardPoolId:
|
|
1442
|
-
// '0xbca914adce058ad0902c7f3cfcd698392a475f00dcfdc3f76001d0370b98777a',
|
|
1443
|
-
"0x38eee9699c4fc132a6623e54b865f047df4fc6eb83af807300f44e8f4b235ff0"
|
|
1444
|
-
)
|
|
1356
|
+
rewardPoolId: "0x38eee9699c4fc132a6623e54b865f047df4fc6eb83af807300f44e8f4b235ff0"
|
|
1445
1357
|
}
|
|
1446
1358
|
},
|
|
1447
1359
|
config: ""
|
|
1448
1360
|
},
|
|
1449
1361
|
borrowIncentive: {
|
|
1450
|
-
id: "
|
|
1362
|
+
id: "0x8fe05c796e779c71e7739dcaecefb8757ff9482f62e419dbd0dd9c35b740054f",
|
|
1451
1363
|
adminCap: "0x56ac8e6f2b360b2b35c0168d72cc6cd17d9592afb83709865cb87af24bb2025b",
|
|
1452
|
-
object: "
|
|
1453
|
-
query: "
|
|
1454
|
-
incentivePools: "
|
|
1455
|
-
incentiveAccounts: "
|
|
1456
|
-
config: "
|
|
1364
|
+
object: "0x8fe05c796e779c71e7739dcaecefb8757ff9482f62e419dbd0dd9c35b740054f",
|
|
1365
|
+
query: "0x5fba54ac5862f087112c54c02339623bd245721f5e21ea3330fc8c8afc8f51f4",
|
|
1366
|
+
incentivePools: "0xcace4f4736229043d9f897667d046370b8a4d6534bfd307787c40b4c9f42514a",
|
|
1367
|
+
incentiveAccounts: "0x41ff558f580ca0f711910fd6ef687fce9df76ee8e7fc5e150bdfae08e17fae62",
|
|
1368
|
+
config: "0x9636e7b947b806b9fe438d037f02bb24026c5b2691d2f6bad349c2e117f77cc3"
|
|
1457
1369
|
},
|
|
1458
1370
|
referral: {
|
|
1459
1371
|
id: "0x1bf5a8ce77050d8052549d743e16b469f15aa6b81b752b78b6ebb65179665f5a",
|
|
@@ -1465,8 +1377,6 @@ var TEST_ADDRESSES = {
|
|
|
1465
1377
|
revenueTableId: "0x595baa3654c297bff84ab7786a2d250f019cefc66e8df8e89fd9d41e02bd30dd",
|
|
1466
1378
|
referralTiers: "0x144350f3db9b46d11b140084cd54e6de0b9c3b8d265ce8059b51d0ef58ea464b",
|
|
1467
1379
|
tiersTableId: "0xeac755a7a8b7798530905ac79e8c114f19d0f130f6eab012954f08faac29c75d",
|
|
1468
|
-
// authorizedWitnessList:
|
|
1469
|
-
// '0xf21b0ed043c9bb70842c0129159f4943dbcc3c9ef2f2f808af65f8be25cfd20e',
|
|
1470
1380
|
authorizedWitnessList: "0x9d6223dc52015b8a3986a573590ef2af8f1b8f3e4685513888c052f001b87e7f",
|
|
1471
1381
|
version: "0x3545849eb97723e676a476ec9d4fe5f2eb0eb2c6b78972851114fd4c7ed4639f"
|
|
1472
1382
|
},
|
|
@@ -1486,19 +1396,19 @@ var TEST_ADDRESSES = {
|
|
|
1486
1396
|
userRewardTableId: "0x748a80395849ed37db1b0e14f2ab5d1d96458d2359ab3a84eb079d0f4ac7cf2e"
|
|
1487
1397
|
},
|
|
1488
1398
|
scoin: {
|
|
1489
|
-
id: "
|
|
1399
|
+
id: "0x826a4934bee9487e558eed603cf42f30cdc4321d6f31083930791b95f903b9f9",
|
|
1490
1400
|
coins: {
|
|
1491
1401
|
ssui: {
|
|
1492
|
-
coinType: "
|
|
1493
|
-
treasury: "
|
|
1494
|
-
},
|
|
1495
|
-
scetus: {
|
|
1496
|
-
coinType: "0x8b71e6d323ed78515af2bead13bf3d0da1562ba4a99234eb7c4f14fd39ef0427::scallop_cetus::SCALLOP_CETUS",
|
|
1497
|
-
treasury: "0xd786f4b2d26278cc7911a3445b1b085eab60f269ef9dbb6b87e803d52f155003"
|
|
1402
|
+
coinType: "0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI",
|
|
1403
|
+
treasury: "0x03f1d94a40bd9f5d556bacb5c5245732b185572f6a29b36ad8b555d9a8a24f09"
|
|
1498
1404
|
},
|
|
1499
1405
|
ssca: {
|
|
1500
|
-
coinType: "
|
|
1501
|
-
treasury: "
|
|
1406
|
+
coinType: "0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA",
|
|
1407
|
+
treasury: "0x1b05d2cd8b20dba19da073a54195fc52d2f438ea19dea0713bae7a7dab308199"
|
|
1408
|
+
},
|
|
1409
|
+
susdc: {
|
|
1410
|
+
coinType: "0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC",
|
|
1411
|
+
treasury: "0x6ef82ef94472dcb8c2cdeac8df38874024c08570ca165986ba56d1e38fe0c0a3"
|
|
1502
1412
|
},
|
|
1503
1413
|
swusdc: {
|
|
1504
1414
|
coinType: "0xf5447c4305a486d8c8557559887c2c39449ddb5e748f15d33946d02a1663c158::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC",
|
|
@@ -1533,12 +1443,12 @@ var TEST_ADDRESSES = {
|
|
|
1533
1443
|
treasury: "0xdad9bc6293e694f67a5274ea51b596e0bdabfafc585ae6d7e82888e65f1a03e0"
|
|
1534
1444
|
},
|
|
1535
1445
|
sdeep: {
|
|
1536
|
-
coinType: "
|
|
1537
|
-
treasury: "
|
|
1446
|
+
coinType: "0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP",
|
|
1447
|
+
treasury: "0x71d41465cf2d16fa0206126526bebdf65c8871d1fcfbd0c2237db2306afd67ba"
|
|
1538
1448
|
},
|
|
1539
1449
|
sfud: {
|
|
1540
|
-
coinType: "
|
|
1541
|
-
treasury: "
|
|
1450
|
+
coinType: "0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD",
|
|
1451
|
+
treasury: "0x858c492d51425b922c040c1a389e185b3b00d565e7d72ead1a81dc733104660d"
|
|
1542
1452
|
}
|
|
1543
1453
|
}
|
|
1544
1454
|
}
|
|
@@ -1551,6 +1461,31 @@ var MAX_LOCK_DURATION = MAX_LOCK_ROUNDS * UNLOCK_ROUND_DURATION;
|
|
|
1551
1461
|
var MIN_INITIAL_LOCK_AMOUNT = 1e10;
|
|
1552
1462
|
var MIN_TOP_UP_AMOUNT = 1e9;
|
|
1553
1463
|
|
|
1464
|
+
// src/constants/xoracle.ts
|
|
1465
|
+
var xOracleList = {
|
|
1466
|
+
// @TODO: Update to real oracle list
|
|
1467
|
+
usdc: { primary: ["pyth"], secondary: [] },
|
|
1468
|
+
sbeth: { primary: [], secondary: [] },
|
|
1469
|
+
sbusdt: { primary: [], secondary: [] },
|
|
1470
|
+
sbwbtc: { primary: [], secondary: [] },
|
|
1471
|
+
weth: { primary: [], secondary: [] },
|
|
1472
|
+
wbtc: { primary: [], secondary: [] },
|
|
1473
|
+
wusdc: { primary: [], secondary: [] },
|
|
1474
|
+
wusdt: { primary: [], secondary: [] },
|
|
1475
|
+
sui: { primary: ["pyth"], secondary: [] },
|
|
1476
|
+
wapt: { primary: [], secondary: [] },
|
|
1477
|
+
wsol: { primary: [], secondary: [] },
|
|
1478
|
+
cetus: { primary: [], secondary: [] },
|
|
1479
|
+
afsui: { primary: [], secondary: [] },
|
|
1480
|
+
hasui: { primary: [], secondary: [] },
|
|
1481
|
+
vsui: { primary: [], secondary: [] },
|
|
1482
|
+
sca: { primary: ["pyth"], secondary: [] },
|
|
1483
|
+
fud: { primary: ["pyth"], secondary: [] },
|
|
1484
|
+
deep: { primary: ["pyth"], secondary: [] },
|
|
1485
|
+
fdusd: { primary: [], secondary: [] },
|
|
1486
|
+
blub: { primary: [], secondary: [] }
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1554
1489
|
// src/models/scallopCache.ts
|
|
1555
1490
|
var import_query_core = require("@tanstack/query-core");
|
|
1556
1491
|
var import_sui_kit2 = require("@scallop-io/sui-kit");
|
|
@@ -3122,7 +3057,7 @@ var parseDataFromPythPriceFeed = (feed, address) => {
|
|
|
3122
3057
|
publishTime: Number(feed.price.publishTime) * 10 ** 3
|
|
3123
3058
|
};
|
|
3124
3059
|
} else {
|
|
3125
|
-
throw new Error(
|
|
3060
|
+
throw new Error(`Invalid feed id: ${feed.id}`);
|
|
3126
3061
|
}
|
|
3127
3062
|
};
|
|
3128
3063
|
var findClosestUnlockRound = (unlockAtInSecondTimestamp) => {
|
|
@@ -4111,7 +4046,7 @@ var getObligations = async ({
|
|
|
4111
4046
|
address
|
|
4112
4047
|
}, ownerAddress) => {
|
|
4113
4048
|
const owner = ownerAddress;
|
|
4114
|
-
const protocolObjectId = address.get("core.object")
|
|
4049
|
+
const protocolObjectId = address.get("core.object") || PROTOCOL_OBJECT_ID;
|
|
4115
4050
|
const keyObjectsResponse = [];
|
|
4116
4051
|
let hasNextPage = false;
|
|
4117
4052
|
let nextCursor = null;
|
|
@@ -4172,10 +4107,19 @@ var getObligationLocked = async (cache, obligation) => {
|
|
|
4172
4107
|
};
|
|
4173
4108
|
var queryObligation = async ({
|
|
4174
4109
|
address
|
|
4175
|
-
}, obligationId) => {
|
|
4110
|
+
}, obligationId, version = address.get("core.version"), market = address.get("core.market")) => {
|
|
4176
4111
|
const packageId = address.get("core.packages.query.id");
|
|
4177
4112
|
const queryTarget = `${packageId}::obligation_query::obligation_data`;
|
|
4178
|
-
const args = [
|
|
4113
|
+
const args = [
|
|
4114
|
+
version,
|
|
4115
|
+
market,
|
|
4116
|
+
obligationId,
|
|
4117
|
+
{
|
|
4118
|
+
objectId: import_utils5.SUI_CLOCK_OBJECT_ID,
|
|
4119
|
+
mutable: false,
|
|
4120
|
+
initialSharedVersion: "1"
|
|
4121
|
+
}
|
|
4122
|
+
];
|
|
4179
4123
|
const queryResult = await address.cache.queryInspectTxn(
|
|
4180
4124
|
{ queryTarget, args }
|
|
4181
4125
|
// txBlock
|
|
@@ -5129,9 +5073,9 @@ var getPythPrices = async ({
|
|
|
5129
5073
|
{}
|
|
5130
5074
|
);
|
|
5131
5075
|
};
|
|
5132
|
-
var getAllCoinPrices = async (query, marketPools, coinPrices) => {
|
|
5133
|
-
coinPrices = coinPrices ?? await query.utils.getCoinPrices();
|
|
5134
|
-
marketPools = marketPools ?? (await query.getMarketPools(void 0, { coinPrices })).pools;
|
|
5076
|
+
var getAllCoinPrices = async (query, marketPools, coinPrices, indexer = false) => {
|
|
5077
|
+
coinPrices = coinPrices ?? (indexer ? await query.getCoinPricesByIndexer() : await query.utils.getCoinPrices());
|
|
5078
|
+
marketPools = marketPools ?? (await query.getMarketPools(void 0, { coinPrices, indexer })).pools;
|
|
5135
5079
|
if (!marketPools) {
|
|
5136
5080
|
throw new Error(`Failed to fetch market pool for getAllCoinPrices`);
|
|
5137
5081
|
}
|
|
@@ -5712,25 +5656,15 @@ var getTotalVeScaTreasuryAmount = async (utils, veScaTreasury) => {
|
|
|
5712
5656
|
const veScaConfig = utils.address.get("vesca.config");
|
|
5713
5657
|
veScaTreasury = veScaTreasury ?? utils.address.get("vesca.treasury");
|
|
5714
5658
|
const txb = new import_sui_kit4.SuiTxBlock();
|
|
5659
|
+
const clockObjectRef = txb.sharedObjectRef({
|
|
5660
|
+
objectId: import_sui_kit4.SUI_CLOCK_OBJECT_ID,
|
|
5661
|
+
mutable: false,
|
|
5662
|
+
initialSharedVersion: "1"
|
|
5663
|
+
});
|
|
5715
5664
|
const refreshQueryTarget = `${veScaPkgId}::treasury::refresh`;
|
|
5716
|
-
const refreshArgs = [
|
|
5717
|
-
veScaConfig,
|
|
5718
|
-
veScaTreasury,
|
|
5719
|
-
txb.sharedObjectRef({
|
|
5720
|
-
objectId: import_sui_kit4.SUI_CLOCK_OBJECT_ID,
|
|
5721
|
-
mutable: false,
|
|
5722
|
-
initialSharedVersion: "1"
|
|
5723
|
-
})
|
|
5724
|
-
];
|
|
5665
|
+
const refreshArgs = [veScaConfig, veScaTreasury, clockObjectRef];
|
|
5725
5666
|
const veScaAmountQueryTarget = `${veScaPkgId}::treasury::total_ve_sca_amount`;
|
|
5726
|
-
const veScaAmountArgs = [
|
|
5727
|
-
veScaTreasury,
|
|
5728
|
-
txb.sharedObjectRef({
|
|
5729
|
-
objectId: import_sui_kit4.SUI_CLOCK_OBJECT_ID,
|
|
5730
|
-
mutable: false,
|
|
5731
|
-
initialSharedVersion: "1"
|
|
5732
|
-
})
|
|
5733
|
-
];
|
|
5667
|
+
const veScaAmountArgs = [veScaTreasury, clockObjectRef];
|
|
5734
5668
|
const resolvedRefreshArgs = await Promise.all(
|
|
5735
5669
|
refreshArgs.map(async (arg) => {
|
|
5736
5670
|
if (typeof arg === "string") {
|
|
@@ -5794,14 +5728,14 @@ var getVeScaTreasuryInfo = async (utils) => {
|
|
|
5794
5728
|
};
|
|
5795
5729
|
|
|
5796
5730
|
// src/queries/poolAddressesQuery.ts
|
|
5797
|
-
var getAllAddresses = async (query) => {
|
|
5731
|
+
var getAllAddresses = async (query, pools = [...SUPPORT_POOLS]) => {
|
|
5798
5732
|
const results = {};
|
|
5799
5733
|
const marketId = query.address.get("core.market");
|
|
5800
5734
|
const marketObject = (await query.cache.queryGetObject(marketId))?.data;
|
|
5801
5735
|
if (!(marketObject && marketObject.content?.dataType === "moveObject"))
|
|
5802
5736
|
throw new Error(`Failed to fetch marketObject`);
|
|
5803
5737
|
const fields = marketObject.content.fields;
|
|
5804
|
-
const coinTypesPairs =
|
|
5738
|
+
const coinTypesPairs = pools.reduce(
|
|
5805
5739
|
(acc, pool) => {
|
|
5806
5740
|
acc.push([pool, query.utils.parseCoinType(pool).substring(2)]);
|
|
5807
5741
|
return acc;
|
|
@@ -5919,6 +5853,78 @@ var getAllAddresses = async (query) => {
|
|
|
5919
5853
|
return results;
|
|
5920
5854
|
};
|
|
5921
5855
|
|
|
5856
|
+
// src/queries/xOracleQuery.ts
|
|
5857
|
+
var PRIMARY_PRICE_UPDATE_POLICY = "0xbcd908d0ee6d63d726e61676f3feeec3d19817f4849bbecf372dd3399f247f6b";
|
|
5858
|
+
var SECONDARY_PRICE_UPDDATE_POLICY = "0x624a6f120777bb30e718b86e836c205ef4229448052377dc3d78272a6662b2c0";
|
|
5859
|
+
var getPriceUpdatePolicies = async (address) => {
|
|
5860
|
+
const priceUpdatePolicyRulesKeyType = `${address.get("core.packages.xOracle.object")}::price_update_policy::PriceUpdatePolicyRulesKey`;
|
|
5861
|
+
const [primaryPriceUpdatePolicyTable, secondaryPriceUpdatePolicyTable] = await Promise.all([
|
|
5862
|
+
address.cache.queryGetDynamicFieldObject({
|
|
5863
|
+
parentId: PRIMARY_PRICE_UPDATE_POLICY,
|
|
5864
|
+
name: {
|
|
5865
|
+
type: priceUpdatePolicyRulesKeyType,
|
|
5866
|
+
value: { dummy_field: false }
|
|
5867
|
+
}
|
|
5868
|
+
}),
|
|
5869
|
+
address.cache.queryGetDynamicFieldObject({
|
|
5870
|
+
parentId: SECONDARY_PRICE_UPDDATE_POLICY,
|
|
5871
|
+
name: {
|
|
5872
|
+
type: priceUpdatePolicyRulesKeyType,
|
|
5873
|
+
value: { dummy_field: false }
|
|
5874
|
+
}
|
|
5875
|
+
})
|
|
5876
|
+
]);
|
|
5877
|
+
return {
|
|
5878
|
+
primary: primaryPriceUpdatePolicyTable,
|
|
5879
|
+
secondary: secondaryPriceUpdatePolicyTable
|
|
5880
|
+
};
|
|
5881
|
+
};
|
|
5882
|
+
var PRIMARY_PRICE_UPDATE_POLICY_VECSET_ID = "0xfb1330aa028ed6a159b742c71b5a79b3b6824cf71efa40ea82b52486ad209264";
|
|
5883
|
+
var SECONDARY_PRICE_UPDATE_POLICY_VECSET_ID = "0x4b827acc73f3f53f808dd73a7ee0a60ae61e84322176bece72b26467030b467c";
|
|
5884
|
+
var getAssetOracles = async (utils, ruleType) => {
|
|
5885
|
+
const ruleTypeNameToOracleType = {
|
|
5886
|
+
[`${utils.address.get("core.packages.pyth.object")}::rule::Rule`]: "pyth",
|
|
5887
|
+
[`${utils.address.get("core.packages.supra.object")}::rule::Rule`]: "supra",
|
|
5888
|
+
[`${utils.address.get("core.packages.switchboard.object")}::rule::Rule`]: "switchboard"
|
|
5889
|
+
};
|
|
5890
|
+
const assetPrimaryOracles = {};
|
|
5891
|
+
let cursor = null;
|
|
5892
|
+
do {
|
|
5893
|
+
const response = await utils.cache.queryGetDynamicFields({
|
|
5894
|
+
parentId: ruleType === "primary" ? PRIMARY_PRICE_UPDATE_POLICY_VECSET_ID : SECONDARY_PRICE_UPDATE_POLICY_VECSET_ID,
|
|
5895
|
+
cursor,
|
|
5896
|
+
limit: 10
|
|
5897
|
+
});
|
|
5898
|
+
if (!response)
|
|
5899
|
+
break;
|
|
5900
|
+
const { data, hasNextPage, nextCursor } = response;
|
|
5901
|
+
cursor = nextCursor;
|
|
5902
|
+
const objectIds = data.map((dynamicField) => dynamicField.objectId);
|
|
5903
|
+
const objectResponses = await utils.cache.queryGetObjects(objectIds);
|
|
5904
|
+
objectResponses.forEach((object) => {
|
|
5905
|
+
if (!object.content || object.content.dataType !== "moveObject")
|
|
5906
|
+
return;
|
|
5907
|
+
const fields = object.content.fields;
|
|
5908
|
+
const typeName = fields.name.fields.name;
|
|
5909
|
+
const assetName = utils.parseCoinNameFromType(`0x${typeName}`);
|
|
5910
|
+
if (!assetName)
|
|
5911
|
+
throw new Error(`Invalid asset name: ${assetName}`);
|
|
5912
|
+
if (!assetPrimaryOracles[assetName]) {
|
|
5913
|
+
assetPrimaryOracles[assetName] = [];
|
|
5914
|
+
}
|
|
5915
|
+
const value = fields.value;
|
|
5916
|
+
value.fields.contents.forEach((content) => {
|
|
5917
|
+
assetPrimaryOracles[assetName].push(
|
|
5918
|
+
ruleTypeNameToOracleType[`0x${content.fields.name}`]
|
|
5919
|
+
);
|
|
5920
|
+
});
|
|
5921
|
+
});
|
|
5922
|
+
if (!hasNextPage)
|
|
5923
|
+
break;
|
|
5924
|
+
} while (cursor);
|
|
5925
|
+
return assetPrimaryOracles;
|
|
5926
|
+
};
|
|
5927
|
+
|
|
5922
5928
|
// src/models/scallopUtils.ts
|
|
5923
5929
|
var ScallopUtils = class {
|
|
5924
5930
|
constructor(params, instance) {
|
|
@@ -6110,7 +6116,7 @@ var ScallopUtils = class {
|
|
|
6110
6116
|
* @return Market coin type.
|
|
6111
6117
|
*/
|
|
6112
6118
|
parseMarketCoinType(coinName) {
|
|
6113
|
-
const protocolObjectId = this.address.get("core.object")
|
|
6119
|
+
const protocolObjectId = this.address.get("core.object") || PROTOCOL_OBJECT_ID;
|
|
6114
6120
|
const coinType = this.parseCoinType(coinName, true);
|
|
6115
6121
|
return `${protocolObjectId}::reserve::MarketCoin<${coinType}>`;
|
|
6116
6122
|
}
|
|
@@ -6407,13 +6413,19 @@ var import_sui_kit5 = require("@scallop-io/sui-kit");
|
|
|
6407
6413
|
// src/builders/oracle.ts
|
|
6408
6414
|
var import_utils12 = require("@mysten/sui/utils");
|
|
6409
6415
|
var import_pyth_sui_js2 = require("@pythnetwork/pyth-sui-js");
|
|
6410
|
-
var updateOracles = async (builder, txBlock, assetCoinNames
|
|
6416
|
+
var updateOracles = async (builder, txBlock, assetCoinNames = [
|
|
6417
|
+
.../* @__PURE__ */ new Set([...SUPPORT_POOLS, ...SUPPORT_COLLATERALS])
|
|
6418
|
+
], options = { usePythPullModel: true }) => {
|
|
6411
6419
|
const usePythPullModel = builder.params.usePythPullModel ?? options.usePythPullModel;
|
|
6412
|
-
|
|
6413
|
-
|
|
6420
|
+
const flattenedRules = [
|
|
6421
|
+
...new Set(
|
|
6422
|
+
Object.values(xOracleList).flatMap(({ primary, secondary }) => [
|
|
6423
|
+
...primary,
|
|
6424
|
+
...secondary
|
|
6425
|
+
])
|
|
6426
|
+
)
|
|
6414
6427
|
];
|
|
6415
|
-
|
|
6416
|
-
if (usePythPullModel && rules.includes("pyth")) {
|
|
6428
|
+
if (flattenedRules.includes("pyth") && usePythPullModel) {
|
|
6417
6429
|
const pythClient = new import_pyth_sui_js2.SuiPythClient(
|
|
6418
6430
|
builder.suiKit.client(),
|
|
6419
6431
|
builder.address.get("core.oracles.pyth.state"),
|
|
@@ -6443,7 +6455,12 @@ var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePyth
|
|
|
6443
6455
|
}
|
|
6444
6456
|
const updateAssetCoinNames = [...new Set(assetCoinNames)];
|
|
6445
6457
|
for (const assetCoinName of updateAssetCoinNames) {
|
|
6446
|
-
await updateOracle(
|
|
6458
|
+
await updateOracle(
|
|
6459
|
+
builder,
|
|
6460
|
+
txBlock,
|
|
6461
|
+
assetCoinName,
|
|
6462
|
+
xOracleList[assetCoinName]
|
|
6463
|
+
);
|
|
6447
6464
|
}
|
|
6448
6465
|
};
|
|
6449
6466
|
var updateOracle = async (builder, txBlock, assetCoinName, rules) => {
|
|
@@ -6473,37 +6490,42 @@ var updatePrice = (txBlock, rules, xOraclePackageId, xOracleId, pythPackageId, p
|
|
|
6473
6490
|
xOracleId,
|
|
6474
6491
|
coinType
|
|
6475
6492
|
);
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6493
|
+
Object.entries(rules).forEach(([type, rule]) => {
|
|
6494
|
+
if (rule.includes("pyth")) {
|
|
6495
|
+
updatePythPrice(
|
|
6496
|
+
type,
|
|
6497
|
+
txBlock,
|
|
6498
|
+
pythPackageId,
|
|
6499
|
+
request,
|
|
6500
|
+
pythStateId,
|
|
6501
|
+
pythFeedObjectId,
|
|
6502
|
+
pythRegistryId,
|
|
6503
|
+
coinType
|
|
6504
|
+
);
|
|
6505
|
+
}
|
|
6506
|
+
if (rule.includes("supra")) {
|
|
6507
|
+
updateSupraPrice(
|
|
6508
|
+
type,
|
|
6509
|
+
txBlock,
|
|
6510
|
+
supraPackageId,
|
|
6511
|
+
request,
|
|
6512
|
+
supraHolderId,
|
|
6513
|
+
supraRegistryId,
|
|
6514
|
+
coinType
|
|
6515
|
+
);
|
|
6516
|
+
}
|
|
6517
|
+
if (rule.includes("switchboard")) {
|
|
6518
|
+
updateSwitchboardPrice(
|
|
6519
|
+
type,
|
|
6520
|
+
txBlock,
|
|
6521
|
+
switchboardPackageId,
|
|
6522
|
+
request,
|
|
6523
|
+
switchboardAggregatorId,
|
|
6524
|
+
switchboardRegistryId,
|
|
6525
|
+
coinType
|
|
6526
|
+
);
|
|
6527
|
+
}
|
|
6528
|
+
});
|
|
6507
6529
|
confirmPriceUpdateRequest(
|
|
6508
6530
|
txBlock,
|
|
6509
6531
|
xOraclePackageId,
|
|
@@ -6536,41 +6558,41 @@ var confirmPriceUpdateRequest = (txBlock, packageId, xOracleId, request, coinTyp
|
|
|
6536
6558
|
);
|
|
6537
6559
|
return txBlock;
|
|
6538
6560
|
};
|
|
6539
|
-
var updateSupraPrice = (txBlock, packageId, request, holderId, registryId, coinType) => {
|
|
6561
|
+
var updateSupraPrice = (type, txBlock, packageId, request, holderId, registryId, coinType) => {
|
|
6540
6562
|
txBlock.moveCall(
|
|
6541
|
-
`${packageId}::rule::
|
|
6563
|
+
`${packageId}::rule::set_price_as_${type}`,
|
|
6542
6564
|
[
|
|
6543
6565
|
request,
|
|
6544
6566
|
holderId,
|
|
6545
6567
|
registryId,
|
|
6546
6568
|
txBlock.sharedObjectRef({
|
|
6547
6569
|
objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
|
|
6548
|
-
|
|
6549
|
-
|
|
6570
|
+
initialSharedVersion: "1",
|
|
6571
|
+
mutable: false
|
|
6550
6572
|
})
|
|
6551
6573
|
],
|
|
6552
6574
|
[coinType]
|
|
6553
6575
|
);
|
|
6554
6576
|
};
|
|
6555
|
-
var updateSwitchboardPrice = (txBlock, packageId, request, aggregatorId, registryId, coinType) => {
|
|
6577
|
+
var updateSwitchboardPrice = (type, txBlock, packageId, request, aggregatorId, registryId, coinType) => {
|
|
6556
6578
|
txBlock.moveCall(
|
|
6557
|
-
`${packageId}::rule::
|
|
6579
|
+
`${packageId}::rule::set_price_as_${type}`,
|
|
6558
6580
|
[
|
|
6559
6581
|
request,
|
|
6560
6582
|
aggregatorId,
|
|
6561
6583
|
registryId,
|
|
6562
6584
|
txBlock.sharedObjectRef({
|
|
6563
6585
|
objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
|
|
6564
|
-
|
|
6565
|
-
|
|
6586
|
+
initialSharedVersion: "1",
|
|
6587
|
+
mutable: false
|
|
6566
6588
|
})
|
|
6567
6589
|
],
|
|
6568
6590
|
[coinType]
|
|
6569
6591
|
);
|
|
6570
6592
|
};
|
|
6571
|
-
var updatePythPrice = (txBlock, packageId, request, stateId, feedObjectId, registryId, coinType) => {
|
|
6593
|
+
var updatePythPrice = (type, txBlock, packageId, request, stateId, feedObjectId, registryId, coinType) => {
|
|
6572
6594
|
txBlock.moveCall(
|
|
6573
|
-
`${packageId}::rule::
|
|
6595
|
+
`${packageId}::rule::set_price_as_${type}`,
|
|
6574
6596
|
[
|
|
6575
6597
|
request,
|
|
6576
6598
|
stateId,
|
|
@@ -6578,8 +6600,8 @@ var updatePythPrice = (txBlock, packageId, request, stateId, feedObjectId, regis
|
|
|
6578
6600
|
registryId,
|
|
6579
6601
|
txBlock.sharedObjectRef({
|
|
6580
6602
|
objectId: import_utils12.SUI_CLOCK_OBJECT_ID,
|
|
6581
|
-
|
|
6582
|
-
|
|
6603
|
+
initialSharedVersion: "1",
|
|
6604
|
+
mutable: false
|
|
6583
6605
|
})
|
|
6584
6606
|
],
|
|
6585
6607
|
[coinType]
|
|
@@ -6616,6 +6638,11 @@ var generateCoreNormalMethod = ({
|
|
|
6616
6638
|
};
|
|
6617
6639
|
const referralPkgId = builder.address.get("referral.id");
|
|
6618
6640
|
const referralWitnessType = `${referralPkgId}::scallop_referral_program::REFERRAL_WITNESS`;
|
|
6641
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
6642
|
+
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6643
|
+
mutable: false,
|
|
6644
|
+
initialSharedVersion: "1"
|
|
6645
|
+
});
|
|
6619
6646
|
return {
|
|
6620
6647
|
openObligation: () => {
|
|
6621
6648
|
const [obligation, obligationKey, obligationHotPotato] = builder.moveCall(
|
|
@@ -6661,11 +6688,7 @@ var generateCoreNormalMethod = ({
|
|
|
6661
6688
|
coreIds.coinDecimalsRegistry,
|
|
6662
6689
|
txBlock.pure.u64(amount),
|
|
6663
6690
|
coreIds.xOracle,
|
|
6664
|
-
|
|
6665
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6666
|
-
mutable: false,
|
|
6667
|
-
initialSharedVersion: "1"
|
|
6668
|
-
})
|
|
6691
|
+
clockObjectRef
|
|
6669
6692
|
],
|
|
6670
6693
|
[coinType]
|
|
6671
6694
|
);
|
|
@@ -6675,16 +6698,7 @@ var generateCoreNormalMethod = ({
|
|
|
6675
6698
|
return builder.moveCall(
|
|
6676
6699
|
txBlock,
|
|
6677
6700
|
`${coreIds.protocolPkg}::mint::mint`,
|
|
6678
|
-
[
|
|
6679
|
-
coreIds.version,
|
|
6680
|
-
coreIds.market,
|
|
6681
|
-
coin,
|
|
6682
|
-
txBlock.sharedObjectRef({
|
|
6683
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6684
|
-
mutable: false,
|
|
6685
|
-
initialSharedVersion: "1"
|
|
6686
|
-
})
|
|
6687
|
-
],
|
|
6701
|
+
[coreIds.version, coreIds.market, coin, clockObjectRef],
|
|
6688
6702
|
[coinType]
|
|
6689
6703
|
);
|
|
6690
6704
|
},
|
|
@@ -6693,16 +6707,7 @@ var generateCoreNormalMethod = ({
|
|
|
6693
6707
|
return builder.moveCall(
|
|
6694
6708
|
txBlock,
|
|
6695
6709
|
`${coreIds.protocolPkg}::mint::mint_entry`,
|
|
6696
|
-
[
|
|
6697
|
-
coreIds.version,
|
|
6698
|
-
coreIds.market,
|
|
6699
|
-
coin,
|
|
6700
|
-
txBlock.sharedObjectRef({
|
|
6701
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6702
|
-
mutable: false,
|
|
6703
|
-
initialSharedVersion: "1"
|
|
6704
|
-
})
|
|
6705
|
-
],
|
|
6710
|
+
[coreIds.version, coreIds.market, coin, clockObjectRef],
|
|
6706
6711
|
[coinType]
|
|
6707
6712
|
);
|
|
6708
6713
|
},
|
|
@@ -6711,16 +6716,7 @@ var generateCoreNormalMethod = ({
|
|
|
6711
6716
|
return builder.moveCall(
|
|
6712
6717
|
txBlock,
|
|
6713
6718
|
`${coreIds.protocolPkg}::redeem::redeem`,
|
|
6714
|
-
[
|
|
6715
|
-
coreIds.version,
|
|
6716
|
-
coreIds.market,
|
|
6717
|
-
marketCoin,
|
|
6718
|
-
txBlock.sharedObjectRef({
|
|
6719
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6720
|
-
mutable: false,
|
|
6721
|
-
initialSharedVersion: "1"
|
|
6722
|
-
})
|
|
6723
|
-
],
|
|
6719
|
+
[coreIds.version, coreIds.market, marketCoin, clockObjectRef],
|
|
6724
6720
|
[coinType]
|
|
6725
6721
|
);
|
|
6726
6722
|
},
|
|
@@ -6729,16 +6725,7 @@ var generateCoreNormalMethod = ({
|
|
|
6729
6725
|
return builder.moveCall(
|
|
6730
6726
|
txBlock,
|
|
6731
6727
|
`${coreIds.protocolPkg}::redeem::redeem_entry`,
|
|
6732
|
-
[
|
|
6733
|
-
coreIds.version,
|
|
6734
|
-
coreIds.market,
|
|
6735
|
-
marketCoin,
|
|
6736
|
-
txBlock.sharedObjectRef({
|
|
6737
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6738
|
-
mutable: false,
|
|
6739
|
-
initialSharedVersion: "1"
|
|
6740
|
-
})
|
|
6741
|
-
],
|
|
6728
|
+
[coreIds.version, coreIds.market, marketCoin, clockObjectRef],
|
|
6742
6729
|
[coinType]
|
|
6743
6730
|
);
|
|
6744
6731
|
},
|
|
@@ -6755,11 +6742,7 @@ var generateCoreNormalMethod = ({
|
|
|
6755
6742
|
coreIds.coinDecimalsRegistry,
|
|
6756
6743
|
amount,
|
|
6757
6744
|
coreIds.xOracle,
|
|
6758
|
-
|
|
6759
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6760
|
-
mutable: false,
|
|
6761
|
-
initialSharedVersion: "1"
|
|
6762
|
-
})
|
|
6745
|
+
clockObjectRef
|
|
6763
6746
|
],
|
|
6764
6747
|
[coinType]
|
|
6765
6748
|
);
|
|
@@ -6778,11 +6761,7 @@ var generateCoreNormalMethod = ({
|
|
|
6778
6761
|
borrowReferral,
|
|
6779
6762
|
typeof amount === "number" ? txBlock.pure.u64(amount) : amount,
|
|
6780
6763
|
coreIds.xOracle,
|
|
6781
|
-
|
|
6782
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6783
|
-
mutable: false,
|
|
6784
|
-
initialSharedVersion: "1"
|
|
6785
|
-
})
|
|
6764
|
+
clockObjectRef
|
|
6786
6765
|
],
|
|
6787
6766
|
[coinType, referralWitnessType]
|
|
6788
6767
|
);
|
|
@@ -6800,11 +6779,7 @@ var generateCoreNormalMethod = ({
|
|
|
6800
6779
|
coreIds.coinDecimalsRegistry,
|
|
6801
6780
|
txBlock.pure.u64(amount),
|
|
6802
6781
|
coreIds.xOracle,
|
|
6803
|
-
|
|
6804
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6805
|
-
mutable: false,
|
|
6806
|
-
initialSharedVersion: "1"
|
|
6807
|
-
})
|
|
6782
|
+
clockObjectRef
|
|
6808
6783
|
],
|
|
6809
6784
|
[coinType]
|
|
6810
6785
|
);
|
|
@@ -6814,17 +6789,7 @@ var generateCoreNormalMethod = ({
|
|
|
6814
6789
|
builder.moveCall(
|
|
6815
6790
|
txBlock,
|
|
6816
6791
|
`${coreIds.protocolPkg}::repay::repay`,
|
|
6817
|
-
[
|
|
6818
|
-
coreIds.version,
|
|
6819
|
-
obligation,
|
|
6820
|
-
coreIds.market,
|
|
6821
|
-
coin,
|
|
6822
|
-
txBlock.sharedObjectRef({
|
|
6823
|
-
objectId: import_utils13.SUI_CLOCK_OBJECT_ID,
|
|
6824
|
-
mutable: false,
|
|
6825
|
-
initialSharedVersion: "1"
|
|
6826
|
-
})
|
|
6827
|
-
],
|
|
6792
|
+
[coreIds.version, obligation, coreIds.market, coin, clockObjectRef],
|
|
6828
6793
|
[coinType]
|
|
6829
6794
|
);
|
|
6830
6795
|
},
|
|
@@ -6969,7 +6934,7 @@ var generateCoreQuickMethod = ({
|
|
|
6969
6934
|
) ?? [];
|
|
6970
6935
|
const updateCoinNames = [...obligationCoinNames, poolCoinName];
|
|
6971
6936
|
await updateOracles(builder, txBlock, updateCoinNames);
|
|
6972
|
-
return
|
|
6937
|
+
return txBlock.borrow(
|
|
6973
6938
|
obligationInfo.obligationId,
|
|
6974
6939
|
obligationInfo.obligationKey,
|
|
6975
6940
|
amount,
|
|
@@ -7107,6 +7072,11 @@ var generateSpoolNormalMethod = ({
|
|
|
7107
7072
|
const spoolIds = {
|
|
7108
7073
|
spoolPkg: builder.address.get("spool.id")
|
|
7109
7074
|
};
|
|
7075
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7076
|
+
objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
|
|
7077
|
+
mutable: false,
|
|
7078
|
+
initialSharedVersion: "1"
|
|
7079
|
+
});
|
|
7110
7080
|
return {
|
|
7111
7081
|
createStakeAccount: (stakeMarketCoinName) => {
|
|
7112
7082
|
const marketCoinType = builder.utils.parseMarketCoinType(stakeMarketCoinName);
|
|
@@ -7116,14 +7086,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7116
7086
|
return builder.moveCall(
|
|
7117
7087
|
txBlock,
|
|
7118
7088
|
`${spoolIds.spoolPkg}::user::new_spool_account`,
|
|
7119
|
-
[
|
|
7120
|
-
stakePoolId,
|
|
7121
|
-
txBlock.sharedObjectRef({
|
|
7122
|
-
objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
|
|
7123
|
-
mutable: false,
|
|
7124
|
-
initialSharedVersion: "1"
|
|
7125
|
-
})
|
|
7126
|
-
],
|
|
7089
|
+
[stakePoolId, clockObjectRef],
|
|
7127
7090
|
[marketCoinType]
|
|
7128
7091
|
);
|
|
7129
7092
|
},
|
|
@@ -7135,16 +7098,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7135
7098
|
builder.moveCall(
|
|
7136
7099
|
txBlock,
|
|
7137
7100
|
`${spoolIds.spoolPkg}::user::stake`,
|
|
7138
|
-
[
|
|
7139
|
-
stakePoolId,
|
|
7140
|
-
stakeAccount,
|
|
7141
|
-
coin,
|
|
7142
|
-
txBlock.sharedObjectRef({
|
|
7143
|
-
objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
|
|
7144
|
-
mutable: false,
|
|
7145
|
-
initialSharedVersion: "1"
|
|
7146
|
-
})
|
|
7147
|
-
],
|
|
7101
|
+
[stakePoolId, stakeAccount, coin, clockObjectRef],
|
|
7148
7102
|
[marketCoinType]
|
|
7149
7103
|
);
|
|
7150
7104
|
},
|
|
@@ -7156,16 +7110,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7156
7110
|
return builder.moveCall(
|
|
7157
7111
|
txBlock,
|
|
7158
7112
|
`${spoolIds.spoolPkg}::user::unstake`,
|
|
7159
|
-
[
|
|
7160
|
-
stakePoolId,
|
|
7161
|
-
stakeAccount,
|
|
7162
|
-
amount,
|
|
7163
|
-
txBlock.sharedObjectRef({
|
|
7164
|
-
objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
|
|
7165
|
-
mutable: false,
|
|
7166
|
-
initialSharedVersion: "1"
|
|
7167
|
-
})
|
|
7168
|
-
],
|
|
7113
|
+
[stakePoolId, stakeAccount, amount, clockObjectRef],
|
|
7169
7114
|
[marketCoinType]
|
|
7170
7115
|
);
|
|
7171
7116
|
},
|
|
@@ -7182,16 +7127,7 @@ var generateSpoolNormalMethod = ({
|
|
|
7182
7127
|
return builder.moveCall(
|
|
7183
7128
|
txBlock,
|
|
7184
7129
|
`${spoolIds.spoolPkg}::user::redeem_rewards`,
|
|
7185
|
-
[
|
|
7186
|
-
stakePoolId,
|
|
7187
|
-
rewardPoolId,
|
|
7188
|
-
stakeAccount,
|
|
7189
|
-
txBlock.sharedObjectRef({
|
|
7190
|
-
objectId: import_utils15.SUI_CLOCK_OBJECT_ID,
|
|
7191
|
-
mutable: false,
|
|
7192
|
-
initialSharedVersion: "1"
|
|
7193
|
-
})
|
|
7194
|
-
],
|
|
7130
|
+
[stakePoolId, rewardPoolId, stakeAccount, clockObjectRef],
|
|
7195
7131
|
[marketCoinType, rewardCoinType]
|
|
7196
7132
|
);
|
|
7197
7133
|
}
|
|
@@ -7366,6 +7302,11 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7366
7302
|
treasury: builder.address.get("vesca.treasury"),
|
|
7367
7303
|
config: builder.address.get("vesca.config")
|
|
7368
7304
|
};
|
|
7305
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7306
|
+
objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
|
|
7307
|
+
mutable: false,
|
|
7308
|
+
initialSharedVersion: "1"
|
|
7309
|
+
});
|
|
7369
7310
|
return {
|
|
7370
7311
|
stakeObligation: (obligationId, obligationKey) => {
|
|
7371
7312
|
builder.moveCall(
|
|
@@ -7378,11 +7319,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7378
7319
|
obligationKey,
|
|
7379
7320
|
obligationId,
|
|
7380
7321
|
borrowIncentiveIds.obligationAccessStore,
|
|
7381
|
-
|
|
7382
|
-
objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
|
|
7383
|
-
mutable: false,
|
|
7384
|
-
initialSharedVersion: "1"
|
|
7385
|
-
})
|
|
7322
|
+
clockObjectRef
|
|
7386
7323
|
]
|
|
7387
7324
|
);
|
|
7388
7325
|
},
|
|
@@ -7401,11 +7338,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7401
7338
|
veScaIds.treasury,
|
|
7402
7339
|
veScaIds.table,
|
|
7403
7340
|
veScaKey,
|
|
7404
|
-
|
|
7405
|
-
objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
|
|
7406
|
-
mutable: false,
|
|
7407
|
-
initialSharedVersion: "1"
|
|
7408
|
-
})
|
|
7341
|
+
clockObjectRef
|
|
7409
7342
|
],
|
|
7410
7343
|
[]
|
|
7411
7344
|
);
|
|
@@ -7420,11 +7353,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7420
7353
|
borrowIncentiveIds.incentiveAccounts,
|
|
7421
7354
|
obligationKey,
|
|
7422
7355
|
obligationId,
|
|
7423
|
-
|
|
7424
|
-
objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
|
|
7425
|
-
mutable: false,
|
|
7426
|
-
initialSharedVersion: "1"
|
|
7427
|
-
})
|
|
7356
|
+
clockObjectRef
|
|
7428
7357
|
]
|
|
7429
7358
|
);
|
|
7430
7359
|
},
|
|
@@ -7439,11 +7368,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7439
7368
|
borrowIncentiveIds.incentiveAccounts,
|
|
7440
7369
|
obligationKey,
|
|
7441
7370
|
obligationId,
|
|
7442
|
-
|
|
7443
|
-
objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
|
|
7444
|
-
mutable: false,
|
|
7445
|
-
initialSharedVersion: "1"
|
|
7446
|
-
})
|
|
7371
|
+
clockObjectRef
|
|
7447
7372
|
],
|
|
7448
7373
|
[rewardType]
|
|
7449
7374
|
);
|
|
@@ -7458,11 +7383,7 @@ var generateBorrowIncentiveNormalMethod = ({ builder, txBlock }) => {
|
|
|
7458
7383
|
borrowIncentiveIds.incentiveAccounts,
|
|
7459
7384
|
obligation,
|
|
7460
7385
|
veScaKey,
|
|
7461
|
-
|
|
7462
|
-
objectId: import_sui_kit7.SUI_CLOCK_OBJECT_ID,
|
|
7463
|
-
mutable: false,
|
|
7464
|
-
initialSharedVersion: "1"
|
|
7465
|
-
})
|
|
7386
|
+
clockObjectRef
|
|
7466
7387
|
]
|
|
7467
7388
|
);
|
|
7468
7389
|
}
|
|
@@ -7602,6 +7523,11 @@ var generateNormalVeScaMethod = ({
|
|
|
7602
7523
|
treasury: builder.address.get("vesca.treasury"),
|
|
7603
7524
|
config: builder.address.get("vesca.config")
|
|
7604
7525
|
};
|
|
7526
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7527
|
+
objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
|
|
7528
|
+
mutable: false,
|
|
7529
|
+
initialSharedVersion: "1"
|
|
7530
|
+
});
|
|
7605
7531
|
return {
|
|
7606
7532
|
lockSca: (scaCoin, unlockAtInSecondTimestamp) => {
|
|
7607
7533
|
return builder.moveCall(
|
|
@@ -7613,11 +7539,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7613
7539
|
veScaIds.treasury,
|
|
7614
7540
|
scaCoin,
|
|
7615
7541
|
unlockAtInSecondTimestamp,
|
|
7616
|
-
|
|
7617
|
-
objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
|
|
7618
|
-
mutable: false,
|
|
7619
|
-
initialSharedVersion: "1"
|
|
7620
|
-
})
|
|
7542
|
+
clockObjectRef
|
|
7621
7543
|
],
|
|
7622
7544
|
[]
|
|
7623
7545
|
);
|
|
@@ -7632,11 +7554,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7632
7554
|
veScaIds.table,
|
|
7633
7555
|
veScaIds.treasury,
|
|
7634
7556
|
newUnlockAtInSecondTimestamp,
|
|
7635
|
-
|
|
7636
|
-
objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
|
|
7637
|
-
mutable: false,
|
|
7638
|
-
initialSharedVersion: "1"
|
|
7639
|
-
})
|
|
7557
|
+
clockObjectRef
|
|
7640
7558
|
],
|
|
7641
7559
|
[]
|
|
7642
7560
|
);
|
|
@@ -7651,11 +7569,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7651
7569
|
veScaIds.table,
|
|
7652
7570
|
veScaIds.treasury,
|
|
7653
7571
|
scaCoin,
|
|
7654
|
-
|
|
7655
|
-
objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
|
|
7656
|
-
mutable: false,
|
|
7657
|
-
initialSharedVersion: "1"
|
|
7658
|
-
})
|
|
7572
|
+
clockObjectRef
|
|
7659
7573
|
],
|
|
7660
7574
|
[]
|
|
7661
7575
|
);
|
|
@@ -7671,11 +7585,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7671
7585
|
veScaIds.treasury,
|
|
7672
7586
|
scaCoin,
|
|
7673
7587
|
newUnlockAtInSecondTimestamp,
|
|
7674
|
-
|
|
7675
|
-
objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
|
|
7676
|
-
mutable: false,
|
|
7677
|
-
initialSharedVersion: "1"
|
|
7678
|
-
})
|
|
7588
|
+
clockObjectRef
|
|
7679
7589
|
],
|
|
7680
7590
|
[]
|
|
7681
7591
|
);
|
|
@@ -7689,11 +7599,7 @@ var generateNormalVeScaMethod = ({
|
|
|
7689
7599
|
veScaKey,
|
|
7690
7600
|
veScaIds.table,
|
|
7691
7601
|
veScaIds.treasury,
|
|
7692
|
-
|
|
7693
|
-
objectId: import_sui_kit8.SUI_CLOCK_OBJECT_ID,
|
|
7694
|
-
mutable: false,
|
|
7695
|
-
initialSharedVersion: "1"
|
|
7696
|
-
})
|
|
7602
|
+
clockObjectRef
|
|
7697
7603
|
],
|
|
7698
7604
|
[]
|
|
7699
7605
|
);
|
|
@@ -7838,7 +7744,7 @@ var generateQuickVeScaMethod = ({
|
|
|
7838
7744
|
const veSca = await requireVeSca(builder, txBlock, veScaKey);
|
|
7839
7745
|
checkVesca(veSca?.unlockAt);
|
|
7840
7746
|
if (veSca) {
|
|
7841
|
-
const sca =
|
|
7747
|
+
const sca = txBlock.redeemSca(veSca.keyId);
|
|
7842
7748
|
if (transferSca) {
|
|
7843
7749
|
txBlock.transferObjects([sca], sender);
|
|
7844
7750
|
return;
|
|
@@ -7893,6 +7799,11 @@ var generateReferralNormalMethod = ({
|
|
|
7893
7799
|
version: builder.address.get("referral.version")
|
|
7894
7800
|
};
|
|
7895
7801
|
const veScaTable = builder.address.get("vesca.table");
|
|
7802
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
7803
|
+
objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
|
|
7804
|
+
mutable: false,
|
|
7805
|
+
initialSharedVersion: "1"
|
|
7806
|
+
});
|
|
7896
7807
|
return {
|
|
7897
7808
|
bindToReferral: (veScaKeyId) => {
|
|
7898
7809
|
builder.moveCall(
|
|
@@ -7902,11 +7813,7 @@ var generateReferralNormalMethod = ({
|
|
|
7902
7813
|
referralIds.referralBindings,
|
|
7903
7814
|
txBlock.pure.id(veScaKeyId),
|
|
7904
7815
|
veScaTable,
|
|
7905
|
-
|
|
7906
|
-
objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
|
|
7907
|
-
mutable: false,
|
|
7908
|
-
initialSharedVersion: "1"
|
|
7909
|
-
})
|
|
7816
|
+
clockObjectRef
|
|
7910
7817
|
],
|
|
7911
7818
|
[]
|
|
7912
7819
|
);
|
|
@@ -7922,11 +7829,7 @@ var generateReferralNormalMethod = ({
|
|
|
7922
7829
|
referralIds.referralBindings,
|
|
7923
7830
|
referralIds.authorizedWitnessList,
|
|
7924
7831
|
referralIds.referralTiers,
|
|
7925
|
-
|
|
7926
|
-
objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
|
|
7927
|
-
mutable: false,
|
|
7928
|
-
initialSharedVersion: "1"
|
|
7929
|
-
})
|
|
7832
|
+
clockObjectRef
|
|
7930
7833
|
],
|
|
7931
7834
|
[coinType]
|
|
7932
7835
|
);
|
|
@@ -7940,11 +7843,7 @@ var generateReferralNormalMethod = ({
|
|
|
7940
7843
|
referralIds.version,
|
|
7941
7844
|
ticket,
|
|
7942
7845
|
referralIds.referralRevenuePool,
|
|
7943
|
-
|
|
7944
|
-
objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
|
|
7945
|
-
mutable: false,
|
|
7946
|
-
initialSharedVersion: "1"
|
|
7947
|
-
})
|
|
7846
|
+
clockObjectRef
|
|
7948
7847
|
],
|
|
7949
7848
|
[coinType]
|
|
7950
7849
|
);
|
|
@@ -7958,11 +7857,7 @@ var generateReferralNormalMethod = ({
|
|
|
7958
7857
|
referralIds.version,
|
|
7959
7858
|
referralIds.referralRevenuePool,
|
|
7960
7859
|
veScaKey,
|
|
7961
|
-
|
|
7962
|
-
objectId: import_sui_kit9.SUI_CLOCK_OBJECT_ID,
|
|
7963
|
-
mutable: false,
|
|
7964
|
-
initialSharedVersion: "1"
|
|
7965
|
-
})
|
|
7860
|
+
clockObjectRef
|
|
7966
7861
|
],
|
|
7967
7862
|
[coinType]
|
|
7968
7863
|
);
|
|
@@ -8403,6 +8298,16 @@ var ScallopIndexer = class {
|
|
|
8403
8298
|
async getCoinPrice(poolCoinName) {
|
|
8404
8299
|
return (await this.getMarketPool(poolCoinName))?.coinPrice ?? 0;
|
|
8405
8300
|
}
|
|
8301
|
+
async getCoinPrices() {
|
|
8302
|
+
const marketPools = await this.getMarketPools();
|
|
8303
|
+
return Object.entries(marketPools).reduce(
|
|
8304
|
+
(prev, [coinName, market]) => {
|
|
8305
|
+
prev[coinName] = market.coinPrice;
|
|
8306
|
+
return prev;
|
|
8307
|
+
},
|
|
8308
|
+
{}
|
|
8309
|
+
);
|
|
8310
|
+
}
|
|
8406
8311
|
};
|
|
8407
8312
|
|
|
8408
8313
|
// src/models/scallopQuery.ts
|
|
@@ -8561,8 +8466,8 @@ var ScallopQuery = class {
|
|
|
8561
8466
|
* @param obligationId - The obligation id.
|
|
8562
8467
|
* @return Obligation data.
|
|
8563
8468
|
*/
|
|
8564
|
-
async queryObligation(obligationId) {
|
|
8565
|
-
return queryObligation(this, obligationId);
|
|
8469
|
+
async queryObligation(obligationId, args) {
|
|
8470
|
+
return queryObligation(this, obligationId, args?.version, args?.market);
|
|
8566
8471
|
}
|
|
8567
8472
|
/**
|
|
8568
8473
|
* Get all asset coin amounts.
|
|
@@ -8980,19 +8885,31 @@ var ScallopQuery = class {
|
|
|
8980
8885
|
async getCoinPriceByIndexer(poolName) {
|
|
8981
8886
|
return this.indexer.getCoinPrice(poolName);
|
|
8982
8887
|
}
|
|
8888
|
+
/**
|
|
8889
|
+
* Get all supported pool price from indexer
|
|
8890
|
+
* @returns prices data
|
|
8891
|
+
*/
|
|
8892
|
+
async getCoinPricesByIndexer() {
|
|
8893
|
+
return this.indexer.getCoinPrices();
|
|
8894
|
+
}
|
|
8983
8895
|
/**
|
|
8984
8896
|
* Get all coin prices, including sCoin
|
|
8985
8897
|
* @returns prices data
|
|
8986
8898
|
*/
|
|
8987
8899
|
async getAllCoinPrices(args) {
|
|
8988
|
-
return getAllCoinPrices(
|
|
8900
|
+
return getAllCoinPrices(
|
|
8901
|
+
this,
|
|
8902
|
+
args?.marketPools,
|
|
8903
|
+
args?.coinPrices,
|
|
8904
|
+
args?.indexer
|
|
8905
|
+
);
|
|
8989
8906
|
}
|
|
8990
8907
|
/**
|
|
8991
8908
|
* Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
|
|
8992
8909
|
* @returns
|
|
8993
8910
|
*/
|
|
8994
|
-
async getPoolAddresses() {
|
|
8995
|
-
return getAllAddresses(this);
|
|
8911
|
+
async getPoolAddresses(poolNames) {
|
|
8912
|
+
return getAllAddresses(this, poolNames);
|
|
8996
8913
|
}
|
|
8997
8914
|
/**
|
|
8998
8915
|
* Get user portfolio
|
|
@@ -9004,6 +8921,33 @@ var ScallopQuery = class {
|
|
|
9004
8921
|
args?.indexer ?? false
|
|
9005
8922
|
);
|
|
9006
8923
|
}
|
|
8924
|
+
/**
|
|
8925
|
+
* Get both primary and secondary price update policy objects
|
|
8926
|
+
* @returns price update policies
|
|
8927
|
+
*/
|
|
8928
|
+
async getPriceUpdatePolicies() {
|
|
8929
|
+
return await getPriceUpdatePolicies(this.address);
|
|
8930
|
+
}
|
|
8931
|
+
/**
|
|
8932
|
+
* Return the supported primary and secondary oracles for all supported pool assets
|
|
8933
|
+
* @returns
|
|
8934
|
+
*/
|
|
8935
|
+
async getAssetOracles() {
|
|
8936
|
+
const [primary, secondary] = await Promise.all([
|
|
8937
|
+
getAssetOracles(this.utils, "primary"),
|
|
8938
|
+
getAssetOracles(this.utils, "secondary")
|
|
8939
|
+
]);
|
|
8940
|
+
return SUPPORT_POOLS.reduce(
|
|
8941
|
+
(acc, pool) => {
|
|
8942
|
+
acc[pool] = {
|
|
8943
|
+
primary: primary[pool] ?? [],
|
|
8944
|
+
secondary: secondary[pool] ?? []
|
|
8945
|
+
};
|
|
8946
|
+
return acc;
|
|
8947
|
+
},
|
|
8948
|
+
{}
|
|
8949
|
+
);
|
|
8950
|
+
}
|
|
9007
8951
|
};
|
|
9008
8952
|
|
|
9009
8953
|
// src/models/scallopBuilder.ts
|
|
@@ -10016,6 +9960,7 @@ var Scallop = class {
|
|
|
10016
9960
|
stakeMarketCoins,
|
|
10017
9961
|
suiBridgeCoins,
|
|
10018
9962
|
voloCoinIds,
|
|
10019
|
-
wormholeCoinIds
|
|
9963
|
+
wormholeCoinIds,
|
|
9964
|
+
xOracleList
|
|
10020
9965
|
});
|
|
10021
9966
|
//# sourceMappingURL=index.js.map
|