@alphafi/alphafi-sdk 0.0.39 → 0.0.41

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 (322) hide show
  1. package/dist/cjs/adminFunctions.d.ts.map +1 -1
  2. package/dist/cjs/adminFunctions.js +9 -1
  3. package/dist/cjs/adminFunctions.js.map +1 -1
  4. package/dist/cjs/common/coins.d.ts.map +1 -1
  5. package/dist/cjs/common/coins.js +18 -0
  6. package/dist/cjs/common/coins.js.map +1 -1
  7. package/dist/cjs/common/constants.d.ts +288 -0
  8. package/dist/cjs/common/constants.d.ts.map +1 -1
  9. package/dist/cjs/common/constants.js +214 -8
  10. package/dist/cjs/common/constants.js.map +1 -1
  11. package/dist/cjs/common/maps.d.ts +1 -0
  12. package/dist/cjs/common/maps.d.ts.map +1 -1
  13. package/dist/cjs/common/maps.js +207 -14
  14. package/dist/cjs/common/maps.js.map +1 -1
  15. package/dist/cjs/common/types.d.ts +58 -5
  16. package/dist/cjs/common/types.d.ts.map +1 -1
  17. package/dist/cjs/common/types.js.map +1 -1
  18. package/dist/cjs/graphql/getMultiReceipts.d.ts.map +1 -1
  19. package/dist/cjs/graphql/getMultiReceipts.js +49 -36
  20. package/dist/cjs/graphql/getMultiReceipts.js.map +1 -1
  21. package/dist/cjs/index.d.ts +5 -9
  22. package/dist/cjs/index.d.ts.map +1 -1
  23. package/dist/cjs/index.js +17 -8
  24. package/dist/cjs/index.js.map +1 -1
  25. package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
  26. package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
  27. package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
  28. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
  29. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +6 -12
  30. package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
  31. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +6 -3
  32. package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  33. package/dist/cjs/sui-sdk/functions/getReceipts.js +42 -26
  34. package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
  35. package/dist/cjs/transactions/7k.d.ts +13 -0
  36. package/dist/cjs/transactions/7k.d.ts.map +1 -0
  37. package/dist/cjs/transactions/7k.js +46 -0
  38. package/dist/cjs/transactions/7k.js.map +1 -0
  39. package/dist/cjs/transactions/alpha.d.ts.map +1 -1
  40. package/dist/cjs/transactions/alpha.js +1 -0
  41. package/dist/cjs/transactions/alpha.js.map +1 -1
  42. package/dist/cjs/transactions/bluefin.d.ts +12 -0
  43. package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
  44. package/dist/cjs/transactions/bluefin.js +937 -91
  45. package/dist/cjs/transactions/bluefin.js.map +1 -1
  46. package/dist/cjs/transactions/cetus.d.ts +0 -3
  47. package/dist/cjs/transactions/cetus.d.ts.map +1 -1
  48. package/dist/cjs/transactions/cetus.js +4 -63
  49. package/dist/cjs/transactions/cetus.js.map +1 -1
  50. package/dist/cjs/transactions/deposit.d.ts +3 -0
  51. package/dist/cjs/transactions/deposit.d.ts.map +1 -1
  52. package/dist/cjs/transactions/deposit.js +77 -1
  53. package/dist/cjs/transactions/deposit.js.map +1 -1
  54. package/dist/cjs/transactions/deposit1.d.ts +1 -0
  55. package/dist/cjs/transactions/deposit1.d.ts.map +1 -0
  56. package/dist/cjs/transactions/deposit1.js +86 -0
  57. package/dist/cjs/transactions/deposit1.js.map +1 -0
  58. package/dist/cjs/transactions/types.d.ts +14 -0
  59. package/dist/cjs/transactions/types.d.ts.map +1 -0
  60. package/dist/cjs/transactions/types.js +3 -0
  61. package/dist/cjs/transactions/types.js.map +1 -0
  62. package/dist/cjs/transactions/withdraw.d.ts.map +1 -1
  63. package/dist/cjs/transactions/withdraw.js +17 -2
  64. package/dist/cjs/transactions/withdraw.js.map +1 -1
  65. package/dist/cjs/transactions/zapDeposit.d.ts +9 -0
  66. package/dist/cjs/transactions/zapDeposit.d.ts.map +1 -1
  67. package/dist/cjs/transactions/zapDeposit.js +1117 -725
  68. package/dist/cjs/transactions/zapDeposit.js.map +1 -1
  69. package/dist/esm/adminFunctions.d.ts.map +1 -1
  70. package/dist/esm/adminFunctions.js +10 -2
  71. package/dist/esm/adminFunctions.js.map +1 -1
  72. package/dist/esm/common/coins.d.ts.map +1 -1
  73. package/dist/esm/common/coins.js +18 -0
  74. package/dist/esm/common/coins.js.map +1 -1
  75. package/dist/esm/common/constants.d.ts +288 -0
  76. package/dist/esm/common/constants.d.ts.map +1 -1
  77. package/dist/esm/common/constants.js +214 -8
  78. package/dist/esm/common/constants.js.map +1 -1
  79. package/dist/esm/common/maps.d.ts +1 -0
  80. package/dist/esm/common/maps.d.ts.map +1 -1
  81. package/dist/esm/common/maps.js +206 -13
  82. package/dist/esm/common/maps.js.map +1 -1
  83. package/dist/esm/common/types.d.ts +58 -5
  84. package/dist/esm/common/types.d.ts.map +1 -1
  85. package/dist/esm/common/types.js.map +1 -1
  86. package/dist/esm/graphql/getMultiReceipts.d.ts.map +1 -1
  87. package/dist/esm/graphql/getMultiReceipts.js +49 -36
  88. package/dist/esm/graphql/getMultiReceipts.js.map +1 -1
  89. package/dist/esm/index.d.ts +5 -9
  90. package/dist/esm/index.d.ts.map +1 -1
  91. package/dist/esm/index.js +5 -9
  92. package/dist/esm/index.js.map +1 -1
  93. package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
  94. package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
  95. package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
  96. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
  97. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +7 -13
  98. package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
  99. package/dist/esm/sui-sdk/functions/getReceipts.d.ts +6 -3
  100. package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
  101. package/dist/esm/sui-sdk/functions/getReceipts.js +43 -26
  102. package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
  103. package/dist/esm/transactions/7k.d.ts +13 -0
  104. package/dist/esm/transactions/7k.d.ts.map +1 -0
  105. package/dist/esm/transactions/7k.js +42 -0
  106. package/dist/esm/transactions/7k.js.map +1 -0
  107. package/dist/esm/transactions/alpha.d.ts.map +1 -1
  108. package/dist/esm/transactions/alpha.js +1 -0
  109. package/dist/esm/transactions/alpha.js.map +1 -1
  110. package/dist/esm/transactions/bluefin.d.ts +12 -0
  111. package/dist/esm/transactions/bluefin.d.ts.map +1 -1
  112. package/dist/esm/transactions/bluefin.js +928 -86
  113. package/dist/esm/transactions/bluefin.js.map +1 -1
  114. package/dist/esm/transactions/cetus.d.ts +0 -3
  115. package/dist/esm/transactions/cetus.d.ts.map +1 -1
  116. package/dist/esm/transactions/cetus.js +2 -57
  117. package/dist/esm/transactions/cetus.js.map +1 -1
  118. package/dist/esm/transactions/deposit.d.ts +3 -0
  119. package/dist/esm/transactions/deposit.d.ts.map +1 -1
  120. package/dist/esm/transactions/deposit.js +74 -2
  121. package/dist/esm/transactions/deposit.js.map +1 -1
  122. package/dist/esm/transactions/deposit1.d.ts +2 -0
  123. package/dist/esm/transactions/deposit1.d.ts.map +1 -0
  124. package/dist/esm/transactions/deposit1.js +86 -0
  125. package/dist/esm/transactions/deposit1.js.map +1 -0
  126. package/dist/esm/transactions/types.d.ts +14 -0
  127. package/dist/esm/transactions/types.d.ts.map +1 -0
  128. package/dist/esm/transactions/types.js +2 -0
  129. package/dist/esm/transactions/types.js.map +1 -0
  130. package/dist/esm/transactions/withdraw.d.ts.map +1 -1
  131. package/dist/esm/transactions/withdraw.js +18 -3
  132. package/dist/esm/transactions/withdraw.js.map +1 -1
  133. package/dist/esm/transactions/zapDeposit.d.ts +9 -1
  134. package/dist/esm/transactions/zapDeposit.d.ts.map +1 -1
  135. package/dist/esm/transactions/zapDeposit.js +1113 -726
  136. package/dist/esm/transactions/zapDeposit.js.map +1 -1
  137. package/docs/assets/highlight.css +78 -0
  138. package/docs/assets/icons.js +18 -0
  139. package/docs/assets/icons.svg +1 -0
  140. package/docs/assets/main.js +60 -0
  141. package/docs/assets/navigation.js +1 -0
  142. package/docs/assets/search.js +1 -0
  143. package/docs/assets/style.css +1493 -0
  144. package/docs/functions/alphaLpBreakdown.html +1 -0
  145. package/docs/functions/cetusLpBreakdown.html +1 -0
  146. package/docs/functions/claimRewardTxb.html +1 -0
  147. package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -0
  148. package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -0
  149. package/docs/functions/coinsInPool.html +1 -0
  150. package/docs/functions/collectRewards.html +1 -0
  151. package/docs/functions/deposit.html +1 -0
  152. package/docs/functions/depositDoubleAssetTxb.html +1 -0
  153. package/docs/functions/depositSingleAssetTxb.html +1 -0
  154. package/docs/functions/fetchAfterTransactionEvents.html +1 -0
  155. package/docs/functions/fetchAutoCompoundingEvents.html +1 -0
  156. package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -0
  157. package/docs/functions/fetchCetusPools.html +1 -0
  158. package/docs/functions/fetchChainIdentifier.html +1 -0
  159. package/docs/functions/fetchCheckRatioEvents.html +1 -0
  160. package/docs/functions/fetchLiquidityChangeEvents.html +1 -0
  161. package/docs/functions/fetchMultiReceipts.html +1 -0
  162. package/docs/functions/fetchNftHolders.html +1 -0
  163. package/docs/functions/fetchPools.html +1 -0
  164. package/docs/functions/fetchPortfolioData.html +1 -0
  165. package/docs/functions/fetchProtocolData.html +1 -0
  166. package/docs/functions/fetchTVL.html +1 -0
  167. package/docs/functions/fetchUserVaultBalances.html +1 -0
  168. package/docs/functions/fetchUserVaults.html +1 -0
  169. package/docs/functions/fetchUserWalletData.html +1 -0
  170. package/docs/functions/fetchWithdrawV2Events.html +1 -0
  171. package/docs/functions/getAirdropShare.html +1 -0
  172. package/docs/functions/getAllDoubleAssetVaults.html +1 -0
  173. package/docs/functions/getAllSingleAssetVaults.html +1 -0
  174. package/docs/functions/getAllVaultBalances.html +1 -0
  175. package/docs/functions/getAllVaults.html +1 -0
  176. package/docs/functions/getAlphaUnlocks.html +1 -0
  177. package/docs/functions/getAlphaVaultBalance.html +1 -0
  178. package/docs/functions/getAmounts.html +1 -0
  179. package/docs/functions/getApr.html +1 -0
  180. package/docs/functions/getAprs.html +1 -0
  181. package/docs/functions/getApy.html +1 -0
  182. package/docs/functions/getApys.html +1 -0
  183. package/docs/functions/getCetusInvestorTicksMap.html +1 -0
  184. package/docs/functions/getCetusSqrtPriceMap.html +1 -0
  185. package/docs/functions/getCoinAmountsFromLiquidity.html +1 -0
  186. package/docs/functions/getConf.html +1 -0
  187. package/docs/functions/getCurrentTick.html +1 -0
  188. package/docs/functions/getDoubleAssetVaultBalance.html +1 -0
  189. package/docs/functions/getDoubleAssetVaults.html +1 -0
  190. package/docs/functions/getHoldersFromTransactions.html +1 -0
  191. package/docs/functions/getInvestor.html +1 -0
  192. package/docs/functions/getInvestorPoolMap.html +1 -0
  193. package/docs/functions/getLastAutoCompoundTime.html +1 -0
  194. package/docs/functions/getLatestPrices.html +1 -0
  195. package/docs/functions/getLiquidity.html +1 -0
  196. package/docs/functions/getMultiInvestor.html +1 -0
  197. package/docs/functions/getMultiLatestPrices.html +1 -0
  198. package/docs/functions/getMultiParentPool.html +1 -0
  199. package/docs/functions/getMultiPool.html +1 -0
  200. package/docs/functions/getMultiReceipts.html +1 -0
  201. package/docs/functions/getParentPool.html +1 -0
  202. package/docs/functions/getPool.html +1 -0
  203. package/docs/functions/getPoolExchangeRateMap.html +1 -0
  204. package/docs/functions/getPositionRange.html +1 -0
  205. package/docs/functions/getPositionTicks.html +1 -0
  206. package/docs/functions/getPriceToTick.html +1 -0
  207. package/docs/functions/getRebalanceHistories.html +1 -0
  208. package/docs/functions/getRebalanceHistory.html +1 -0
  209. package/docs/functions/getReceipts.html +1 -0
  210. package/docs/functions/getSingleAssetVaultBalance.html +1 -0
  211. package/docs/functions/getSingleAssetVaults.html +1 -0
  212. package/docs/functions/getSuiClient.html +3 -0
  213. package/docs/functions/getSuiNodeUrl.html +3 -0
  214. package/docs/functions/getTVLs.html +1 -0
  215. package/docs/functions/getTickToPrice.html +1 -0
  216. package/docs/functions/getUserTokensFromTransactions.html +1 -0
  217. package/docs/functions/getUserTokensInUsdFromTransactions.html +1 -0
  218. package/docs/functions/getVaultBalance.html +1 -0
  219. package/docs/functions/getVaultBalanceForActiveUsers.html +1 -0
  220. package/docs/functions/getVaults.html +1 -0
  221. package/docs/functions/getXTokenVaultBalanceForActiveUsers.html +1 -0
  222. package/docs/functions/getZapAmounts.html +1 -0
  223. package/docs/functions/lastAutocompoundTime.html +1 -0
  224. package/docs/functions/liquidityToTokens.html +1 -0
  225. package/docs/functions/multiLiquidityToTokens.html +1 -0
  226. package/docs/functions/multiTokensToUsd.html +1 -0
  227. package/docs/functions/multiXTokensToLiquidity.html +1 -0
  228. package/docs/functions/parseUserWalletData.html +1 -0
  229. package/docs/functions/setSuiClient.html +7 -0
  230. package/docs/functions/setSuiNodeUrl.html +5 -0
  231. package/docs/functions/withdraw.html +1 -0
  232. package/docs/functions/withdrawAlphaTxb.html +1 -0
  233. package/docs/functions/withdrawTxb.html +1 -0
  234. package/docs/functions/zapDepositTxb.html +1 -0
  235. package/docs/index.html +76 -0
  236. package/docs/interfaces/Coin.html +12 -0
  237. package/docs/interfaces/CoinPair.html +3 -0
  238. package/docs/interfaces/NaviVoloData.html +3 -0
  239. package/docs/interfaces/RebalanceHistoryType.html +9 -0
  240. package/docs/modules.html +177 -0
  241. package/docs/types/AfterTransactionEventNode.html +1 -0
  242. package/docs/types/Allocator.html +1 -0
  243. package/docs/types/AlphaFiDoubleAssetVault.html +1 -0
  244. package/docs/types/AlphaFiMultiVaultBalance.html +1 -0
  245. package/docs/types/AlphaFiSingleAssetVault.html +1 -0
  246. package/docs/types/AlphaFiVault.html +1 -0
  247. package/docs/types/AlphaFiVaultBalance.html +1 -0
  248. package/docs/types/AlphaPoolType.html +1 -0
  249. package/docs/types/AlphaReceipt.html +1 -0
  250. package/docs/types/AlphaReceiptFields.html +1 -0
  251. package/docs/types/AlphaVaultBalance.html +1 -0
  252. package/docs/types/AutoCompoundingEventNode.html +1 -0
  253. package/docs/types/BluefinInvestor.html +1 -0
  254. package/docs/types/BluefinPoolType.html +1 -0
  255. package/docs/types/BucketInvestor.html +1 -0
  256. package/docs/types/CetusInvestor.html +1 -0
  257. package/docs/types/CetusPoolType.html +1 -0
  258. package/docs/types/CetusSwapOptions.html +1 -0
  259. package/docs/types/CoinAmounts.html +1 -0
  260. package/docs/types/CoinName.html +1 -0
  261. package/docs/types/CoinType.html +1 -0
  262. package/docs/types/CommonInvestorFields.html +1 -0
  263. package/docs/types/CreatePoolOptions.html +1 -0
  264. package/docs/types/Distributor.html +1 -0
  265. package/docs/types/DoubleAssetMultiVaultBalance.html +1 -0
  266. package/docs/types/DoubleAssetPoolNames.html +1 -0
  267. package/docs/types/DoubleAssetTokenHoldings.html +1 -0
  268. package/docs/types/DoubleAssetVaultBalance.html +1 -0
  269. package/docs/types/GetHoldersParams.html +1 -0
  270. package/docs/types/GetTokenHoldingsParams.html +1 -0
  271. package/docs/types/GetUserTokensFromTransactionsParams.html +1 -0
  272. package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +1 -0
  273. package/docs/types/GetVaultBalanceForActiveUsersParams.html +1 -0
  274. package/docs/types/GetVaultBalanceParams.html +1 -0
  275. package/docs/types/HoldingsObj.html +1 -0
  276. package/docs/types/Icon.html +1 -0
  277. package/docs/types/Investor.html +1 -0
  278. package/docs/types/LiquidityChangeEventNode.html +1 -0
  279. package/docs/types/LiquidityToTokensParams.html +1 -0
  280. package/docs/types/LiquidityToUsdParams.html +1 -0
  281. package/docs/types/LoopingDebt.html +1 -0
  282. package/docs/types/LpBreakdownType.html +1 -0
  283. package/docs/types/MemberPoolDataType.html +1 -0
  284. package/docs/types/MemberType.html +1 -0
  285. package/docs/types/MultiGetVaultBalancesParams.html +1 -0
  286. package/docs/types/NaviInvestor.html +1 -0
  287. package/docs/types/OtherReceiptFields.html +1 -0
  288. package/docs/types/PoolName.html +1 -0
  289. package/docs/types/PoolReceipt.html +1 -0
  290. package/docs/types/PoolType.html +1 -0
  291. package/docs/types/Receipt.html +1 -0
  292. package/docs/types/ReceiptGQL.html +1 -0
  293. package/docs/types/SingleAssetMultiVaultBalance.html +1 -0
  294. package/docs/types/SingleAssetPoolNames.html +1 -0
  295. package/docs/types/SingleAssetTokenHoldings.html +1 -0
  296. package/docs/types/SingleAssetVaultBalance.html +1 -0
  297. package/docs/types/SingleGetVaultBalancesParams.html +1 -0
  298. package/docs/types/StrategyType.html +1 -0
  299. package/docs/types/SuiNetwork.html +1 -0
  300. package/docs/types/SwapOptions.html +1 -0
  301. package/docs/types/TickSpacing.html +1 -0
  302. package/docs/types/TotalWeightType.html +1 -0
  303. package/docs/types/TransactionBlockType.html +1 -0
  304. package/docs/types/UserPoolLiquidity.html +1 -0
  305. package/docs/types/UserPoolTokenHoldings.html +1 -0
  306. package/docs/types/UserUsdHoldings.html +1 -0
  307. package/docs/types/VaultBalance.html +1 -0
  308. package/docs/types/WithdrawV2EventNode.html +1 -0
  309. package/docs/variables/bluefinPoolMap.html +1 -0
  310. package/docs/variables/cetusPoolMap.html +1 -0
  311. package/docs/variables/coinsList.html +1 -0
  312. package/docs/variables/defunctPoolsSet.html +1 -0
  313. package/docs/variables/doubleAssetPoolCoinMap.html +1 -0
  314. package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -0
  315. package/docs/variables/loopingAccountAddresses.html +1 -0
  316. package/docs/variables/loopingPoolCoinMap.html +1 -0
  317. package/docs/variables/naviAssetMap.html +1 -0
  318. package/docs/variables/poolIdPoolNameMap.html +1 -0
  319. package/docs/variables/poolInfo.html +1 -0
  320. package/docs/variables/singleAssetPoolCoinMap.html +1 -0
  321. package/docs/variables/stableCoins.html +1 -0
  322. package/package.json +2 -1
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withdrawBluefinType2Txb = exports.withdrawBluefinType1Txb = exports.withdrawBluefinSuiFirstTxb = exports.depositBluefinType2Txb = exports.depositBluefinType1Txb = exports.depositBluefinSuiFirstTxb = void 0;
3
+ exports.withdrawBluefinStsuiTxb = exports.withdrawBluefinType2Txb = exports.withdrawBluefinType1Txb = exports.withdrawBluefinSuiSecondTxb = exports.withdrawBluefinSuiFirstTxb = exports.depositBluefinStsuiTxb = exports.depositBluefinType2Txb = exports.depositBluefinType1Txb = exports.depositBluefinSuiSecondTxb = exports.depositBluefinSuiFirstTxb = void 0;
4
4
  const transactions_1 = require("@mysten/sui/transactions");
