@scallop-io/sui-scallop-sdk 3.0.2 → 4.1.0

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.
Files changed (283) hide show
  1. package/dist/Logger-Cg2iFdpH.d.ts +8 -0
  2. package/dist/builder.cjs +22 -0
  3. package/dist/builder.d.cts +28 -0
  4. package/dist/builder.d.ts +28 -0
  5. package/dist/builder.js +4 -0
  6. package/dist/chunk-33AK5RWM.js +15 -0
  7. package/dist/chunk-6UQ4NWEU.js +3 -0
  8. package/dist/chunk-DIC6P5HB.js +11 -0
  9. package/dist/chunk-S34VOEZN.js +3 -0
  10. package/dist/chunk-VTGQACWU.js +6 -0
  11. package/dist/client.cjs +21 -0
  12. package/dist/client.d.cts +401 -0
  13. package/dist/client.d.ts +401 -0
  14. package/dist/client.js +5 -0
  15. package/dist/errors.cjs +10 -0
  16. package/dist/errors.d.cts +32 -0
  17. package/dist/errors.d.ts +32 -0
  18. package/dist/errors.js +1 -0
  19. package/dist/index.cjs +51 -34
  20. package/dist/index.d.cts +130 -3145
  21. package/dist/index.d.ts +130 -3145
  22. package/dist/index.js +8 -12
  23. package/dist/logger.cjs +6 -0
  24. package/dist/logger.d.cts +7 -0
  25. package/dist/logger.d.ts +7 -0
  26. package/dist/logger.js +1 -0
  27. package/dist/query-DkitepDi.d.ts +3305 -0
  28. package/dist/query.cjs +19 -0
  29. package/dist/query.d.cts +9 -0
  30. package/dist/query.d.ts +9 -0
  31. package/dist/query.js +3 -0
  32. package/dist/types.cjs +2 -0
  33. package/dist/types.d.cts +90 -0
  34. package/dist/types.d.ts +90 -0
  35. package/dist/types.js +1 -0
  36. package/package.json +98 -56
  37. package/src/constants/api.ts +2 -0
  38. package/src/constants/coinType.ts +2 -0
  39. package/src/constants/common.ts +0 -7
  40. package/src/constants/index.ts +2 -0
  41. package/src/constants/queryKeys.ts +14 -7
  42. package/src/constants/testAddress.ts +1 -0
  43. package/src/datasources/api.ts +34 -0
  44. package/src/datasources/indexer.ts +8 -0
  45. package/src/datasources/onchain.ts +121 -0
  46. package/src/entries/builder.ts +5 -0
  47. package/src/entries/client.ts +3 -0
  48. package/src/entries/errors.ts +2 -0
  49. package/src/entries/index.ts +17 -0
  50. package/src/entries/logger.ts +2 -0
  51. package/src/entries/query.ts +6 -0
  52. package/src/entries/types.ts +2 -0
  53. package/src/errors/ScallopConfigError.ts +8 -0
  54. package/src/errors/ScallopError.ts +30 -0
  55. package/src/errors/ScallopIndexerError.ts +8 -0
  56. package/src/errors/ScallopParseError.ts +8 -0
  57. package/src/errors/ScallopRpcError.ts +8 -0
  58. package/src/errors/ScallopTransactionBuildError.ts +8 -0
  59. package/src/errors/index.ts +6 -0
  60. package/src/logger/Logger.ts +6 -0
  61. package/src/logger/consoleLogger.ts +13 -0
  62. package/src/logger/index.ts +3 -0
  63. package/src/logger/noopLogger.ts +8 -0
  64. package/src/mappers/index.ts +1 -0
  65. package/src/mappers/moveTypeMapper.ts +48 -0
  66. package/src/models/index.ts +8 -10
  67. package/src/models/interface.ts +9 -9
  68. package/src/models/scallop.ts +9 -16
  69. package/src/models/scallopAddress/const.ts +416 -0
  70. package/src/models/scallopAddress/index.ts +188 -0
  71. package/src/models/scallopAddress/types.ts +212 -0
  72. package/src/models/{scallopBuilder.ts → scallopBuilder/index.ts} +65 -29
  73. package/src/models/scallopBuilder/types.ts +37 -0
  74. package/src/models/{scallopClient.ts → scallopClient/index.ts} +157 -598
  75. package/src/models/scallopClient/types.ts +25 -0
  76. package/src/models/scallopConstants/config/AddressConfigSource.ts +13 -0
  77. package/src/models/scallopConstants/config/ConfigValidator.ts +70 -0
  78. package/src/models/scallopConstants/config/PoolAddressConfigSource.ts +12 -0
  79. package/src/models/scallopConstants/config/ScallopConfig.ts +80 -0
  80. package/src/models/scallopConstants/config/ScallopConfigSnapshot.ts +46 -0
  81. package/src/models/scallopConstants/config/WhitelistConfigSource.ts +16 -0
  82. package/src/models/scallopConstants/config/index.ts +6 -0
  83. package/src/models/scallopConstants/const.ts +19 -0
  84. package/src/models/scallopConstants/constantsSource.ts +98 -0
  85. package/src/models/scallopConstants/deriveConstants.ts +150 -0
  86. package/src/models/scallopConstants/index.ts +257 -0
  87. package/src/models/scallopConstants/loadConstantsState.ts +135 -0
  88. package/src/models/scallopConstants/types.ts +77 -0
  89. package/src/models/scallopConstants/utils.ts +69 -0
  90. package/src/models/scallopQuery/index.ts +1279 -0
  91. package/src/models/scallopQuery/types.ts +9 -0
  92. package/src/models/scallopQuery/utils.ts +13 -0
  93. package/src/models/scallopUtils/index.ts +505 -0
  94. package/src/models/scallopUtils/types.ts +30 -0
  95. package/src/models/transactionExecutor.ts +122 -0
  96. package/src/repositories/addressApi/helpers.ts +14 -0
  97. package/src/repositories/addressApi/index.ts +24 -0
  98. package/src/repositories/addressApi/schema.ts +0 -0
  99. package/src/repositories/addressApi/types.ts +177 -0
  100. package/src/repositories/base.ts +38 -0
  101. package/src/repositories/borrowIncentive/bcs.ts +11 -0
  102. package/src/repositories/borrowIncentive/helpers.ts +396 -0
  103. package/src/repositories/borrowIncentive/index.ts +52 -0
  104. package/src/{types/query/borrowIncentive.ts → repositories/borrowIncentive/types.ts} +69 -23
  105. package/src/repositories/borrowIncentive/utils.ts +234 -0
  106. package/src/repositories/cache.ts +4 -0
  107. package/src/repositories/coinBalance/helpers.ts +394 -0
  108. package/src/repositories/coinBalance/index.ts +69 -0
  109. package/src/repositories/coinBalance/types.ts +33 -0
  110. package/src/repositories/flashloan/const.ts +3 -0
  111. package/src/repositories/flashloan/helpers.ts +107 -0
  112. package/src/repositories/flashloan/index.ts +34 -0
  113. package/src/repositories/flashloan/types.ts +16 -0
  114. package/src/repositories/isolatedAssets/bcs.ts +4 -0
  115. package/src/repositories/isolatedAssets/const.ts +2 -0
  116. package/src/repositories/isolatedAssets/helpers.ts +91 -0
  117. package/src/repositories/isolatedAssets/index.ts +42 -0
  118. package/src/repositories/isolatedAssets/types.ts +35 -0
  119. package/src/repositories/loyaltyProgram/bcs.ts +7 -0
  120. package/src/repositories/loyaltyProgram/helpers.ts +117 -0
  121. package/src/repositories/loyaltyProgram/index.ts +28 -0
  122. package/src/repositories/loyaltyProgram/schema.ts +18 -0
  123. package/src/repositories/loyaltyProgram/types.ts +37 -0
  124. package/src/repositories/market/const.ts +6 -0
  125. package/src/repositories/market/helpers.ts +740 -0
  126. package/src/repositories/market/index.ts +137 -0
  127. package/src/repositories/market/mapper.ts +30 -0
  128. package/src/repositories/market/types.ts +443 -0
  129. package/src/repositories/market/utils.ts +285 -0
  130. package/src/repositories/obligation/helpers.ts +228 -0
  131. package/src/repositories/obligation/index.ts +51 -0
  132. package/src/repositories/obligation/types.ts +71 -0
  133. package/src/repositories/obligation/utils.ts +57 -0
  134. package/src/repositories/poolAddresses/const.ts +5 -0
  135. package/src/repositories/poolAddresses/helpers.ts +422 -0
  136. package/src/repositories/poolAddresses/index.ts +56 -0
  137. package/src/repositories/poolAddresses/schema.ts +34 -0
  138. package/src/repositories/poolAddresses/types.ts +69 -0
  139. package/src/repositories/price/const.ts +1 -0
  140. package/src/repositories/price/helpers.ts +237 -0
  141. package/src/repositories/price/index.ts +91 -0
  142. package/src/repositories/price/schema.ts +24 -0
  143. package/src/repositories/price/types.ts +56 -0
  144. package/src/repositories/price/utils.ts +21 -0
  145. package/src/repositories/referral/bcs.ts +3 -0
  146. package/src/repositories/referral/helper.ts +24 -0
  147. package/src/repositories/referral/index.ts +31 -0
  148. package/src/repositories/referral/types.ts +33 -0
  149. package/src/repositories/spool/const.ts +1 -0
  150. package/src/repositories/spool/helpers.ts +471 -0
  151. package/src/repositories/spool/index.ts +135 -0
  152. package/src/{types/query/spool.ts → repositories/spool/types.ts} +67 -2
  153. package/src/repositories/spool/utils.ts +215 -0
  154. package/src/repositories/types.ts +39 -0
  155. package/src/repositories/utils.ts +137 -0
  156. package/src/repositories/veSca/bcs.ts +6 -0
  157. package/src/repositories/veSca/helpers.ts +341 -0
  158. package/src/repositories/veSca/index.ts +57 -0
  159. package/src/repositories/veSca/types.ts +79 -0
  160. package/src/repositories/veScaLoyaltyProgram/bcs.ts +3 -0
  161. package/src/repositories/veScaLoyaltyProgram/helpers.ts +135 -0
  162. package/src/repositories/veScaLoyaltyProgram/index.ts +28 -0
  163. package/src/repositories/veScaLoyaltyProgram/schema.ts +15 -0
  164. package/src/repositories/veScaLoyaltyProgram/types.ts +47 -0
  165. package/src/repositories/wiring/datasources.ts +42 -0
  166. package/src/repositories/wiring/metadata.ts +292 -0
  167. package/src/repositories/wiring/registry.ts +194 -0
  168. package/src/repositories/wiring/source.ts +63 -0
  169. package/src/repositories/xOracle/bcs.ts +7 -0
  170. package/src/repositories/xOracle/const.ts +1 -0
  171. package/src/repositories/xOracle/helpers.ts +304 -0
  172. package/src/repositories/xOracle/index.ts +45 -0
  173. package/src/repositories/xOracle/types.ts +96 -0
  174. package/src/repositories/xOracle/utils.ts +3 -0
  175. package/src/services/client/BorrowService.ts +229 -0
  176. package/src/services/client/CollateralService.ts +76 -0
  177. package/src/services/client/LendingService.ts +75 -0
  178. package/src/services/client/ReferralService.ts +71 -0
  179. package/src/services/client/SpoolService.ts +170 -0
  180. package/src/services/client/VeScaService.ts +142 -0
  181. package/src/services/client/types.ts +44 -0
  182. package/src/services/index.ts +8 -0
  183. package/src/services/query/portfolioCalculations.ts +1171 -0
  184. package/src/txBuilders/borrowIncentive/index.ts +80 -0
  185. package/src/txBuilders/borrowIncentive/moveCalls.ts +124 -0
  186. package/src/txBuilders/borrowIncentive/quick.ts +207 -0
  187. package/src/txBuilders/context.ts +62 -0
  188. package/src/txBuilders/core/index.ts +95 -0
  189. package/src/txBuilders/core/moveCalls.ts +241 -0
  190. package/src/txBuilders/core/quick.ts +306 -0
  191. package/src/{builders → txBuilders}/index.ts +35 -9
  192. package/src/txBuilders/loyaltyProgram/index.ts +78 -0
  193. package/src/txBuilders/loyaltyProgram/moveCalls.ts +44 -0
  194. package/src/txBuilders/loyaltyProgram/quick.ts +58 -0
  195. package/src/txBuilders/manifest.ts +160 -0
  196. package/src/txBuilders/modules.ts +70 -0
  197. package/src/{builders → txBuilders}/oracles/index.ts +3 -2
  198. package/src/{builders → txBuilders}/oracles/pyth.ts +4 -3
  199. package/src/txBuilders/referral/index.ts +72 -0
  200. package/src/txBuilders/referral/moveCalls.ts +93 -0
  201. package/src/txBuilders/referral/quick.ts +57 -0
  202. package/src/txBuilders/sCoin/index.ts +72 -0
  203. package/src/txBuilders/sCoin/moveCalls.ts +36 -0
  204. package/src/txBuilders/sCoin/quick.ts +34 -0
  205. package/src/txBuilders/spool/index.ts +82 -0
  206. package/src/txBuilders/spool/moveCalls.ts +79 -0
  207. package/src/{builders/spoolBuilder.ts → txBuilders/spool/quick.ts} +22 -162
  208. package/src/txBuilders/utils.ts +36 -0
  209. package/src/txBuilders/verify.ts +45 -0
  210. package/src/txBuilders/vesca/index.ts +75 -0
  211. package/src/txBuilders/vesca/moveCalls.ts +147 -0
  212. package/src/{builders/vescaBuilder.ts → txBuilders/vesca/quick.ts} +85 -274
  213. package/src/types/address.ts +4 -178
  214. package/src/types/builder/borrowIncentive.ts +4 -3
  215. package/src/types/builder/core.ts +6 -33
  216. package/src/types/builder/index.ts +5 -1
  217. package/src/types/builder/loyaltyProgram.ts +4 -3
  218. package/src/types/builder/modules.ts +49 -0
  219. package/src/types/builder/referral.ts +5 -4
  220. package/src/types/builder/sCoin.ts +20 -2
  221. package/src/types/builder/spool.ts +22 -2
  222. package/src/types/builder/vesca.ts +4 -12
  223. package/src/types/constant/index.ts +3 -1
  224. package/src/types/constant/queryKeys.ts +15 -8
  225. package/src/types/index.ts +5 -6
  226. package/src/types/internal/dto.ts +46 -0
  227. package/src/types/internal/index.ts +2 -0
  228. package/src/types/internal/move.ts +13 -0
  229. package/src/types/public/index.ts +21 -0
  230. package/src/types/query/core.ts +0 -317
  231. package/src/types/query/index.ts +3 -4
  232. package/src/types/query/portfolio.ts +2 -15
  233. package/src/types/repositories/borrowIncentive.ts +12 -0
  234. package/src/types/repositories/index.ts +9 -0
  235. package/src/types/repositories/loyaltyProgram.ts +2 -0
  236. package/src/types/repositories/market.ts +13 -0
  237. package/src/types/repositories/spool.ts +21 -0
  238. package/src/types/repositories/veSca.ts +5 -0
  239. package/src/types/repositories/veScaLoyaltyProgram.ts +2 -0
  240. package/src/types/sui.ts +0 -1
  241. package/src/utils/array.ts +7 -0
  242. package/src/utils/cache.ts +17 -0
  243. package/src/utils/object.ts +30 -12
  244. package/src/utils/query.ts +9 -190
  245. package/src/utils/vesca.ts +0 -8
  246. package/src/builders/borrowIncentiveBuilder.ts +0 -372
  247. package/src/builders/coreBuilder.ts +0 -636
  248. package/src/builders/loyaltyProgramBuilder.ts +0 -142
  249. package/src/builders/referralBuilder.ts +0 -192
  250. package/src/builders/sCoinBuilder.ts +0 -124
  251. package/src/index.ts +0 -13
  252. package/src/models/scallopAddress.ts +0 -841
  253. package/src/models/scallopAxios.ts +0 -185
  254. package/src/models/scallopConstants.ts +0 -380
  255. package/src/models/scallopIndexer.ts +0 -226
  256. package/src/models/scallopQuery.ts +0 -974
  257. package/src/models/scallopQueryClient.ts +0 -29
  258. package/src/models/scallopSuiKit.ts +0 -480
  259. package/src/models/scallopUtils.ts +0 -734
  260. package/src/queries/borrowIncentiveQuery.ts +0 -361
  261. package/src/queries/borrowLimitQuery.ts +0 -33
  262. package/src/queries/coreQuery.ts +0 -1173
  263. package/src/queries/flashloanFeeQuery.ts +0 -92
  264. package/src/queries/index.ts +0 -15
  265. package/src/queries/isolatedAssetQuery.ts +0 -103
  266. package/src/queries/loyaltyProgramQuery.ts +0 -178
  267. package/src/queries/ownerQuery.ts +0 -32
  268. package/src/queries/poolAddressesQuery.ts +0 -340
  269. package/src/queries/portfolioQuery.ts +0 -1149
  270. package/src/queries/priceQuery.ts +0 -37
  271. package/src/queries/referralQuery.ts +0 -42
  272. package/src/queries/sCoinQuery.ts +0 -195
  273. package/src/queries/spoolQuery.ts +0 -542
  274. package/src/queries/supplyLimitQuery.ts +0 -32
  275. package/src/queries/switchboardQuery.ts +0 -65
  276. package/src/queries/vescaQuery.ts +0 -312
  277. package/src/queries/xOracleQuery.ts +0 -149
  278. package/src/types/constant/common.ts +0 -55
  279. package/src/types/query/loyaltyProgram.ts +0 -12
  280. package/src/types/query/vesca.ts +0 -27
  281. package/src/utils/index.ts +0 -7
  282. package/src/utils/indexer.ts +0 -47
  283. /package/src/{models → datasources}/rateLimiter.ts +0 -0
package/dist/index.d.cts CHANGED
@@ -1,11 +1,20 @@
1
- import * as _mysten_sui_client from '@mysten/sui/client';
2
1
  import { SuiClientTypes } from '@mysten/sui/client';
