@alphafi/alphafi-sdk 0.0.49 → 0.0.51

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 (325) hide show
  1. package/dist/cjs/adminFunctions.d.ts +4 -1
  2. package/dist/cjs/adminFunctions.d.ts.map +1 -1
  3. package/dist/cjs/adminFunctions.js +77 -0
  4. package/dist/cjs/adminFunctions.js.map +1 -1
  5. package/dist/cjs/common/coins.d.ts.map +1 -1
  6. package/dist/cjs/common/coins.js +6 -0
  7. package/dist/cjs/common/coins.js.map +1 -1
  8. package/dist/cjs/common/constants.d.ts +48 -0
  9. package/dist/cjs/common/constants.d.ts.map +1 -1
  10. package/dist/cjs/common/constants.js +34 -0
  11. package/dist/cjs/common/constants.js.map +1 -1
  12. package/dist/cjs/common/maps.d.ts +3 -0
  13. package/dist/cjs/common/maps.d.ts.map +1 -1
  14. package/dist/cjs/common/maps.js +144 -0
  15. package/dist/cjs/common/maps.js.map +1 -1
  16. package/dist/cjs/common/pyth.d.ts +1 -1
  17. package/dist/cjs/common/pyth.d.ts.map +1 -1
  18. package/dist/cjs/common/pyth.js.map +1 -1
  19. package/dist/cjs/common/types.d.ts +22 -6
  20. package/dist/cjs/common/types.d.ts.map +1 -1
  21. package/dist/cjs/common/types.js.map +1 -1
  22. package/dist/cjs/getVaultBalances.js +1 -1
  23. package/dist/cjs/getVaultBalances.js.map +1 -1
  24. package/dist/cjs/graphql/getMultiReceipts.d.ts.map +1 -1
  25. package/dist/cjs/graphql/getMultiReceipts.js +21 -4
  26. package/dist/cjs/graphql/getMultiReceipts.js.map +1 -1
  27. package/dist/cjs/index.d.ts +3 -2
  28. package/dist/cjs/index.d.ts.map +1 -1
  29. package/dist/cjs/index.js +11 -4
  30. package/dist/cjs/index.js.map +1 -1
  31. package/dist/cjs/sui-sdk/client.d.ts +8 -0
  32. package/dist/cjs/sui-sdk/client.d.ts.map +1 -1
  33. package/dist/cjs/sui-sdk/client.js +12 -0
  34. package/dist/cjs/sui-sdk/client.js.map +1 -1
  35. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +1 -1
  36. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
  37. package/dist/cjs/sui-sdk/functions/getPositionRange.d.ts +10 -0
  38. package/dist/cjs/sui-sdk/functions/getPositionRange.d.ts.map +1 -0
  39. package/dist/cjs/sui-sdk/functions/getPositionRange.js +86 -0
  40. package/dist/cjs/sui-sdk/functions/getPositionRange.js.map +1 -0
  41. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +9 -15
  42. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  43. package/dist/cjs/sui-sdk/functions/getReceipts.js +290 -200
  44. package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
  45. package/dist/cjs/transactions/blueRewards.d.ts.map +1 -1
  46. package/dist/cjs/transactions/blueRewards.js +27 -2
  47. package/dist/cjs/transactions/blueRewards.js.map +1 -1
  48. package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
  49. package/dist/cjs/transactions/bluefin.js +110 -0
  50. package/dist/cjs/transactions/bluefin.js.map +1 -1
  51. package/dist/cjs/transactions/collect_rewards.d.ts.map +1 -1
  52. package/dist/cjs/transactions/collect_rewards.js +2 -1
  53. package/dist/cjs/transactions/collect_rewards.js.map +1 -1
  54. package/dist/cjs/transactions/deposit.d.ts.map +1 -1
  55. package/dist/cjs/transactions/deposit.js +10 -3
  56. package/dist/cjs/transactions/deposit.js.map +1 -1
  57. package/dist/cjs/transactions/zapDeposit.d.ts.map +1 -1
  58. package/dist/cjs/transactions/zapDeposit.js +58 -29
  59. package/dist/cjs/transactions/zapDeposit.js.map +1 -1
  60. package/dist/cjs/utils/prices.d.ts.map +1 -1
  61. package/dist/cjs/utils/prices.js +1 -0
  62. package/dist/cjs/utils/prices.js.map +1 -1
  63. package/dist/esm/adminFunctions.d.ts +4 -1
  64. package/dist/esm/adminFunctions.d.ts.map +1 -1
  65. package/dist/esm/adminFunctions.js +76 -2
  66. package/dist/esm/adminFunctions.js.map +1 -1
  67. package/dist/esm/common/coins.d.ts.map +1 -1
  68. package/dist/esm/common/coins.js +6 -0
  69. package/dist/esm/common/coins.js.map +1 -1
  70. package/dist/esm/common/constants.d.ts +48 -0
  71. package/dist/esm/common/constants.d.ts.map +1 -1
  72. package/dist/esm/common/constants.js +34 -0
  73. package/dist/esm/common/constants.js.map +1 -1
  74. package/dist/esm/common/maps.d.ts +3 -0
  75. package/dist/esm/common/maps.d.ts.map +1 -1
  76. package/dist/esm/common/maps.js +144 -0
  77. package/dist/esm/common/maps.js.map +1 -1
  78. package/dist/esm/common/pyth.d.ts +1 -1
  79. package/dist/esm/common/pyth.d.ts.map +1 -1
  80. package/dist/esm/common/pyth.js.map +1 -1
  81. package/dist/esm/common/types.d.ts +22 -6
  82. package/dist/esm/common/types.d.ts.map +1 -1
  83. package/dist/esm/common/types.js.map +1 -1
  84. package/dist/esm/getVaultBalances.js +1 -1
  85. package/dist/esm/getVaultBalances.js.map +1 -1
  86. package/dist/esm/graphql/getMultiReceipts.d.ts.map +1 -1
  87. package/dist/esm/graphql/getMultiReceipts.js +21 -3
  88. package/dist/esm/graphql/getMultiReceipts.js.map +1 -1
  89. package/dist/esm/index.d.ts +3 -2
  90. package/dist/esm/index.d.ts.map +1 -1
  91. package/dist/esm/index.js +3 -2
  92. package/dist/esm/index.js.map +1 -1
  93. package/dist/esm/sui-sdk/client.d.ts +8 -0
  94. package/dist/esm/sui-sdk/client.d.ts.map +1 -1
  95. package/dist/esm/sui-sdk/client.js +10 -0
  96. package/dist/esm/sui-sdk/client.js.map +1 -1
  97. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +1 -1
  98. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
  99. package/dist/esm/sui-sdk/functions/getPositionRange.d.ts +10 -0
  100. package/dist/esm/sui-sdk/functions/getPositionRange.d.ts.map +1 -0
  101. package/dist/esm/sui-sdk/functions/getPositionRange.js +82 -0
  102. package/dist/esm/sui-sdk/functions/getPositionRange.js.map +1 -0
  103. package/dist/esm/sui-sdk/functions/getReceipts.d.ts +9 -15
  104. package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  105. package/dist/esm/sui-sdk/functions/getReceipts.js +288 -198
  106. package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
  107. package/dist/esm/transactions/blueRewards.d.ts.map +1 -1
  108. package/dist/esm/transactions/blueRewards.js +27 -2
  109. package/dist/esm/transactions/blueRewards.js.map +1 -1
  110. package/dist/esm/transactions/bluefin.d.ts.map +1 -1
  111. package/dist/esm/transactions/bluefin.js +110 -0
  112. package/dist/esm/transactions/bluefin.js.map +1 -1
  113. package/dist/esm/transactions/collect_rewards.d.ts.map +1 -1
  114. package/dist/esm/transactions/collect_rewards.js +2 -1
  115. package/dist/esm/transactions/collect_rewards.js.map +1 -1
  116. package/dist/esm/transactions/deposit.d.ts.map +1 -1
  117. package/dist/esm/transactions/deposit.js +10 -3
  118. package/dist/esm/transactions/deposit.js.map +1 -1
  119. package/dist/esm/transactions/zapDeposit.d.ts.map +1 -1
  120. package/dist/esm/transactions/zapDeposit.js +59 -30
  121. package/dist/esm/transactions/zapDeposit.js.map +1 -1
  122. package/dist/esm/utils/prices.d.ts.map +1 -1
  123. package/dist/esm/utils/prices.js +1 -0
  124. package/dist/esm/utils/prices.js.map +1 -1
  125. package/docs/assets/highlight.css +51 -74
  126. package/docs/assets/icons.js +17 -20
  127. package/docs/assets/main.js +5 -2163
  128. package/docs/assets/navigation.js +1 -2
  129. package/docs/assets/search.js +1 -2
  130. package/docs/assets/style.css +850 -846
  131. package/docs/functions/alphaLpBreakdown.html +1 -253
  132. package/docs/functions/cetusLpBreakdown.html +1 -253
  133. package/docs/functions/claimBlueRewardTxb.html +1 -0
  134. package/docs/functions/claimRewardTxb.html +1 -243
  135. package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -267
  136. package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -260
  137. package/docs/functions/coinsInPool.html +1 -438
  138. package/docs/functions/collectRewards.html +1 -242
  139. package/docs/functions/deposit.html +1 -246
  140. package/docs/functions/depositDoubleAssetTxb.html +1 -270
  141. package/docs/functions/depositSingleAssetTxb.html +1 -263
  142. package/docs/functions/fetchAfterTransactionEvents.html +1 -306
  143. package/docs/functions/fetchAutoCompoundingEvents.html +1 -257
  144. package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -251
  145. package/docs/functions/fetchCetusPools.html +1 -231
  146. package/docs/functions/fetchChainIdentifier.html +1 -233
  147. package/docs/functions/fetchCheckRatioEvents.html +1 -249
  148. package/docs/functions/fetchLiquidityChangeEvents.html +1 -257
  149. package/docs/functions/fetchMultiReceipts.html +1 -261
  150. package/docs/functions/fetchNftHolders.html +1 -233
  151. package/docs/functions/fetchPools.html +1 -230
  152. package/docs/functions/fetchPortfolioData.html +1 -243
  153. package/docs/functions/fetchProtocolData.html +1 -231
  154. package/docs/functions/fetchTVL.html +1 -253
  155. package/docs/functions/fetchUserVaultBalances.html +1 -245
  156. package/docs/functions/fetchUserVaults.html +1 -243
  157. package/docs/functions/fetchUserWalletData.html +1 -243
  158. package/docs/functions/fetchVoloExchangeRate.html +1 -0
  159. package/docs/functions/fetchWithdrawV2Events.html +1 -255
  160. package/docs/functions/getAirdropShare.html +1 -243
  161. package/docs/functions/getAllDoubleAssetVaults.html +1 -235
  162. package/docs/functions/getAllSingleAssetVaults.html +1 -235
  163. package/docs/functions/getAllVaultBalances.html +1 -265
  164. package/docs/functions/getAllVaults.html +1 -233
  165. package/docs/functions/getAlphaUnlocks.html +1 -245
  166. package/docs/functions/getAlphaVaultBalance.html +1 -255
  167. package/docs/functions/getAmounts.html +1 -272
  168. package/docs/functions/getApr.html +1 -243
  169. package/docs/functions/getAprs.html +1 -255
  170. package/docs/functions/getApy.html +1 -243
  171. package/docs/functions/getApys.html +1 -255
  172. package/docs/functions/getCetusInvestorTicksMap.html +1 -284
  173. package/docs/functions/getCetusPool.html +1 -0
  174. package/docs/functions/getCetusSqrtPriceMap.html +1 -249
  175. package/docs/functions/getCoinAmountsFromLiquidity.html +1 -273
  176. package/docs/functions/getConf.html +1 -11763
  177. package/docs/functions/getCurrentTick.html +1 -247
  178. package/docs/functions/getDistributor.html +1 -0
  179. package/docs/functions/getDoubleAssetVaultBalance.html +1 -268
  180. package/docs/functions/getDoubleAssetVaults.html +1 -253
  181. package/docs/functions/getHoldersFromTransactions.html +1 -299
  182. package/docs/functions/getInvestor.html +1 -259
  183. package/docs/functions/getInvestorPoolMap.html +1 -241
  184. package/docs/functions/getLastAutoCompoundTime.html +1 -249
  185. package/docs/functions/getLatestPrices.html +1 -253
  186. package/docs/functions/getLiquidity.html +1 -260
  187. package/docs/functions/getMultiCetusPool.html +1 -0
  188. package/docs/functions/getMultiInvestor.html +1 -231
  189. package/docs/functions/getMultiLatestPrices.html +1 -233
  190. package/docs/functions/getMultiParentPool.html +1 -231
  191. package/docs/functions/getMultiPool.html +1 -231
  192. package/docs/functions/getMultiReceipts.html +1 -243
  193. package/docs/functions/getParentPool.html +1 -266
  194. package/docs/functions/getPool.html +1 -262
  195. package/docs/functions/getPoolExchangeRate.html +1 -0
  196. package/docs/functions/getPoolExchangeRateMap.html +1 -249
  197. package/docs/functions/getPoolsWeightDistribution.html +1 -0
  198. package/docs/functions/getPositionRange.html +1 -283
  199. package/docs/functions/getPositionRanges.html +1 -289
  200. package/docs/functions/getPositionTicks.html +1 -249
  201. package/docs/functions/getPriceToTick.html +1 -254
  202. package/docs/functions/getRebalanceHistories.html +1 -269
  203. package/docs/functions/getRebalanceHistory.html +1 -255
  204. package/docs/functions/getReceipts.html +1 -268
  205. package/docs/functions/getSingleAssetVaultBalance.html +1 -268
  206. package/docs/functions/getSingleAssetVaults.html +1 -253
  207. package/docs/functions/getSuiClient.html +3 -247
  208. package/docs/functions/getSuiNodeUrl.html +3 -232
  209. package/docs/functions/getTVLs-1.html +1 -243
  210. package/docs/functions/getTickToPrice.html +1 -254
  211. package/docs/functions/getTvls.html +1 -259
  212. package/docs/functions/getUserTokensFromTransactions.html +1 -269
  213. package/docs/functions/getUserTokensInUsdFromTransactions.html +1 -263
  214. package/docs/functions/getVaultBalance.html +1 -277
  215. package/docs/functions/getVaultBalanceForActiveUsers.html +1 -261
  216. package/docs/functions/getVaults.html +1 -250
  217. package/docs/functions/getXTokenVaultBalanceForActiveUsers.html +1 -261
  218. package/docs/functions/getZapAmounts.html +1 -323
  219. package/docs/functions/lastAutocompoundTime.html +1 -249
  220. package/docs/functions/liquidityToTokens.html +1 -253
  221. package/docs/functions/multiLiquidityToTokens.html +1 -271
  222. package/docs/functions/multiTokensToUsd.html +1 -262
  223. package/docs/functions/multiXTokensToLiquidity.html +1 -257
  224. package/docs/functions/parseUserWalletData.html +1 -243
  225. package/docs/functions/pendingBlueRewardAmount.html +1 -0
  226. package/docs/functions/setCustomSuiClient.html +5 -0
  227. package/docs/functions/setSuiClient.html +7 -255
  228. package/docs/functions/setSuiNodeUrl.html +5 -249
  229. package/docs/functions/setWeights.html +1 -0
  230. package/docs/functions/withdraw.html +1 -249
  231. package/docs/functions/withdrawAlphaTxb.html +1 -257
  232. package/docs/functions/withdrawTxb.html +1 -260
  233. package/docs/functions/zapDepositTxb.html +1 -300
  234. package/docs/index.html +41 -587
  235. package/docs/interfaces/Coin.html +12 -474
  236. package/docs/interfaces/CoinPair.html +3 -358
  237. package/docs/interfaces/NaviVoloData.html +3 -514
  238. package/docs/interfaces/PoolData.html +8 -0
  239. package/docs/interfaces/PoolWeightDistribution.html +4 -0
  240. package/docs/interfaces/RebalanceHistoryType.html +9 -652
  241. package/docs/modules.html +193 -1315
  242. package/docs/types/AfterTransactionEventNode.html +1 -305
  243. package/docs/types/Allocator.html +1 -321
  244. package/docs/types/AlphaFiDoubleAssetVault.html +1 -258
  245. package/docs/types/AlphaFiMultiVaultBalance.html +1 -219
  246. package/docs/types/AlphaFiSingleAssetVault.html +1 -244
  247. package/docs/types/AlphaFiVault.html +1 -214
  248. package/docs/types/AlphaFiVaultBalance.html +1 -220
  249. package/docs/types/AlphaPoolType.html +1 -383
  250. package/docs/types/AlphaReceipt.html +1 -220
  251. package/docs/types/AlphaReceiptFields.html +1 -421
  252. package/docs/types/AlphaVaultBalance.html +1 -245
  253. package/docs/types/AutoBalancePoolNames.html +1 -0
  254. package/docs/types/AutoCompoundingEventNode.html +1 -225
  255. package/docs/types/BluefinInvestor.html +1 -209
  256. package/docs/types/BluefinPoolType.html +1 -440
  257. package/docs/types/BucketInvestor.html +1 -249
  258. package/docs/types/CetusInvestor.html +1 -240
  259. package/docs/types/CetusPoolType.html +1 -433
  260. package/docs/types/CetusSwapOptions.html +1 -209
  261. package/docs/types/CoinAmounts.html +1 -216
  262. package/docs/types/CoinName.html +1 -290
  263. package/docs/types/CoinType.html +1 -291
  264. package/docs/types/CommonInvestorFields.html +1 -276
  265. package/docs/types/CreatePoolOptions.html +1 -246
  266. package/docs/types/Distributor.html +1 -341
  267. package/docs/types/DoubleAssetMultiVaultBalance.html +1 -236
  268. package/docs/types/DoubleAssetPoolNames.html +1 -289
  269. package/docs/types/DoubleAssetTokenHoldings.html +1 -232
  270. package/docs/types/DoubleAssetVaultBalance.html +1 -229
  271. package/docs/types/GetHoldersParams.html +1 -221
  272. package/docs/types/GetTokenHoldingsParams.html +1 -227
  273. package/docs/types/GetUserTokensFromTransactionsParams.html +1 -233
  274. package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +1 -244
  275. package/docs/types/GetVaultBalanceForActiveUsersParams.html +1 -231
  276. package/docs/types/GetVaultBalanceParams.html +1 -217
  277. package/docs/types/HoldingsObj.html +1 -223
  278. package/docs/types/Icon.html +1 -266
  279. package/docs/types/Investor.html +1 -245
  280. package/docs/types/LiquidityChangeEventNode.html +1 -220
  281. package/docs/types/LiquidityToTokensParams.html +1 -255
  282. package/docs/types/LiquidityToUsdParams.html +1 -267
  283. package/docs/types/LoopingDebt.html +1 -258
  284. package/docs/types/LoopingPoolNames.html +1 -0
  285. package/docs/types/LpBreakdownType.html +1 -238
  286. package/docs/types/MemberPoolDataType.html +1 -276
  287. package/docs/types/MemberType.html +1 -269
  288. package/docs/types/MultiGetVaultBalancesParams.html +1 -229
  289. package/docs/types/NaviInvestor.html +1 -235
  290. package/docs/types/OtherReceiptFields.html +1 -373
  291. package/docs/types/PoolName.html +1 -326
  292. package/docs/types/PoolReceipt.html +1 -253
  293. package/docs/types/PoolType.html +1 -388
  294. package/docs/types/Receipt.html +1 -475
  295. package/docs/types/ReceiptGQL.html +1 -374
  296. package/docs/types/SingleAssetMultiVaultBalance.html +1 -232
  297. package/docs/types/SingleAssetPoolNames.html +1 -247
  298. package/docs/types/SingleAssetTokenHoldings.html +1 -228
  299. package/docs/types/SingleAssetVaultBalance.html +1 -223
  300. package/docs/types/SingleGetVaultBalancesParams.html +1 -224
  301. package/docs/types/StrategyType.html +1 -217
  302. package/docs/types/SuiNetwork.html +1 -213
  303. package/docs/types/SwapOptions.html +1 -248
  304. package/docs/types/TickSpacing.html +1 -212
  305. package/docs/types/TotalWeightType.html +1 -246
  306. package/docs/types/TransactionBlockType.html +1 -358
  307. package/docs/types/UserPoolLiquidity.html +1 -221
  308. package/docs/types/UserPoolTokenHoldings.html +1 -217
  309. package/docs/types/UserUsdHoldings.html +1 -223
  310. package/docs/types/VaultBalance.html +1 -216
  311. package/docs/types/WithdrawV2EventNode.html +1 -208
  312. package/docs/variables/bluefinPoolMap.html +1 -214
  313. package/docs/variables/cetusPoolMap.html +1 -214
  314. package/docs/variables/coinsList.html +1 -220
  315. package/docs/variables/defunctPoolsSet.html +1 -209
  316. package/docs/variables/doubleAssetPoolCoinMap.html +1 -237
  317. package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -218
  318. package/docs/variables/loopingAccountAddresses.html +1 -219
  319. package/docs/variables/loopingPoolCoinMap.html +1 -233
  320. package/docs/variables/naviAssetMap.html +1 -215
  321. package/docs/variables/poolIdPoolNameMap.html +1 -218
  322. package/docs/variables/poolInfo.html +1 -304
  323. package/docs/variables/singleAssetPoolCoinMap.html +1 -229
  324. package/docs/variables/stableCoins.html +1 -207
  325. package/package.json +2 -3