5
5
  const coins_js_1 = require("../common/coins.js");
6
6
  const constants_js_1 = require("../common/constants.js");
7
7
  const maps_js_1 = require("../common/maps.js");
8
8
  const getReceipts_js_1 = require("../sui-sdk/functions/getReceipts.js");
9
- const cetus_js_1 = require("./cetus.js");
10
9
  const client_js_1 = require("../sui-sdk/client.js");
10
+ const deposit_js_1 = require("./deposit.js");
11
11
  const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, transaction = undefined) => {
12
12
  const suiClient = (0, client_js_1.getSuiClient)();
13
13
  const address = options.address;
@@ -39,7 +39,7 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
39
39
  break;
40
40
  }
41
41
  } while (true);
42
- const amounts = await (0, cetus_js_1.getAmounts)(poolName, isAmountA, amount);
42
+ const amounts = await (0, deposit_js_1.getAmounts)(poolName, isAmountA, amount);
43
43
  if (amounts) {
44
44
  const amount1 = amounts[0];
45
45
  const amount2 = amounts[1];
@@ -67,14 +67,13 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
67
67
  arguments: [txb.object(receipt[0].objectId)],
68
68
  });
69
69
  }
70
- console.log(poolinfo.poolId);
71
70
  if (poolName === "BLUEFIN-SUI-USDC") {
72
71
  txb.moveCall({
73
72
  target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_deposit`,
74
73
  typeArguments: [
75
74
  coins_js_1.coinsList[pool1].type,
76
75
  coins_js_1.coinsList[pool2].type,
77
- coins_js_1.coinsList["DEEP"].type,
76
+ coins_js_1.coinsList["BLUE"].type,
78
77
  coins_js_1.coinsList["SUI"].type,
79
78
  ],
80
79
  arguments: [
@@ -89,7 +88,7 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
89
88
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
90
89
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
91
90
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
92
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
91
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
93
92
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
94
93
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
95
94
  ],
@@ -101,7 +100,7 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
101
100
  typeArguments: [
102
101
  coins_js_1.coinsList[pool1].type,
103
102
  coins_js_1.coinsList[pool2].type,
104
- coins_js_1.coinsList["DEEP"].type,
103
+ coins_js_1.coinsList["BLUE"].type,
105
104
  coins_js_1.coinsList["SUI"].type,
106
105
  ],
107
106
  arguments: [
@@ -116,7 +115,7 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
116
115
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
117
116
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
118
117
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_BUCK_POOL),
119
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
118
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
120
119
  txb.object(maps_js_1.cetusPoolMap["BUCK-SUI"]),
121
120
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
122
121
  ],
@@ -128,7 +127,7 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
128
127
  typeArguments: [
129
128
  coins_js_1.coinsList[pool1].type,
130
129
  coins_js_1.coinsList[pool2].type,
131
- coins_js_1.coinsList["DEEP"].type,
130
+ coins_js_1.coinsList["BLUE"].type,
132
131
  coins_js_1.coinsList["SUI"].type,
133
132
  ],
134
133
  arguments: [
@@ -143,7 +142,7 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
143
142
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
144
143
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
145
144
  txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_AUSD_POOL),
146
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
145
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
147
146
  txb.object(maps_js_1.cetusPoolMap["AUSD-SUI"]),
148
147
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
149
148
  ],
@@ -158,6 +157,181 @@ const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, options, t
158
157
  return txb;
159
158
  };
160
159
  exports.depositBluefinSuiFirstTxb = depositBluefinSuiFirstTxb;
160
+ const depositBluefinSuiSecondTxb = async (amount, poolName, isAmountA, options, transaction = undefined) => {
161
+ const suiClient = (0, client_js_1.getSuiClient)();
162
+ const address = options.address;
163
+ let txb;
164
+ if (transaction)
165
+ txb = transaction;
166
+ else
167
+ txb = new transactions_1.Transaction();
168
+ poolName = poolName.toUpperCase();
169
+ const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
170
+ const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
171
+ const receipt = await (0, getReceipts_js_1.getReceipts)(poolName, address, true);
172
+ let coins1 = [];
173
+ let currentCursor = null;
174
+ do {
175
+ const response = await suiClient.getCoins({
176
+ owner: address,
177
+ coinType: coins_js_1.coinsList[pool1].type,
178
+ cursor: currentCursor,
179
+ });
180
+ coins1 = coins1.concat(response.data);
181
+ // Check if there's a next page
182
+ if (response.hasNextPage && response.nextCursor) {
183
+ currentCursor = response.nextCursor;
184
+ }
185
+ else {
186
+ // No more pages available
187
+ // console.log("No more receipts available.");
188
+ break;
189
+ }
190
+ } while (true);
191
+ const amounts = await (0, deposit_js_1.getAmounts)(poolName, isAmountA, amount);
192
+ if (amounts) {
193
+ const amount1 = amounts[0];
194
+ const amount2 = amounts[1];
195
+ let coin1;
196
+ if (coins1.length >= 1) {
197
+ //coin1
198
+ [coin1] = txb.splitCoins(txb.object(coins1[0].coinObjectId), [0]);
199
+ txb.mergeCoins(coin1, coins1.map((c) => c.coinObjectId));
200
+ const [depositCoinA] = txb.splitCoins(coin1, [amount1]);
201
+ //coin2
202
+ const [depositCoinB] = txb.splitCoins(txb.gas, [amount2]);
203
+ const poolinfo = maps_js_1.poolInfo[poolName];
204
+ let someReceipt;
205
+ if (receipt.length == 0) {
206
+ [someReceipt] = txb.moveCall({
207
+ target: `0x1::option::none`,
208
+ typeArguments: [poolinfo.receiptType],
209
+ arguments: [],
210
+ });
211
+ }
212
+ else {
213
+ [someReceipt] = txb.moveCall({
214
+ target: `0x1::option::some`,
215
+ typeArguments: [receipt[0].content.type],
216
+ arguments: [txb.object(receipt[0].objectId)],
217
+ });
218
+ }
219
+ if (poolName === "BLUEFIN-BLUE-SUI") {
220
+ txb.moveCall({
221
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
222
+ typeArguments: [
223
+ coins_js_1.coinsList[pool1].type,
224
+ coins_js_1.coinsList[pool2].type,
225
+ coins_js_1.coinsList["DEEP"].type,
226
+ coins_js_1.coinsList["SUI"].type,
227
+ ],
228
+ arguments: [
229
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
230
+ txb.object((0, constants_js_1.getConf)().VERSION),
231
+ someReceipt,
232
+ txb.object(poolinfo.poolId),
233
+ depositCoinA,
234
+ depositCoinB,
235
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
236
+ txb.object(poolinfo.investorId),
237
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
238
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
239
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
240
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
241
+ txb.object(maps_js_1.cetusPoolMap["BLUE-SUI"]),
242
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
243
+ ],
244
+ });
245
+ }
246
+ else if (poolName === "BLUEFIN-WBTC-SUI") {
247
+ txb.moveCall({
248
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
249
+ typeArguments: [
250
+ coins_js_1.coinsList[pool1].type,
251
+ coins_js_1.coinsList[pool2].type,
252
+ coins_js_1.coinsList["BLUE"].type,
253
+ coins_js_1.coinsList["SUI"].type,
254
+ ],
255
+ arguments: [
256
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
257
+ txb.object((0, constants_js_1.getConf)().VERSION),
258
+ someReceipt,
259
+ txb.object(poolinfo.poolId),
260
+ depositCoinA,
261
+ depositCoinB,
262
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
263
+ txb.object(poolinfo.investorId),
264
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
265
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
266
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_WBTC_SUI_POOL),
267
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
268
+ txb.object(maps_js_1.cetusPoolMap["WBTC-SUI"]),
269
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
270
+ ],
271
+ });
272
+ }
273
+ else if (poolName === "BLUEFIN-DEEP-SUI") {
274
+ txb.moveCall({
275
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
276
+ typeArguments: [
277
+ coins_js_1.coinsList[pool1].type,
278
+ coins_js_1.coinsList[pool2].type,
279
+ coins_js_1.coinsList["BLUE"].type,
280
+ coins_js_1.coinsList["SUI"].type,
281
+ ],
282
+ arguments: [
283
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
284
+ txb.object((0, constants_js_1.getConf)().VERSION),
285
+ someReceipt,
286
+ txb.object(poolinfo.poolId),
287
+ depositCoinA,
288
+ depositCoinB,
289
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
290
+ txb.object(poolinfo.investorId),
291
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
292
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
293
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
294
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
295
+ txb.object(maps_js_1.cetusPoolMap["DEEP-SUI"]),
296
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
297
+ ],
298
+ });
299
+ }
300
+ else if (poolName === "BLUEFIN-STSUI-SUI") {
301
+ txb.moveCall({
302
+ target: `${poolinfo.packageId}::alphafi_bluefin_stsui_sui_pool::user_deposit`,
303
+ typeArguments: [
304
+ coins_js_1.coinsList[pool1].type,
305
+ coins_js_1.coinsList[pool2].type,
306
+ coins_js_1.coinsList["BLUE"].type,
307
+ ],
308
+ arguments: [
309
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
310
+ txb.object((0, constants_js_1.getConf)().VERSION),
311
+ someReceipt,
312
+ txb.object(poolinfo.poolId),
313
+ depositCoinA,
314
+ depositCoinB,
315
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
316
+ txb.object(poolinfo.investorId),
317
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
318
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_SUI_POOL),
319
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
320
+ txb.object((0, constants_js_1.getConf)().LST_INFO),
321
+ txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
322
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
323
+ ],
324
+ });
325
+ }
326
+ txb.transferObjects([coin1], address);
327
+ }
328
+ else {
329
+ throw new Error(`No ${pool1} or ${pool2} Coins`);
330
+ }
331
+ }
332
+ return txb;
333
+ };
334
+ exports.depositBluefinSuiSecondTxb = depositBluefinSuiSecondTxb;
161
335
  const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, transaction = undefined) => {
162
336
  const suiClient = (0, client_js_1.getSuiClient)();
163
337
  const address = options.address;
@@ -208,7 +382,7 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
208
382
  break;
209
383
  }
210
384
  } while (true);
211
- const amounts = await (0, cetus_js_1.getAmounts)(poolName, isAmountA, amount);
385
+ const amounts = await (0, deposit_js_1.getAmounts)(poolName, isAmountA, amount);
212
386
  if (amounts) {
213
387
  const amount1 = amounts[0];
214
388
  const amount2 = amounts[1];
@@ -245,7 +419,7 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
245
419
  typeArguments: [
246
420
  coins_js_1.coinsList[pool1].type,
247
421
  coins_js_1.coinsList[pool2].type,
248
- coins_js_1.coinsList["DEEP"].type,
422
+ coins_js_1.coinsList["BLUE"].type,
249
423
  coins_js_1.coinsList["SUI"].type,
250
424
  ],
251
425
  arguments: [
@@ -260,7 +434,7 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
260
434
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
261
435
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
262
436
  txb.object((0, constants_js_1.getConf)().BLUEFIN_USDT_USDC_POOL),
263
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
437
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
264
438
  txb.object(maps_js_1.cetusPoolMap["USDC-USDT"]),
265
439
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
266
440
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -273,7 +447,7 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
273
447
  typeArguments: [
274
448
  coins_js_1.coinsList[pool1].type,
275
449
  coins_js_1.coinsList[pool2].type,
276
- coins_js_1.coinsList["DEEP"].type,
450
+ coins_js_1.coinsList["BLUE"].type,
277
451
  coins_js_1.coinsList["SUI"].type,
278
452
  ],
279
453
  arguments: [
@@ -288,7 +462,7 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
288
462
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
289
463
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
290
464
  txb.object((0, constants_js_1.getConf)().BLUEFIN_AUSD_USDC_POOL),
291
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
465
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
292
466
  txb.object(maps_js_1.cetusPoolMap["USDC-AUSD"]),
293
467
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
294
468
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -301,7 +475,7 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
301
475
  typeArguments: [
302
476
  coins_js_1.coinsList[pool1].type,
303
477
  coins_js_1.coinsList[pool2].type,
304
- coins_js_1.coinsList["DEEP"].type,
478
+ coins_js_1.coinsList["BLUE"].type,
305
479
  coins_js_1.coinsList["SUI"].type,
306
480
  ],
307
481
  arguments: [
@@ -316,13 +490,69 @@ const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, tran
316
490
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
317
491
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
318
492
  txb.object((0, constants_js_1.getConf)().BLUEFIN_WBTC_USDC_POOL),
319
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
493
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
320
494
  txb.object(maps_js_1.cetusPoolMap["USDC-WBTC"]),
321
495
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
322
496
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
323
497
  ],
324
498
  });
325
499
  }
500
+ else if (poolName === "BLUEFIN-SEND-USDC") {
501
+ txb.moveCall({
502
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit`,
503
+ typeArguments: [
504
+ coins_js_1.coinsList[pool1].type,
505
+ coins_js_1.coinsList[pool2].type,
506
+ coins_js_1.coinsList["BLUE"].type,
507
+ coins_js_1.coinsList["SUI"].type,
508
+ ],
509
+ arguments: [
510
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
511
+ txb.object((0, constants_js_1.getConf)().VERSION),
512
+ someReceipt,
513
+ txb.object(poolinfo.poolId),
514
+ depositCoinA,
515
+ depositCoinB,
516
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
517
+ txb.object(poolinfo.investorId),
518
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
519
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
520
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_SEND_USDC_POOL),
521
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
522
+ txb.object(maps_js_1.cetusPoolMap["USDC-SEND"]),
523
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
524
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
525
+ ],
526
+ });
527
+ }
528
+ else if (poolName === "BLUEFIN-STSUI-USDC") {
529
+ txb.moveCall({
530
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit`,
531
+ typeArguments: [
532
+ coins_js_1.coinsList[pool1].type,
533
+ coins_js_1.coinsList[pool2].type,
534
+ coins_js_1.coinsList["BLUE"].type,
535
+ coins_js_1.coinsList["SUI"].type,
536
+ ],
537
+ arguments: [
538
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
539
+ txb.object((0, constants_js_1.getConf)().VERSION),
540
+ someReceipt,
541
+ txb.object(poolinfo.poolId),
542
+ depositCoinA,
543
+ depositCoinB,
544
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
545
+ txb.object(poolinfo.investorId),
546
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
547
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
548
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_USDC_POOL),
549
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
550
+ txb.object(maps_js_1.cetusPoolMap["USDC-STSUI"]),
551
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
552
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
553
+ ],
554
+ });
555
+ }
326
556
  txb.transferObjects([coin1], address);
327
557
  txb.transferObjects([coin2], address);
328
558
  }
@@ -383,7 +613,7 @@ const depositBluefinType2Txb = async (amount, poolName, isAmountA, options, tran
383
613
  break;
384
614
  }
385
615
  } while (true);
386
- const amounts = await (0, cetus_js_1.getAmounts)(poolName, isAmountA, amount);
616
+ const amounts = await (0, deposit_js_1.getAmounts)(poolName, isAmountA, amount);
387
617
  if (amounts) {
388
618
  const amount1 = amounts[0];
389
619
  const amount2 = amounts[1];
@@ -420,7 +650,7 @@ const depositBluefinType2Txb = async (amount, poolName, isAmountA, options, tran
420
650
  typeArguments: [
421
651
  coins_js_1.coinsList[pool1].type,
422
652
  coins_js_1.coinsList[pool2].type,
423
- coins_js_1.coinsList["DEEP"].type,
653
+ coins_js_1.coinsList["BLUE"].type,
424
654
  coins_js_1.coinsList["SUI"].type,
425
655
  ],
426
656
  arguments: [
@@ -435,7 +665,7 @@ const depositBluefinType2Txb = async (amount, poolName, isAmountA, options, tran
435
665
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
436
666
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
437
667
  txb.object((0, constants_js_1.getConf)().BLUEFIN_ALPHA_USDC_POOL),
438
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
668
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
439
669
  txb.object(maps_js_1.cetusPoolMap["ALPHA-USDC"]),
440
670
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
441
671
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -448,7 +678,7 @@ const depositBluefinType2Txb = async (amount, poolName, isAmountA, options, tran
448
678
  typeArguments: [
449
679
  coins_js_1.coinsList[pool1].type,
450
680
  coins_js_1.coinsList[pool2].type,
451
- coins_js_1.coinsList["DEEP"].type,
681
+ coins_js_1.coinsList["BLUE"].type,
452
682
  coins_js_1.coinsList["SUI"].type,
453
683
  ],
454
684
  arguments: [
@@ -463,58 +693,409 @@ const depositBluefinType2Txb = async (amount, poolName, isAmountA, options, tran
463
693
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
464
694
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
465
695
  txb.object((0, constants_js_1.getConf)().BLUEFIN_NAVX_VSUI_POOL),
466
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
696
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
467
697
  txb.object(maps_js_1.cetusPoolMap["NAVX-VSUI"]),
468
698
  txb.object(maps_js_1.cetusPoolMap["VSUI-SUI"]),
469
699
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
470
700
  ],
471
701
  });
472
702
  }
473
- txb.transferObjects([coin1], address);
474
- txb.transferObjects([coin2], address);
475
- }
476
- else {
477
- throw new Error(`No ${pool1} or ${pool2} Coins`);
478
- }
479
- }
480
- return txb;
481
- };
482
- exports.depositBluefinType2Txb = depositBluefinType2Txb;
483
- const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) => {
484
- const address = options.address;
485
- const txb = new transactions_1.Transaction();
486
- const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
487
- const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
488
- const receipt = await (0, getReceipts_js_1.getReceipts)(poolName, address, true);
489
- const alphaReceipt = await (0, getReceipts_js_1.getReceipts)("ALPHA", address, true);
490
- if (receipt.length > 0) {
491
- let alpha_receipt;
492
- if (alphaReceipt.length == 0) {
493
- [alpha_receipt] = txb.moveCall({
494
- target: `0x1::option::none`,
495
- typeArguments: [(0, constants_js_1.getConf)().ALPHA_POOL_RECEIPT],
496
- arguments: [],
497
- });
498
- }
499
- else {
500
- [alpha_receipt] = txb.moveCall({
501
- target: `0x1::option::some`,
502
- typeArguments: [alphaReceipt[0].content.type],
503
- arguments: [txb.object(alphaReceipt[0].objectId)],
504
- });
505
- }
506
- const poolinfo = maps_js_1.poolInfo[poolName];
507
- if (poolName === "BLUEFIN-SUI-USDC") {
508
- txb.moveCall({
509
- target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw`,
510
- typeArguments: [
511
- coins_js_1.coinsList[pool1].type,
512
- coins_js_1.coinsList[pool2].type,
513
- coins_js_1.coinsList["DEEP"].type,
514
- coins_js_1.coinsList["SUI"].type,
515
- ],
516
- arguments: [
517
- txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
703
+ else if (poolName === "BLUEFIN-BLUE-USDC") {
704
+ txb.moveCall({
705
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_deposit`,
706
+ typeArguments: [
707
+ coins_js_1.coinsList[pool1].type,
708
+ coins_js_1.coinsList[pool2].type,
709
+ coins_js_1.coinsList["DEEP"].type,
710
+ coins_js_1.coinsList["SUI"].type,
711
+ ],
712
+ arguments: [
713
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
714
+ txb.object((0, constants_js_1.getConf)().VERSION),
715
+ someReceipt,
716
+ txb.object(poolinfo.poolId),
717
+ depositCoinA,
718
+ depositCoinB,
719
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
720
+ txb.object(poolinfo.investorId),
721
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
722
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
723
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_USDC_POOL),
724
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
725
+ txb.object(maps_js_1.cetusPoolMap["BLUE-USDC"]),
726
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
727
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
728
+ ],
729
+ });
730
+ }
731
+ else if (poolName === "BLUEFIN-STSUI-ETH") {
732
+ txb.moveCall({
733
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_deposit`,
734
+ typeArguments: [
735
+ coins_js_1.coinsList[pool1].type,
736
+ coins_js_1.coinsList[pool2].type,
737
+ coins_js_1.coinsList["BLUE"].type,
738
+ coins_js_1.coinsList["SUI"].type,
739
+ ],
740
+ arguments: [
741
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
742
+ txb.object((0, constants_js_1.getConf)().VERSION),
743
+ someReceipt,
744
+ txb.object(poolinfo.poolId),
745
+ depositCoinA,
746
+ depositCoinB,
747
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
748
+ txb.object(poolinfo.investorId),
749
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
750
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
751
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_ETH_POOL),
752
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
753
+ txb.object(maps_js_1.cetusPoolMap["STSUI-ETH"]),
754
+ txb.object(maps_js_1.cetusPoolMap["ETH-SUI"]),
755
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
756
+ ],
757
+ });
758
+ }
759
+ else if (poolName === "BLUEFIN-STSUI-WSOL") {
760
+ txb.moveCall({
761
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_deposit`,
762
+ typeArguments: [
763
+ coins_js_1.coinsList[pool1].type,
764
+ coins_js_1.coinsList[pool2].type,
765
+ coins_js_1.coinsList["BLUE"].type,
766
+ coins_js_1.coinsList["SUI"].type,
767
+ ],
768
+ arguments: [
769
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
770
+ txb.object((0, constants_js_1.getConf)().VERSION),
771
+ someReceipt,
772
+ txb.object(poolinfo.poolId),
773
+ depositCoinA,
774
+ depositCoinB,
775
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
776
+ txb.object(poolinfo.investorId),
777
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
778
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
779
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_WSOL_POOL),
780
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
781
+ txb.object(maps_js_1.cetusPoolMap["STSUI-WSOL"]),
782
+ txb.object(maps_js_1.cetusPoolMap["WSOL-SUI"]),
783
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
784
+ ],
785
+ });
786
+ }
787
+ txb.transferObjects([coin1], address);
788
+ txb.transferObjects([coin2], address);
789
+ }
790
+ else {
791
+ throw new Error(`No ${pool1} or ${pool2} Coins`);
792
+ }
793
+ }
794
+ return txb;
795
+ };
796
+ exports.depositBluefinType2Txb = depositBluefinType2Txb;
797
+ const depositBluefinStsuiTxb = async (amount, poolName, isAmountA, options, transaction = undefined) => {
798
+ const suiClient = (0, client_js_1.getSuiClient)();
799
+ const address = options.address;
800
+ let txb;
801
+ if (transaction)
802
+ txb = transaction;
803
+ else
804
+ txb = new transactions_1.Transaction();
805
+ poolName = poolName.toUpperCase();
806
+ const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
807
+ const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
808
+ const receipt = await (0, getReceipts_js_1.getReceipts)(poolName, address, true);
809
+ let coins1 = [];
810
+ let coins2 = [];
811
+ let currentCursor = null;
812
+ do {
813
+ const response = await suiClient.getCoins({
814
+ owner: address,
815
+ coinType: coins_js_1.coinsList[pool1].type,
816
+ cursor: currentCursor,
817
+ });
818
+ coins1 = coins1.concat(response.data);
819
+ // Check if there's a next page
820
+ if (response.hasNextPage && response.nextCursor) {
821
+ currentCursor = response.nextCursor;
822
+ }
823
+ else {
824
+ // No more pages available
825
+ // console.log("No more receipts available.");
826
+ break;
827
+ }
828
+ } while (true);
829
+ currentCursor = null;
830
+ do {
831
+ const response = await suiClient.getCoins({
832
+ owner: address,
833
+ coinType: coins_js_1.coinsList[pool2].type,
834
+ cursor: currentCursor,
835
+ });
836
+ coins2 = coins2.concat(response.data);
837
+ // Check if there's a next page
838
+ if (response.hasNextPage && response.nextCursor) {
839
+ currentCursor = response.nextCursor;
840
+ }
841
+ else {
842
+ // No more pages available
843
+ // console.log("No more receipts available.");
844
+ break;
845
+ }
846
+ } while (true);
847
+ const amounts = await (0, deposit_js_1.getAmounts)(poolName, isAmountA, amount);
848
+ console.log(amounts);
849
+ if (amounts) {
850
+ const amount1 = amounts[0];
851
+ const amount2 = amounts[1];
852
+ let coin1;
853
+ let coin2;
854
+ if (coins1.length >= 1 && coins2.length >= 1) {
855
+ //coin1
856
+ [coin1] = txb.splitCoins(txb.object(coins1[0].coinObjectId), [0]);
857
+ txb.mergeCoins(coin1, coins1.map((c) => c.coinObjectId));
858
+ const [depositCoinA] = txb.splitCoins(coin1, [amount1]);
859
+ //coin2
860
+ [coin2] = txb.splitCoins(txb.object(coins2[0].coinObjectId), [0]);
861
+ txb.mergeCoins(coin2, coins2.map((c) => c.coinObjectId));
862
+ const [depositCoinB] = txb.splitCoins(coin2, [amount2]);
863
+ const poolinfo = maps_js_1.poolInfo[poolName];
864
+ let someReceipt;
865
+ if (receipt.length == 0) {
866
+ [someReceipt] = txb.moveCall({
867
+ target: `0x1::option::none`,
868
+ typeArguments: [poolinfo.receiptType],
869
+ arguments: [],
870
+ });
871
+ }
872
+ else {
873
+ [someReceipt] = txb.moveCall({
874
+ target: `0x1::option::some`,
875
+ typeArguments: [receipt[0].content.type],
876
+ arguments: [txb.object(receipt[0].objectId)],
877
+ });
878
+ }
879
+ if (poolName === "BLUEFIN-STSUI-USDC") {
880
+ txb.moveCall({
881
+ target: `${poolinfo.packageId}::alphafi_bluefin_stsui_first_pool::user_deposit`,
882
+ typeArguments: [
883
+ coins_js_1.coinsList[pool1].type,
884
+ coins_js_1.coinsList[pool2].type,
885
+ coins_js_1.coinsList["BLUE"].type,
886
+ ],
887
+ arguments: [
888
+ txb.object((0, constants_js_1.getConf)().ALPHA_STSUI_VERSION),
889
+ txb.object((0, constants_js_1.getConf)().VERSION),
890
+ someReceipt,
891
+ txb.object(poolinfo.poolId),
892
+ depositCoinA,
893
+ depositCoinB,
894
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
895
+ txb.object(poolinfo.investorId),
896
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
897
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
898
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_USDC_POOL),
899
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
900
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
901
+ txb.object(maps_js_1.bluefinPoolMap["SUI-USDC"]),
902
+ txb.object((0, constants_js_1.getConf)().LST_INFO),
903
+ txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
904
+ txb.pure.bool(true),
905
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
906
+ ],
907
+ });
908
+ }
909
+ else if (poolName === "BLUEFIN-ALPHA-STSUI") {
910
+ txb.moveCall({
911
+ target: `${poolinfo.packageId}::alphafi_bluefin_stsui_second_pool::user_deposit`,
912
+ typeArguments: [
913
+ coins_js_1.coinsList[pool1].type,
914
+ coins_js_1.coinsList[pool2].type,
915
+ coins_js_1.coinsList["BLUE"].type,
916
+ ],
917
+ arguments: [
918
+ txb.object((0, constants_js_1.getConf)().ALPHA_STSUI_VERSION),
919
+ txb.object((0, constants_js_1.getConf)().VERSION),
920
+ someReceipt,
921
+ txb.object(poolinfo.poolId),
922
+ depositCoinA,
923
+ depositCoinB,
924
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
925
+ txb.object(poolinfo.investorId),
926
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
927
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
928
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_ALPHA_STSUI_POOL),
929
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
930
+ txb.object(maps_js_1.cetusPoolMap["ALPHA-SUI"]),
931
+ txb.object(maps_js_1.bluefinPoolMap["SUI-ALPHA"]),
932
+ txb.object((0, constants_js_1.getConf)().LST_INFO),
933
+ txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
934
+ txb.pure.bool(false),
935
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
936
+ ],
937
+ });
938
+ }
939
+ txb.transferObjects([coin1], address);
940
+ txb.transferObjects([coin2], address);
941
+ }
942
+ else {
943
+ throw new Error(`No ${pool1} or ${pool2} Coins`);
944
+ }
945
+ }
946
+ return txb;
947
+ };
948
+ exports.depositBluefinStsuiTxb = depositBluefinStsuiTxb;
949
+ const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) => {
950
+ const address = options.address;
951
+ const txb = new transactions_1.Transaction();
952
+ const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
953
+ const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
954
+ const receipt = await (0, getReceipts_js_1.getReceipts)(poolName, address, true);
955
+ const alphaReceipt = await (0, getReceipts_js_1.getReceipts)("ALPHA", address, true);
956
+ if (receipt.length > 0) {
957
+ let alpha_receipt;
958
+ if (alphaReceipt.length == 0) {
959
+ [alpha_receipt] = txb.moveCall({
960
+ target: `0x1::option::none`,
961
+ typeArguments: [(0, constants_js_1.getConf)().ALPHA_POOL_RECEIPT],
962
+ arguments: [],
963
+ });
964
+ }
965
+ else {
966
+ [alpha_receipt] = txb.moveCall({
967
+ target: `0x1::option::some`,
968
+ typeArguments: [alphaReceipt[0].content.type],
969
+ arguments: [txb.object(alphaReceipt[0].objectId)],
970
+ });
971
+ }
972
+ const poolinfo = maps_js_1.poolInfo[poolName];
973
+ if (poolName === "BLUEFIN-SUI-USDC") {
974
+ txb.moveCall({
975
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw`,
976
+ typeArguments: [
977
+ coins_js_1.coinsList[pool1].type,
978
+ coins_js_1.coinsList[pool2].type,
979
+ coins_js_1.coinsList["BLUE"].type,
980
+ coins_js_1.coinsList["SUI"].type,
981
+ ],
982
+ arguments: [
983
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
984
+ txb.object((0, constants_js_1.getConf)().VERSION),
985
+ txb.object(receipt[0].objectId),
986
+ alpha_receipt,
987
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
988
+ txb.object(poolinfo.poolId),
989
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
990
+ txb.object(poolinfo.investorId),
991
+ txb.pure.u128(xTokens),
992
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
993
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
994
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
995
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
996
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
997
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
998
+ ],
999
+ });
1000
+ }
1001
+ else if (poolName === "BLUEFIN-SUI-BUCK") {
1002
+ txb.moveCall({
1003
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw`,
1004
+ typeArguments: [
1005
+ coins_js_1.coinsList[pool1].type,
1006
+ coins_js_1.coinsList[pool2].type,
1007
+ coins_js_1.coinsList["BLUE"].type,
1008
+ coins_js_1.coinsList["SUI"].type,
1009
+ ],
1010
+ arguments: [
1011
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1012
+ txb.object((0, constants_js_1.getConf)().VERSION),
1013
+ txb.object(receipt[0].objectId),
1014
+ alpha_receipt,
1015
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1016
+ txb.object(poolinfo.poolId),
1017
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1018
+ txb.object(poolinfo.investorId),
1019
+ txb.pure.u128(xTokens),
1020
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1021
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1022
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_BUCK_POOL),
1023
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1024
+ txb.object(maps_js_1.cetusPoolMap["BUCK-SUI"]),
1025
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1026
+ ],
1027
+ });
1028
+ }
1029
+ else if (poolName === "BLUEFIN-SUI-AUSD") {
1030
+ txb.moveCall({
1031
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw`,
1032
+ typeArguments: [
1033
+ coins_js_1.coinsList[pool1].type,
1034
+ coins_js_1.coinsList[pool2].type,
1035
+ coins_js_1.coinsList["BLUE"].type,
1036
+ coins_js_1.coinsList["SUI"].type,
1037
+ ],
1038
+ arguments: [
1039
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1040
+ txb.object((0, constants_js_1.getConf)().VERSION),
1041
+ txb.object(receipt[0].objectId),
1042
+ alpha_receipt,
1043
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1044
+ txb.object(poolinfo.poolId),
1045
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1046
+ txb.object(poolinfo.investorId),
1047
+ txb.pure.u128(xTokens),
1048
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1049
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1050
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_AUSD_POOL),
1051
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1052
+ txb.object(maps_js_1.cetusPoolMap["AUSD-SUI"]),
1053
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1054
+ ],
1055
+ });
1056
+ }
1057
+ }
1058
+ else {
1059
+ throw new Error("No receipt found!");
1060
+ }
1061
+ return txb;
1062
+ };
1063
+ exports.withdrawBluefinSuiFirstTxb = withdrawBluefinSuiFirstTxb;
1064
+ const withdrawBluefinSuiSecondTxb = async (xTokens, poolName, options) => {
1065
+ const address = options.address;
1066
+ const txb = new transactions_1.Transaction();
1067
+ const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
1068
+ const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
1069
+ const receipt = await (0, getReceipts_js_1.getReceipts)(poolName, address, true);
1070
+ const alphaReceipt = await (0, getReceipts_js_1.getReceipts)("ALPHA", address, true);
1071
+ if (receipt.length > 0) {
1072
+ let alpha_receipt;
1073
+ if (alphaReceipt.length == 0) {
1074
+ [alpha_receipt] = txb.moveCall({
1075
+ target: `0x1::option::none`,
1076
+ typeArguments: [(0, constants_js_1.getConf)().ALPHA_POOL_RECEIPT],
1077
+ arguments: [],
1078
+ });
1079
+ }
1080
+ else {
1081
+ [alpha_receipt] = txb.moveCall({
1082
+ target: `0x1::option::some`,
1083
+ typeArguments: [alphaReceipt[0].content.type],
1084
+ arguments: [txb.object(alphaReceipt[0].objectId)],
1085
+ });
1086
+ }
1087
+ const poolinfo = maps_js_1.poolInfo[poolName];
1088
+ if (poolName === "BLUEFIN-BLUE-SUI") {
1089
+ txb.moveCall({
1090
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw`,
1091
+ typeArguments: [
1092
+ coins_js_1.coinsList[pool1].type,
1093
+ coins_js_1.coinsList[pool2].type,
1094
+ coins_js_1.coinsList["DEEP"].type,
1095
+ coins_js_1.coinsList["SUI"].type,
1096
+ ],
1097
+ arguments: [
1098
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
518
1099
  txb.object((0, constants_js_1.getConf)().VERSION),
519
1100
  txb.object(receipt[0].objectId),
520
1101
  alpha_receipt,
@@ -525,20 +1106,20 @@ const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) => {
525
1106
  txb.pure.u128(xTokens),
526
1107
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
527
1108
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
528
- txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
1109
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
529
1110
  txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
530
- txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1111
+ txb.object(maps_js_1.cetusPoolMap["BLUE-SUI"]),
531
1112
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
532
1113
  ],
533
1114
  });
534
1115
  }
535
- else if (poolName === "BLUEFIN-SUI-BUCK") {
1116
+ else if (poolName === "BLUEFIN-WBTC-SUI") {
536
1117
  txb.moveCall({
537
- target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw`,
1118
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw`,
538
1119
  typeArguments: [
539
1120
  coins_js_1.coinsList[pool1].type,
540
1121
  coins_js_1.coinsList[pool2].type,
541
- coins_js_1.coinsList["DEEP"].type,
1122
+ coins_js_1.coinsList["BLUE"].type,
542
1123
  coins_js_1.coinsList["SUI"].type,
543
1124
  ],
544
1125
  arguments: [
@@ -553,20 +1134,20 @@ const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) => {
553
1134
  txb.pure.u128(xTokens),
554
1135
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
555
1136
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
556
- txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_BUCK_POOL),
557
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
558
- txb.object(maps_js_1.cetusPoolMap["BUCK-SUI"]),
1137
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_WBTC_SUI_POOL),
1138
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1139
+ txb.object(maps_js_1.cetusPoolMap["WBTC-SUI"]),
559
1140
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
560
1141
  ],
561
1142
  });
562
1143
  }
563
- else if (poolName === "BLUEFIN-SUI-AUSD") {
1144
+ else if (poolName === "BLUEFIN-DEEP-SUI") {
564
1145
  txb.moveCall({
565
- target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_withdraw`,
1146
+ target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw`,
566
1147
  typeArguments: [
567
1148
  coins_js_1.coinsList[pool1].type,
568
1149
  coins_js_1.coinsList[pool2].type,
569
- coins_js_1.coinsList["DEEP"].type,
1150
+ coins_js_1.coinsList["BLUE"].type,
570
1151
  coins_js_1.coinsList["SUI"].type,
571
1152
  ],
572
1153
  arguments: [
@@ -581,9 +1162,36 @@ const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) => {
581
1162
  txb.pure.u128(xTokens),
582
1163
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
583
1164
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
584
- txb.object((0, constants_js_1.getConf)().BLUEFIN_SUI_AUSD_POOL),
585
1165
  txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
586
- txb.object(maps_js_1.cetusPoolMap["AUSD-SUI"]),
1166
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1167
+ txb.object(maps_js_1.cetusPoolMap["DEEP-SUI"]),
1168
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1169
+ ],
1170
+ });
1171
+ }
1172
+ else if (poolName === "BLUEFIN-STSUI-SUI") {
1173
+ txb.moveCall({
1174
+ target: `${poolinfo.packageId}::alphafi_bluefin_stsui_sui_pool::user_withdraw`,
1175
+ typeArguments: [
1176
+ coins_js_1.coinsList[pool1].type,
1177
+ coins_js_1.coinsList[pool2].type,
1178
+ coins_js_1.coinsList["BLUE"].type,
1179
+ ],
1180
+ arguments: [
1181
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1182
+ txb.object((0, constants_js_1.getConf)().VERSION),
1183
+ txb.object(receipt[0].objectId),
1184
+ alpha_receipt,
1185
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1186
+ txb.object(poolinfo.poolId),
1187
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1188
+ txb.object(poolinfo.investorId),
1189
+ txb.pure.u128(xTokens),
1190
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1191
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_SUI_POOL),
1192
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1193
+ txb.object((0, constants_js_1.getConf)().LST_INFO),
1194
+ txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
587
1195
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
588
1196
  ],
589
1197
  });
@@ -594,7 +1202,7 @@ const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) => {
594
1202
  }
595
1203
  return txb;
596
1204
  };
597
- exports.withdrawBluefinSuiFirstTxb = withdrawBluefinSuiFirstTxb;
1205
+ exports.withdrawBluefinSuiSecondTxb = withdrawBluefinSuiSecondTxb;
598
1206
  const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
599
1207
  const address = options.address;
600
1208
  const txb = new transactions_1.Transaction();
@@ -625,7 +1233,7 @@ const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
625
1233
  typeArguments: [
626
1234
  coins_js_1.coinsList[pool1].type,
627
1235
  coins_js_1.coinsList[pool2].type,
628
- coins_js_1.coinsList["DEEP"].type,
1236
+ coins_js_1.coinsList["BLUE"].type,
629
1237
  coins_js_1.coinsList["SUI"].type,
630
1238
  ],
631
1239
  arguments: [
@@ -641,7 +1249,7 @@ const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
641
1249
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
642
1250
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
643
1251
  txb.object((0, constants_js_1.getConf)().BLUEFIN_USDT_USDC_POOL),
644
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1252
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
645
1253
  txb.object(maps_js_1.cetusPoolMap["USDC-USDT"]),
646
1254
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
647
1255
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -654,7 +1262,7 @@ const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
654
1262
  typeArguments: [
655
1263
  coins_js_1.coinsList[pool1].type,
656
1264
  coins_js_1.coinsList[pool2].type,
657
- coins_js_1.coinsList["DEEP"].type,
1265
+ coins_js_1.coinsList["BLUE"].type,
658
1266
  coins_js_1.coinsList["SUI"].type,
659
1267
  ],
660
1268
  arguments: [
@@ -670,7 +1278,7 @@ const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
670
1278
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
671
1279
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
672
1280
  txb.object((0, constants_js_1.getConf)().BLUEFIN_AUSD_USDC_POOL),
673
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1281
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
674
1282
  txb.object(maps_js_1.cetusPoolMap["USDC-AUSD"]),
675
1283
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
676
1284
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -683,7 +1291,7 @@ const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
683
1291
  typeArguments: [
684
1292
  coins_js_1.coinsList[pool1].type,
685
1293
  coins_js_1.coinsList[pool2].type,
686
- coins_js_1.coinsList["DEEP"].type,
1294
+ coins_js_1.coinsList["BLUE"].type,
687
1295
  coins_js_1.coinsList["SUI"].type,
688
1296
  ],
689
1297
  arguments: [
@@ -699,13 +1307,71 @@ const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
699
1307
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
700
1308
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
701
1309
  txb.object((0, constants_js_1.getConf)().BLUEFIN_WBTC_USDC_POOL),
702
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1310
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
703
1311
  txb.object(maps_js_1.cetusPoolMap["USDC-WBTC"]),
704
1312
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
705
1313
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
706
1314
  ],
707
1315
  });
708
1316
  }
1317
+ else if (poolName === "BLUEFIN-SEND-USDC") {
1318
+ txb.moveCall({
1319
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_withdraw`,
1320
+ typeArguments: [
1321
+ coins_js_1.coinsList[pool1].type,
1322
+ coins_js_1.coinsList[pool2].type,
1323
+ coins_js_1.coinsList["BLUE"].type,
1324
+ coins_js_1.coinsList["SUI"].type,
1325
+ ],
1326
+ arguments: [
1327
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1328
+ txb.object((0, constants_js_1.getConf)().VERSION),
1329
+ txb.object(receipt[0].objectId),
1330
+ alpha_receipt,
1331
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1332
+ txb.object(poolinfo.poolId),
1333
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1334
+ txb.object(poolinfo.investorId),
1335
+ txb.pure.u128(xTokens),
1336
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1337
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1338
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_SEND_USDC_POOL),
1339
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1340
+ txb.object(maps_js_1.cetusPoolMap["USDC-SEND"]),
1341
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1342
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1343
+ ],
1344
+ });
1345
+ }
1346
+ else if (poolName === "BLUEFIN-STSUI-USDC") {
1347
+ txb.moveCall({
1348
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_withdraw`,
1349
+ typeArguments: [
1350
+ coins_js_1.coinsList[pool1].type,
1351
+ coins_js_1.coinsList[pool2].type,
1352
+ coins_js_1.coinsList["BLUE"].type,
1353
+ coins_js_1.coinsList["SUI"].type,
1354
+ ],
1355
+ arguments: [
1356
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1357
+ txb.object((0, constants_js_1.getConf)().VERSION),
1358
+ txb.object(receipt[0].objectId),
1359
+ alpha_receipt,
1360
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1361
+ txb.object(poolinfo.poolId),
1362
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1363
+ txb.object(poolinfo.investorId),
1364
+ txb.pure.u128(xTokens),
1365
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1366
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1367
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_USDC_POOL),
1368
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1369
+ txb.object(maps_js_1.cetusPoolMap["USDC-STSUI"]),
1370
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1371
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1372
+ ],
1373
+ });
1374
+ }
709
1375
  }
710
1376
  else {
711
1377
  throw new Error("No receipt found!");
@@ -743,7 +1409,7 @@ const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
743
1409
  typeArguments: [
744
1410
  coins_js_1.coinsList[pool1].type,
745
1411
  coins_js_1.coinsList[pool2].type,
746
- coins_js_1.coinsList["DEEP"].type,
1412
+ coins_js_1.coinsList["BLUE"].type,
747
1413
  coins_js_1.coinsList["SUI"].type,
748
1414
  ],
749
1415
  arguments: [
@@ -759,7 +1425,7 @@ const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
759
1425
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
760
1426
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
761
1427
  txb.object((0, constants_js_1.getConf)().BLUEFIN_ALPHA_USDC_POOL),
762
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1428
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
763
1429
  txb.object(maps_js_1.cetusPoolMap["ALPHA-USDC"]),
764
1430
  txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
765
1431
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
@@ -772,7 +1438,7 @@ const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
772
1438
  typeArguments: [
773
1439
  coins_js_1.coinsList[pool1].type,
774
1440
  coins_js_1.coinsList[pool2].type,
775
- coins_js_1.coinsList["DEEP"].type,
1441
+ coins_js_1.coinsList["BLUE"].type,
776
1442
  coins_js_1.coinsList["SUI"].type,
777
1443
  ],
778
1444
  arguments: [
@@ -788,13 +1454,100 @@ const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
788
1454
  txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
789
1455
  txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
790
1456
  txb.object((0, constants_js_1.getConf)().BLUEFIN_NAVX_VSUI_POOL),
791
- txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1457
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
792
1458
  txb.object(maps_js_1.cetusPoolMap["NAVX-VSUI"]),
793
1459
  txb.object(maps_js_1.cetusPoolMap["VSUI-SUI"]),
794
1460
  txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
795
1461
  ],
796
1462
  });
797
1463
  }
1464
+ else if (poolName === "BLUEFIN-BLUE-USDC") {
1465
+ txb.moveCall({
1466
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_withdraw`,
1467
+ typeArguments: [
1468
+ coins_js_1.coinsList[pool1].type,
1469
+ coins_js_1.coinsList[pool2].type,
1470
+ coins_js_1.coinsList["DEEP"].type,
1471
+ coins_js_1.coinsList["SUI"].type,
1472
+ ],
1473
+ arguments: [
1474
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1475
+ txb.object((0, constants_js_1.getConf)().VERSION),
1476
+ txb.object(receipt[0].objectId),
1477
+ alpha_receipt,
1478
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1479
+ txb.object(poolinfo.poolId),
1480
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1481
+ txb.object(poolinfo.investorId),
1482
+ txb.pure.u128(xTokens),
1483
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1484
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1485
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_USDC_POOL),
1486
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_DEEP_SUI_POOL),
1487
+ txb.object(maps_js_1.cetusPoolMap["BLUE-USDC"]),
1488
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1489
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1490
+ ],
1491
+ });
1492
+ }
1493
+ else if (poolName === "BLUEFIN-STSUI-ETH") {
1494
+ txb.moveCall({
1495
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_withdraw`,
1496
+ typeArguments: [
1497
+ coins_js_1.coinsList[pool1].type,
1498
+ coins_js_1.coinsList[pool2].type,
1499
+ coins_js_1.coinsList["BLUE"].type,
1500
+ coins_js_1.coinsList["SUI"].type,
1501
+ ],
1502
+ arguments: [
1503
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1504
+ txb.object((0, constants_js_1.getConf)().VERSION),
1505
+ txb.object(receipt[0].objectId),
1506
+ alpha_receipt,
1507
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1508
+ txb.object(poolinfo.poolId),
1509
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1510
+ txb.object(poolinfo.investorId),
1511
+ txb.pure.u128(xTokens),
1512
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1513
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1514
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_ETH_POOL),
1515
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1516
+ txb.object(maps_js_1.cetusPoolMap["STSUI-ETH"]),
1517
+ txb.object(maps_js_1.cetusPoolMap["ETH-SUI"]),
1518
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1519
+ ],
1520
+ });
1521
+ }
1522
+ else if (poolName === "BLUEFIN-STSUI-WSOL") {
1523
+ txb.moveCall({
1524
+ target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_withdraw`,
1525
+ typeArguments: [
1526
+ coins_js_1.coinsList[pool1].type,
1527
+ coins_js_1.coinsList[pool2].type,
1528
+ coins_js_1.coinsList["BLUE"].type,
1529
+ coins_js_1.coinsList["SUI"].type,
1530
+ ],
1531
+ arguments: [
1532
+ txb.object((0, constants_js_1.getConf)().ALPHA_4_VERSION),
1533
+ txb.object((0, constants_js_1.getConf)().VERSION),
1534
+ txb.object(receipt[0].objectId),
1535
+ alpha_receipt,
1536
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1537
+ txb.object(poolinfo.poolId),
1538
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1539
+ txb.object(poolinfo.investorId),
1540
+ txb.pure.u128(xTokens),
1541
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1542
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1543
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_WSOL_POOL),
1544
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
1545
+ txb.object(maps_js_1.cetusPoolMap["STSUI-WSOL"]),
1546
+ txb.object(maps_js_1.cetusPoolMap["WSOL-SUI"]),
1547
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1548
+ ],
1549
+ });
1550
+ }
798
1551
  }