3
- import * as _scallop_io_sui_kit from '@scallop-io/sui-kit';
4
- import { SuiObjectArg, SuiTxArg, SuiAmountsArg, NetworkType, SuiKit, SuiKitParams, Transaction, SuiTxBlock, DerivePathParams, SuiTransactionBlockResponse, SuiVecTxArg, SuiAddressArg, TransactionResult as TransactionResult$1 } from '@scallop-io/sui-kit';
5
- import * as _tanstack_query_core from '@tanstack/query-core';
6
- import { QueryClient, QueryClientConfig, QueryKey } from '@tanstack/query-core';
7
- import { AxiosInstance, AxiosResponse, AxiosRequestConfig } from 'axios';
8
- import { Transaction as Transaction$1, TransactionObjectArgument, TransactionResult, Argument } from '@mysten/sui/transactions';
2
+ import { SuiObjectArg, SuiTxArg, SuiAmountsArg, NetworkType } from '@scallop-io/sui-kit';
3
+ import { c as SuiObjectDataOptions, G as GetDynamicFieldsParams, d as GetDynamicFieldObjectParams, e as SuiObjectData, S as ScallopBuilder, f as ScallopQuery, g as ScallopUtils, h as ScallopConstants, A as AddressesInterface, x as xOracleListType, P as PoolAddress, W as Whitelist, i as AddressStringPath } from './query-DkitepDi.js';
4
+ export { B as BaseScallopTxBlock, j as BorrowIncentiveAccounts, k as BorrowIncentiveIds, l as BorrowIncentiveModule, m as BorrowIncentiveNormalMethods, n as BorrowIncentivePool, o as BorrowIncentivePoolPoints, p as BorrowIncentivePools, q as BorrowIncentiveQuickMethods, r as BorrowIncentiveTxBlock, C as CalculatedSpoolData, s as CalculatedSpoolRewardPoolData, t as CoinBalance, u as CoinPrices, v as CoinWrappedType, w as CoreIds, y as CoreModule, z as CoreNormalMethods, D as CoreQuickMethods, E as CoreTxBlock, F as DevInspectResults, H as DynamicFieldPage, I as EncodeDynamicFieldNameInput, J as GenerateBorrowIncentiveNormalMethod, K as GenerateBorrowIncentiveQuickMethod, L as GenerateCoreNormalMethod, M as GenerateCoreQuickMethod, N as GenerateLoyaltyProgramNormalMethod, O as GenerateLoyaltyProgramQuickMethod, Q as GenerateSCoinNormalMethod, R as GenerateSCoinQuickMethod, T as GenerateSpoolNormalMethod, U as GenerateSpoolQuickMethod, V as GenerateVeScaNormalMethod, X as GenerateVeScaQuickMethod, Y as GetBalanceParams, Z as GetOwnedObjectsParams, _ as InspectTxnParsedJson, $ as Lending, a0 as Lendings, a1 as LoyaltyModule, a2 as LoyaltyProgramInfo, a3 as LoyaltyProgramNormalMethods, a4 as LoyaltyProgramQuickMethods, a5 as LoyaltyProgramTxBlock, a6 as Market, a7 as MarketCollateral, a8 as MarketCollaterals, a9 as MarketPool, aa as MarketPools, ab as Markets, ac as NestedResult, ad as ObligationAccount, ae as ObligationAccounts, af as ObligationBorrowIncentive, ag as ObligationBorrowIncentiveReward, ah as ObligationCollateral, ai as ObligationDebt, aj as OptionalKeys, ak as OriginSpoolData, al as OriginSpoolRewardPoolData, am as PaginatedObjectsResponse, an as ParsedBorrowIncentiveAccountData, ao as ParsedBorrowIncentiveAccountPoolData, ap as ParsedSpoolData, aq as ParsedSpoolRewardPoolData, ar as QuickMethodReturnType, as as ReferralModule, at as SCoinActionContext, au as SCoinModule, av as SCoinTxBlock, aw as ScallopAddress, a as ScallopTxBlock, ax as ScallopTxBlockModules, ay as Spool, az as SpoolActionContext, aA as SpoolData, aB as SpoolIds, aC as SpoolModule, aD as SpoolNormalMethods, aE as SpoolQuickMethods, aF as SpoolRewardPool, aG as SpoolTxBlock, aH as Spools, aI as StakeAccount, aJ as StakeAccounts, aK as StakePool, aL as StakePools, aM as StakeRewardPool, aN as StakeRewardPools, aO as SuiKitTransactionExecutor, aP as SuiObjectRef, aQ as SuiObjectResponse, aR as SuiParsedData, aS as SuiTxBlockWithBorrowIncentiveNormalMethods, aT as SuiTxBlockWithCoreNormalMethods, aU as SuiTxBlockWithLoyaltyProgramNormalMethods, aV as SuiTxBlockWithSCoin, aW as SuiTxBlockWithSCoinNormalMethods, aX as SuiTxBlockWithSpool, aY as SuiTxBlockWithSpoolNormalMethods, aZ as SuiTxBlockWithVeScaNormalMethods, a_ as SupportOracleType, a$ as TotalValueLocked, b0 as TransactionCommand, b1 as VeSca, b2 as VeScaLoyaltyProgramInfo, b3 as VeScaModule, b4 as VeScaNormalMethods, b5 as VeScaQuickMethods, b6 as VeScaTreasuryInfo, b7 as VeScaTxBlock, b1 as Vesca, b8 as _SUPPORT_ORACLES, b9 as sCoinNormalMethods, ba as sCoinPkgIds, bb as sCoinQuickMethods, bc as xOracleRuleType, bd as xOracleRules } from './query-DkitepDi.js';
5
+ import { ScallopClient, ScallopClientConstructorParams } from './client.cjs';
6
+ export { AssetCoinIds, AssetCoins, BorrowIncentiveRewardCoins, CoinAmounts, Coins, MarketCoinAmounts, MarketCoins, Obligation, ObligationQueryInterface, SCoinAmounts, SCoinConverterTreasury, SCoinIds, SCoinTreasuryCaps, SCoins, StakeMarketCoins, StakeRewardCoins, SuiBridgeCoins, SuiBridgedCoinPackageIds, VoloCoinIds, WormholeCoinIds, sCoinBalance } from './types.cjs';
7
+ export { ScallopConfigError, ScallopError, ScallopErrorCode, ScallopErrorOptions, ScallopIndexerError, ScallopParseError, ScallopRpcError, ScallopTransactionBuildError } from './errors.cjs';
8
+ export { L as Logger } from './Logger-Cg2iFdpH.js';
9
+ export { consoleLogger, noopLogger } from './logger.cjs';
10
+ import '@tanstack/query-core';
11
+ import 'axios';
12
+ import '@mysten/sui/cryptography';
13
+ import '@mysten/sui/transactions';
14
+ import '@pythnetwork/pyth-sui-js';
15
+
16
+ declare const API_BASE_URL: "https://sui.apis.scallop.io";
17
+ declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
9
18
 