@@ -3,24 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertReceiptGQLToReceipt = convertReceiptGQLToReceipt;
4
4
  exports.getMultiReceipts = getMultiReceipts;
5
5
  exports.getReceipts = getReceipts;
6
- exports.getPoolExchangeRate = getPoolExchangeRate;
7
6
  exports.getMultiPool = getMultiPool;
8
7
  exports.getPool = getPool;
9
8
  exports.getMultiParentPool = getMultiParentPool;
10
9
  exports.getParentPool = getParentPool;
10
+ exports.getMultiCetusPool = getMultiCetusPool;
11
+ exports.getCetusPool = getCetusPool;
11
12
  exports.getMultiInvestor = getMultiInvestor;
12
13
  exports.getInvestor = getInvestor;
14
+ exports.getDistributor = getDistributor;
15
+ exports.getPoolExchangeRate = getPoolExchangeRate;
13
16
  exports.fetchVoloExchangeRate = fetchVoloExchangeRate;
14
17
  exports.multiGetNaviInvestor = multiGetNaviInvestor;
15
- exports.getDistributor = getDistributor;
16
- exports.getPositionRanges = getPositionRanges;
17
- exports.getPositionRange = getPositionRange;
18
18
  const index_js_1 = require("../../index.js");
19
19
  const maps_js_1 = require("../../common/maps.js");