799
1552
  else {
800
1553
  throw new Error("No receipt found!");
@@ -802,4 +1555,97 @@ const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
802
1555
  return txb;
803
1556
  };
804
1557
  exports.withdrawBluefinType2Txb = withdrawBluefinType2Txb;
1558
+ const withdrawBluefinStsuiTxb = async (xTokens, poolName, options) => {
1559
+ const address = options.address;
1560
+ const txb = new transactions_1.Transaction();
1561
+ const pool1 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin1;
1562
+ const pool2 = maps_js_1.doubleAssetPoolCoinMap[poolName].coin2;
1563
+ const receipt = await (0, getReceipts_js_1.getReceipts)(poolName, address, true);
1564
+ const alphaReceipt = await (0, getReceipts_js_1.getReceipts)("ALPHA", address, true);
1565
+ if (receipt.length > 0) {
1566
+ let alpha_receipt;
1567
+ if (alphaReceipt.length == 0) {
1568
+ [alpha_receipt] = txb.moveCall({
1569
+ target: `0x1::option::none`,
1570
+ typeArguments: [(0, constants_js_1.getConf)().ALPHA_POOL_RECEIPT],
1571
+ arguments: [],
1572
+ });
1573
+ }
1574
+ else {
1575
+ [alpha_receipt] = txb.moveCall({
1576
+ target: `0x1::option::some`,
1577
+ typeArguments: [alphaReceipt[0].content.type],
1578
+ arguments: [txb.object(alphaReceipt[0].objectId)],
1579
+ });
1580
+ }
1581
+ const poolinfo = maps_js_1.poolInfo[poolName];
1582
+ if (poolName === "BLUEFIN-STSUI-USDC") {
1583
+ txb.moveCall({
1584
+ target: `${poolinfo.packageId}::alphafi_bluefin_stsui_first_pool::user_withdraw`,
1585
+ typeArguments: [
1586
+ coins_js_1.coinsList[pool1].type,
1587
+ coins_js_1.coinsList[pool2].type,
1588
+ coins_js_1.coinsList["BLUE"].type,
1589
+ ],
1590
+ arguments: [
1591
+ txb.object((0, constants_js_1.getConf)().ALPHA_STSUI_VERSION),
1592
+ txb.object((0, constants_js_1.getConf)().VERSION),
1593
+ txb.object(receipt[0].objectId),
1594
+ alpha_receipt,
1595
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1596
+ txb.object(poolinfo.poolId),
1597
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1598
+ txb.object(poolinfo.investorId),
1599
+ txb.pure.u128(xTokens),
1600
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1601
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1602
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_STSUI_USDC_POOL),
1603
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1604
+ txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
1605
+ txb.object(maps_js_1.bluefinPoolMap["SUI-USDC"]),
1606
+ txb.object((0, constants_js_1.getConf)().LST_INFO),
1607
+ txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
1608
+ txb.pure.bool(true),
1609
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1610
+ ],
1611
+ });
1612
+ }
1613
+ else if (poolName === "BLUEFIN-ALPHA-STSUI") {
1614
+ txb.moveCall({
1615
+ target: `${poolinfo.packageId}::alphafi_bluefin_stsui_second_pool::user_withdraw`,
1616
+ typeArguments: [
1617
+ coins_js_1.coinsList[pool1].type,
1618
+ coins_js_1.coinsList[pool2].type,
1619
+ coins_js_1.coinsList["BLUE"].type,
1620
+ ],
1621
+ arguments: [
1622
+ txb.object((0, constants_js_1.getConf)().ALPHA_STSUI_VERSION),
1623
+ txb.object((0, constants_js_1.getConf)().VERSION),
1624
+ txb.object(receipt[0].objectId),
1625
+ alpha_receipt,
1626
+ txb.object((0, constants_js_1.getConf)().ALPHA_POOL),
1627
+ txb.object(poolinfo.poolId),
1628
+ txb.object((0, constants_js_1.getConf)().ALPHA_DISTRIBUTOR),
1629
+ txb.object(poolinfo.investorId),
1630
+ txb.pure.u128(xTokens),
1631
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
1632
+ txb.object((0, constants_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
1633
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_ALPHA_STSUI_POOL),
1634
+ txb.object((0, constants_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
1635
+ txb.object(maps_js_1.cetusPoolMap["ALPHA-SUI"]),
1636
+ txb.object(maps_js_1.bluefinPoolMap["SUI-ALPHA"]),
1637
+ txb.object((0, constants_js_1.getConf)().LST_INFO),
1638
+ txb.object((0, constants_js_1.getConf)().SUI_SYSTEM_STATE),
1639
+ txb.pure.bool(false),
1640
+ txb.object((0, constants_js_1.getConf)().CLOCK_PACKAGE_ID),
1641
+ ],
1642
+ });
1643
+ }
1644
+ }
1645
+ else {
1646
+ throw new Error("No receipt found!");
1647
+ }
1648
+ return txb;
1649
+ };
1650
+ exports.withdrawBluefinStsuiTxb = withdrawBluefinStsuiTxb;
805
1651
  //# sourceMappingURL=bluefin.js.map