10
19
  /**
11
20
  * Default cache options for the QueryClient.
@@ -22,96 +31,12 @@ declare const DEFAULT_CACHE_OPTIONS: {
22
31
  };
23
32
  };
24
33
 
25
- declare const API_BASE_URL: "https://sui.apis.scallop.io";
26
- declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
34
+ declare const SCA_COIN_TYPE = "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
35
+
27
36
  declare const IS_VE_SCA_TEST: boolean;
28
37
  declare const USE_TEST_ADDRESS: boolean;
29
- declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
30
38
  declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
31
39
 
32
- /** Sui Object with content and json (from getObject, listOwnedObjects, etc.) */
33
- type SuiObjectData = SuiClientTypes.Object<{
34
- content: true;
35
- json: true;
36
- }>;
37
- /**
38
- * SDK v2 GetObjectResponse format
39
- * getObject, getDynamicField, etc. return { object: Object | null }
40
- */
41
- type SuiObjectResponse = {
42
- object: SuiObjectData | null;
43
- };
44
- /** Move object parsed content (dataType, fields structure) */
45
- type SuiParsedData = {
46
- dataType?: string;
47
- type?: string;
48
- hasPublicTransfer?: boolean;
49
- fields?: Record<string, unknown>;
50
- };
51
- type SuiObjectRef = {
52
- objectId: string;
53
- version: number | string;
54
- digest: string;
55
- };
56
- /** Paginated objects response (listDynamicFields, getOwnedObjects, etc.) */
57
- type PaginatedObjectsResponse<T = unknown> = {
58
- objects?: T[];
59
- hasNextPage?: boolean;
60
- cursor?: string | null;
61
- };
62
- /** Extract parsedJson from queryInspectTxn result (Transaction.events[0].parsedJson) */
63
- type InspectTxnParsedJson<T> = {
64
- Transaction?: {
65
- events?: Array<{
66
- parsedJson?: T;
67
- }>;
68
- };
69
- commandResults?: unknown;
70
- } | null | undefined;
71
- type EncodeDynamicFieldNameInput = {
72
- type: string;
73
- } & ({
74
- value: any;
75
- bcs?: never;
76
- } | {
77
- value?: never;
78
- bcs: Uint8Array;
79
- });
80
- type GetBalanceParams = {
81
- owner: string;
82
- coinType?: string | null;
83
- };
84
- type GetDynamicFieldObjectParams<T extends EncodeDynamicFieldNameInput = EncodeDynamicFieldNameInput> = {
85
- parentId: string;
86
- name: T;
87
- };
88
- type GetDynamicFieldsParams = {
89
- parentId: string;
90
- cursor?: string | null;
91
- limit?: number | null;
92
- };
93
- type GetOwnedObjectsParams = {
94
- owner: string;
95
- filter?: any;
96
- options?: SuiClientTypes.ObjectInclude;
97
- cursor?: string | null;
98
- limit?: number | null;
99
- };
100
- type CoinBalance = {
101
- coinType: string;
102
- balance: string;
103
- coinBalance?: bigint;
104
- addressBalance?: bigint;
105
- };
106
- type DevInspectResults = SuiClientTypes.SimulateTransactionResult<{
107
- effects: true;
108
- events: true;
109
- balanceChanges: true;
110
- commandResults: true;
111
- }>;
112
- type DynamicFieldPage = SuiClientTypes.ListDynamicFieldsResponse;
113
- type SuiObjectDataOptions = SuiClientTypes.ObjectInclude;
114
-
115
40
  declare namespace QueryKeys {
116
41
  namespace API {
117
42
  type GetAddresses = {
@@ -126,20 +51,26 @@ declare namespace QueryKeys {
126
51
  queryTarget?: string;
127
52
  args?: SuiObjectArg[];
128
53
  typeArgs?: any[];
54
+ include?: SuiClientTypes.SimulateTransactionInclude;
129
55
  };
130
56
  export type GetObject = BaseType & {
131
57
  objectId?: string;
132
- options?: SuiObjectDataOptions;
58
+ include?: SuiObjectDataOptions;
133
59
  };
134
- export type GetObjects = BaseType & {
135
- objectIds?: string[];
60
+ export type GetSharedObject = BaseType & {
61
+ objectId?: string;
136
62
  };
137
- export type GetOwnedObjects = BaseType & Partial<GetOwnedObjectsParams>;
63
+ export type GetObjects = BaseType & SuiClientTypes.GetObjectsOptions;
64
+ export type GetOwnedObjects = BaseType & Partial<SuiClientTypes.ListOwnedObjectsOptions>;
138
65
  export type GetDynamicFields = BaseType & Partial<GetDynamicFieldsParams>;
139
66
  export type GetDynamicFieldObject = BaseType & Partial<GetDynamicFieldObjectParams>;
140
67
  export type getTotalVeScaTreasuryAmount = BaseType & {
141
68
  refreshArgs?: any[];
142
- vescaAmountArgs?: (string | SuiObjectData | SuiTxArg | SuiAmountsArg | SuiObjectArg)[];
69
+ veScaAmountArgs?: (string | SuiObjectData | SuiTxArg | SuiAmountsArg | SuiObjectArg)[];
70
+ };
71
+ export type GetCoinBalance = BaseType & {
72
+ address?: string;
73
+ coinType?: string;
143
74
  };
144
75
  export type GetAllCoinBalances = BaseType & {
145
76
  activeAddress?: string;
@@ -156,1743 +87,35 @@ declare const queryKeys: {
156
87
  getAddresses: (props?: QueryKeys.API.GetAddresses) => (string | QueryKeys.API.GetAddresses | undefined)[];
157
88
  getWhiteList: () => string[];
158
89
  getPoolAddresses: () => string[];
159
- getMarket: () => string[];
90
+ getMarkets: () => string[];
160
91
  getSpools: () => string[];
161
92
  getBorrowIncentivePools: () => string[];
162
93
  getTotalValueLocked: () => string[];
163
- };
164
- rpc: {
165
- getInspectTxn: (props?: QueryKeys.RPC.GetInspectTxn) => (string | QueryKeys.RPC.GetInspectTxn | undefined)[];
166
- getObject: (props?: QueryKeys.RPC.GetObject) => (string | QueryKeys.RPC.GetObject | undefined)[];
167
- getObjects: (props?: QueryKeys.RPC.GetObjects) => (string | QueryKeys.RPC.GetObjects | undefined)[];
168
- getOwnedObjects: (props?: QueryKeys.RPC.GetOwnedObjects) => (string | {
169
- filter: string;
170
- node?: string;
171
- owner?: string | undefined;
172
- options?: _mysten_sui_client.SuiClientTypes.ObjectInclude;
173
- cursor?: string | null;
174
- limit?: number | null;
175
- })[];
176
- getDynamicFields: (props?: QueryKeys.RPC.GetDynamicFields) => (string | QueryKeys.RPC.GetDynamicFields | undefined)[];
177
- getDynamicFieldObject: (props?: QueryKeys.RPC.GetDynamicFieldObject) => (string | QueryKeys.RPC.GetDynamicFieldObject | undefined)[];
178
- getTotalVeScaTreasuryAmount: (props?: QueryKeys.RPC.getTotalVeScaTreasuryAmount) => (string | {
179
- refreshArgs: string | undefined;
180
- vescaAmountArgs: string | undefined;
181
- node?: string;
182
- })[];
183
- getAllCoinBalances: (props?: QueryKeys.RPC.GetAllCoinBalances) => (string | QueryKeys.RPC.GetAllCoinBalances | undefined)[];
184
- getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
185
- };
186
- oracle: {
187
- getPythLatestPriceFeeds: (endpoint?: string, priceIds?: string[]) => (string | string[] | undefined)[];
188
- getCoinPrices: (priceIds: string[]) => (string | string[])[];
189
- };
190
- };
191
-
192
- declare const RPC_PROVIDERS: string[];
193
-
194
- type ScallopQueryClientParams = {
195
- queryClient?: QueryClient;
196
- queryClientConfig?: QueryClientConfig;
197
- };
198
- declare class ScallopQueryClient {
199
- private _queryClient;
200
- constructor(params?: ScallopQueryClientParams);
201
- get queryClient(): QueryClient;
202
- set queryClient(queryClient: QueryClient);
203
- get defaultQueryClientConfig(): {
204
- defaultOptions: {
205
- queries: {
206
- staleTime: number;
207
- gcTime: number;
208
- };
209
- };
210
- };
211
- }
212
-
213
- type ScallopAxiosParams = {
214
- baseUrl?: string;
215
- axiosInstance?: AxiosInstance;
216
- axiosTimeout?: number;
217
- } & ScallopQueryClientParams;
218
- declare class ScallopAxios extends ScallopQueryClient {
219
- readonly axiosInstance: AxiosInstance;
220
- constructor(params?: ScallopAxiosParams);
221
- post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
222
- post<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
223
- get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
224
- get<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, config?: AxiosRequestConfig<D>): Promise<R>;
225
- put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
226
- put<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
227
- delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
228
- delete<T = any, R = AxiosResponse<T>, D = any>(url: string, queryKey: QueryKey, config?: AxiosRequestConfig<D>): Promise<R>;
229
- }
230
-
231
- type ScallopAddressParams = {
232
- addressId?: string;
233
- urls?: {
234
- addresses?: string[];
235
- };
236
- auth?: string;
237
- networkType?: NetworkType;
238
- forceAddressesInterface?: Partial<Record<NetworkType, AddressesInterface>>;
239
- defaultValues?: {
240
- addresses?: Partial<Record<NetworkType, AddressesInterface>>;
241
- };
242
- } & ScallopAxiosParams;
243
- declare class ScallopAddress {
244
- readonly params: ScallopAddressParams;
245
- private currentAddresses?;
246
- private addressId?;
247
- private network;
248
- private auth;
249
- readonly scallopAxios: ScallopAxios;
250
- private readonly addressMap;
251
- private readonly defaultParamValues;
252
- constructor(params?: ScallopAddressParams);
253
- private initializeForcedAddresses;
254
- get axiosClient(): ScallopAxios;
255
- get queryClient(): _tanstack_query_core.QueryClient;
256
- get defaultValues(): {
257
- addresses?: Partial<Record<NetworkType, AddressesInterface>>;
258
- } | undefined;
259
- getId(): string | undefined;
260
- /**
261
- * Get the address at the provided path.
262
- *
263
- * @param path - The path of the address to get.
264
- * @return The address at the provided path.
265
- */
266
- get(path: AddressStringPath): any;
267
- /**
268
- * Sets the address for the specified path, it does not interact with the API.
269
- *
270
- * @param path - The path of the address to set.
271
- * @param address - The address be setted to the tartget path.
272
- * @return The addresses.
273
- */
274
- set(path: AddressStringPath, address: string): AddressesInterface | undefined;
275
- /**
276
- * Synchronize the specified network addresses from the addresses map to the
277
- * current addresses and change the default network to specified network.
278
- *
279
- * @param network - Specifies which network's addresses you want to get.
280
- * @return Current addresses.
281
- */
282
- switchCurrentAddresses(network: NetworkType): AddressesInterface | undefined;
283
- /**
284
- * Get the addresses, If `network` is not provided, returns the current
285
- * addresses or the default network addresses in the addresses map.
286
- *
287
- * @param network - Specifies which network's addresses you want to get.
288
- */
289
- getAddresses(network?: NetworkType): AddressesInterface | undefined;
290
- /**
291
- * Set the addresses into addresses map. If the specified network is the same
292
- * as the current network, the current addresses will be updated at the same time.
293
- *
294
- * @param addresses - The addresses be setted to the tartget network.
295
- * @param network - Specifies which network's addresses you want to set.
296
- * @return The addresses.
297
- */
298
- setAddresses(addresses: AddressesInterface, network?: NetworkType): void;
299
- /**
300
- * Get all addresses.
301
- *
302
- * @return All addresses.
303
- */
304
- getAllAddresses(): {
305
- [k: string]: AddressesInterface;
306
- };
307
- /**
308
- * Create a new addresses through the API and synchronize it back to the
309
- * instance.
310
- *
311
- * @description
312
- * If the `network` is not specified, the mainnet is used by default.
313
- * If no `addresses` from instance or parameter is provided, an addresses with
314
- * all empty strings is created by default.
315
- *
316
- * This function only allows for one addresses to be input into a specific network
317
- * at a time, and does not provide an addresses map for setting addresses
318
- * across all networks at once.
319
- *
320
- * @param params.addresses - The addresses be setted to the tartget network.
321
- * @param params.network - Specifies which network's addresses you want to set.
322
- * @param params.auth - The authentication API key.
323
- * @param params.memo - Add memo to the addresses created in the API.
324
- * @return All addresses.
325
- */
326
- create(params?: {
327
- addresses?: AddressesInterface | undefined;
328
- network?: NetworkType | undefined;
329
- auth?: string | undefined;
330
- memo?: string | undefined;
331
- }): Promise<{
332
- [k: string]: AddressesInterface;
333
- }>;
334
- protected readApi<T>({ url, queryKey, config, }: {
335
- url: string;
336
- queryKey: QueryKey;
337
- config?: AxiosRequestConfig;
338
- }): Promise<T>;
339
- /**
340
- * Read and synchronizes all addresses from the API into instance.
341
- *
342
- * @param id - The id of the addresses to get.
343
- * @return All addresses.
344
- */
345
- read(id?: string): Promise<{
346
- [k: string]: AddressesInterface;
347
- }>;
348
- /**
349
- * Update the addresses through the API and synchronize it back to the
350
- * instance.
351
- *
352
- * @description
353
- * If the `network` is not specified, the mainnet is used by default.
354
- * If no `addresses` from instance or parameter is provided, an addresses with
355
- * all empty strings is created by default.
356
- *
357
- * This function only allows for one addresses to be input into a specific network
358
- * at a time, and does not provide an addresses map for setting addresses
359
- * across all networks at once.
360
- *
361
- * @param params.id - The id of the addresses to update.
362
- * @param params.addresses - The addresses be setted to the tartget network.
363
- * @param params.network - Specifies which network's addresses you want to set.
364
- * @param params.auth - The authentication api key.
365
- * @param params.memo - Add memo to the addresses created in the API.
366
- * @return All addresses.
367
- */
368
- update(params?: {
369
- id?: string;
370
- addresses?: AddressesInterface | undefined;
371
- network?: NetworkType | undefined;
372
- auth?: string | undefined;
373
- memo?: string | undefined;
374
- }): Promise<{
375
- [k: string]: AddressesInterface;
376
- }>;
377
- /**
378
- * Deletes all addresses of a specified id through the API and clear all
379
- * addresses in the instance.
380
- *
381
- * @param id - The id of the addresses to delete.
382
- * @param auth - The authentication API key.
383
- */
384
- delete(id?: string, auth?: string): Promise<void>;
385
- }
386
-
387
- type CoinName = string;
388
- type CoinType = string;
389
- type SCoinType = string;
390
- type OldMarketCoinType = string;
391
- /**
392
- * @description `scallop_sui`, `scallop_usdt`, etc (parsed directly from coin type, ex: `0x...::scallop_sui::SCALLOP_SUI`)
393
- */
394
- type SCoinRawName = string;
395
- /**
396
- * @description `ssui`, `susdc`, etc..
397
- */
398
- type SCoinName = string;
399
- type ScallopConstantsParams = {
400
- urls?: {
401
- poolAddresses?: string[];
402
- whitelist?: string[];
403
- };
404
- forcePoolAddressInterface?: Record<string, PoolAddress>;
405
- forceWhitelistInterface?: Whitelist | Record<string, any>;
406
- defaultValues?: {
407
- poolAddresses?: Record<string, PoolAddress>;
408
- whitelist?: Whitelist | Record<string, any>;
409
- };
410
- } & ScallopAddressParams;
411
- declare class ScallopConstants extends ScallopAddress {
412
- readonly params: ScallopConstantsParams;
413
- private _poolAddresses;
414
- private _whitelist;
415
- /**
416
- * @description coin names to coin decimal map
417
- */
418
- coinDecimals: Record<CoinName, number | undefined>;
419
- coinNameToOldMarketCoinTypeMap: Record<CoinName, OldMarketCoinType | undefined>;
420
- scoinRawNameToSCoinNameMap: Record<SCoinRawName, SCoinName | undefined>;
421
- scoinTypeToSCoinNameMap: Record<SCoinType, SCoinName | undefined>;
422
- wormholeCoinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
423
- voloCoinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
424
- suiBridgeCoinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
425
- /**
426
- * @description coin names to coin types map
427
- */
428
- coinTypes: Record<CoinName, CoinType | undefined>;
429
- /**
430
- * @description scoin names to scoin types map
431
- */
432
- sCoinTypes: Record<SCoinName, SCoinType | undefined>;
433
- coinTypeToCoinNameMap: Record<CoinType, CoinName | undefined>;
434
- /**
435
- * @description Supported borrow incentive reward coin names
436
- */
437
- supportedBorrowIncentiveRewards: Set<CoinName>;
438
- constructor(params?: ScallopConstantsParams);
439
- get protocolObjectId(): string;
440
- get isInitialized(): boolean;
441
- get whitelist(): Whitelist;
442
- get poolAddresses(): Record<string, PoolAddress | undefined>;
443
- get defaultValues(): ({
444
- poolAddresses?: Record<string, PoolAddress>;
445
- whitelist?: Whitelist | Record<string, any>;
446
- } & {
447
- addresses?: Partial<Record<NetworkType, AddressesInterface>>;
448
- }) | undefined;
449
- private isAddressInitialized;
450
- parseToOldMarketCoin(coinType: string): string;
451
- init({ networkType, force, addressId, constantsParams, }?: {
452
- networkType?: NetworkType;
453
- force?: boolean;
454
- addressId?: string;
455
- constantsParams?: Partial<ScallopConstantsParams>;
456
- }): Promise<void>;
457
- private initConstants;
458
- readWhiteList(): Promise<Whitelist>;
459
- readPoolAddresses(): Promise<Record<string, PoolAddress>>;
460
- }
461
-
462
- type ScallopIndexerParams = {
463
- indexerApiUrl?: string;
464
- } & ScallopAxiosParams;
465
- declare class ScallopIndexer extends ScallopAxios {
466
- constructor(params?: ScallopIndexerParams);
467
- /**
468
- * Get market index data.
469
- *
470
- * @return Market data.
471
- */
472
- getMarket(): Promise<Pick<Market, 'pools' | 'collaterals'>>;
473
- /**
474
- * Get market pools index data.
475
- *
476
- * @return Market pools data.
477
- */
478
- getMarketPools(): Promise<Required<MarketPools>>;
479
- /**
480
- * Get market pool index data.
481
- *
482
- * @return Market pool data.
483
- */
484
- getMarketPool(poolCoinName: string): Promise<MarketPool>;
485
- /**
486
- * Get market collaterals index data.
487
- *
488
- * @return Market collaterals data.
489
- */
490
- getMarketCollaterals(): Promise<Required<MarketCollaterals>>;
491
- /**
492
- * Get market collateral index data.
493
- *
494
- * @return Market collateral data.
495
- */
496
- getMarketCollateral(collateralCoinName: string): Promise<MarketCollateral>;
497
- /**
498
- * Get spools index data.
499
- *
500
- * @return Spools data.
501
- */
502
- getSpools(): Promise<Required<Spools>>;
503
- /**
504
- * Get spool index data.
505
- *
506
- * @return Spool data.
507
- */
508
- getSpool(marketCoinName: string): Promise<Spool>;
509
- /**
510
- * Get borrow incentive pools index data.
511
- *
512
- * @return Borrow incentive pools data.
513
- */
514
- getBorrowIncentivePools(): Promise<Required<BorrowIncentivePools>>;
515
- /**
516
- * Get borrow incentive pool index data.
517
- *
518
- * @return Borrow incentive pool data.
519
- */
520
- getBorrowIncentivePool(borrowIncentiveCoinName: string): Promise<BorrowIncentivePool>;
521
- /**
522
- * Get total value locked index data.
523
- *
524
- * @return Total value locked.
525
- */
526
- getTotalValueLocked(): Promise<TotalValueLocked & {
527
- totalValueChangeRatio: number;
528
- borrowValueChangeRatio: number;
529
- supplyValueChangeRatio: number;
530
- }>;
531
- /**
532
- * Get coin price index data.
533
- *
534
- * @return price data.
535
- */
536
- getCoinPrice(poolCoinName: string): Promise<number>;
537
- getCoinPrices(): Promise<Record<string, number>>;
538
- }
539
-
540
- type QueryInspectTxnParams = {
541
- queryTarget: string;
542
- args: SuiObjectArg[];
543
- typeArgs?: any[];
544
- txBlock?: SuiTxBlock;
545
- keys?: QueryKey;
546
- };
547
- type ScallopSuiKitParams = {
548
- suiKit?: SuiKit;
549
- tokensPerSecond?: number;
550
- walletAddress?: string;
551
- } & SuiKitParams & ScallopQueryClientParams;
552
- declare class ScallopSuiKit extends ScallopQueryClient {
553
- readonly suiKit: SuiKit;
554
- private _walletAddress;
555
- private _tokensPerSecond;
556
- private rateLimiter;
557
- constructor(params?: ScallopSuiKitParams);
558
- switchFullNodes(fullNodes: string[]): void;
559
- get client(): _mysten_sui_client.ClientWithCoreApi;
560
- get walletAddress(): string;
561
- set walletAddress(value: string);
562
- get tokensPerSecond(): number;
563
- set tokensPerSecond(value: number);
564
- get currentFullNode(): string;
565
- signAndSendTxn(tx: Uint8Array | Transaction | SuiTxBlock, derivePathParams?: DerivePathParams): Promise<_scallop_io_sui_kit.SuiTransactionBlockResponse>;
566
- private callWithRateLimiter;
567
- private queryGetNormalizedMoveFunction;
568
- /**
569
- * @description Provides cache for getObject of the SuiKit.
570
- * @param objectId
571
- * @param QueryObjectParams
572
- * @returns Promise<SuiObjectResponse>
573
- */
574
- queryGetObject(objectId: string, options?: SuiObjectDataOptions): Promise<_mysten_sui_client.SuiClientTypes.GetObjectResponse<{}>>;
575
- /**
576
- * @description Provides cache for getObjects of the SuiKit.
577
- * @param objectIds
578
- * @returns Promise<SuiObjectData[]>
579
- */
580
- queryGetObjects(objectIds: string[], options?: SuiObjectDataOptions): Promise<SuiObjectData[]>;
581
- /**
582
- * @description Provides cache for getOwnedObjects of the SuiKit.
583
- * @param input
584
- * @returns Promise<PaginatedObjectsResponse>
585
- */
586
- queryGetOwnedObjects(input: GetOwnedObjectsParams): Promise<PaginatedObjectsResponse<SuiObjectData> | null>;
587
- queryGetDynamicFields(input: GetDynamicFieldsParams): Promise<DynamicFieldPage | null>;
588
- queryGetDynamicFieldObject(input: GetDynamicFieldObjectParams): Promise<SuiObjectResponse | null>;
589
- queryGetAllCoinBalances(owner: string): Promise<{
590
- [k: string]: CoinBalance;
591
- }>;
592
- queryGetCoinBalance(input: GetBalanceParams): Promise<CoinBalance | null>;
593
- /**
594
- * @description Provides cache for inspectTxn of the SuiKit.
595
- * @param QueryInspectTxnParams
596
- * @param txBlock
597
- * @returns Promise<DevInspectResults>
598
- */
599
- queryInspectTxn({ queryTarget, args, typeArgs, txBlock, keys, }: QueryInspectTxnParams): Promise<DevInspectResults | null>;
600
- /**
601
- * v2: Use JSON-RPC devInspectTransactionBlock for read-only simulation.
602
- * Bypasses strict gRPC simulateTransaction (ownership/gas checks).
603
- */
604
- devInspectTxn(txBlock: SuiTxBlock): Promise<DevInspectResults>;
605
- }
606
-
607
- type ScallopQueryParams = {
608
- indexer?: ScallopIndexer;
609
- utils?: ScallopUtils;
610
- } & ScallopUtilsParams & ScallopIndexerParams;
611
- declare class ScallopQuery implements ScallopQueryInterface {
612
- readonly indexer: ScallopIndexer;
613
- readonly utils: ScallopUtils;
614
- constructor(params?: ScallopQueryParams);
615
- initIndexerFallback(): void;
616
- /**
617
- * Request the scallop API to initialize data.
618
- *
619
- * @param force - Whether to force initialization.
620
- */
621
- init(force?: boolean): Promise<void>;
622
- get constants(): ScallopConstants;
623
- get walletAddress(): string;
624
- get scallopSuiKit(): ScallopSuiKit;
625
- get address(): ScallopConstants;
626
- /**
627
- * @deprecated use getMarketPools
628
- * Query market data.
629
- * @param indexer - Whether to use indexer.
630
- * @return Market data.
631
- */
632
- queryMarket(args?: {
633
- coinPrices?: CoinPrices;
634
- indexer?: boolean;
635
- }): Promise<Market>;
636
- /**
637
- * Get market pools.
638
- *
639
- * @description
640
- * To obtain all market pools at once, it is recommended to use
641
- * the `queryMarket` method to reduce time consumption.
642
- *
643
- * @param poolCoinNames - Specific an array of support pool coin name.
644
- * @param indexer - Whether to use indexer.
645
- * @return Market pools data.
646
- */
647
- getMarketPools(poolCoinNames?: string[], args?: {
648
- coinPrices?: CoinPrices;
649
- indexer?: boolean;
650
- }): Promise<{
651
- pools: MarketPools;
652
- collaterals: MarketCollaterals;
653
- }>;
654
- /**
655
- * Get market pool
656
- *
657
- * @param poolCoinName - Specific support pool coin name.
658
- * @param indexer - Whether to use indexer.
659
- * @return Market pool data.
660
- */
661
- getMarketPool(poolCoinName: string, args?: {
662
- coinPrice?: number;
663
- indexer?: boolean;
664
- }): Promise<MarketPool | undefined>;
665
- /**
666
- * Get market collaterals.
667
- *
668
- * @description
669
- * To obtain all market collaterals at once, it is recommended to use
670
- * the `queryMarket` method to reduce time consumption.
671
- *
672
- * @param collateralCoinNames - Specific an array of support collateral coin name.
673
- * @param indexer - Whether to use indexer.
674
- * @return Market collaterals data.
675
- */
676
- getMarketCollaterals(collateralCoinNames?: string[], args?: {
677
- indexer?: boolean;
678
- }): Promise<{
679
- [x: string]: MarketCollateral | undefined;
680
- }>;
681
- /**
682
- * Get market collateral
683
- *
684
- * @param collateralCoinName - Specific support collateral coin name.
685
- * @param indexer - Whether to use indexer.
686
- * @return Market collateral data.
687
- */
688
- getMarketCollateral(collateralCoinName: string, args?: {
689
- indexer?: boolean;
690
- }): Promise<MarketCollateral | undefined>;
691
- /**
692
- * Get obligations data.
693
- *
694
- * @param ownerAddress - The owner address.
695
- * @return Obligations data.
696
- */
697
- getObligations(ownerAddress?: string): Promise<Obligation[]>;
698
- /**
699
- * Query obligation data.
700
- *
701
- * @param obligationId - The obligation id.
702
- * @return Obligation data.
703
- */
704
- queryObligation(obligationId: SuiObjectArg): Promise<ObligationQueryInterface | undefined>;
705
- /**
706
- * Get all asset coin amounts.
707
- *
708
- * @param assetCoinNames - Specific an array of support asset coin name.
709
- * @param ownerAddress - The owner address.
710
- * @return All coin amounts.
711
- */
712
- getCoinAmounts(assetCoinNames?: string[], ownerAddress?: string): Promise<OptionalKeys<Record<string, number>>>;
713
- /**
714
- * Get asset coin amount.
715
- *
716
- * @param assetCoinName - Specific support asset coin name.
717
- * @param ownerAddress - The owner address.
718
- * @return Coin amount.
719
- */
720
- getCoinAmount(assetCoinName: string, ownerAddress?: string): Promise<number>;
721
- /**
722
- * Get all market coin amounts.
723
- *
724
- * @param coinNames - Specific an array of support market coin name.
725
- * @param ownerAddress - The owner address.
726
- * @return All market market coin amounts.
727
- */
728
- getMarketCoinAmounts(marketCoinNames?: string[], ownerAddress?: string): Promise<OptionalKeys<Record<string, number>>>;
729
- /**
730
- * Get market coin amount.
731
- *
732
- * @param coinNames - Specific support market coin name.
733
- * @param ownerAddress - The owner address.
734
- * @return Market market coin amount.
735
- */
736
- getMarketCoinAmount(marketCoinName: string, ownerAddress?: string): Promise<number>;
737
- /**
738
- * Get price from pyth fee object.
739
- *
740
- * @param assetCoinName - Specific support asset coin name.
741
- * @return Asset coin price.
742
- */
743
- getPriceFromPyth(assetCoinName: string): Promise<number>;
744
- /**
745
- * Get prices from pyth fee object.
746
- *
747
- * @param assetCoinNames - Array of supported asset coin names.
748
- * @return Array of asset coin prices.
749
- */
750
- getPricesFromPyth(assetCoinNames: string[]): Promise<Record<string, number>>;
751
- /**
752
- * Get spools data.
753
- *
754
- * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
755
- * @param indexer - Whether to use indexer.
756
- * @return Spools data.
757
- */
758
- getSpools(stakeMarketCoinNames?: string[], args?: {
759
- marketPools?: MarketPools;
760
- coinPrices?: CoinPrices;
761
- indexer?: boolean;
762
- }): Promise<{
763
- [x: string]: Spool | undefined;
764
- }>;
765
- /**
766
- * Get spool data.
767
- *
768
- * @param stakeMarketCoinName - Specific support stake market coin name.
769
- * @param indexer - Whether to use indexer.
770
- * @return Spool data.
771
- */
772
- getSpool(stakeMarketCoinName: string, args?: {
773
- marketPool?: MarketPool;
774
- coinPrices?: CoinPrices;
775
- indexer?: boolean;
776
- }): Promise<Spool | undefined>;
777
- /**
778
- * Get stake accounts data for all stake pools (spools).
779
- *
780
- * @param ownerAddress - The owner address.
781
- * @return All Stake accounts data.
782
- */
783
- getAllStakeAccounts(ownerAddress?: string): Promise<StakeAccounts>;
784
- /**
785
- * Get stake accounts data for specific stake pool (spool).
786
- *
787
- * @param stakeMarketCoinName - Specific support stake market coin name.
788
- * @param ownerAddress - The owner address.
789
- * @return Stake accounts data.
790
- */
791
- getStakeAccounts(stakeMarketCoinName: string, ownerAddress?: string): Promise<StakeAccount[]>;
792
- /**
793
- * Get stake pools (spools) data.
794
- *
795
- * @description
796
- * For backward compatible, it is recommended to use `getSpools` method
797
- * to get all spools data.
798
- *
799
- * @param stakeMarketCoinNames - Specific an array of support stake market coin name.
800
- * @return Stake pools data.
801
- */
802
- getStakePools(stakeMarketCoinNames?: string[]): Promise<{
803
- [x: string]: StakePool | undefined;
804
- }>;
805
- /**
806
- * Get stake pool (spool) data.
807
- *
808
- * @description
809
- * For backward compatible, it is recommended to use `getSpool` method
810
- * to get all spool data.
811
- *
812
- * @param stakeMarketCoinName - Specific support stake market coin name.
813
- * @return Stake pool data.
814
- */
815
- getStakePool(stakeMarketCoinName: string): Promise<StakePool | undefined>;
816
- /**
817
- * Get stake reward pools data.
818
- *
819
- * @description
820
- * For backward compatible, it is recommended to use `getSpools` method
821
- * to get all spools data.
822
- *
823
- * @param stakeMarketCoinNames - Specific an array of stake market coin name.
824
- * @return Stake reward pools data.
825
- */
826
- getStakeRewardPools(stakeMarketCoinNames?: string[]): Promise<{
827
- [x: string]: StakeRewardPool | undefined;
828
- }>;
829
- /**
830
- * Get stake reward pool data.
831
- *
832
- * @description
833
- * For backward compatible, it is recommended to use `getSpool` method
834
- * to get spool data.
835
- *
836
- * @param marketCoinName - Specific support stake market coin name.
837
- * @return Stake reward pool data.
838
- */
839
- getStakeRewardPool(stakeMarketCoinName: string): Promise<StakeRewardPool | undefined>;
840
- /**
841
- * Get borrow incentive pools data.
842
- *
843
- * @param coinNames - Specific an array of support borrow incentive coin name.
844
- * @param indexer - Whether to use indexer.
845
- * @return Borrow incentive pools data.
846
- */
847
- getBorrowIncentivePools(coinNames?: string[], args?: {
848
- coinPrices?: CoinPrices;
849
- indexer?: boolean;
850
- marketPools?: MarketPools;
851
- }): Promise<{
852
- [x: string]: BorrowIncentivePool | undefined;
853
- }>;
854
- /**
855
- * Get borrow incentive accounts data.
856
- *
857
- * @param coinNames - Specific support borrow incentive coin name.
858
- * @param ownerAddress - The owner address.
859
- * @return Borrow incentive accounts data.
860
- */
861
- getBorrowIncentiveAccounts(obligationId: string | SuiObjectRef, coinNames?: string[]): Promise<{
862
- [x: string]: ParsedBorrowIncentiveAccountData | undefined;
863
- }>;
864
- /**
865
- * Get user lending and spool infomation for specific pools.
866
- *
867
- * @param poolCoinNames - Specific an array of support pool coin name.
868
- * @param ownerAddress - The owner address.
869
- * @param indexer - Whether to use indexer.
870
- * @return All lending and spool infomation.
871
- */
872
- getLendings(poolCoinNames?: string[], ownerAddress?: string, args?: {
873
- indexer?: boolean;
874
- marketPools?: MarketPools;
875
- coinPrices?: CoinPrices;
876
- }): Promise<{
877
- [x: string]: Lending | undefined;
878
- }>;
879
- /**
880
- * Get user lending and spool information for specific pool.
881
- *
882
- * @param poolCoinName - Specific support pool coin name.
883
- * @param ownerAddress - The owner address.
884
- * @param indexer - Whether to use indexer.
885
- * @return Lending pool data.
886
- */
887
- getLending(poolCoinName: string, ownerAddress?: string, args?: {
888
- indexer?: boolean;
889
- }): Promise<Lending>;
890
- /**
891
- * Get user all obligation accounts information from ownerAddress.
892
- *
893
- * @description
894
- * All collateral and borrowing information in all obligation accounts owned by the user.
895
- *
896
- * @param ownerAddress - The owner address.
897
- * @param args - Additional arguments.
898
- * @return All obligation accounts information.
899
- */
900
- getObligationAccounts(ownerAddress?: string, args?: {
901
- indexer?: boolean;
902
- market?: {
903
- collaterals: MarketCollaterals;
904
- pools: MarketPools;
905
- };
906
- coinPrices?: CoinPrices;
907
- }): Promise<{
908
- [x: string]: ObligationAccount | undefined;
909
- }>;
910
- /**
911
- * Get user all obligation accounts information from obligationIds.
912
- *
913
- * @description
914
- * All collateral and borrowing information in all obligation accounts.
915
- *
916
- * @param obligationIds - Obligation IDs.
917
- * @param args - Additional arguments.
918
- * @return All obligation accounts information.
919
- */
920
- getObligationAccountsByIds(obligationIds: string[], args?: {
921
- market?: {
922
- collaterals: MarketCollaterals;
923
- pools: MarketPools;
924
- };
925
- coinPrices?: CoinPrices;
926
- indexer?: boolean;
927
- }): Promise<ObligationAccount[]>;
928
- /**
929
- * Get obligation account by id
930
- *
931
- * @description
932
- * All collateral and borrowing information in obligation account.
933
- *
934
- * @param obligationId - Obligation ID.
935
- * @param args - Additional arguments.
936
- * @return All obligation accounts information.
937
- */
938
- getObligationAccountById(obligationId: string, args?: {
939
- market?: {
940
- collaterals: MarketCollaterals;
941
- pools: MarketPools;
942
- };
943
- coinPrices?: CoinPrices;
944
- indexer?: boolean;
945
- }): Promise<ObligationAccount>;
946
- /**
947
- * Get obligation account information for specific id.
948
- *
949
- * @description
950
- * borrowing and obligation information for specific pool.
951
- *
952
- * @param obligationId - The obligation id.
953
- * @param ownerAddress - The owner address.
954
- * @param args - Additional arguments.
955
- * @return Borrowing and collateral information.
956
- */
957
- getObligationAccount(obligationId: string, ownerAddress?: string, args?: {
958
- indexer?: boolean;
959
- }): Promise<ObligationAccount | undefined>;
960
- /**
961
- * Get total value locked.
962
- *
963
- * @param indexer - Whether to use indexer.
964
- * @description
965
- * Include total supplied value and total borrowed value.
966
- *
967
- * @return Total value locked.
968
- */
969
- getTvl(args?: {
970
- indexer?: boolean;
971
- }): Promise<TotalValueLocked>;
972
- /**
973
- * Get veSca data.
974
- * @param veScaKey
975
- * @returns veSca
976
- */
977
- getVeSca(veScaKey: string | SuiObjectData): Promise<Vesca | undefined>;
978
- /**
979
- * Get all veSca from walletAdddress
980
- * @param walletAddress
981
- * @returns array of veSca
982
- */
983
- getVeScas({ walletAddress, excludeEmpty, }?: {
984
- walletAddress?: string;
985
- excludeEmpty?: boolean;
986
- }): Promise<Vesca[]>;
987
- /**
988
- * Get total vesca treasury with movecall
989
- * @returns Promise<string | undefined>
990
- */
991
- getVeScaTreasuryInfo(): Promise<VeScaTreasuryInfo | null>;
992
- /**
993
- * Return binded referrer veScaKeyId of referee walletAddress if exist
994
- * @param walletAddress
995
- * @returns veScaKeyId
996
- */
997
- getVeScaKeyIdFromReferralBindings(walletAddress?: string): Promise<string | null>;
998
- /**
999
- * @deprecated use getBindedObligation instead
1000
- * @param veScaKey
1001
- * @returns obligationId
1002
- */
1003
- getBindedObligationId(veScaKey: string): Promise<string | undefined>;
1004
- /**
1005
- * Get binded obligation from a veScaKey if it exists.
1006
- * @param veScaKey
1007
- * @returns { obligationId, obligationKey } if binded, otherwise null
1008
- */
1009
- getBindedObligation(veScaKey: string): Promise<{
1010
- obligationId: string;
1011
- obligationKey: string;
1012
- } | null>;
1013
- /**
1014
- * Get binded veSCA key from a obligationId if it exists.
1015
- * @param obligationId
1016
- * @returns veScaKey
1017
- */
1018
- getBindedVeScaKey(obligationId: string): Promise<string | null>;
1019
- /**
1020
- * Get user's veSCA loyalty program informations
1021
- * @param veScaKey
1022
- * @returns Loyalty program information
1023
- */
1024
- getLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<LoyaltyProgramInfo | null>;
1025
- /**
1026
- * Get user's veSCA rewards informations from loyalty program
1027
- * @param veScaKey
1028
- * @returns Loyalty program information
1029
- */
1030
- getVeScaLoyaltyProgramInfos(veScaKey?: string | SuiObjectData): Promise<VeScaLoyaltyProgramInfo | null>;
1031
- /**
1032
- * Get total supply of sCoin
1033
- * @param sCoinName - Supported sCoin name
1034
- * @returns Total Supply
1035
- */
1036
- getSCoinTotalSupply(sCoinName: string): Promise<number>;
1037
- /**
1038
- * Get all sCoin amounts.
1039
- *
1040
- * @param sCoinNames - Specific an array of support sCoin name.
1041
- * @param ownerAddress - The owner address.
1042
- * @return All market sCoin amounts.
1043
- */
1044
- getSCoinAmounts(sCoinNames?: string[], ownerAddress?: string): Promise<OptionalKeys<Record<string, number>>>;
1045
- /**
1046
- * Get sCoin amount.
1047
- *
1048
- * @param coinNames - Specific support sCoin name.
1049
- * @param ownerAddress - The owner address.
1050
- * @return sCoin amount.
1051
- */
1052
- getSCoinAmount(sCoinName: string | string, ownerAddress?: string): Promise<number>;
1053
- /**
1054
- * Get swap rate from sCoin A to sCoin B
1055
- * @param assetCoinNames
1056
- * @returns
1057
- */
1058
- getSCoinSwapRate(fromSCoin: string, toSCoin: string): Promise<number>;
1059
- getFlashLoanFees(assetCoinNames?: string[]): Promise<Record<string, number>>;
1060
- /**
1061
- * Get supply limit of lending pool
1062
- */
1063
- getPoolSupplyLimit(poolName: string): Promise<string | null>;
1064
- /**
1065
- * Get borrow limit of borrow pool
1066
- */
1067
- getPoolBorrowLimit(poolName: string): Promise<string | null>;
1068
- /**
1069
- * Get list of isolated assets
1070
- */
1071
- getIsolatedAssets(useOnChainQuery?: boolean): Promise<string[]>;
1072
- /**
1073
- * Check if asset is an isolated asset
1074
- */
1075
- isIsolatedAsset(assetCoinName: string, useOnChainQuery?: boolean): Promise<boolean>;
1076
- /**
1077
- * Get pool coin price from indexer
1078
- * @param coinName
1079
- * @returns price data
1080
- */
1081
- getCoinPriceByIndexer(poolName: string): Promise<number>;
1082
- /**
1083
- * Get all supported pool price from indexer
1084
- * @returns prices data
1085
- */
1086
- getCoinPricesByIndexer(): Promise<Record<string, number>>;
1087
- /**
1088
- * Get all coin prices, including sCoin
1089
- * @returns prices data
1090
- */
1091
- getAllCoinPrices(args?: {
1092
- marketPools?: MarketPools;
1093
- coinPrices?: CoinPrices;
1094
- indexer?: boolean;
1095
- }): Promise<{
1096
- [x: string]: number | undefined;
1097
- }>;
1098
- /**
1099
- * Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
1100
- * @returns
1101
- */
1102
- getPoolAddresses(apiAddressId?: string | undefined): Promise<OptionalKeys<Record<string, PoolAddress>>>;
1103
- /**
1104
- * Get user portfolio
1105
- */
1106
- getUserPortfolio(args?: {
1107
- walletAddress?: string;
1108
- indexer?: boolean;
1109
- }): Promise<{
1110
- totalLockedScaValue: number;
1111
- lendings: {
1112
- suppliedCoin: number;
1113
- suppliedValue: number;
1114
- stakedCoin: number;
1115
- coinName: string;
1116
- symbol: string;
1117
- coinType: string;
1118
- coinPrice: number;
1119
- coinDecimals: number;
1120
- supplyApr: number;
1121
- supplyApy: number;
1122
- incentiveApr: number;
1123
- }[];
1124
- borrowings: {
1125
- obligationId: string;
1126
- totalDebtsInUsd: number;
1127
- totalCollateralInUsd: number;
1128
- riskLevel: number;
1129
- availableCollateralInUsd: number;
1130
- totalUnhealthyCollateralInUsd: number;
1131
- collaterals: {
1132
- coinName: string;
1133
- symbol: string;
1134
- coinDecimals: number;
1135
- coinType: string;
1136
- coinPrice: number;
1137
- depositedCoin: number;
1138
- depositedValueInUsd: number;
1139
- }[];
1140
- borrowedPools: {
1141
- coinName: string;
1142
- symbol: string;
1143
- coinDecimals: number;
1144
- coinType: string;
1145
- coinPrice: number;
1146
- borrowedCoin: number;
1147
- borrowedValueInUsd: number;
1148
- borrowApr: number | undefined;
1149
- borrowApy: number | undefined;
1150
- incentiveInfos: {
1151
- coinName: string;
1152
- symbol: string;
1153
- coinType: string;
1154
- boostValue: number;
1155
- maxBoost: number;
1156
- incentiveApr: number;
1157
- boostedIncentiveApr: number;
1158
- }[];
1159
- }[];
1160
- }[];
1161
- pendingRewards: {
1162
- lendings: any;
1163
- borrowIncentives: any;
1164
- };
1165
- veScas: {
1166
- veScaKey: string;
1167
- coinPrice: number;
1168
- lockedScaInCoin: number;
1169
- lockedScaInUsd: number;
1170
- currentVeScaBalance: number;
1171
- remainingLockPeriodInDays: number;
1172
- unlockAt: number;
1173
- }[];
1174
- totalDebtValue: number;
1175
- totalCollateralValue: number;
1176
- totalSupplyValue: number;
1177
- }>;
1178
- /**
1179
- * Get both primary and secondary price update policy objects
1180
- * @returns price update policies
1181
- */
1182
- getPriceUpdatePolicies(): Promise<{
1183
- primary: SuiObjectResponse | null;
1184
- secondary: SuiObjectResponse | null;
1185
- }>;
1186
- /**
1187
- * Return the supported primary and secondary oracles for all supported pool assets
1188
- * @returns
1189
- */
1190
- getAssetOracles(): Promise<Record<string, xOracleRules>>;
1191
- /**
1192
- * Get switchboard on-demand aggregator object id based on coinType
1193
- * @param coinType
1194
- * @returns
1195
- */
1196
- getSwitchboardOnDemandAggregatorObjectIds(coinName: string[]): Promise<string[]>;
1197
- }
1198
-
1199
- type ScallopBuilderParams = {
1200
- query?: ScallopQuery;
1201
- usePythPullModel?: boolean;
1202
- sponsoredFeeds?: string[];
1203
- useOnChainXOracleList?: boolean;
1204
- } & ScallopQueryParams;
1205
- /**
1206
- * @description
1207
- * It provides methods for operating the transaction block, making it more convenient to organize transaction combinations.
1208
- *
1209
- * @example
1210
- * ```typescript
1211
- * const scallopBuilder = new ScallopBuilder(<parameters>);
1212
- * await scallopBuilder.init();
1213
- * const txBlock = scallopBuilder.<builder functions>();
1214
- * ```
1215
- */
1216
- declare class ScallopBuilder implements ScallopBuilderInterface {
1217
- readonly query: ScallopQuery;
1218
- readonly usePythPullModel: boolean;
1219
- readonly useOnChainXOracleList: boolean;
1220
- readonly sponsoredFeeds: string[];
1221
- constructor(params?: ScallopBuilderParams);
1222
- get utils(): ScallopUtils;
1223
- get constants(): ScallopConstants;
1224
- get walletAddress(): string;
1225
- get scallopSuiKit(): ScallopSuiKit;
1226
- get suiKit(): _scallop_io_sui_kit.SuiKit;
1227
- get address(): ScallopConstants;
1228
- /**
1229
- * Request the scallop API to initialize data.
1230
- *
1231
- * @param force - Whether to force initialization.
1232
- */
1233
- init(force?: boolean): Promise<void>;
1234
- /**
1235
- * Create a scallop txBlock instance that enhances transaction block.
1236
- *
1237
- * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1238
- * @return Scallop txBlock.
1239
- */
1240
- createTxBlock(txBlock?: ScallopTxBlock | SuiTxBlock | Transaction$1): ScallopTxBlock;
1241
- /**
1242
- * Specifying the sender's amount of coins to get coins args from transaction result.
1243
- *
1244
- * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1245
- * @param assetCoinName - Specific support asset coin name.
1246
- * @param amount - Amount of coins to be selected.
1247
- * @param sender - Sender address.
1248
- * @param isSponsored - Whether the transaction is a sponsored transaction.
1249
- * @return Take coin and left coin.
1250
- */
1251
- selectCoin(txBlock: ScallopTxBlock | SuiTxBlock, assetCoinName: string, amount: number, sender?: string, isSponsored?: boolean): Promise<{
1252
- takeCoin: {
1253
- NestedResult: [number, number];
1254
- $kind: "NestedResult";
1255
- };
1256
- leftCoin?: undefined;
1257
- totalAmount?: undefined;
1258
- } | {
1259
- takeCoin: TransactionObjectArgument;
1260
- leftCoin: TransactionObjectArgument;
1261
- totalAmount: number;
1262
- }>;
1263
- /**
1264
- * Specifying the sender's amount of market coins to get coins args from transaction result.
1265
- *
1266
- * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1267
- * @param marketCoinName - Specific support market coin name.
1268
- * @param amount - Amount of coins to be selected.
1269
- * @param sender - Sender address.
1270
- * @return Take coin and left coin.
1271
- */
1272
- selectMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, marketCoinName: string, amount: number, sender?: string): Promise<{
1273
- takeCoin: TransactionObjectArgument;
1274
- leftCoin: TransactionObjectArgument;
1275
- totalAmount: number;
1276
- }>;
1277
- /**
1278
- * Specifying the sender's amount of sCoins to get coins args from transaction result.
1279
- *
1280
- * @param txBlock - Scallop txBlock or txBlock created by SuiKit .
1281
- * @param marketCoinName - Specific support sCoin name.
1282
- * @param amount - Amount of coins to be selected.
1283
- * @param sender - Sender address.
1284
- * @return Take coin and left coin.
1285
- */
1286
- selectSCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
1287
- takeCoin: TransactionObjectArgument;
1288
- leftCoin: TransactionObjectArgument;
1289
- totalAmount: number;
1290
- }>;
1291
- /**
1292
- * Select sCoin or market coin automatically. Prioritize sCoin first
1293
- */
1294
- selectSCoinOrMarketCoin(txBlock: ScallopTxBlock | SuiTxBlock, sCoinName: string, amount: number, sender?: string): Promise<{
1295
- sCoin: TransactionObjectArgument | undefined;
1296
- marketCoin: TransactionObjectArgument | undefined;
1297
- }>;
1298
- /**
1299
- * Execute Scallop txBlock using the `signAndSendTxn` methods in suikit.
1300
- *
1301
- * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
1302
- */
1303
- signAndSendTxBlock(txBlock: ScallopTxBlock | SuiTxBlock | Transaction$1): Promise<SuiTransactionBlockResponse>;
1304
- moveCall(txb: ScallopTxBlock | SuiTxBlock, target: string, args?: (SuiTxArg | SuiVecTxArg | SuiObjectArg | SuiAmountsArg)[], typeArgs?: string[]): _scallop_io_sui_kit.TransactionResult;
1305
- }
1306
-
1307
- interface ScallopBaseInterface {
1308
- scallopSuiKit: ScallopSuiKit;
1309
- constants: ScallopConstants;
1310
- walletAddress: string;
1311
- init: () => Promise<void>;
1312
- }
1313
- interface ScallopUtilsInterface extends ScallopBaseInterface {
1314
- address: ScallopAddress;
1315
- }
1316
- interface ScallopQueryInterface extends ScallopUtilsInterface {
1317
- utils: ScallopUtils;
1318
- }
1319
- interface ScallopBuilderInterface extends ScallopQueryInterface {
1320
- query: ScallopQuery;
1321
- }
1322
- interface ScallopClientInterface extends ScallopBuilderInterface {
1323
- builder: ScallopBuilder;
1324
- }
1325
-
1326
- type ScallopUtilsParams = {
1327
- pythEndpoints?: string[];
1328
- scallopSuiKit?: ScallopSuiKit;
1329
- scallopConstants?: ScallopConstants;
1330
- } & ScallopSuiKitParams & ScallopConstantsParams;
1331
- declare class ScallopUtils implements ScallopUtilsInterface {
1332
- pythEndpoints: string[];
1333
- readonly scallopSuiKit: ScallopSuiKit;
1334
- readonly constants: ScallopConstants;
1335
- readonly timeout: number;
1336
- constructor(params?: ScallopUtilsParams);
1337
- get walletAddress(): string;
1338
- get suiKit(): _scallop_io_sui_kit.SuiKit;
1339
- get queryClient(): _tanstack_query_core.QueryClient;
1340
- get address(): ScallopConstants;
1341
- isSuiBridgeAsset(coinName: string): boolean;
1342
- isWormholeAsset(coinName: string): boolean;
1343
- isLayerZeroAsset(coinName: string): boolean;
1344
- isMarketCoin(coinName: string): boolean;
1345
- init({ force }?: {
1346
- force?: boolean;
1347
- }): Promise<void>;
1348
- /**
1349
- * Convert market coin name to coin name.
1350
- *
1351
- * @param marketCoinName - Specific support market coin name.
1352
- * @return Coin Name.
1353
- */
1354
- parseCoinName<T extends string>(marketCoinName: string): T;
1355
- /**
1356
- * Convert coin name to symbol.
1357
- *
1358
- * @param coinName - Specific support coin name.
1359
- * @return Symbol string.
1360
- */
1361
- parseSymbol(coinName: string): string;
1362
- /**
1363
- * Convert coin name to coin type.
1364
- *
1365
- * @description
1366
- * The Coin type of wormhole is fixed `coin:Coin`. Here using package id
1367
- * to determine and return the type.
1368
- *
1369
- * @param coinPackageId - Package id of coin.
1370
- * @param coinName - Specific support coin name.
1371
- * @return Coin type.
1372
- */
1373
- parseCoinType(coinName: string, useOldMarketCoin?: boolean): string;
1374
- /**
1375
- * Convert coin name to sCoin name.
1376
- *
1377
- * @param coinName - Specific support coin name.
1378
- * @return sCoin name.
1379
- */
1380
- parseSCoinName<T extends string>(coinName: string): T | undefined;
1381
- /**
1382
- * Convert sCoin name to market coin name.
1383
- * This function will parse new sCoin name `scallop_...` to its old market coin name which is shorter
1384
- * e.g: `scallop_sui -> ssui
1385
- * if no `scallop_...` is encountered, return coinName
1386
- * @return sCoin name
1387
- */
1388
- parseSCoinTypeNameToMarketCoinName(coinName: string): string;
1389
- /**
1390
- * Convert sCoin name into sCoin type
1391
- * @param sCoinName
1392
- * @returns sCoin type
1393
- */
1394
- parseSCoinType(sCoinName: string): string;
1395
- /**
1396
- * Convert sCoinType into sCoin name
1397
- * @param sCoinType
1398
- * @returns sCoin name
1399
- */
1400
- parseSCoinNameFromType(sCoinType: string): string | undefined;
1401
- /**
1402
- * Convert sCoin name into its underlying coin type
1403
- * @param sCoinName
1404
- * @returns coin type
1405
- */
1406
- parseUnderlyingSCoinType(sCoinName: string): string;
1407
- /**
1408
- * Get sCoin treasury id from sCoin name
1409
- * @param sCoinName
1410
- * @returns sCoin treasury id
1411
- */
1412
- getSCoinTreasury(sCoinName: string): any;
1413
- /**
1414
- * Convert coin name to market coin type.
1415
- *
1416
- * @param coinPackageId - Package id of coin.
1417
- * @param coinName - Specific support coin name.
1418
- * @return Market coin type.
1419
- */
1420
- parseMarketCoinType(coinName: string): string;
1421
- /**
1422
- * Convert coin name to market coin name.
1423
- *
1424
- * @param coinName - Specific support coin name.
1425
- * @return Market coin name.
1426
- */
1427
- parseMarketCoinName<T extends string>(coinName: string): T;
1428
- /**
1429
- * Get reward type of spool.
1430
- *
1431
- * @param stakeMarketCoinName - Support stake market coin.
1432
- * @return Spool reward coin name.
1433
- */
1434
- getSpoolRewardCoinName: () => string;
1435
- /**
1436
- * Get coin decimal.
1437
- *
1438
- * return Coin decimal.
1439
- */
1440
- getCoinDecimal(coinName: string): number;
1441
- /**
1442
- * Get coin wrapped type.
1443
- *
1444
- * return Coin wrapped type.
1445
- */
1446
- getCoinWrappedType(assetCoinName: string): CoinWrappedType;
1447
- /**
1448
- * Convert coin type to coin name.
1449
- *
1450
- * @description
1451
- * The coin name cannot be obtained directly from the wormhole type. Here
1452
- * the package id is used to determine and return a specific name.
1453
- *
1454
- * @param coinType - Specific support coin type.
1455
- * @return Coin Name.
1456
- */
1457
- parseCoinNameFromType(coinType: string): string;
1458
- /**
1459
- * Select coin id that add up to the given amount as transaction arguments.
1460
- *
1461
- * @param ownerAddress - The address of the owner.
1462
- * @param amount - The amount that including coin decimals.
1463
- * @param coinType - The coin type, default is 0x2::SUI::SUI.
1464
- * @return The selected transaction coin arguments.
1465
- */
1466
- selectCoins(amount: number, coinType?: string, ownerAddress?: string): Promise<{
1467
- objectId: string;
1468
- digest: string;
1469
- version: string;
1470
- balance: string;
1471
- }[]>;
1472
- /**
1473
- * Merge coins with type `coinType` to dest
1474
- * @param txBlock
1475
- * @param dest
1476
- * @param coinType
1477
- * @param sender
1478
- */
1479
- mergeSimilarCoins(txBlock: SuiTxBlock | Transaction, dest: SuiObjectArg, coinType: string, sender?: string): Promise<void>;
1480
- /**
1481
- * Get all asset coin names in the obligation record by obligation id.
1482
- *
1483
- * @description
1484
- * This can often be used to determine which assets in an obligation require
1485
- * price updates before interacting with specific instructions of the Scallop contract.
1486
- *
1487
- * @param obligationId - The obligation id.
1488
- * @return Asset coin Names.
1489
- */
1490
- getObligationCoinNames(obligationId: SuiObjectArg): Promise<string[] | undefined>;
1491
- private parseDataFromPythPriceFeed;
1492
- getPythPrice(assetCoinName: string, priceFeedObject?: SuiObjectData | null): Promise<number>;
1493
- getPythPrices(assetCoinNames: string[]): Promise<Record<string, number>>;
1494
- /**
1495
- * Get asset coin price.
1496
- *
1497
- * @description
1498
- * The strategy for obtaining the price is to get it through pyth API first,
1499
- * and then on-chain data if API cannot be retrieved.
1500
- * Currently, we only support obtaining from pyth protocol, other
1501
- * oracles will be supported in the future.
1502
- *
1503
- * @param assetCoinNames - Specific an array of support asset coin name.
1504
- * @return Asset coin price.
1505
- */
1506
- getCoinPrices(coinNames?: string[], useOnChainObjects?: boolean): Promise<OptionalKeys<Record<string, number>>>;
1507
- /**
1508
- * Convert apr to apy.
1509
- *
1510
- * @param apr The annual percentage rate (APR).
1511
- * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
1512
- * @return The equivalent annual percentage yield (APY) for the given APR and compounding frequency.
1513
- */
1514
- parseAprToApy(apr: number, compoundFrequency?: number): number;
1515
- /**
1516
- * Convert apy to apr.
1517
- *
1518
- * @param apr The equivalent annual percentage yield (APY).
1519
- * @param compoundFrequency How often interest is compounded per year. Default is daily (365 times a year).
1520
- * @return The equivalent annual percentage rate (APR) for the given APY and compounding frequency.
1521
- */
1522
- parseApyToApr(apy: number, compoundFrequency?: number): number;
1523
- /**
1524
- * Give extend lock period to get unlock at in seconds timestamp.
1525
- *
1526
- * @description
1527
- * - When the user without remaining unlock period, If the extended unlock day is not specified,
1528
- * the unlock period will be increased by one day by default.
1529
- * - When the given extended day plus the user's remaining unlock period exceeds the maximum
1530
- * unlock period, the maximum unlock period is used as unlock period.
1531
- *
1532
- * @param extendLockPeriodInDay The extend lock period in day.
1533
- * @param unlockAtInSecondTimestamp The unlock timestamp from veSca object.
1534
- * @return New unlock at in seconds timestamp.
1535
- */
1536
- getUnlockAt(extendLockPeriodInDay?: number, unlockAtInMillisTimestamp?: number): number;
1537
- /**
1538
- * Get detailed contract address and price id information for supported pool in Scallop
1539
- * @returns Supported pool informations
1540
- */
1541
- getSupportedPoolAddresses(): PoolAddress[];
1542
- }
1543
-
1544
- type ScallopClientParams = {
1545
- networkType?: NetworkType;
1546
- builder?: ScallopBuilder;
1547
- } & ScallopBuilderParams;
1548
- type ScallopClientFnReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : Transaction$1;
1549
- type ScallopClientVeScaReturnType<T extends boolean> = T extends true ? SuiTransactionBlockResponse : {
1550
- tx: Transaction$1;
1551
- scaCoin: TransactionResult;
1552
- };
1553
- /**
1554
- * @description
1555
- * It provides contract interaction operations for general users.
1556
- *
1557
- * @example
1558
- * ```typescript
1559
- * const scallopClient = new ScallopClient(<parameters>);
1560
- * await scallopClient.init();
1561
- * scallopClient.<client functions>();
1562
- * await scallopClient.<client async functions>();
1563
- * ```
1564
- */
1565
- declare class ScallopClient implements ScallopClientInterface {
1566
- readonly builder: ScallopBuilder;
1567
- networkType: NetworkType;
1568
- constructor(params?: ScallopClientParams);
1569
- get query(): ScallopQuery;
1570
- get utils(): ScallopUtils;
1571
- get constants(): ScallopConstants;
1572
- get walletAddress(): string;
1573
- get scallopSuiKit(): ScallopSuiKit;
1574
- get address(): ScallopConstants;
1575
- /**
1576
- * Request the scallop API to initialize data.
1577
- *
1578
- * @param force - Whether to force initialization.
1579
- */
1580
- init(force?: boolean): Promise<void>;
1581
- /**
1582
- * Query market data.
1583
- * @deprecated use ScallopQuery instance instead
1584
- * @description
1585
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1586
- *
1587
- * @return Market data.
1588
- */
1589
- queryMarket(): Promise<Market>;
1590
- /**
1591
- * Get obligations data.
1592
- * @deprecated use ScallopQuery instance instead
1593
- * @description
1594
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1595
- *
1596
- * @param ownerAddress - The owner address.
1597
- * @return Obligations data.
1598
- */
1599
- getObligations(ownerAddress?: string): Promise<Obligation[]>;
1600
- /**
1601
- * Query obligation data.
1602
- * @deprecated use ScallopQuery instance instead
1603
- * @description
1604
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1605
- *
1606
- * @param obligationId - The obligation id.
1607
- * @return Obligation data.
1608
- */
1609
- queryObligation(obligationId: string): Promise<ObligationQueryInterface | undefined>;
1610
- /**
1611
- * Query all stake accounts data.
1612
- * @deprecated use ScallopQuery instance instead
1613
- * @description
1614
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1615
- *
1616
- * @param ownerAddress - The owner address.
1617
- * @return All stake accounts data.
1618
- */
1619
- getAllStakeAccounts(ownerAddress?: string): Promise<StakeAccounts>;
1620
- /**
1621
- * Query stake account data.
1622
- * @deprecated use ScallopQuery instance instead
1623
- * @description
1624
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1625
- *
1626
- * @param stakeMarketCoinName - Support stake market coin.
1627
- * @param ownerAddress - The owner address.
1628
- * @return Stake accounts data.
1629
- */
1630
- getStakeAccounts(stakeMarketCoinName: string, ownerAddress?: string): Promise<StakeAccount[]>;
1631
- /**
1632
- * Query stake pool data.
1633
- * @deprecated use ScallopQuery instance instead
1634
- *
1635
- * @description
1636
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1637
- *
1638
- * @param stakeMarketCoinName - Support stake market coin.
1639
- * @return Stake pool data.
1640
- */
1641
- getStakePool(stakeMarketCoinName: string): Promise<StakePool | undefined>;
1642
- /**
1643
- * Query reward pool data.
1644
- * @deprecated use ScallopQuery instance instead
1645
- *
1646
- * @description
1647
- * This method might be deprecated in the future, please use the {@link ScallopQuery} query instance instead.
1648
- *
1649
- * @param stakeMarketCoinName - Support stake market coin.
1650
- * @return Reward pool data.
1651
- */
1652
- getStakeRewardPool(stakeMarketCoinName: string): Promise<StakeRewardPool | undefined>;
1653
- /**
1654
- * Open obligation.
1655
- *
1656
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1657
- * @return Transaction block response or transaction block.
1658
- */
1659
- openObligation(): Promise<SuiTransactionBlockResponse>;
1660
- openObligation<S extends boolean>(sign?: S): Promise<ScallopClientFnReturnType<S>>;
1661
- /**
1662
- * Deposit collateral into the specific pool.
1663
- *
1664
- * @param collateralCoinName - Types of collateral coin.
1665
- * @param amount - The amount of coins would deposit.
1666
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1667
- * @param obligationId - The obligation object.
1668
- * @param walletAddress - The wallet address of the owner.
1669
- * @param isSponsoredTx - Whether the transaction is sponsored.
1670
- * @return Transaction block response or transaction block.
1671
- */
1672
- depositCollateral(collateralCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1673
- depositCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign?: S, obligationId?: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
1674
- /**
1675
- * Withdraw collateral from the specific pool.
1676
- *
1677
- * @param collateralCoinName - Types of collateral coin.
1678
- * @param amount - The amount of coins would deposit.
1679
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1680
- * @param obligationId - The obligation object.
1681
- * @param obligationKey - The obligation key object to verifying obligation authority.
1682
- * @param walletAddress - The wallet address of the owner.
1683
- * @param isSponsoredTx - Whether the transaction is sponsored.
1684
- * @return Transaction block response or transaction block.
1685
- */
1686
- withdrawCollateral(collateralCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1687
- withdrawCollateral<S extends boolean>(collateralCoinName: string, amount: number, sign?: S, obligationId?: string, obligationKey?: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
1688
- /**
1689
- * @deprecated Use {@link supply} instead.
1690
- * Deposit asset into the specific pool.
1691
- *
1692
- * @param poolCoinName - Types of pool coin.
1693
- * @param amount - The amount of coins would deposit.
1694
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1695
- * @param walletAddress - The wallet address of the owner.
1696
- * @return Transaction block response or transaction block.
1697
- */
1698
- deposit(poolCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1699
- deposit<S extends boolean>(poolCoinName: string, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1700
- /**
1701
- * Supply asset into the specific lending pool.
1702
- *
1703
- * @param poolCoinName - Types of pool coin.
1704
- * @param amount - The amount of coins would deposit.
1705
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1706
- * @param walletAddress - The wallet address of the owner.
1707
- * @return Transaction block response or transaction block.
1708
- */
1709
- supply(poolCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1710
- supply<S extends boolean>(poolCoinName: string, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1711
- /**
1712
- * @deprecated Use {@link supplyAndStake}
1713
- * Deposit asset into the specific pool and Stake market coin into the corresponding spool.
1714
- *
1715
- * @param stakeCoinName - Types of stake coin.
1716
- * @param amount - The amount of coins would deposit.
1717
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1718
- * @param stakeAccountId - The stake account object.
1719
- * @param walletAddress - The wallet address of the owner.
1720
- * @return Transaction block response or transaction block.
1721
- */
1722
- depositAndStake(stakeCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1723
- depositAndStake<S extends boolean>(stakeCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1724
- /**
1725
- * Supply asset into the specific lending pool and stake market coin into the corresponding staking pool (spool).
1726
- *
1727
- * @param stakeCoinName - Types of stake coin.
1728
- * @param amount - The amount of coins would supply.
1729
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1730
- * @param stakeAccountId - The stake account object.
1731
- * @param walletAddress - The wallet address of the owner.
1732
- * @return Transaction block response or transaction block.
1733
- */
1734
- supplyAndStake(stakeCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1735
- supplyAndStake<S extends boolean>(stakeCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1736
- /**
1737
- * Withdraw asset from the specific lending pool, must return market coin.
1738
- *
1739
- * @param poolCoinName - Specific support pool coin name.
1740
- * @param amount - The amount of coins would withdraw.
1741
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1742
- * @param walletAddress - The wallet address of the owner.
1743
- * @return Transaction block response or transaction block.
1744
- */
1745
- withdraw(poolCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1746
- withdraw<S extends boolean>(poolCoinName: string, amount: number, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1747
- /**
1748
- * Borrow asset from the specific pool.
1749
- *
1750
- * @param poolCoinName - Specific support pool coin name.
1751
- * @param amount - The amount of coins would borrow.
1752
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1753
- * @param obligationId - The obligation object.
1754
- * @param obligationKey - The obligation key object to verifying obligation authority.
1755
- * @param walletAddress - The wallet address of the owner.
1756
- * @param isSponsoredTx - Whether the transaction is sponsored.
1757
- * @return Transaction block response or transaction block.
1758
- */
1759
- borrow<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
1760
- /**
1761
- * Repay asset into the specific pool.
1762
- *
1763
- * @param poolCoinName - Specific support pool coin name.
1764
- * @param amount - The amount of coins would repay.
1765
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1766
- * @param obligationId - The obligation object.
1767
- * @param walletAddress - The wallet address of the owner.
1768
- * @param isSponsoredTx - Whether the transaction is sponsored.
1769
- * @return Transaction block response or transaction block.
1770
- */
1771
- repay<S extends boolean>(poolCoinName: string, amount: number, sign: S | undefined, obligationId: string, obligationKey: string, walletAddress?: string, isSponsoredTx?: boolean): Promise<ScallopClientFnReturnType<S>>;
1772
- /**
1773
- * FlashLoan asset from the specific pool.
1774
- *
1775
- * @param poolCoinName - Specific support pool coin name..
1776
- * @param amount - The amount of coins would repay.
1777
- * @param callback - The callback function to build transaction block and return coin argument.
1778
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1779
- * @return Transaction block response or transaction block.
1780
- */
1781
- flashLoan(poolCoinName: string, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg): Promise<SuiTransactionBlockResponse>;
1782
- flashLoan<S extends boolean>(poolCoinName: string, amount: number, callback: (txBlock: ScallopTxBlock, coin: TransactionObjectArgument | string) => SuiObjectArg, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1783
- /**
1784
- * Create stake account.
1785
- *
1786
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1787
- * @param walletAddress - The wallet address of the owner.
1788
- * @return Transaction block response or transaction block.
1789
- */
1790
- createStakeAccount(marketCoinName: string): Promise<SuiTransactionBlockResponse>;
1791
- createStakeAccount<S extends boolean>(marketCoinName: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1792
- /**
1793
- * Stake market coin into the specific spool.
1794
- *
1795
- * @param marketCoinName - Types of market coin.
1796
- * @param amount - The amount of coins would deposit.
1797
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1798
- * @param stakeAccountId - The stake account object.
1799
- * @param walletAddress - The wallet address of the owner.
1800
- * @return Transaction block response or transaction block.
1801
- */
1802
- stake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1803
- stake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1804
- /**
1805
- * Unstake market coin from the specific spool.
1806
- *
1807
- * @param stakeMarketCoinName - Types of mak coin.
1808
- * @param amount - The amount of coins would deposit.
1809
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1810
- * @param accountId - The stake account object.
1811
- * @param walletAddress - The wallet address of the owner.
1812
- * @return Transaction block response or transaction block.
1813
- */
1814
- unstake(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1815
- unstake<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1816
- /**
1817
- * Unstake market coin from the specific spool and withdraw asset from the corresponding pool.
1818
- *
1819
- * @param marketCoinName - Types of mak coin.
1820
- * @param amount - The amount of coins would deposit.
1821
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1822
- * @param accountId - The stake account object.
1823
- * @param walletAddress - The wallet address of the owner.
1824
- * @return Transaction block response or transaction block.
1825
- */
1826
- unstakeAndWithdraw(stakeMarketCoinName: string, amount: number): Promise<SuiTransactionBlockResponse>;
1827
- unstakeAndWithdraw<S extends boolean>(stakeMarketCoinName: string, amount: number, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1828
- /**
1829
- * Claim reward coin from the specific spool.
1830
- *
1831
- * @param stakeMarketCoinName - Types of mak coin.
1832
- * @param amount - The amount of coins would deposit.
1833
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1834
- * @param accountId - The stake account object.
1835
- * @param walletAddress - The wallet address of the owner.
1836
- * @return Transaction block response or transaction block.
1837
- */
1838
- claim(stakeMarketCoinName: string): Promise<SuiTransactionBlockResponse>;
1839
- claim<S extends boolean>(stakeMarketCoinName: string, sign?: S, stakeAccountId?: string, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1840
- /**
1841
- * stake obligaion.
1842
- *
1843
- * @param obligationId - The obligation account object.
1844
- * @param obligationKeyId - The obligation key account object.
1845
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1846
- * @param walletAddress - The wallet address of the owner.
1847
- * @return Transaction block response or transaction block
1848
- */
1849
- stakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1850
- /**
1851
- * unstake obligaion.
1852
- *
1853
- * @param obligationId - The obligation account object.
1854
- * @param obligationKeyId - The obligation key account object.
1855
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1856
- * @param walletAddress - The wallet address of the owner.
1857
- * @return Transaction block response or transaction block
1858
- */
1859
- unstakeObligation<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1860
- /**
1861
- * Claim borrow incentive reward.
1862
- *
1863
- * @param poolName
1864
- * @param amount - The amount of coins would deposit.
1865
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1866
- * @param accountId - The stake account object.
1867
- * @param walletAddress - The wallet address of the owner.
1868
- * @return Transaction block response or transaction block
1869
- */
1870
- claimBorrowIncentive<S extends boolean>(obligationId: string, obligationKeyId: string, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1871
- /**
1872
- * Function to migrate all market coin in user wallet into sCoin
1873
- * @returns Transaction response
1874
- */
1875
- migrateAllMarketCoin<S extends boolean>(includeStakePool?: boolean, sign?: S, walletAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1876
- /**
1877
- * Claim unlocked SCA from all veSCA accounts.
1878
- */
1879
- claimAllUnlockedSca(): Promise<SuiTransactionBlockResponse>;
1880
- claimAllUnlockedSca<S extends boolean>(sign?: S, walletAddress?: string): Promise<ScallopClientVeScaReturnType<S>>;
1881
- /**
1882
- * Mint and get test coin.
1883
- *
1884
- * @remarks
1885
- * Only be used on the test network.
1886
- *
1887
- * @param assetCoinName - Specific asset coin name.
1888
- * @param amount - The amount of coins minted and received.
1889
- * @param receiveAddress - The wallet address that receives the coins.
1890
- * @param sign - Decide to directly sign the transaction or return the transaction block.
1891
- * @return Transaction block response or transaction block.
1892
- */
1893
- mintTestCoin(assetCoinName: Exclude<string, 'sui'>, amount: number): Promise<SuiTransactionBlockResponse>;
1894
- mintTestCoin<S extends boolean>(assetCoinName: Exclude<string, 'sui'>, amount: number, sign?: S, receiveAddress?: string): Promise<ScallopClientFnReturnType<S>>;
1895
- }
94
+ };
95
+ rpc: {
96
+ getInspectTxn: (props?: QueryKeys.RPC.GetInspectTxn) => (string | QueryKeys.RPC.GetInspectTxn | undefined)[];
97
+ getObject: (props?: QueryKeys.RPC.GetObject) => (string | QueryKeys.RPC.GetObject | undefined)[];
98
+ getObjects: (props?: QueryKeys.RPC.GetObjects) => (string | QueryKeys.RPC.GetObjects | undefined)[];
99
+ getSharedObject: (props?: QueryKeys.RPC.GetSharedObject) => (string | QueryKeys.RPC.GetSharedObject | undefined)[];
100
+ getOwnedObjects: (props?: QueryKeys.RPC.GetOwnedObjects) => (string | QueryKeys.RPC.GetOwnedObjects | undefined)[];
101
+ getDynamicFields: (props?: QueryKeys.RPC.GetDynamicFields) => (string | QueryKeys.RPC.GetDynamicFields | undefined)[];
102
+ getDynamicFieldObject: (props?: QueryKeys.RPC.GetDynamicFieldObject) => (string | QueryKeys.RPC.GetDynamicFieldObject | undefined)[];
103
+ getTotalVeScaTreasuryAmount: (props?: QueryKeys.RPC.getTotalVeScaTreasuryAmount) => (string | {
104
+ refreshArgs: string | undefined;
105
+ veScaAmountArgs: string | undefined;
106
+ node?: string;
107
+ })[];
108
+ getCoinBalance: (props?: QueryKeys.RPC.GetCoinBalance) => (string | QueryKeys.RPC.GetCoinBalance | undefined)[];
109
+ getAllCoinBalances: (props?: QueryKeys.RPC.GetAllCoinBalances) => (string | QueryKeys.RPC.GetAllCoinBalances | undefined)[];
110
+ getNormalizedMoveFunction: (props?: QueryKeys.RPC.GetNormalizedMoveFunction) => (string | QueryKeys.RPC.GetNormalizedMoveFunction | undefined)[];
111
+ };
112
+ oracle: {
113
+ getPythLatestPriceFeeds: (endpoint?: string, priceIds?: string[]) => (string | string[] | undefined)[];
114
+ getCoinPrices: (priceIds: string[]) => (string | string[])[];
115
+ };
116
+ };
117
+
118
+ declare const RPC_PROVIDERS: string[];
1896
119
 
1897
120
  /**
1898
121
  * @argument params - The parameters for the Scallop instance.
@@ -1911,12 +134,12 @@ declare class ScallopClient implements ScallopClientInterface {
1911
134
  * const scallopUtils = await sdk.createScallopUtils();
1912
135
  * ```
1913
136
  */
1914
- type ScallopParams = {
137
+ type ScallopConstructorParams = {
1915
138
  client?: ScallopClient;
1916
- } & ScallopClientParams;
139
+ } & ScallopClientConstructorParams;
1917
140
  declare class Scallop {
1918
141
  readonly client: ScallopClient;
1919
- constructor(params?: ScallopParams);
142
+ constructor({ client, ...scallopClientArgs }: ScallopConstructorParams);
1920
143
  init(force?: boolean): Promise<void>;
1921
144
  /**
1922
145
  * Create a scallop client instance that already has initial data.
@@ -1942,12 +165,6 @@ declare class Scallop {
1942
165
  * @return Scallop Utils.
1943
166
  */
1944
167
  createScallopUtils(): Promise<ScallopUtils>;
1945
- /**
1946
- * Create a scallop indexer instance.
1947
- *
1948
- * @return Scallop Indexer.
1949
- */
1950
- createScallopIndexer(): Promise<ScallopIndexer>;
1951
168
  /**
1952
169
  * Get a scallop constants instance that already has initial data.
1953
170
  * @returns Scallop Constants
@@ -1955,1309 +172,6 @@ declare class Scallop {
1955
172
  getScallopConstants(): Promise<ScallopConstants>;
1956
173
  }
1957
174
 
1958
- type CoreIds = {
1959
- protocolPkg: string;
1960
- market: string;
1961
- version: string;
1962
- coinDecimalsRegistry: string;
1963
- xOracle: string;
1964
- };
1965
- type NestedResult = Extract<Argument, {
1966
- $kind: 'NestedResult';
1967
- }>;
1968
- /** Transaction command from getData().commands (MoveCall, TransferObjects, etc.) */
1969
- type TransactionCommand = ReturnType<Transaction$1['getData']>['commands'][number];
1970
- type Obligation$1 = NestedResult;
1971
- type ObligationKey = NestedResult;
1972
- type ObligationHotPotato = NestedResult;
1973
- type CoreNormalMethods = {
1974
- openObligation: () => [Obligation$1, ObligationKey, ObligationHotPotato];
1975
- returnObligation: (obligation: SuiObjectArg, obligationHotPotato: SuiObjectArg) => void;
1976
- openObligationEntry: () => void;
1977
- /**
1978
- * @deprecated Use {@link depositCollateral} instead.
1979
- */
1980
- addCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
1981
- depositCollateral: (obligation: SuiObjectArg, coin: SuiObjectArg, collateralCoinName: string) => void;
1982
- takeCollateral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, collateralCoinName: string) => TransactionResult;
1983
- /**
1984
- * @deprecated Use {@link supply} instead.
1985
- */
1986
- deposit: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1987
- supply: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1988
- depositEntry: (coin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1989
- withdraw: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1990
- withdrawEntry: (marketCoin: SuiObjectArg, poolCoinName: string) => TransactionResult;
1991
- borrow: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
1992
- borrowWithReferral: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, borrowReferral: SuiObjectArg, amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
1993
- borrowEntry: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, amount: number, poolCoinName: string) => TransactionResult;
1994
- repay: (obligation: SuiObjectArg, coin: SuiObjectArg, poolCoinName: string) => void;
1995
- borrowFlashLoan: (amount: number | SuiTxArg, poolCoinName: string) => TransactionResult;
1996
- repayFlashLoan: (coin: SuiObjectArg, loan: SuiObjectArg, poolCoinName: string) => void;
1997
- liquidate: (obligation: SuiObjectArg, coin: SuiObjectArg, debtCoinName: string, collateralCoinName: string) => [NestedResult, NestedResult];
1998
- };
1999
- type CoreQuickMethods = {
2000
- /**
2001
- * @deprecated Use {@link depositCollateralQuick} instead.
2002
- */
2003
- addCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
2004
- depositCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
2005
- takeCollateralQuick: (amount: number, collateralCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
2006
- usePythPullModel?: boolean;
2007
- useOnChainXOracleList?: boolean;
2008
- sponsoredFeeds?: string[];
2009
- isSponsoredTx?: boolean;
2010
- }) => Promise<TransactionResult>;
2011
- borrowQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
2012
- usePythPullModel?: boolean;
2013
- useOnChainXOracleList?: boolean;
2014
- sponsoredFeeds?: string[];
2015
- isSponsoredTx?: boolean;
2016
- }) => Promise<TransactionResult>;
2017
- borrowWithReferralQuick: (amount: number, poolCoinName: string, borrowReferral: SuiObjectArg, obligationId?: SuiObjectArg, obligationKey?: SuiObjectArg, updateOracleOptions?: {
2018
- usePythPullModel?: boolean;
2019
- useOnChainXOracleList?: boolean;
2020
- sponsoredFeeds?: string[];
2021
- isSponsoredTx?: boolean;
2022
- }) => Promise<TransactionResult>;
2023
- /**
2024
- * @deprecated Use {@link supplyQuick} instead.
2025
- */
2026
- depositQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean, isSponsoredTx?: boolean) => Promise<TransactionResult>;
2027
- supplyQuick: (amount: number, poolCoinName: string, returnSCoin?: boolean, isSponsoredTx?: boolean) => Promise<TransactionResult>;
2028
- withdrawQuick: (amount: number, poolCoinName: string) => Promise<TransactionResult>;
2029
- repayQuick: (amount: number, poolCoinName: string, obligationId?: SuiObjectArg, isSponsoredTx?: boolean) => Promise<void>;
2030
- updateAssetPricesQuick: (assetCoinNames?: string[], updateOracleOptions?: {
2031
- usePythPullModel?: boolean;
2032
- useOnChainXOracleList?: boolean;
2033
- sponsoredFeeds?: string[];
2034
- isSponsoredTx?: boolean;
2035
- }) => Promise<void>;
2036
- liquidateQuick: (amount: number, debtCoinName: string, collateralCoinName: string, obligationId: SuiObjectArg, updateOracleOptions?: {
2037
- usePythPullModel?: boolean;
2038
- useOnChainXOracleList?: boolean;
2039
- sponsoredFeeds?: string[];
2040
- isSponsoredTx?: boolean;
2041
- }) => Promise<[NestedResult, NestedResult]>;
2042
- };
2043
- type SuiTxBlockWithCoreNormalMethods = SuiTxBlock & SuiTxBlockWithSpool & CoreNormalMethods;
2044
- type CoreTxBlock = SuiTxBlockWithCoreNormalMethods & CoreQuickMethods;
2045
- type GenerateCoreNormalMethod = (params: {
2046
- builder: ScallopBuilder;
2047
- txBlock: SuiTxBlock;
2048
- }) => CoreNormalMethods;
2049
- type GenerateCoreQuickMethod = (params: {
2050
- builder: ScallopBuilder;
2051
- txBlock: SuiTxBlockWithCoreNormalMethods;
2052
- }) => CoreQuickMethods;
2053
-
2054
- type SpoolIds = {
2055
- spoolPkg: string;
2056
- };
2057
- type SpoolNormalMethods = {
2058
- createStakeAccount: (stakeMarketCoinName: string) => TransactionResult;
2059
- stake: (stakeAccount: SuiAddressArg, coin: SuiObjectArg, stakeMarketCoinName: string) => void;
2060
- unstake: (stakeAccount: SuiAddressArg, amount: number, stakeMarketCoinName: string) => TransactionResult;
2061
- claim: (stakeAccount: SuiAddressArg, stakeMarketCoinName: string) => TransactionResult;
2062
- };
2063
- type SpoolQuickMethods = {
2064
- stakeQuick(amountOrMarketCoin: SuiObjectArg | number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<void>;
2065
- unstakeQuick(amount: number, stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg, returnSCoin?: boolean): Promise<TransactionResult | undefined>;
2066
- claimQuick(stakeMarketCoinName: string, stakeAccountId?: SuiAddressArg): Promise<TransactionResult[]>;
2067
- };
2068
- type SuiTxBlockWithSpoolNormalMethods = SuiTxBlock & SuiTxBlockWithSCoin & SpoolNormalMethods;
2069
- type SpoolTxBlock = SuiTxBlockWithSpoolNormalMethods & SpoolQuickMethods;
2070
- type GenerateSpoolNormalMethod = (params: {
2071
- builder: ScallopBuilder;
2072
- txBlock: SuiTxBlock;
2073
- }) => SpoolNormalMethods;
2074
- type GenerateSpoolQuickMethod = (params: {
2075
- builder: ScallopBuilder;
2076
- txBlock: SuiTxBlockWithSpoolNormalMethods;
2077
- }) => SpoolQuickMethods;
2078
-
2079
- type BorrowIncentiveIds = {
2080
- borrowIncentivePkg: string;
2081
- query: string;
2082
- config: string;
2083
- incentivePools: string;
2084
- incentiveAccounts: string;
2085
- obligationAccessStore: string;
2086
- };
2087
- type BorrowIncentiveNormalMethods = {
2088
- stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
2089
- stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
2090
- unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
2091
- claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, rewardType: string) => TransactionResult;
2092
- deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
2093
- };
2094
- type BorrowIncentiveQuickMethods = {
2095
- stakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
2096
- stakeObligationWithVeScaQuick(obligation?: string, obligationKey?: string, veScaKey?: string): Promise<void>;
2097
- unstakeObligationQuick(obligation?: string, obligationKey?: string): Promise<void>;
2098
- claimBorrowIncentiveQuick(rewardType: string, obligation?: string, obligationKey?: string): Promise<TransactionResult>;
2099
- };
2100
- type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiTxBlock & BorrowIncentiveNormalMethods;
2101
- type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
2102
- type GenerateBorrowIncentiveNormalMethod = (params: {
2103
- builder: ScallopBuilder;
2104
- txBlock: SuiTxBlock;
2105
- }) => BorrowIncentiveNormalMethods;
2106
- type GenerateBorrowIncentiveQuickMethod = (params: {
2107
- builder: ScallopBuilder;
2108
- txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
2109
- }) => BorrowIncentiveQuickMethods;
2110
-
2111
- /** Dynamic field response structure from queryGetDynamicFieldObject (subs table) - SDK v2 */
2112
- type DynamicFieldResponseWithContents = {
2113
- object?: {
2114
- json?: {
2115
- value?: {
2116
- contents?: unknown[];
2117
- };
2118
- };
2119
- };
2120
- };
2121
- type VeScaNormalMethods = {
2122
- lockSca: (scaCoin: SuiObjectArg, unlockAtInSecondTimestamp: number) => TransactionResult;
2123
- extendLockPeriod: (veScaKey: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
2124
- extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
2125
- renewExpiredVeSca: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg, newUnlockAtInSecondTimestamp: number) => void;
2126
- redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
2127
- mintEmptyVeSca: () => TransactionResult;
2128
- splitVeSca: (veScaKey: SuiObjectArg, splitAmount: string) => TransactionResult;
2129
- mergeVeSca: (targetVeScaKey: SuiObjectArg, sourceVeScaKey: SuiObjectArg) => void;
2130
- };
2131
- type QuickMethodReturnType<T extends boolean> = T extends true ? void : TransactionResult;
2132
- type VeScaQuickMethods = {
2133
- /**
2134
- * Quick methods to automate
2135
- * lock initial SCA, extend lock period, lock more SCA, renew expired VeSCA, and redeem SCA
2136
- *
2137
- * **Flow:**
2138
- * - If only `amountOrCoin` is provided, it will lock the amount of existing not expired veSCA
2139
- * - If only `lockPeriodInDays` is provided, it will extend the lock period of existing not expired veSCA
2140
- *
2141
- * **Note:**
2142
- * - If one or both flow above is used on a expired veSCA, it will claim the unlocked SCA
2143
- * and renew the veSCA first, and then flow continues
2144
- * - If users has no veSCA yet, they need to provide both `amountOrCoin` and `lockPeriodInDays` for initial lock
2145
- * @param amountOrCoin
2146
- * @param lockPeriodInDays
2147
- * @param autoCheck
2148
- */
2149
- lockScaQuick(params: {
2150
- amountOrCoin?: SuiObjectArg | number;
2151
- lockPeriodInDays?: number;
2152
- autoCheck?: boolean;
2153
- veScaKey?: SuiObjectData | string;
2154
- }): Promise<void>;
2155
- extendLockPeriodQuick: (params: {
2156
- lockPeriodInDays: number;
2157
- autoCheck?: boolean;
2158
- veScaKey?: SuiObjectData | string;
2159
- }) => Promise<void>;
2160
- extendLockAmountQuick: (params: {
2161
- scaAmount: number;
2162
- autoCheck?: boolean;
2163
- veScaKey?: SuiObjectData | string;
2164
- }) => Promise<void>;
2165
- renewExpiredVeScaQuick: (params: {
2166
- scaAmount: number;
2167
- lockPeriodInDays: number;
2168
- autoCheck?: boolean;
2169
- veScaKey?: SuiObjectData | string;
2170
- }) => Promise<void>;
2171
- redeemScaQuick: <T extends boolean>(params: {
2172
- veScaKey?: SuiObjectData | string;
2173
- transferSca?: T;
2174
- }) => Promise<QuickMethodReturnType<T> | undefined>;
2175
- splitVeScaQuick: <T extends boolean>(params: {
2176
- splitAmount: string;
2177
- veScaKey: string;
2178
- transferVeScaKey?: T;
2179
- }) => Promise<QuickMethodReturnType<T> | undefined>;
2180
- mergeVeScaQuick: (params: {
2181
- targetVeScaKey: string;
2182
- sourceVeScaKey: string;
2183
- }) => Promise<void>;
2184
- };
2185
- type SuiTxBlockWithVeScaNormalMethods = SuiTxBlock & VeScaNormalMethods;
2186
- type VeScaTxBlock = SuiTxBlockWithVeScaNormalMethods & VeScaQuickMethods;
2187
- type GenerateVeScaNormalMethod = (params: {
2188
- builder: ScallopBuilder;
2189
- txBlock: SuiTxBlock;
2190
- }) => VeScaNormalMethods;
2191
- type GenerateVeScaQuickMethod = (params: {
2192
- builder: ScallopBuilder;
2193
- txBlock: SuiTxBlockWithVeScaNormalMethods;
2194
- }) => VeScaQuickMethods;
2195
-
2196
- type ReferralNormalMethods = {
2197
- bindToReferral: (veScaKeyId: string) => void;
2198
- claimReferralTicket: (poolCoinName: string) => TransactionResult$1;
2199
- burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: string) => void;
2200
- claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: string) => TransactionResult$1;
2201
- unbindReferral: () => void;
2202
- };
2203
- type ReferralQuickMethods = {
2204
- claimReferralRevenueQuick: (veScaKey: SuiObjectArg, coinNames: string[]) => Promise<void>;
2205
- };
2206
- type SuiTxBlockWithReferralNormalMethods = SuiTxBlock & ReferralNormalMethods;
2207
- type ReferralTxBlock = SuiTxBlockWithReferralNormalMethods & ReferralQuickMethods;
2208
-
2209
- type LoyaltyProgramNormalMethods = {
2210
- claimLoyaltyRevenue: (veScaKey: SuiObjectArg) => TransactionResult$1;
2211
- claimVeScaLoyaltyReward: (veScaKey: SuiObjectArg) => TransactionResult$1;
2212
- };
2213
- type LoyaltyProgramQuickMethods = {
2214
- claimLoyaltyRevenueQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2215
- claimVeScaLoyaltyRewardQuick: (veScaKey?: SuiObjectArg) => Promise<void>;
2216
- };
2217
- type SuiTxBlockWithLoyaltyProgramNormalMethods = SuiTxBlock & LoyaltyProgramNormalMethods;
2218
- type LoyaltyProgramTxBlock = SuiTxBlockWithLoyaltyProgramNormalMethods & LoyaltyProgramQuickMethods;
2219
- type GenerateLoyaltyProgramNormalMethod = (params: {
2220
- builder: ScallopBuilder;
2221
- txBlock: SuiTxBlock;
2222
- }) => LoyaltyProgramNormalMethods;
2223
- type GenerateLoyaltyProgramQuickMethod = (params: {
2224
- builder: ScallopBuilder;
2225
- txBlock: SuiTxBlockWithLoyaltyProgramNormalMethods;
2226
- }) => LoyaltyProgramQuickMethods;
2227
-
2228
- type sCoinPkgIds = {
2229
- pkgId: string;
2230
- };
2231
- type sCoinNormalMethods = {
2232
- /**
2233
- * Lock marketCoin and return sCoin
2234
- * @param marketCoinName
2235
- * @param marketCoin
2236
- * @returns
2237
- */
2238
- mintSCoin: (marketCoinName: string, marketCoin: SuiObjectArg) => TransactionResult$1;
2239
- /**
2240
- * Burn sCoin and return marketCoin
2241
- * @param sCoinName
2242
- * @param sCoin
2243
- * @returns
2244
- */
2245
- burnSCoin: (sCoinName: string, sCoin: SuiObjectArg) => TransactionResult$1;
2246
- };
2247
- type sCoinQuickMethods = {
2248
- mintSCoinQuick: (marketCoinName: string, amount: number) => Promise<TransactionResult$1>;
2249
- burnSCoinQuick: (sCoinName: string, amount: number) => Promise<TransactionResult$1>;
2250
- };
2251
- type SuiTxBlockWithSCoinNormalMethods = SuiTxBlock & BaseScallopTxBlock & sCoinNormalMethods;
2252
- type SCoinTxBlock = SuiTxBlockWithSCoinNormalMethods & sCoinQuickMethods;
2253
- type GenerateSCoinNormalMethod = (params: {
2254
- builder: ScallopBuilder;
2255
- txBlock: SuiTxBlock;
2256
- }) => sCoinNormalMethods;
2257
- type GenerateSCoinQuickMethod = (params: {
2258
- builder: ScallopBuilder;
2259
- txBlock: SuiTxBlockWithSCoinNormalMethods;
2260
- }) => sCoinQuickMethods;
2261
-
2262
- type BaseScallopTxBlock = ReferralTxBlock & LoyaltyProgramTxBlock & BorrowIncentiveTxBlock & VeScaTxBlock;
2263
- type SuiTxBlockWithSCoin = BaseScallopTxBlock & SCoinTxBlock;
2264
- type SuiTxBlockWithSpool = SuiTxBlockWithSCoin & SpoolTxBlock;
2265
- type ScallopTxBlock = SuiTxBlockWithSpool & CoreTxBlock;
2266
-
2267
- type PoolAddress = {
2268
- coinName: string;
2269
- symbol: string;
2270
- coinType: string;
2271
- coinMetadataId: string;
2272
- decimals: number;
2273
- isIsolated: boolean;
2274
- pythFeed?: string;
2275
- pythFeedObjectId?: string;
2276
- lendingPoolAddress?: string;
2277
- borrowDynamic?: string;
2278
- interestModel?: string;
2279
- borrowFeeKey?: string;
2280
- flashloanFeeObject?: string;
2281
- coinGeckoId?: string;
2282
- collateralPoolAddress?: string;
2283
- riskModel?: string;
2284
- supplyLimitKey?: string;
2285
- borrowLimitKey?: string;
2286
- sCoinType?: string;
2287
- sCoinName?: string;
2288
- sCoinSymbol?: string;
2289
- sCoinMetadataId?: string;
2290
- sCoinTreasury?: string;
2291
- isolatedAssetKey: string;
2292
- spool?: string;
2293
- spoolReward?: string;
2294
- spoolName?: string;
2295
- };
2296
- type Whitelist = {
2297
- lending: Set<string>;
2298
- borrowing: Set<string>;
2299
- collateral: Set<string>;
2300
- packages: Set<string>;
2301
- spool: Set<string>;
2302
- scoin: Set<string>;
2303
- suiBridge: Set<string>;
2304
- wormhole: Set<string>;
2305
- layerZero: Set<string>;
2306
- oracles: Set<string>;
2307
- borrowIncentiveRewards: Set<string>;
2308
- rewardsAsPoint: Set<string>;
2309
- pythEndpoints: Set<string>;
2310
- deprecated: Set<string>;
2311
- emerging: Set<string>;
2312
- };
2313
- type CoinWrappedType = {
2314
- from: string;
2315
- type: string;
2316
- } | undefined;
2317
-
2318
- type Coins = {
2319
- [K in string]: K;
2320
- };
2321
- type AssetCoins = {
2322
- [K in string]: K;
2323
- };
2324
- type MarketCoins = {
2325
- [K in string]: K;
2326
- };
2327
- type SCoins = {
2328
- [K in string]: K;
2329
- };
2330
- type StakeMarketCoins = {
2331
- [K in string]: K;
2332
- };
2333
- type StakeRewardCoins = {
2334
- [key in string]: string;
2335
- };
2336
- type SuiBridgeCoins = {
2337
- [K in string]: K;
2338
- };
2339
- type BorrowIncentiveRewardCoins = {
2340
- [key in string]: string[];
2341
- };
2342
- type AssetCoinIds = {
2343
- [key in string]: string;
2344
- };
2345
- type SCoinIds = {
2346
- [key in string]: string;
2347
- };
2348
- type SCoinTreasuryCaps = {
2349
- [key in string]: string;
2350
- };
2351
- type SCoinConverterTreasury = {
2352
- [key in string]: string;
2353
- };
2354
- type PickFromUnion<T, K extends string> = K extends T ? K : never;
2355
- type WormholeCoinIds = {
2356
- [key in PickFromUnion<string, 'weth' | 'wbtc' | 'wusdc' | 'wusdt' | 'wapt' | 'wsol'>]: string;
2357
- };
2358
- type VoloCoinIds = {
2359
- [key in PickFromUnion<string, 'vsui'>]: string;
2360
- };
2361
- type SuiBridgedCoinPackageIds = {
2362
- [key in string]: string;
2363
- };
2364
-
2365
- declare const _SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
2366
- type SupportOracleType = (typeof _SUPPORT_ORACLES)[number];
2367
- type xOracleRules = {
2368
- primary: SupportOracleType[];
2369
- secondary: SupportOracleType[];
2370
- };
2371
- type xOracleRuleType = keyof xOracleRules;
2372
- type xOracleListType = {
2373
- [key in string]: xOracleRules;
2374
- };
2375
-
2376
- interface BorrowIncentiveAccountKey {
2377
- id: string;
2378
- onwerId: string;
2379
- }
2380
- type OptionalKeys$4<T> = {
2381
- [K in keyof T]?: T[K];
2382
- };
2383
- type BorrowIncentivePools = OptionalKeys$4<Record<string, BorrowIncentivePool>>;
2384
- type BorrowIncentivePoolPoints = {
2385
- symbol: string;
2386
- coinName: string;
2387
- coinType: string;
2388
- coinDecimal: number;
2389
- coinPrice: number;
2390
- } & Required<Pick<ParsedBorrowIncentivePoolPointData, 'points' | 'distributedPoint' | 'weightedAmount'>> & CalculatedBorrowIncentivePoolPointData;
2391
- type BorrowIncentivePool = {
2392
- coinName: string;
2393
- symbol: string;
2394
- coinType: string;
2395
- coinDecimal: number;
2396
- coinPrice: number;
2397
- stakedAmount: number;
2398
- stakedCoin: number;
2399
- stakedValue: number;
2400
- points: OptionalKeys$4<Record<string, BorrowIncentivePoolPoints>>;
2401
- };
2402
- type OriginBorrowIncentivePoolPointData = {
2403
- point_type: {
2404
- name: string;
2405
- };
2406
- distributed_point_per_period: string;
2407
- point_distribution_time: string;
2408
- distributed_point: string;
2409
- points: string;
2410
- index: string;
2411
- base_weight: string;
2412
- weighted_amount: string;
2413
- last_update: string;
2414
- created_at: string;
2415
- };
2416
- type OriginBorrowIncentivePoolData = {
2417
- pool_type: {
2418
- name: string;
2419
- };
2420
- points: OriginBorrowIncentivePoolPointData[];
2421
- min_stakes: string;
2422
- max_stakes: string;
2423
- stakes: string;
2424
- created_at: string;
2425
- };
2426
- type ParsedBorrowIncentivePoolPointData = {
2427
- pointType: string;
2428
- distributedPointPerPeriod: number;
2429
- period: number;
2430
- distributedPoint: number;
2431
- points: number;
2432
- index: number;
2433
- baseWeight: number;
2434
- weightedAmount: number;
2435
- lastUpdate: number;
2436
- createdAt: number;
2437
- };
2438
- type ParsedBorrowIncentivePoolData = {
2439
- poolType: string;
2440
- poolPoints: OptionalKeys$4<Record<string, ParsedBorrowIncentivePoolPointData>>;
2441
- minStakes: number;
2442
- maxStakes: number;
2443
- staked: number;
2444
- };
2445
- type CalculatedBorrowIncentivePoolPointData = {
2446
- baseWeight: number;
2447
- weightedStakedAmount: number;
2448
- weightedStakedCoin: number;
2449
- weightedStakedValue: number;
2450
- distributedPointPerSec: number;
2451
- accumulatedPoints: number;
2452
- currentPointIndex: number;
2453
- currentTotalDistributedPoint: number;
2454
- rewardApr: number;
2455
- rewardPerSec: number;
2456
- };
2457
- type BorrowIncentiveAccounts = OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountData>>;
2458
- type OriginBorrowIncentiveAccountPoolData = {
2459
- point_type: {
2460
- name: string;
2461
- };
2462
- weighted_amount: string;
2463
- points: string;
2464
- total_points: string;
2465
- index: string;
2466
- };
2467
- type OriginBorrowIncentiveAccountData = {
2468
- points_list: OriginBorrowIncentiveAccountPoolData[];
2469
- pool_type: {
2470
- name: string;
2471
- };
2472
- debt_amount: string;
2473
- };
2474
- type ParsedBorrowIncentiveAccountPoolData = {
2475
- pointType: string;
2476
- weightedAmount: number;
2477
- points: number;
2478
- totalPoints: number;
2479
- index: number;
2480
- };
2481
- type ParsedBorrowIncentiveAccountData = {
2482
- pointList: OptionalKeys$4<Record<string, ParsedBorrowIncentiveAccountPoolData>>;
2483
- poolType: string;
2484
- debtAmount: number;
2485
- };
2486
- /**
2487
- * The query interface for `incentive_pools_query::incentive_pools_data` inspectTxn.
2488
- */
2489
- interface BorrowIncentivePoolsQueryInterface {
2490
- incentive_pools: OriginBorrowIncentivePoolData[];
2491
- }
2492
- /**
2493
- * The query interface for `incentive_account_query::incentive_account_data` inspectTxn.
2494
- */
2495
- interface BorrowIncentiveAccountsQueryInterface {
2496
- pool_records: OriginBorrowIncentiveAccountData[];
2497
- }
2498
-
2499
- type OptionalKeys$3<T> = {
2500
- [K in keyof T]?: T[K];
2501
- };
2502
- type MarketPools = OptionalKeys$3<Record<string, MarketPool>>;
2503
- type MarketCollaterals = OptionalKeys$3<Record<string, MarketCollateral>>;
2504
- type CoinAmounts = OptionalKeys$3<Record<string, number>>;
2505
- type MarketCoinAmounts = OptionalKeys$3<Record<string, number>>;
2506
- type SCoinAmounts = OptionalKeys$3<Record<string, number>>;
2507
- type BalanceSheet = {
2508
- cash: string;
2509
- debt: string;
2510
- market_coin_supply: string;
2511
- revenue: string;
2512
- };
2513
- type BorrowDynamic = {
2514
- borrow_index: string;
2515
- interest_rate: {
2516
- value: string;
2517
- };
2518
- interest_rate_scale: string;
2519
- last_updated: string;
2520
- };
2521
- type BorrowFee = {
2522
- value: string;
2523
- };
2524
- type InterestModel = {
2525
- base_borrow_rate_per_sec: {
2526
- value: string;
2527
- };
2528
- borrow_rate_on_high_kink: {
2529
- value: string;
2530
- };
2531
- borrow_rate_on_mid_kink: {
2532
- value: string;
2533
- };
2534
- borrow_weight: {
2535
- value: string;
2536
- };
2537
- borrow_fee_rate: {
2538
- value: string;
2539
- };
2540
- high_kink: {
2541
- value: string;
2542
- };
2543
- interest_rate_scale: string;
2544
- max_borrow_rate: {
2545
- value: string;
2546
- };
2547
- mid_kink: {
2548
- value: string;
2549
- };
2550
- min_borrow_amount: string;
2551
- revenue_factor: {
2552
- value: string;
2553
- };
2554
- type: string;
2555
- };
2556
- type RiskModel = {
2557
- collateral_factor: {
2558
- value: string;
2559
- };
2560
- liquidation_discount: {
2561
- value: string;
2562
- };
2563
- liquidation_factor: {
2564
- value: string;
2565
- };
2566
- liquidation_penalty: {
2567
- value: string;
2568
- };
2569
- liquidation_revenue_factor: {
2570
- value: string;
2571
- };
2572
- max_collateral_amount: string;
2573
- type: string;
2574
- };
2575
- type CollateralStat = {
2576
- amount: string;
2577
- };
2578
- type MarketPool = {
2579
- coinName: string;
2580
- symbol: string;
2581
- coinType: string;
2582
- marketCoinType: string;
2583
- sCoinType: string;
2584
- coinWrappedType: CoinWrappedType;
2585
- coinDecimal: number;
2586
- coinPrice: number;
2587
- maxSupplyCoin: number;
2588
- maxBorrowCoin: number;
2589
- isIsolated: boolean;
2590
- } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
2591
- type MarketCollateral = {
2592
- coinName: string;
2593
- symbol: string;
2594
- coinType: string;
2595
- marketCoinType: string;
2596
- coinWrappedType: CoinWrappedType;
2597
- coinDecimal: number;
2598
- coinPrice: number;
2599
- isIsolated: boolean;
2600
- } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPenalty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
2601
- type OriginMarketPoolData = {
2602
- type: string;
2603
- maxBorrowRate: {
2604
- value: string;
2605
- };
2606
- interestRate: {
2607
- value: string;
2608
- };
2609
- interestRateScale: string;
2610
- borrowIndex: string;
2611
- lastUpdated: string;
2612
- cash: string;
2613
- debt: string;
2614
- marketCoinSupply: string;
2615
- reserve: string;
2616
- reserveFactor: {
2617
- value: string;
2618
- };
2619
- borrowWeight: {
2620
- value: string;
2621
- };
2622
- borrowFeeRate: {
2623
- value: string;
2624
- };
2625
- baseBorrowRatePerSec: {
2626
- value: string;
2627
- };
2628
- borrowRateOnHighKink: {
2629
- value: string;
2630
- };
2631
- borrowRateOnMidKink: {
2632
- value: string;
2633
- };
2634
- highKink: {
2635
- value: string;
2636
- };
2637
- midKink: {
2638
- value: string;
2639
- };
2640
- minBorrowAmount: string;
2641
- isIsolated: boolean;
2642
- supplyLimit: string;
2643
- borrowLimit: string;
2644
- };
2645
- type ParsedMarketPoolData = {
2646
- coinType: string;
2647
- maxBorrowRate: number;
2648
- borrowRate: number;
2649
- borrowRateScale: number;
2650
- borrowIndex: number;
2651
- lastUpdated: number;
2652
- cashAmount: number;
2653
- debtAmount: number;
2654
- marketCoinSupplyAmount: number;
2655
- reserveAmount: number;
2656
- reserveFactor: number;
2657
- borrowWeight: number;
2658
- borrowFee: number;
2659
- baseBorrowRate: number;
2660
- borrowRateOnHighKink: number;
2661
- borrowRateOnMidKink: number;
2662
- highKink: number;
2663
- midKink: number;
2664
- minBorrowAmount: number;
2665
- isIsolated: boolean;
2666
- supplyLimit: number;
2667
- borrowLimit: number;
2668
- };
2669
- type CalculatedMarketPoolData = {
2670
- baseBorrowApr: number;
2671
- baseBorrowApy: number;
2672
- borrowAprOnHighKink: number;
2673
- borrowApyOnHighKink: number;
2674
- borrowAprOnMidKink: number;
2675
- borrowApyOnMidKink: number;
2676
- coinDecimal: number;
2677
- conversionRate: number;
2678
- maxBorrowApr: number;
2679
- maxBorrowApy: number;
2680
- borrowApr: number;
2681
- borrowApy: number;
2682
- borrowIndex: number;
2683
- growthInterest: number;
2684
- supplyAmount: number;
2685
- supplyCoin: number;
2686
- borrowAmount: number;
2687
- borrowCoin: number;
2688
- reserveAmount: number;
2689
- reserveCoin: number;
2690
- utilizationRate: number;
2691
- supplyApr: number;
2692
- supplyApy: number;
2693
- isIsolated: boolean;
2694
- maxSupplyCoin: number;
2695
- maxBorrowCoin: number;
2696
- };
2697
- type OriginMarketCollateralData = {
2698
- type: string;
2699
- isIsolated: boolean;
2700
- collateralFactor: {
2701
- value: string;
2702
- };
2703
- liquidationFactor: {
2704
- value: string;
2705
- };
2706
- liquidationDiscount: {
2707
- value: string;
2708
- };
2709
- liquidationPenalty: {
2710
- value: string;
2711
- };
2712
- liquidationReserveFactor: {
2713
- value: string;
2714
- };
2715
- maxCollateralAmount: string;
2716
- totalCollateralAmount: string;
2717
- };
2718
- type ParsedMarketCollateralData = {
2719
- coinType: string;
2720
- collateralFactor: number;
2721
- liquidationFactor: number;
2722
- liquidationDiscount: number;
2723
- liquidationPenalty: number;
2724
- liquidationReserveFactor: number;
2725
- maxCollateralAmount: number;
2726
- totalCollateralAmount: number;
2727
- isIsolated: boolean;
2728
- };
2729
- type CalculatedMarketCollateralData = {
2730
- coinDecimal: number;
2731
- isIsolated: boolean;
2732
- maxDepositAmount: number;
2733
- maxDepositCoin: number;
2734
- depositAmount: number;
2735
- depositCoin: number;
2736
- };
2737
- type Market = {
2738
- pools: MarketPools;
2739
- collaterals: MarketCollaterals;
2740
- data?: MarketQueryInterface;
2741
- };
2742
- type Obligation = {
2743
- id: string;
2744
- keyId: string;
2745
- locked: boolean;
2746
- };
2747
- /**
2748
- * The query interface for `market_query::market_data` inspectTxn.
2749
- */
2750
- interface MarketQueryInterface {
2751
- collaterals: {
2752
- collateralFactor: {
2753
- value: string;
2754
- };
2755
- liquidationDiscount: {
2756
- value: string;
2757
- };
2758
- liquidationFactor: {
2759
- value: string;
2760
- };
2761
- liquidationPanelty: {
2762
- value: string;
2763
- };
2764
- liquidationReserveFactor: {
2765
- value: string;
2766
- };
2767
- maxCollateralAmount: string;
2768
- totalCollateralAmount: string;
2769
- type: {
2770
- name: string;
2771
- };
2772
- }[];
2773
- pools: {
2774
- baseBorrowRatePerSec: {
2775
- value: string;
2776
- };
2777
- borrowRateOnHighKink: {
2778
- value: string;
2779
- };
2780
- borrowRateOnMidKink: {
2781
- value: string;
2782
- };
2783
- maxBorrowRate: {
2784
- value: string;
2785
- };
2786
- highKink: {
2787
- value: string;
2788
- };
2789
- midKink: {
2790
- value: string;
2791
- };
2792
- interestRate: {
2793
- value: string;
2794
- };
2795
- interestRateScale: string;
2796
- borrowIndex: string;
2797
- lastUpdated: string;
2798
- cash: string;
2799
- debt: string;
2800
- marketCoinSupply: string;
2801
- minBorrowAmount: string;
2802
- reserve: string;
2803
- reserveFactor: {
2804
- value: string;
2805
- };
2806
- borrowWeight: {
2807
- value: string;
2808
- };
2809
- borrowFeeRate: {
2810
- value: string;
2811
- };
2812
- type: {
2813
- name: string;
2814
- };
2815
- }[];
2816
- }
2817
- /**
2818
- * The query interface for `obligation_query::obligation_data` inspectTxn.
2819
- */
2820
- interface ObligationQueryInterface {
2821
- collaterals: {
2822
- type: {
2823
- name: string;
2824
- };
2825
- amount: string;
2826
- }[];
2827
- debts: {
2828
- type: {
2829
- name: string;
2830
- };
2831
- amount: string;
2832
- borrowIndex: string;
2833
- }[];
2834
- }
2835
-
2836
- type LoyaltyProgramInfo = {
2837
- pendingReward: number;
2838
- totalPoolReward: number;
2839
- isClaimEnabled: boolean;
2840
- };
2841
- type VeScaLoyaltyProgramInfo = {
2842
- pendingVeScaReward: number;
2843
- pendingScaReward: number;
2844
- totalPoolReward: number;
2845
- isClaimEnabled: boolean;
2846
- };
2847
-
2848
- type OptionalKeys$2<T> = {
2849
- [K in keyof T]?: T[K];
2850
- };
2851
- type Spools = OptionalKeys$2<Record<string, Spool>>;
2852
- type Spool = {
2853
- marketCoinName: string;
2854
- symbol: string;
2855
- coinType: string;
2856
- marketCoinType: string;
2857
- rewardCoinType: string;
2858
- sCoinType: string;
2859
- coinDecimal: number;
2860
- rewardCoinDecimal: number;
2861
- coinPrice: number;
2862
- marketCoinPrice: number;
2863
- rewardCoinPrice: number;
2864
- } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
2865
- type OriginSpoolData = {
2866
- stakeType: string;
2867
- maxDistributedPoint: string;
2868
- distributedPoint: string;
2869
- distributedPointPerPeriod: string;
2870
- pointDistributionTime: string;
2871
- maxStake: string;
2872
- stakes: string;
2873
- index: string;
2874
- createdAt: string;
2875
- lastUpdate: string;
2876
- };
2877
- type SpoolData = {
2878
- created_at: string;
2879
- distributed_point: string;
2880
- distributed_point_per_period: string;
2881
- id: {
2882
- id: string;
2883
- };
2884
- index: string;
2885
- last_update: string;
2886
- max_distributed_point: string;
2887
- max_stakes: string;
2888
- point_distribution_time: string;
2889
- stake_type: string;
2890
- stakes: string;
2891
- };
2892
- type ParsedSpoolData = {
2893
- stakeType: string;
2894
- maxPoint: number;
2895
- distributedPoint: number;
2896
- pointPerPeriod: number;
2897
- period: number;
2898
- maxStake: number;
2899
- staked: number;
2900
- index: number;
2901
- createdAt: number;
2902
- lastUpdate: number;
2903
- };
2904
- type CalculatedSpoolData = {
2905
- stakedAmount: number;
2906
- stakedCoin: number;
2907
- stakedValue: number;
2908
- distributedPointPerSec: number;
2909
- accumulatedPoints: number;
2910
- currentPointIndex: number;
2911
- currentTotalDistributedPoint: number;
2912
- startDate: Date;
2913
- endDate: Date;
2914
- };
2915
- type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
2916
- type OriginSpoolRewardPoolData = {
2917
- claimed_rewards: string;
2918
- exchange_rate_denominator: string;
2919
- exchange_rate_numerator: string;
2920
- rewards: string;
2921
- spool_id: string;
2922
- };
2923
- type ParsedSpoolRewardPoolData = {
2924
- claimedRewards: number;
2925
- exchangeRateDenominator: number;
2926
- exchangeRateNumerator: number;
2927
- rewards: number;
2928
- spoolId: string;
2929
- };
2930
- type CalculatedSpoolRewardPoolData = {
2931
- rewardApr: number;
2932
- totalRewardAmount: number;
2933
- totalRewardCoin: number;
2934
- totalRewardValue: number;
2935
- remaindRewardAmount: number;
2936
- remaindRewardCoin: number;
2937
- remaindRewardValue: number;
2938
- claimedRewardAmount: number;
2939
- claimedRewardCoin: number;
2940
- claimedRewardValue: number;
2941
- rewardPerSec: number;
2942
- };
2943
- type StakePools = OptionalKeys$2<Record<string, StakePool>>;
2944
- type StakeRewardPools = OptionalKeys$2<Record<string, StakeRewardPool>>;
2945
- type StakeAccounts = Record<string, StakeAccount[]>;
2946
- interface StakeAccount {
2947
- id: string;
2948
- type: string;
2949
- stakePoolId: string;
2950
- stakeType: string;
2951
- staked: number;
2952
- index: number;
2953
- points: number;
2954
- totalPoints: number;
2955
- }
2956
- interface StakePool {
2957
- id: string;
2958
- type: string;
2959
- maxPoint: number;
2960
- distributedPoint: number;
2961
- pointPerPeriod: number;
2962
- period: number;
2963
- maxStake: number;
2964
- stakeType: string;
2965
- totalStaked: number;
2966
- index: number;
2967
- createdAt: number;
2968
- lastUpdate: number;
2969
- }
2970
- interface StakeRewardPool {
2971
- id: string;
2972
- type: string;
2973
- stakePoolId: string;
2974
- ratioDenominator: number;
2975
- ratioNumerator: number;
2976
- rewards: number;
2977
- claimedRewards: number;
2978
- }
2979
-
2980
- type OptionalKeys$1<T> = {
2981
- [K in keyof T]?: T[K];
2982
- };
2983
- type Lendings = OptionalKeys$1<Record<string, Lending>>;
2984
- type ObligationAccounts = OptionalKeys$1<Record<string, ObligationAccount>>;
2985
- type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
2986
- supplyApr: number;
2987
- supplyApy: number;
2988
- rewardApr: number;
2989
- suppliedAmount: number;
2990
- suppliedCoin: number;
2991
- suppliedValue: number;
2992
- stakedMarketAmount: number;
2993
- stakedMarketCoin: number;
2994
- stakedAmount: number;
2995
- stakedCoin: number;
2996
- stakedValue: number;
2997
- unstakedMarketAmount: number;
2998
- unstakedMarketCoin: number;
2999
- unstakedAmount: number;
3000
- unstakedCoin: number;
3001
- unstakedValue: number;
3002
- availableSupplyAmount: number;
3003
- availableSupplyCoin: number;
3004
- availableWithdrawAmount: number;
3005
- availableWithdrawCoin: number;
3006
- availableStakeAmount: number;
3007
- availableStakeCoin: number;
3008
- availableUnstakeAmount: number;
3009
- availableUnstakeCoin: number;
3010
- availableClaimAmount: number;
3011
- availableClaimCoin: number;
3012
- };
3013
- type ObligationAccount = {
3014
- obligationId: string;
3015
- totalDepositedValue: number;
3016
- totalBorrowedValue: number;
3017
- totalBalanceValue: number;
3018
- totalBorrowCapacityValue: number;
3019
- totalAvailableCollateralValue: number;
3020
- totalBorrowedValueWithWeight: number;
3021
- totalRequiredCollateralValue: number;
3022
- totalUnhealthyCollateralValue: number;
3023
- totalRiskLevel: number;
3024
- totalDepositedPools: number;
3025
- totalBorrowedPools: number;
3026
- totalRewardedPools: number;
3027
- collaterals: OptionalKeys$1<Record<string, ObligationCollateral>>;
3028
- debts: OptionalKeys$1<Record<string, ObligationDebt>>;
3029
- borrowIncentives: OptionalKeys$1<Record<string, ObligationBorrowIncentive>>;
3030
- };
3031
- type ObligationCollateral = {
3032
- coinName: string;
3033
- coinType: string;
3034
- symbol: string;
3035
- coinDecimal: number;
3036
- coinPrice: number;
3037
- depositedAmount: number;
3038
- depositedCoin: number;
3039
- depositedValue: number;
3040
- borrowCapacityValue: number;
3041
- requiredCollateralValue: number;
3042
- availableDepositAmount: number;
3043
- availableDepositCoin: number;
3044
- availableWithdrawAmount: number;
3045
- availableWithdrawCoin: number;
3046
- };
3047
- type ObligationDebt = {
3048
- coinName: string;
3049
- coinType: string;
3050
- symbol: string;
3051
- coinDecimal: number;
3052
- coinPrice: number;
3053
- borrowedAmount: number;
3054
- borrowedCoin: number;
3055
- borrowedValue: number;
3056
- borrowedValueWithWeight: number;
3057
- borrowIndex: number;
3058
- requiredRepayAmount: number;
3059
- requiredRepayCoin: number;
3060
- availableBorrowAmount: number;
3061
- availableBorrowCoin: number;
3062
- availableRepayAmount: number;
3063
- availableRepayCoin: number;
3064
- rewards: ObligationBorrowIncentiveReward[];
3065
- };
3066
- type ObligationBorrowIncentiveReward = {
3067
- coinName: string;
3068
- coinType: string;
3069
- symbol: string;
3070
- coinDecimal: number;
3071
- coinPrice: number;
3072
- weightedBorrowAmount: number;
3073
- availableClaimCoin: number;
3074
- availableClaimAmount: number;
3075
- baseRewardApr: number;
3076
- boostValue: number;
3077
- boostedRewardApr: number;
3078
- maxBoost: number;
3079
- };
3080
- type ObligationBorrowIncentive = {
3081
- coinName: string;
3082
- coinType: string;
3083
- symbol: string;
3084
- coinDecimal: number;
3085
- coinPrice: number;
3086
- rewards: ObligationBorrowIncentiveReward[];
3087
- };
3088
- type TotalValueLocked = {
3089
- supplyLendingValue: number;
3090
- supplyCollateralValue: number;
3091
- supplyValue: number;
3092
- borrowValue: number;
3093
- totalValue: number;
3094
- supplyValueChangeRatio?: number;
3095
- supplyLendingValueChangeRatio?: number;
3096
- supplyCollateralValueChangeRatio?: number;
3097
- borrowValueChangeRatio?: number;
3098
- totalValueChangeRatio?: number;
3099
- };
3100
-
3101
- type sCoinBalance = number;
3102
-
3103
- type Vesca = {
3104
- id: string;
3105
- keyId: string;
3106
- keyObject?: SuiObjectRef;
3107
- object: SuiObjectRef;
3108
- lockedScaAmount: string;
3109
- lockedScaCoin: number;
3110
- currentVeScaBalance: number;
3111
- unlockAt: number;
3112
- };
3113
- type VeScaTreasuryFields = {
3114
- total_ve_sca_amount: string;
3115
- sca_balance: string;
3116
- unlock_schedule: {
3117
- locked_sca_amount: string;
3118
- };
3119
- };
3120
- type VeScaTreasuryInfo = {
3121
- totalLockedSca: number;
3122
- totalVeSca: number;
3123
- averageLockingPeriod: number;
3124
- averageLockingPeriodUnit: string;
3125
- };
3126
-
3127
- interface AddressesInterface {
3128
- id?: string;
3129
- core: {
3130
- version: string;
3131
- versionCap: string;
3132
- object: string;
3133
- market: string;
3134
- adminCap: string;
3135
- coinDecimalsRegistry: string;
3136
- obligationAccessStore: string;
3137
- coins: Partial<Record<string, {
3138
- id: string;
3139
- treasury: string;
3140
- metaData: string;
3141
- coinType: string;
3142
- symbol: string;
3143
- decimals: number;
3144
- oracle: {
3145
- [K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? string : K extends (typeof _SUPPORT_ORACLES)[1] ? string : K extends (typeof _SUPPORT_ORACLES)[2] ? {
3146
- feed: string;
3147
- feedObject: string;
3148
- } : never;
3149
- };
3150
- }>>;
3151
- oracles: {
3152
- [K in SupportOracleType]: K extends (typeof _SUPPORT_ORACLES)[0] ? {
3153
- registry: string;
3154
- registryCap: string;
3155
- holder: string;
3156
- } : K extends (typeof _SUPPORT_ORACLES)[1] ? {
3157
- registry: string;
3158
- registryCap: string;
3159
- registryTableId: string;
3160
- state: string;
3161
- } : K extends (typeof _SUPPORT_ORACLES)[2] ? {
3162
- registry: string;
3163
- registryCap: string;
3164
- state: string;
3165
- wormhole: string;
3166
- wormholeState: string;
3167
- } : never;
3168
- } & {
3169
- xOracle: string;
3170
- xOracleCap: string;
3171
- primaryPriceUpdatePolicyObject: string;
3172
- secondaryPriceUpdatePolicyObject: string;
3173
- primaryPriceUpdatePolicyVecsetId: string;
3174
- secondaryPriceUpdatePolicyVecsetId: string;
3175
- };
3176
- packages: Partial<Record<string, {
3177
- id: string;
3178
- object?: string;
3179
- upgradeCap: string;
3180
- }>>;
3181
- };
3182
- spool: {
3183
- id: string;
3184
- adminCap: string;
3185
- object: string;
3186
- config: string;
3187
- pools: Partial<Record<string, {
3188
- id: string;
3189
- rewardPoolId: string;
3190
- }>>;
3191
- };
3192
- borrowIncentive: {
3193
- id: string;
3194
- adminCap: string;
3195
- object: string;
3196
- query: string;
3197
- config: string;
3198
- incentivePools: string;
3199
- incentiveAccounts: string;
3200
- };
3201
- vesca: {
3202
- id: string;
3203
- object: string;
3204
- adminCap: string;
3205
- tableId: string;
3206
- table: string;
3207
- treasury: string;
3208
- config: string;
3209
- subsTable: string;
3210
- subsTableId: string;
3211
- subsWhitelist: string;
3212
- };
3213
- referral: {
3214
- id: string;
3215
- version: string;
3216
- object: string;
3217
- adminCap: string;
3218
- referralBindings: string;
3219
- bindingTableId: string;
3220
- referralRevenuePool: string;
3221
- revenueTableId: string;
3222
- referralTiers: string;
3223
- tiersTableId: string;
3224
- authorizedWitnessList: string;
3225
- };
3226
- loyaltyProgram: {
3227
- id: string;
3228
- adminCap?: string;
3229
- object: string;
3230
- rewardPool: string;
3231
- userRewardTableId: string;
3232
- };
3233
- veScaLoyaltyProgram: {
3234
- id: string;
3235
- adminCap?: string;
3236
- object: string;
3237
- veScaRewardPool: string;
3238
- veScaRewardTableId: string;
3239
- };
3240
- scoin: {
3241
- id: string;
3242
- coins: Partial<Record<string, {
3243
- coinType: string;
3244
- symbol: string;
3245
- treasury: string;
3246
- metaData: string;
3247
- }>>;
3248
- };
3249
- }
3250
- type AddressPathsProps<T> = T extends string ? [] : {
3251
- [K in Extract<keyof T, string>]: [K, ...AddressPathsProps<T[K]>];
3252
- }[Extract<keyof T, string>];
3253
- type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
3254
- type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
3255
-
3256
- type OptionalKeys<T> = {
3257
- [K in keyof T]?: T[K];
3258
- };
3259
- type CoinPrices = OptionalKeys<Record<string, number>>;
3260
-
3261
175
  declare const TEST_ADDRESSES: AddressesInterface;
3262
176
  declare const WHITELIST: {
3263
177
  lending: Set<string>;
@@ -3452,4 +366,75 @@ declare const MIN_TOP_UP_AMOUNT: 1000000000;
3452
366
 
3453
367
  declare const xOracleList: xOracleListType;
3454
368
 
3455
- export { API_BASE_URL, type AddressStringPath, type AddressesInterface, type AssetCoinIds, type AssetCoins, type BalanceSheet, type BaseScallopTxBlock, type BorrowDynamic, type BorrowFee, type BorrowIncentiveAccountKey, type BorrowIncentiveAccounts, type BorrowIncentiveAccountsQueryInterface, type BorrowIncentiveIds, type BorrowIncentiveNormalMethods, type BorrowIncentivePool, type BorrowIncentivePoolPoints, type BorrowIncentivePools, type BorrowIncentivePoolsQueryInterface, type BorrowIncentiveQuickMethods, type BorrowIncentiveRewardCoins, type BorrowIncentiveTxBlock, type CalculatedBorrowIncentivePoolPointData, type CalculatedMarketCollateralData, type CalculatedMarketPoolData, type CalculatedSpoolData, type CalculatedSpoolRewardPoolData, type CoinAmounts, type CoinBalance, type CoinPrices, type CoinWrappedType, type Coins, type CollateralStat, type CoreIds, type CoreNormalMethods, type CoreQuickMethods, type CoreTxBlock, DEFAULT_CACHE_OPTIONS, type DevInspectResults, type DynamicFieldPage, type DynamicFieldResponseWithContents, type EncodeDynamicFieldNameInput, type GenerateBorrowIncentiveNormalMethod, type GenerateBorrowIncentiveQuickMethod, type GenerateCoreNormalMethod, type GenerateCoreQuickMethod, type GenerateLoyaltyProgramNormalMethod, type GenerateLoyaltyProgramQuickMethod, type GenerateSCoinNormalMethod, type GenerateSCoinQuickMethod, type GenerateSpoolNormalMethod, type GenerateSpoolQuickMethod, type GenerateVeScaNormalMethod, type GenerateVeScaQuickMethod, type GetBalanceParams, type GetDynamicFieldObjectParams, type GetDynamicFieldsParams, type GetOwnedObjectsParams, IS_VE_SCA_TEST, type InspectTxnParsedJson, type InterestModel, type Lending, type Lendings, type LoyaltyProgramInfo, type LoyaltyProgramNormalMethods, type LoyaltyProgramQuickMethods, type LoyaltyProgramTxBlock, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, type Market, type MarketCoinAmounts, type MarketCoins, type MarketCollateral, type MarketCollaterals, type MarketPool, type MarketPools, type MarketQueryInterface, type NestedResult, OLD_BORROW_INCENTIVE_PROTOCOL_ID, type Obligation, type ObligationAccount, type ObligationAccounts, type ObligationBorrowIncentive, type ObligationBorrowIncentiveReward, type ObligationCollateral, type ObligationDebt, type ObligationQueryInterface, type OptionalKeys, type OriginBorrowIncentiveAccountData, type OriginBorrowIncentiveAccountPoolData, type OriginBorrowIncentivePoolData, type OriginBorrowIncentivePoolPointData, type OriginMarketCollateralData, type OriginMarketPoolData, type OriginSpoolData, type OriginSpoolRewardPoolData, POOL_ADDRESSES, type PaginatedObjectsResponse, type ParsedBorrowIncentiveAccountData, type ParsedBorrowIncentiveAccountPoolData, type ParsedBorrowIncentivePoolData, type ParsedBorrowIncentivePoolPointData, type ParsedMarketCollateralData, type ParsedMarketPoolData, type ParsedSpoolData, type ParsedSpoolRewardPoolData, type PoolAddress, type QuickMethodReturnType, RPC_PROVIDERS, type RiskModel, SCA_COIN_TYPE, type SCoinAmounts, type SCoinConverterTreasury, type SCoinIds, type SCoinTreasuryCaps, type SCoinTxBlock, type SCoins, SDK_API_BASE_URL, Scallop, ScallopAddress, ScallopBuilder, ScallopClient, ScallopConstants, ScallopIndexer, ScallopQuery, ScallopSuiKit, type ScallopTxBlock, ScallopUtils, type Spool, type SpoolData, type SpoolIds, type SpoolNormalMethods, type SpoolQuickMethods, type SpoolRewardPool, type SpoolTxBlock, type Spools, type StakeAccount, type StakeAccounts, type StakeMarketCoins, type StakePool, type StakePools, type StakeRewardCoins, type StakeRewardPool, type StakeRewardPools, type SuiBridgeCoins, type SuiBridgedCoinPackageIds, type SuiObjectData, type SuiObjectDataOptions, type SuiObjectRef, type SuiObjectResponse, type SuiParsedData, type SuiTxBlockWithBorrowIncentiveNormalMethods, type SuiTxBlockWithCoreNormalMethods, type SuiTxBlockWithLoyaltyProgramNormalMethods, type SuiTxBlockWithSCoin, type SuiTxBlockWithSCoinNormalMethods, type SuiTxBlockWithSpool, type SuiTxBlockWithSpoolNormalMethods, type SuiTxBlockWithVeScaNormalMethods, type SupportOracleType, TEST_ADDRESSES, type TotalValueLocked, type TransactionCommand, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, type VeScaLoyaltyProgramInfo, type VeScaNormalMethods, type VeScaQuickMethods, type VeScaTreasuryFields, type VeScaTreasuryInfo, type VeScaTxBlock, type Vesca, type VoloCoinIds, WHITELIST, type Whitelist, type WormholeCoinIds, _SUPPORT_ORACLES, queryKeys, type sCoinBalance, type sCoinNormalMethods, type sCoinPkgIds, type sCoinQuickMethods, xOracleList, type xOracleListType, type xOracleRuleType, type xOracleRules };
369
+ interface AddressConfigSource {
370
+ getAddresses(networkType?: NetworkType): AddressesInterface | undefined;
371
+ }
372
+ declare const createLiveAddressConfigSource: (constants: ScallopConstants) => AddressConfigSource;
373
+
374
+ interface PoolAddressConfigSource {
375
+ getPoolAddresses(): Readonly<Record<string, PoolAddress | undefined>>;
376
+ }
377
+ declare const createLivePoolAddressConfigSource: (constants: ScallopConstants) => PoolAddressConfigSource;
378
+
379
+ interface WhitelistConfigSource {
380
+ getWhitelist(): Readonly<Whitelist>;
381
+ }
382
+ declare const createLiveWhitelistConfigSource: (constants: ScallopConstants) => WhitelistConfigSource;
383
+
384
+ /**
385
+ * Immutable read-only view of the live `ScallopConstants` state used by
386
+ * services that should not mutate constants. Cheap to build — does not deep
387
+ * copy. Treat fields as read-only by convention; the readonly types prevent
388
+ * accidental writes at the TS level.
389
+ */
390
+ interface ScallopConfigSnapshot {
391
+ readonly addresses: Readonly<AddressesInterface> | undefined;
392
+ readonly poolAddresses: Readonly<Record<string, PoolAddress | undefined>>;
393
+ readonly whitelist: Readonly<{
394
+ lending: ReadonlySet<string>;
395
+ collateral: ReadonlySet<string>;
396
+ borrowing: ReadonlySet<string>;
397
+ packages: ReadonlySet<string>;
398
+ scoin: ReadonlySet<string>;
399
+ spool: ReadonlySet<string>;
400
+ oracles: ReadonlySet<string>;
401
+ pythEndpoints: ReadonlySet<string>;
402
+ emerging: ReadonlySet<string>;
403
+ suiBridge: ReadonlySet<string>;
404
+ wormhole: ReadonlySet<string>;
405
+ layerZero: ReadonlySet<string>;
406
+ }>;
407
+ get(path: AddressStringPath): string | undefined;
408
+ }
409
+ declare const createScallopConfigSnapshot: (constants: ScallopConstants) => ScallopConfigSnapshot;
410
+
411
+ /**
412
+ * Address paths that must resolve to a non-empty value for the SDK to operate
413
+ * the core lending market. Other paths are considered optional features.
414
+ */
415
+ declare const REQUIRED_CORE_PATHS: readonly ["core.version", "core.market", "core.packages.protocol.id", "core.coinDecimalsRegistry", "core.oracles.xOracle"];
416
+ type RequiredCorePath = (typeof REQUIRED_CORE_PATHS)[number];
417
+ declare const REQUIRED_WHITELIST_KEYS: readonly ["lending", "collateral", "borrowing", "packages", "scoin", "spool", "oracles", "pythEndpoints"];
418
+ type ConfigValidationResult = {
419
+ valid: boolean;
420
+ missingPaths: RequiredCorePath[];
421
+ emptyWhitelistKeys: string[];
422
+ };
423
+ declare const validateConfigSnapshot: (snapshot: ScallopConfigSnapshot, options?: {
424
+ requiredPaths?: readonly RequiredCorePath[];
425
+ }) => ConfigValidationResult;
426
+ declare const assertConfigSnapshot: (snapshot: ScallopConfigSnapshot, options?: {
427
+ requiredPaths?: readonly RequiredCorePath[];
428
+ }) => void;
429
+
430
+ type ScallopConfigSources = {
431
+ addressSource: AddressConfigSource;
432
+ poolAddressSource: PoolAddressConfigSource;
433
+ whitelistSource: WhitelistConfigSource;
434
+ };
435
+ declare const loadScallopConfigSnapshot: (sources: ScallopConfigSources, options?: {
436
+ validate?: boolean;
437
+ requiredPaths?: readonly RequiredCorePath[];
438
+ }) => ScallopConfigSnapshot;
439
+
440
+ export { API_BASE_URL, type AddressConfigSource, AddressStringPath, AddressesInterface, type ConfigValidationResult, DEFAULT_CACHE_OPTIONS, GetDynamicFieldObjectParams, GetDynamicFieldsParams, IS_VE_SCA_TEST, MAX_LOCK_DURATION, MAX_LOCK_ROUNDS, MIN_INITIAL_LOCK_AMOUNT, MIN_TOP_UP_AMOUNT, OLD_BORROW_INCENTIVE_PROTOCOL_ID, POOL_ADDRESSES, PoolAddress, type PoolAddressConfigSource, REQUIRED_CORE_PATHS, REQUIRED_WHITELIST_KEYS, RPC_PROVIDERS, type RequiredCorePath, SCA_COIN_TYPE, SDK_API_BASE_URL, Scallop, ScallopBuilder, ScallopClient, type ScallopConfigSnapshot, type ScallopConfigSources, ScallopConstants, ScallopQuery, ScallopUtils, SuiObjectData, SuiObjectDataOptions, TEST_ADDRESSES, UNLOCK_ROUND_DURATION, USE_TEST_ADDRESS, WHITELIST, Whitelist, type WhitelistConfigSource, assertConfigSnapshot, createLiveAddressConfigSource, createLivePoolAddressConfigSource, createLiveWhitelistConfigSource, createScallopConfigSnapshot, loadScallopConfigSnapshot, queryKeys, validateConfigSnapshot, xOracleList, xOracleListType };