20
20
  const decimal_js_1 = require("decimal.js");
21
21
  const client_js_1 = require("../client.js");
22
22
  const simpleCache_js_1 = require("../../utils/simpleCache.js");
23
- const cetus_sui_clmm_sdk_1 = require("@cetusprotocol/cetus-sui-clmm-sdk");
24
23
  function convertReceiptGQLToReceipt(receipts) {
25
24
  const res = receipts.map((receipt) => {
26
25
  return {
@@ -183,35 +182,6 @@ async function getReceipts(poolName, address, ignoreCache) {
183
182
  }
184
183
  return cachedPromise;
185
184
  }
186
- async function getPoolExchangeRate(poolName, ignoreCache) {
187
- let pool;
188
- try {
189
- pool = await getPool(poolName, ignoreCache);
190
- const xTokenSupply = new decimal_js_1.Decimal(pool.content.fields.xTokenSupply);
191
- let tokensInvested = new decimal_js_1.Decimal(pool.content.fields.tokensInvested);
192
- if (poolName == "ALPHA") {
193
- tokensInvested = new decimal_js_1.Decimal(pool.content.fields.alpha_bal);
194
- }
195
- else if (maps_js_1.poolInfo[poolName].parentProtocolName == "CETUS") {
196
- const investor = (await getInvestor(poolName, ignoreCache));
197
- if (!investor) {
198
- throw new Error(`couldnt fetch investor object for pool: ${poolName}`);
199
- }
200
- tokensInvested = new decimal_js_1.Decimal(pool.content.fields.tokensInvested);
201
- }
202
- // Check for division by zero
203
- if (xTokenSupply.eq(0)) {
204
- console.error("Division by zero error: tokensInvested is zero.");
205
- return new decimal_js_1.Decimal(0);
206
- }
207
- const poolExchangeRate = tokensInvested.div(xTokenSupply);
208
- return poolExchangeRate;
209
- }
210
- catch (err) {
211
- console.log(`getPoolExchangeRate failed for poolName: ${poolName}, with error ${err}`);
212
- throw err;
213
- }
214
- }
215
185
  const poolCache = new simpleCache_js_1.SimpleCache();
216
186
  const poolPromiseCache = new simpleCache_js_1.SimpleCache();
217
187
  async function getMultiPool() {
@@ -222,26 +192,37 @@ async function getMultiPool() {
222
192
  const poolIds = pools.map((pool) => {
223
193
  return maps_js_1.poolInfo[pool].poolId;
224
194
  });
225
- try {
226
- const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
227
- ids: poolIds,
228
- options: {
229
- showContent: true,
230
- },
231
- });
232
- for (let i = 0; i < pools.length; i = i + 1) {
233
- const poolData = o[i].data;
234
- const cacheKey = `pool_${maps_js_1.poolInfo[pools[i]].poolId}`;
235
- poolCache.set(cacheKey, poolData);
236
- }
195
+ const batchSize = 49; // Set the desired batch size
196
+ // Create an array to hold the batches
197
+ const batches = [];
198
+ //const batches = [];
199
+ // Loop through the entries array and create batches
200
+ for (let i = 0; i < poolIds.length; i += batchSize) {
201
+ const batchEntries = poolIds.slice(i, i + batchSize);
202
+ batches.push(batchEntries); // Convert to object before pushing
237
203
  }
238
- catch (error) {
239
- console.error(`Error getting multiPools - ${error}`);
204
+ for (const poolIdsBatch of batches) {
205
+ try {
206
+ const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
207
+ ids: poolIdsBatch,
208
+ options: {
209
+ showContent: true,
210
+ },
211
+ });
212
+ for (let i = 0; i < poolIdsBatch.length; i = i + 1) {
213
+ const poolData = o[i].data;
214
+ const cacheKey = `pool_${poolIdsBatch[i]}`;
215
+ poolCache.set(cacheKey, poolData);
216
+ }
217
+ }
218
+ catch (error) {
219
+ console.error(`Error getting multiPools - ${error}`);
220
+ }
240
221
  }
241
222
  }
242
223
  async function getPool(poolName, ignoreCache) {
243
224
  const suiClient = (0, client_js_1.getSuiClient)();
244
- const cacheKey = `pool_${maps_js_1.poolInfo[poolName.toUpperCase()].poolId}`;
225
+ const cacheKey = `pool_${maps_js_1.poolInfo[poolName].poolId}`;
245
226
  if (ignoreCache) {
246
227
  poolCache.delete(cacheKey);
247
228
  poolPromiseCache.delete(cacheKey);
@@ -283,36 +264,135 @@ async function getPool(poolName, ignoreCache) {
283
264
  poolPromiseCache.set(cacheKey, poolPromise);
284
265
  return poolPromise;
285
266
  }
286
- const cetusPoolCache = new simpleCache_js_1.SimpleCache();
287
- const cetusPoolPromiseCache = new simpleCache_js_1.SimpleCache();
267
+ const parentPoolCache = new simpleCache_js_1.SimpleCache();
268
+ const parentPoolPromiseCache = new simpleCache_js_1.SimpleCache();
288
269
  async function getMultiParentPool() {
289
270
  let pools = Object.keys(maps_js_1.poolInfo);
290
271
  pools = pools.filter((pool) => {
291
- return maps_js_1.poolInfo[pool].poolId !== "";
272
+ return maps_js_1.poolInfo[pool].parentPoolId !== "";
292
273
  });
293
- const poolIds = pools.map((pool) => {
274
+ const parentPoolIds = pools.map((pool) => {
294
275
  return maps_js_1.poolInfo[pool].parentPoolId;
295
276
  });
296
- try {
297
- const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
298
- ids: poolIds,
299
- options: {
300
- showContent: true,
301
- },
302
- });
303
- for (let i = 0; i < pools.length; i = i + 1) {
304
- const poolData = o[i].data;
305
- const cacheKey = `pool_${maps_js_1.poolInfo[pools[i]].parentPoolId}`;
306
- cetusPoolCache.set(cacheKey, poolData);
307
- }
277
+ const poolsSet = new Set(parentPoolIds);
278
+ const poolIds = [...poolsSet];
279
+ const batchSize = 49;
280
+ // Create an array to hold the batches
281
+ const batches = [];
282
+ //const batches = [];
283
+ // Loop through the entries array and create batches
284
+ for (let i = 0; i < poolIds.length; i += batchSize) {
285
+ const batchEntries = poolIds.slice(i, i + batchSize);
286
+ batches.push(batchEntries); // Convert to object before pushing
308
287
  }
309
- catch (e) {
310
- console.error(`[getMultiParentPool] Error getting multiPools`);
288
+ for (const parentPoolIdsBatch of batches) {
289
+ try {
290
+ const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
291
+ ids: parentPoolIdsBatch,
292
+ options: {
293
+ showContent: true,
294
+ },
295
+ });
296
+ for (let i = 0; i < parentPoolIdsBatch.length; i = i + 1) {
297
+ const parentPoolData = o[i].data;
298
+ const cacheKey = `parentPool_${parentPoolIdsBatch[i]}`;
299
+ parentPoolCache.set(cacheKey, parentPoolData);
300
+ }
301
+ }
302
+ catch (error) {
303
+ console.error(`Error getting multiParentPools - ${error}`);
304
+ }
311
305
  }
312
306
  }
313
307
  async function getParentPool(poolName, ignoreCache) {
314
308
  const suiClient = (0, client_js_1.getSuiClient)();
315
- const cacheKey = `pool_${poolName}`;
309
+ const cacheKey = `parentPool_${maps_js_1.poolInfo[poolName].parentPoolId}`;
310
+ if (ignoreCache) {
311
+ parentPoolCache.delete(cacheKey);
312
+ parentPoolPromiseCache.delete(cacheKey);
313
+ }
314
+ // Check if the pool is already in the cache
315
+ const cachedPool = parentPoolCache.get(cacheKey);
316
+ if (cachedPool) {
317
+ return cachedPool;
318
+ }
319
+ // Check if there is already a promise in the cache
320
+ let parentPoolPromise = parentPoolPromiseCache.get(cacheKey);
321
+ if (parentPoolPromise) {
322
+ return parentPoolPromise;
323
+ }
324
+ // If not, create a new promise and cache it
325
+ parentPoolPromise = (async () => {
326
+ try {
327
+ const id = maps_js_1.poolInfo[poolName]
328
+ ? maps_js_1.poolInfo[poolName].parentPoolId
329
+ : index_js_1.cetusPoolMap[poolName]
330
+ ? index_js_1.cetusPoolMap[poolName]
331
+ : index_js_1.bluefinPoolMap[poolName];
332
+ const o = await suiClient.getObject({
333
+ id: id,
334
+ options: {
335
+ showContent: true,
336
+ },
337
+ });
338
+ const parentPool = o.data;
339
+ // Cache the pool object
340
+ parentPoolCache.set(cacheKey, parentPool);
341
+ return parentPool;
342
+ }
343
+ catch (err) {
344
+ console.error(`getParentPool failed for poolName: ${poolName}`);
345
+ throw err;
346
+ }
347
+ finally {
348
+ // Remove the promise from the cache after it resolves
349
+ parentPoolPromiseCache.delete(cacheKey);
350
+ }
351
+ })();
352
+ // Cache the promise
353
+ parentPoolPromiseCache.set(cacheKey, parentPoolPromise);
354
+ return parentPoolPromise;
355
+ }
356
+ const cetusPoolCache = new simpleCache_js_1.SimpleCache();
357
+ const cetusPoolPromiseCache = new simpleCache_js_1.SimpleCache();
358
+ async function getMultiCetusPool() {
359
+ let pools = Object.keys(index_js_1.cetusPoolMap);
360
+ pools = pools.filter((pool) => {
361
+ return index_js_1.cetusPoolMap[pool] !== "";
362
+ });
363
+ const poolIds = pools.map((pool) => {
364
+ return index_js_1.cetusPoolMap[pool];
365
+ });
366
+ const batchSize = 49;
367
+ // Create an array to hold the batches
368
+ const batches = [];
369
+ // Loop through the entries array and create batches
370
+ for (let i = 0; i < poolIds.length; i += batchSize) {
371
+ const batchEntries = poolIds.slice(i, i + batchSize);
372
+ batches.push(batchEntries); // Convert to object before pushing
373
+ }
374
+ for (const cetusPoolIdsBatch of batches) {
375
+ try {
376
+ const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
377
+ ids: cetusPoolIdsBatch,
378
+ options: {
379
+ showContent: true,
380
+ },
381
+ });
382
+ for (let i = 0; i < pools.length; i = i + 1) {
383
+ const poolData = o[i].data;
384
+ const cacheKey = `cetusPool_${index_js_1.cetusPoolMap[pools[i]]}`;
385
+ cetusPoolCache.set(cacheKey, poolData);
386
+ }
387
+ }
388
+ catch (e) {
389
+ console.error(`Error getting multiCetusPools`, e);
390
+ }
391
+ }
392
+ }
393
+ async function getCetusPool(poolName, ignoreCache) {
394
+ const suiClient = (0, client_js_1.getSuiClient)();
395
+ const cacheKey = `cetusPool_${index_js_1.cetusPoolMap[poolName]}`;
316
396
  if (ignoreCache) {
317
397
  cetusPoolCache.delete(cacheKey);
318
398
  cetusPoolPromiseCache.delete(cacheKey);
@@ -330,13 +410,8 @@ async function getParentPool(poolName, ignoreCache) {
330
410
  // If not, create a new promise and cache it
331
411
  cetusPoolPromise = (async () => {
332
412
  try {
333
- const id = maps_js_1.poolInfo[poolName]
334
- ? maps_js_1.poolInfo[poolName].parentPoolId
335
- : index_js_1.cetusPoolMap[poolName]
336
- ? index_js_1.cetusPoolMap[poolName]
337
- : index_js_1.bluefinPoolMap[poolName];
338
413
  const o = await suiClient.getObject({
339
- id: id,
414
+ id: index_js_1.cetusPoolMap[poolName],
340
415
  options: {
341
416
  showContent: true,
342
417
  },
@@ -346,9 +421,9 @@ async function getParentPool(poolName, ignoreCache) {
346
421
  cetusPoolCache.set(cacheKey, cetusPool);
347
422
  return cetusPool;
348
423
  }
349
- catch (err) {
424
+ catch (e) {
350
425
  console.error(`getCetusPool failed for poolName: ${poolName}`);
351
- throw err;
426
+ return undefined;
352
427
  }
353
428
  finally {
354
429
  // Remove the promise from the cache after it resolves
@@ -369,26 +444,37 @@ async function getMultiInvestor() {
369
444
  const investorIds = pools.map((pool) => {
370
445
  return maps_js_1.poolInfo[pool].investorId;
371
446
  });
372
- try {
373
- const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
374
- ids: investorIds,
375
- options: {
376
- showContent: true,
377
- },
378
- });
379
- for (let i = 0; i < pools.length; i = i + 1) {
380
- const investorData = o[i].data;
381
- const cacheKey = `investor_${maps_js_1.poolInfo[pools[i]].investorId}`;
382
- investorCache.set(cacheKey, investorData);
383
- }
447
+ const batchSize = 49;
448
+ // Create an array to hold the batches
449
+ const batches = [];
450
+ //const batches = [];
451
+ // Loop through the entries array and create batches
452
+ for (let i = 0; i < investorIds.length; i += batchSize) {
453
+ const batchEntries = investorIds.slice(i, i + batchSize);
454
+ batches.push(batchEntries); // Convert to object before pushing
384
455
  }
385
- catch (e) {
386
- console.error(`[getMultiInvestor] Error getting multiPools`);
456
+ for (const investorIdsBatch of batches) {
457
+ try {
458
+ const o = await (0, client_js_1.getSuiClient)().multiGetObjects({
459
+ ids: investorIdsBatch,
460
+ options: {
461
+ showContent: true,
462
+ },
463
+ });
464
+ for (let i = 0; i < investorIdsBatch.length; i = i + 1) {
465
+ const investorData = o[i].data;
466
+ const cacheKey = `investor_${investorIdsBatch[i]}`;
467
+ investorCache.set(cacheKey, investorData);
468
+ }
469
+ }
470
+ catch (error) {
471
+ console.error(`Error getting multiInvestor - ${error}`);
472
+ }
387
473
  }
388
474
  }
389
475
  async function getInvestor(poolName, ignoreCache) {
390
476
  const suiClient = (0, client_js_1.getSuiClient)();
391
- const cacheKey = `investor_${maps_js_1.poolInfo[poolName.toUpperCase()].investorId}`;
477
+ const cacheKey = `investor_${maps_js_1.poolInfo[poolName].investorId}`;
392
478
  if (ignoreCache) {
393
479
  investorCache.delete(cacheKey);
394
480
  investorPromiseCache.delete(cacheKey);
@@ -407,7 +493,7 @@ async function getInvestor(poolName, ignoreCache) {
407
493
  cetusInvestorPromise = (async () => {
408
494
  try {
409
495
  const o = await suiClient.getObject({
410
- id: maps_js_1.poolInfo[poolName.toUpperCase()].investorId,
496
+ id: maps_js_1.poolInfo[poolName].investorId,
411
497
  options: {
412
498
  showContent: true,
413
499
  },
@@ -442,46 +528,6 @@ async function getInvestor(poolName, ignoreCache) {
442
528
  investorPromiseCache.set(cacheKey, cetusInvestorPromise);
443
529
  return cetusInvestorPromise;
444
530
  }
445
- async function fetchVoloExchangeRate() {
446
- const apiUrl = "https://open-api.naviprotocol.io/api/volo/stats";
447
- const NaviVoloDetails = await fetch(apiUrl)
448
- .then(async (response) => {
449
- if (!response.ok) {
450
- throw new Error(`HTTP error! status: ${response.status}`);
451
- }
452
- const data = (await response.json()); // Parse the JSON response
453
- return data;
454
- })
455
- .catch((error) => {
456
- console.log("failed to fetch Navi-volo details", error);
457
- throw error;
458
- });
459
- return NaviVoloDetails;
460
- }
461
- async function multiGetNaviInvestor(poolNames) {
462
- const results = {};
463
- const poolInvestorIds = [];
464
- for (const poolName of poolNames) {
465
- poolInvestorIds.push(maps_js_1.poolInfo[poolName.toUpperCase()].investorId);
466
- }
467
- try {
468
- const suiClient = (0, client_js_1.getSuiClient)();
469
- const objects = await suiClient.multiGetObjects({
470
- ids: poolInvestorIds,
471
- options: { showContent: true },
472
- });
473
- for (let i = 0; i < objects.length; i++) {
474
- const investor = objects[i].data;
475
- results[poolNames[i]] = investor;
476
- }
477
- return results;
478
- }
479
- catch (err) {
480
- //improve
481
- console.error("multiGetNaviInvestor failed for poolNames: ", poolNames.join(", "));
482
- throw err;
483
- }
484
- }
485
531
  const distributorCache = new simpleCache_js_1.SimpleCache();
486
532
  const distributorPromiseCache = new simpleCache_js_1.SimpleCache();
487
533
  async function getDistributor(ignoreCache) {
@@ -528,83 +574,127 @@ async function getDistributor(ignoreCache) {
528
574
  distributorPromiseCache.set(cacheKey, distributorPromise);
529
575
  return distributorPromise;
530
576
  }
531
- async function getPositionRanges(poolNames = []) {
532
- const res = new Map();
533
- // Use Promise.all to handle multiple promises in parallel
534
- await Promise.all(poolNames.map(async (poolName) => {
535
- if (poolName == "ALPHA" ||
536
- !["CETUS", "BLUEFIN"].includes(maps_js_1.poolInfo[poolName.toString()].parentProtocolName)) {
537
- return;
577
+ async function getPoolExchangeRate(poolName, ignoreCache) {
578
+ let pool;
579
+ try {
580
+ pool = await getPool(poolName, ignoreCache);
581
+ const xTokenSupply = new decimal_js_1.Decimal(pool.content.fields.xTokenSupply);
582
+ let tokensInvested = new decimal_js_1.Decimal(pool.content.fields.tokensInvested);
583
+ if (poolName == "ALPHA") {
584
+ tokensInvested = new decimal_js_1.Decimal(pool.content.fields.alpha_bal);
538
585
  }
539
- let investor;
540
- if (maps_js_1.poolInfo[poolName.toString()].parentProtocolName == "CETUS") {
541
- investor = (await getInvestor(poolName, false));
586
+ else if (maps_js_1.poolInfo[poolName].parentProtocolName == "CETUS") {
587
+ const investor = (await getInvestor(poolName, ignoreCache));
588
+ if (!investor) {
589
+ throw new Error(`couldnt fetch investor object for pool: ${poolName}`);
590
+ }
591
+ tokensInvested = new decimal_js_1.Decimal(pool.content.fields.tokensInvested);
542
592
  }
543
- else {
544
- investor = (await getInvestor(poolName, false));
593
+ // Check for division by zero
594
+ if (xTokenSupply.eq(0)) {
595
+ console.error("Division by zero error: tokensInvested is zero.");
596
+ return new decimal_js_1.Decimal(0);
545
597
  }
546
- const coinAName = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
547
- const coinA = index_js_1.coinsList[coinAName];
548
- const coinBName = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
549
- const coinB = index_js_1.coinsList[coinBName];
550
- if (investor) {
551
- const upperBound = 443636;
552
- let lowerTick = Number(investor.content.fields.lower_tick);
553
- let upperTick = Number(investor.content.fields.upper_tick);
554
- if (lowerTick > upperBound) {
555
- lowerTick = -~(lowerTick - 1);
598
+ const poolExchangeRate = tokensInvested.div(xTokenSupply);
599
+ return poolExchangeRate;
600
+ }
601
+ catch (err) {
602
+ console.log(`getPoolExchangeRate failed for poolName: ${poolName}, with error ${err}`);
603
+ throw err;
604
+ }
605
+ }
606
+ const naviVoloExchangeRateCache = new simpleCache_js_1.SimpleCache();
607
+ const naviVoloExchangeRatePromiseCache = new simpleCache_js_1.SimpleCache();
608
+ async function fetchVoloExchangeRate(ignoreCache) {
609
+ const apiUrl = "https://open-api.naviprotocol.io/api/volo/stats";
610
+ let NaviVoloDetails;
611
+ if (ignoreCache) {
612
+ naviVoloExchangeRateCache.clear();
613
+ naviVoloExchangeRatePromiseCache.delete(apiUrl);
614
+ }
615
+ const cachedResponse = naviVoloExchangeRateCache.get(apiUrl);
616
+ if (cachedResponse) {
617
+ NaviVoloDetails = cachedResponse;
618
+ }
619
+ else {
620
+ const default_volo_data = {
621
+ data: {
622
+ operatorBalance: "",
623
+ collectableFee: "",
624
+ pendingStakes: "",
625
+ poolTotalRewards: "0",
626
+ unstakeTicketSupply: "",
627
+ totalStaked: "",
628
+ activeStake: "",
629
+ calcTotalRewards: "",
630
+ currentEpoch: "",
631
+ validators: {},
632
+ exchangeRate: (1 / 0.973).toString(),
633
+ totalSupply: "",
634
+ apy: "",
635
+ sortedValidators: [""],
636
+ maxInstantUnstake: "",
637
+ maxNoFeeUnstake: "",
638
+ },
639
+ code: 0,
640
+ };
641
+ try {
642
+ let cachedPromise = naviVoloExchangeRatePromiseCache.get(apiUrl);
643
+ if (!cachedPromise) {
644
+ cachedPromise = fetch(apiUrl)
645
+ .then(async (response) => {
646
+ if (!response.ok) {
647
+ throw new Error(`HTTP error! status: ${response.status}`);
648
+ }
649
+ const data = (await response.json()); // Parse the JSON response
650
+ naviVoloExchangeRateCache.set(apiUrl, data); // Cache the response
651
+ naviVoloExchangeRatePromiseCache.delete(apiUrl); // Remove the promise from the cache
652
+ return data;
653
+ })
654
+ .catch((error) => {
655
+ naviVoloExchangeRatePromiseCache.delete(apiUrl); // Ensure the promise is removed on error
656
+ throw error;
657
+ });
658
+ naviVoloExchangeRatePromiseCache.set(apiUrl, cachedPromise);
659
+ NaviVoloDetails = await cachedPromise;
660
+ return cachedPromise;
556
661
  }
557
- if (upperTick > upperBound) {
558
- upperTick = -~(upperTick - 1);
662
+ else {
663
+ NaviVoloDetails = default_volo_data;
664
+ return Promise.resolve(default_volo_data);
559
665
  }
560
- const lowerPrice = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(lowerTick, coinA.expo, coinB.expo);
561
- const upperPrice = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(upperTick, coinA.expo, coinB.expo);
562
- res.set(poolName, {
563
- lowerPrice: lowerPrice.toString(),
564
- upperPrice: upperPrice.toString(),
565
- });
566
- }
567
- }));
568
- return res;
569
- }
570
- async function getPositionRange(ignoreCache) {
571
- const res = new Map();
572
- for (const poolNameString of Object.keys(maps_js_1.poolInfo)) {
573
- const poolName = poolNameString;
574
- if (poolName == "ALPHA" ||
575
- !["CETUS", "BLUEFIN"].includes(maps_js_1.poolInfo[poolNameString].parentProtocolName)) {
576
- continue;
577
- }
578
- let investor;
579
- if (maps_js_1.poolInfo[poolNameString].parentProtocolName == "CETUS") {
580
- investor = (await getInvestor(poolName, ignoreCache));
581
666
  }
582
- else {
583
- investor = (await getInvestor(poolName, ignoreCache));
667
+ catch (error) {
668
+ console.log("error in api", error);
669
+ NaviVoloDetails = default_volo_data;
670
+ return Promise.resolve(default_volo_data);
584
671
  }
585
- const coinAName = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
586
- const coinA = index_js_1.coinsList[coinAName];
587
- const coinBName = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
588
- const coinB = index_js_1.coinsList[coinBName];
589
- if (investor) {
590
- const upperBound = 443636;
591
- let lowerTick = Number(investor.content.fields.lower_tick);
592
- let upperTick = Number(investor.content.fields.upper_tick);
593
- if (lowerTick > upperBound) {
594
- lowerTick = -~(lowerTick - 1);
595
- }
596
- if (upperTick > upperBound) {
597
- upperTick = -~(upperTick - 1);
598
- }
599
- const lowerPrice = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(lowerTick, coinA.expo, coinB.expo);
600
- const upperPrice = cetus_sui_clmm_sdk_1.TickMath.tickIndexToPrice(upperTick, coinA.expo, coinB.expo);
601
- res.set(poolName, {
602
- lowerPrice: lowerPrice.toString(),
603
- upperPrice: upperPrice.toString(),
604
- });
672
+ }
673
+ return NaviVoloDetails;
674
+ }
675
+ async function multiGetNaviInvestor(poolNames) {
676
+ const results = {};
677
+ const poolInvestorIds = [];
678
+ for (const poolName of poolNames) {
679
+ poolInvestorIds.push(maps_js_1.poolInfo[poolName].investorId);
680
+ }
681
+ try {
682
+ const suiClient = (0, client_js_1.getSuiClient)();
683
+ const objects = await suiClient.multiGetObjects({
684
+ ids: poolInvestorIds,
685
+ options: { showContent: true },
686
+ });
687
+ for (let i = 0; i < objects.length; i++) {
688
+ const investor = objects[i].data;
689
+ results[poolNames[i]] = investor;
605
690
  }
691
+ return results;
692
+ }
693
+ catch (err) {
694
+ //improve
695
+ console.error("multiGetNaviInvestor failed for poolNames: ", poolNames.join(", "));
696
+ throw err;
606
697
  }
607
- return res;
608
698
  }
609
699
  /*
610
700
  for the missing pools, add a promise, each of those promises waits for there respective object from a map, that map is populated all at once,