@alphafi/alphafi-sdk 0.0.79 → 0.0.81

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 (245) hide show
  1. package/dist/cjs/common/constants.d.ts +16 -0
  2. package/dist/cjs/common/constants.d.ts.map +1 -1
  3. package/dist/cjs/common/constants.js +41 -10
  4. package/dist/cjs/common/constants.js.map +1 -1
  5. package/dist/cjs/common/maps.d.ts.map +1 -1
  6. package/dist/cjs/common/maps.js +4 -0
  7. package/dist/cjs/common/maps.js.map +1 -1
  8. package/dist/cjs/transactions/blueRewards.d.ts.map +1 -1
  9. package/dist/cjs/transactions/blueRewards.js +64 -0
  10. package/dist/cjs/transactions/blueRewards.js.map +1 -1
  11. package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
  12. package/dist/cjs/transactions/bluefin.js +465 -9
  13. package/dist/cjs/transactions/bluefin.js.map +1 -1
  14. package/dist/cjs/transactions/bucket.d.ts.map +1 -1
  15. package/dist/cjs/transactions/bucket.js +24 -0
  16. package/dist/cjs/transactions/bucket.js.map +1 -1
  17. package/dist/cjs/transactions/navi-looping.d.ts.map +1 -1
  18. package/dist/cjs/transactions/navi-looping.js +44 -44
  19. package/dist/cjs/transactions/navi-looping.js.map +1 -1
  20. package/dist/cjs/transactions/navi.d.ts.map +1 -1
  21. package/dist/cjs/transactions/navi.js +140 -216
  22. package/dist/cjs/transactions/navi.js.map +1 -1
  23. package/dist/esm/common/constants.d.ts +16 -0
  24. package/dist/esm/common/constants.d.ts.map +1 -1
  25. package/dist/esm/common/constants.js +41 -10
  26. package/dist/esm/common/constants.js.map +1 -1
  27. package/dist/esm/common/maps.d.ts.map +1 -1
  28. package/dist/esm/common/maps.js +4 -0
  29. package/dist/esm/common/maps.js.map +1 -1
  30. package/dist/esm/transactions/blueRewards.d.ts.map +1 -1
  31. package/dist/esm/transactions/blueRewards.js +64 -0
  32. package/dist/esm/transactions/blueRewards.js.map +1 -1
  33. package/dist/esm/transactions/bluefin.d.ts.map +1 -1
  34. package/dist/esm/transactions/bluefin.js +465 -9
  35. package/dist/esm/transactions/bluefin.js.map +1 -1
  36. package/dist/esm/transactions/bucket.d.ts.map +1 -1
  37. package/dist/esm/transactions/bucket.js +25 -1
  38. package/dist/esm/transactions/bucket.js.map +1 -1
  39. package/dist/esm/transactions/navi-looping.d.ts.map +1 -1
  40. package/dist/esm/transactions/navi-looping.js +45 -45
  41. package/dist/esm/transactions/navi-looping.js.map +1 -1
  42. package/dist/esm/transactions/navi.d.ts.map +1 -1
  43. package/dist/esm/transactions/navi.js +140 -216
  44. package/dist/esm/transactions/navi.js.map +1 -1
  45. package/docs/assets/search.js +1 -1
  46. package/docs/functions/alphaLpBreakdown.html +1 -1
  47. package/docs/functions/cetusLpBreakdown.html +1 -1
  48. package/docs/functions/claimBlueRewardTxb.html +1 -1
  49. package/docs/functions/claimRewardTxb.html +1 -1
  50. package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -1
  51. package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -1
  52. package/docs/functions/coinsInPool.html +1 -1
  53. package/docs/functions/collectRewards.html +1 -1
  54. package/docs/functions/deposit.html +1 -1
  55. package/docs/functions/depositDoubleAssetTxb.html +1 -1
  56. package/docs/functions/depositSingleAssetTxb.html +1 -1
  57. package/docs/functions/fetchAfterTransactionEvents.html +1 -1
  58. package/docs/functions/fetchAirdropClaimEvents.html +1 -1
  59. package/docs/functions/fetchAutoCompoundingEvents.html +1 -1
  60. package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -1
  61. package/docs/functions/fetchCetusPools.html +1 -1
  62. package/docs/functions/fetchChainIdentifier.html +1 -1
  63. package/docs/functions/fetchCheckRatioEvents.html +1 -1
  64. package/docs/functions/fetchEvents.html +1 -1
  65. package/docs/functions/fetchLiquidityChangeEvents.html +1 -1
  66. package/docs/functions/fetchMultiCategoryEvents.html +1 -1
  67. package/docs/functions/fetchMultiReceipts.html +1 -1
  68. package/docs/functions/fetchNftHolders.html +1 -1
  69. package/docs/functions/fetchPools.html +1 -1
  70. package/docs/functions/fetchPortfolioData.html +1 -1
  71. package/docs/functions/fetchProtocolData.html +1 -1
  72. package/docs/functions/fetchTVL.html +1 -1
  73. package/docs/functions/fetchTransactions.html +1 -1
  74. package/docs/functions/fetchUserVaultBalances.html +1 -1
  75. package/docs/functions/fetchUserVaults.html +1 -1
  76. package/docs/functions/fetchUserWalletData.html +1 -1
  77. package/docs/functions/fetchVoloExchangeRate.html +1 -1
  78. package/docs/functions/fetchWithdrawV2Events.html +1 -1
  79. package/docs/functions/getAirdropShare.html +1 -1
  80. package/docs/functions/getAllDoubleAssetVaults.html +1 -1
  81. package/docs/functions/getAllSingleAssetVaults.html +1 -1
  82. package/docs/functions/getAllVaultBalances.html +1 -1
  83. package/docs/functions/getAllVaults.html +1 -1
  84. package/docs/functions/getAlphaUnlocks.html +1 -1
  85. package/docs/functions/getAlphaVaultBalance.html +1 -1
  86. package/docs/functions/getAmounts.html +1 -1
  87. package/docs/functions/getApr.html +1 -1
  88. package/docs/functions/getAprs.html +1 -1
  89. package/docs/functions/getApy.html +1 -1
  90. package/docs/functions/getApys.html +1 -1
  91. package/docs/functions/getCetusInvestorTicksMap.html +1 -1
  92. package/docs/functions/getCetusPool.html +1 -1
  93. package/docs/functions/getCetusSqrtPriceMap.html +1 -1
  94. package/docs/functions/getCoinAmountsFromLiquidity.html +1 -1
  95. package/docs/functions/getConf.html +1 -1
  96. package/docs/functions/getCurrentTick.html +1 -1
  97. package/docs/functions/getDistributor.html +1 -1
  98. package/docs/functions/getDoubleAssetVaultBalance.html +1 -1
  99. package/docs/functions/getDoubleAssetVaults.html +1 -1
  100. package/docs/functions/getInvestor.html +1 -1
  101. package/docs/functions/getInvestorPoolMap.html +1 -1
  102. package/docs/functions/getLastAutoCompoundTime.html +1 -1
  103. package/docs/functions/getLatestPrices.html +1 -1
  104. package/docs/functions/getLiquidity.html +1 -1
  105. package/docs/functions/getMultiCetusPool.html +1 -1
  106. package/docs/functions/getMultiInvestor.html +1 -1
  107. package/docs/functions/getMultiLatestPrices.html +1 -1
  108. package/docs/functions/getMultiParentPool.html +1 -1
  109. package/docs/functions/getMultiPool.html +1 -1
  110. package/docs/functions/getMultiReceipts.html +1 -1
  111. package/docs/functions/getParentPool.html +1 -1
  112. package/docs/functions/getPool.html +1 -1
  113. package/docs/functions/getPoolExchangeRate.html +1 -1
  114. package/docs/functions/getPoolExchangeRateMap.html +1 -1
  115. package/docs/functions/getPoolsWeightDistribution.html +1 -1
  116. package/docs/functions/getPositionRange.html +1 -1
  117. package/docs/functions/getPositionRanges.html +1 -1
  118. package/docs/functions/getPositionTicks.html +1 -1
  119. package/docs/functions/getPriceToTick.html +1 -1
  120. package/docs/functions/getRebalanceHistories.html +1 -1
  121. package/docs/functions/getRebalanceHistory.html +1 -1
  122. package/docs/functions/getReceipts.html +1 -1
  123. package/docs/functions/getSingleAssetVaultBalance.html +1 -1
  124. package/docs/functions/getSingleAssetVaults.html +1 -1
  125. package/docs/functions/getSuiClient.html +2 -2
  126. package/docs/functions/getSuiNodeUrl.html +2 -2
  127. package/docs/functions/getTVLs-1.html +1 -1
  128. package/docs/functions/getTickSpacing.html +1 -1
  129. package/docs/functions/getTickToPrice.html +1 -1
  130. package/docs/functions/getTvls.html +1 -1
  131. package/docs/functions/getVaultBalance.html +1 -1
  132. package/docs/functions/getVaults.html +1 -1
  133. package/docs/functions/getZapAmounts.html +1 -1
  134. package/docs/functions/lastAutocompoundTime.html +1 -1
  135. package/docs/functions/liquidityToTokens.html +1 -1
  136. package/docs/functions/multiLiquidityToTokens.html +1 -1
  137. package/docs/functions/multiTokensToUsd.html +1 -1
  138. package/docs/functions/multiXTokensToLiquidity.html +1 -1
  139. package/docs/functions/parseUserWalletData.html +1 -1
  140. package/docs/functions/pendingBlueRewardAmount.html +1 -1
  141. package/docs/functions/setCustomSuiClient.html +2 -2
  142. package/docs/functions/setSuiClient.html +2 -2
  143. package/docs/functions/setSuiNodeUrl.html +2 -2
  144. package/docs/functions/setWeights.html +1 -1
  145. package/docs/functions/withdraw.html +1 -1
  146. package/docs/functions/withdrawAlphaTxb.html +1 -1
  147. package/docs/functions/withdrawTxb.html +1 -1
  148. package/docs/functions/zapDepositTxb.html +1 -1
  149. package/docs/index.html +2 -2
  150. package/docs/interfaces/Coin.html +6 -6
  151. package/docs/interfaces/CoinPair.html +2 -2
  152. package/docs/interfaces/CommonEventAttributes.html +2 -2
  153. package/docs/interfaces/NaviVoloData.html +2 -2
  154. package/docs/interfaces/PoolData.html +2 -2
  155. package/docs/interfaces/PoolWeightDistribution.html +2 -2
  156. package/docs/interfaces/RebalanceHistoryType.html +2 -2
  157. package/docs/modules.html +2 -2
  158. package/docs/types/AfterTransactionEventNode.html +1 -1
  159. package/docs/types/AirdropClaimEventNode.html +1 -1
  160. package/docs/types/Allocator.html +1 -1
  161. package/docs/types/AlphaFiDoubleAssetVault.html +1 -1
  162. package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
  163. package/docs/types/AlphaFiSingleAssetVault.html +1 -1
  164. package/docs/types/AlphaFiVault.html +1 -1
  165. package/docs/types/AlphaFiVaultBalance.html +1 -1
  166. package/docs/types/AlphaPoolType.html +1 -1
  167. package/docs/types/AlphaReceipt.html +1 -1
  168. package/docs/types/AlphaReceiptFields.html +1 -1
  169. package/docs/types/AlphaVaultBalance.html +1 -1
  170. package/docs/types/AutoBalancePoolNames.html +1 -1
  171. package/docs/types/AutoCompoundingEventNode.html +1 -1
  172. package/docs/types/BluefinInvestor.html +1 -1
  173. package/docs/types/BluefinPoolType.html +1 -1
  174. package/docs/types/BucketInvestor.html +1 -1
  175. package/docs/types/CetusInvestor.html +1 -1
  176. package/docs/types/CetusPoolType.html +1 -1
  177. package/docs/types/CetusSwapOptions.html +1 -1
  178. package/docs/types/CoinAmounts.html +1 -1
  179. package/docs/types/CoinName.html +1 -1
  180. package/docs/types/CoinType.html +1 -1
  181. package/docs/types/CommonInvestorFields.html +1 -1
  182. package/docs/types/CreatePoolOptions.html +1 -1
  183. package/docs/types/Distributor.html +1 -1
  184. package/docs/types/DoubleAssetMultiVaultBalance.html +1 -1
  185. package/docs/types/DoubleAssetPoolNames.html +1 -1
  186. package/docs/types/DoubleAssetTokenHoldings.html +1 -1
  187. package/docs/types/DoubleAssetVaultBalance.html +1 -1
  188. package/docs/types/EventCategory.html +1 -1
  189. package/docs/types/EventNode.html +1 -1
  190. package/docs/types/GetHoldersParams.html +1 -1
  191. package/docs/types/GetTokenHoldingsParams.html +1 -1
  192. package/docs/types/GetUserTokensFromTransactionsParams.html +1 -1
  193. package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +1 -1
  194. package/docs/types/GetVaultBalanceParams.html +1 -1
  195. package/docs/types/HoldingsObj.html +1 -1
  196. package/docs/types/Icon.html +1 -1
  197. package/docs/types/Investor.html +1 -1
  198. package/docs/types/LiquidityChangeEventNode.html +1 -1
  199. package/docs/types/LiquidityToTokensParams.html +1 -1
  200. package/docs/types/LiquidityToUsdParams.html +1 -1
  201. package/docs/types/LoopingDebt.html +1 -1
  202. package/docs/types/LoopingPoolNames.html +1 -1
  203. package/docs/types/LpBreakdownType.html +1 -1
  204. package/docs/types/MemberPoolDataType.html +1 -1
  205. package/docs/types/MemberType.html +1 -1
  206. package/docs/types/MultiGetVaultBalancesParams.html +1 -1
  207. package/docs/types/NaviInvestor.html +1 -1
  208. package/docs/types/OtherReceiptFields.html +1 -1
  209. package/docs/types/PoolName.html +1 -1
  210. package/docs/types/PoolReceipt.html +1 -1
  211. package/docs/types/PoolType.html +1 -1
  212. package/docs/types/Receipt.html +1 -1
  213. package/docs/types/ReceiptGQL.html +1 -1
  214. package/docs/types/SingleAssetMultiVaultBalance.html +1 -1
  215. package/docs/types/SingleAssetPoolNames.html +1 -1
  216. package/docs/types/SingleAssetTokenHoldings.html +1 -1
  217. package/docs/types/SingleAssetVaultBalance.html +1 -1
  218. package/docs/types/SingleGetVaultBalancesParams.html +1 -1
  219. package/docs/types/StrategyType.html +1 -1
  220. package/docs/types/SuiNetwork.html +1 -1
  221. package/docs/types/SwapOptions.html +1 -1
  222. package/docs/types/TickSpacing.html +1 -1
  223. package/docs/types/TotalWeightType.html +1 -1
  224. package/docs/types/TransactionBlockType.html +1 -1
  225. package/docs/types/UserPoolLiquidity.html +1 -1
  226. package/docs/types/UserPoolTokenHoldings.html +1 -1
  227. package/docs/types/UserUsdHoldings.html +1 -1
  228. package/docs/types/VaultBalance.html +1 -1
  229. package/docs/types/VoteCastEvent.html +1 -1
  230. package/docs/types/WithdrawV2EventNode.html +1 -1
  231. package/docs/variables/bluefinPoolMap.html +1 -1
  232. package/docs/variables/cetusPoolMap.html +1 -1
  233. package/docs/variables/coinsList.html +1 -1
  234. package/docs/variables/defunctPoolsSet.html +1 -1
  235. package/docs/variables/doubleAssetPoolCoinMap.html +1 -1
  236. package/docs/variables/eventCategories.html +1 -1
  237. package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -1
  238. package/docs/variables/loopingAccountAddresses.html +1 -1
  239. package/docs/variables/loopingPoolCoinMap.html +1 -1
  240. package/docs/variables/naviAssetMap.html +1 -1
  241. package/docs/variables/poolIdPoolNameMap.html +1 -1
  242. package/docs/variables/poolInfo.html +1 -1
  243. package/docs/variables/singleAssetPoolCoinMap.html +1 -1
  244. package/docs/variables/stableCoins.html +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"bucket.d.ts","sourceRoot":"","sources":["../../../src/transactions/bucket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAavD,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAgFtB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CA4DtB"}
1
+ {"version":3,"file":"bucket.d.ts","sourceRoot":"","sources":["../../../src/transactions/bucket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAcvD,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CA2FtB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAuEtB"}
@@ -1,5 +1,5 @@
1
1
  import { Transaction } from "@mysten/sui/transactions";
2
- import { cetusPoolMap, coinsList, getConf, getReceipts, getSuiClient, poolInfo, singleAssetPoolCoinMap, } from "../index.js";
2
+ import { bluefinPoolMap, cetusPoolMap, coinsList, getConf, getReceipts, getSuiClient, poolInfo, singleAssetPoolCoinMap, } from "../index.js";
3
3
  export async function bucketDepositTx(amount, options) {
4
4
  const C = await getConf();
5
5
  const suiClient = getSuiClient();
@@ -45,6 +45,18 @@ export async function bucketDepositTx(amount, options) {
45
45
  arguments: [txb.object(receipt[0].objectId)],
46
46
  });
47
47
  }
48
+ txb.moveCall({
49
+ target: `${poolData.packageId}::alphafi_bucket_investor_v1::collect_and_convert_reward_to_buck`,
50
+ arguments: [
51
+ txb.object(C.ALPHA_3_VERSION),
52
+ txb.object(poolData.investorId),
53
+ txb.object(C.BUCKET_PROTOCOL),
54
+ txb.object(C.FOUNTAIN),
55
+ txb.object(bluefinPoolMap["SUI-USDC"]),
56
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
57
+ txb.object(C.CLOCK_PACKAGE_ID),
58
+ ],
59
+ });
48
60
  txb.moveCall({
49
61
  target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_deposit`,
50
62
  arguments: [
@@ -93,6 +105,18 @@ export async function bucketWithdrawTx(xTokens, options) {
93
105
  arguments: [txb.object(alphaReceipt[0].objectId)],
94
106
  });
95
107
  }
108
+ txb.moveCall({
109
+ target: `${poolData.packageId}::alphafi_bucket_investor_v1::collect_and_convert_reward_to_buck`,
110
+ arguments: [
111
+ txb.object(C.ALPHA_3_VERSION),
112
+ txb.object(poolData.investorId),
113
+ txb.object(C.BUCKET_PROTOCOL),
114
+ txb.object(C.FOUNTAIN),
115
+ txb.object(bluefinPoolMap["SUI-USDC"]),
116
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
117
+ txb.object(C.CLOCK_PACKAGE_ID),
118
+ ],
119
+ });
96
120
  const [buck] = txb.moveCall({
97
121
  target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_withdraw`,
98
122
  arguments: [
@@ -1 +1 @@
1
- {"version":3,"file":"bucket.js","sourceRoot":"","sources":["../../../src/transactions/bucket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,QAAQ,EAGR,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,OAA4B;IAE5B,MAAM,CAAC,GAAG,MAAM,OAAO,EAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAc,MAAM,WAAW,CAC1C,aAAyB,EACzB,OAAO,EACP,IAAI,CACL,CAAC;IACF,IAAI,KAAK,GAAiB,EAAE,CAAC;IAE7B,IAAI,aAAa,GAA8B,IAAI,CAAC;IAEpD,G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C;AACb,CAAC","sourcesContent":["import { CoinStruct } from \"@mysten/sui/client\";\nimport { Transaction } from \"@mysten/sui/transactions\";\nimport {\n cetusPoolMap,\n coinsList,\n getConf,\n getReceipts,\n getSuiClient,\n poolInfo,\n PoolName,\n Receipt,\n singleAssetPoolCoinMap,\n} from \"../index.js\";\n\nexport async function bucketDepositTx(\n amount: string,\n options: { address: string },\n): Promise<Transaction> {\n const C = await getConf();\n const suiClient = getSuiClient();\n const address = options.address;\n const txb = new Transaction();\n const poolData = poolInfo[\"BUCKET-BUCK\"];\n\n const receipt: Receipt[] = await getReceipts(\n \"BUCKET-BUCK\" as PoolName,\n address,\n true,\n );\n let coins: CoinStruct[] = [];\n\n let currentCursor: string | null | undefined = null;\n\n do {\n const response = await suiClient.getCoins({\n owner: address,\n coinType: coinsList[singleAssetPoolCoinMap[\"BUCKET-BUCK\"].coin].type,\n cursor: currentCursor,\n });\n\n coins = coins.concat(response.data);\n\n // Check if there's a next page\n if (response.hasNextPage && response.nextCursor) {\n currentCursor = response.nextCursor;\n } else {\n // No more pages available\n // console.log(\"No more receipts available.\");\n break;\n }\n } while (true);\n\n if (coins.length >= 1) {\n const [coin] = txb.splitCoins(txb.object(coins[0].coinObjectId), [0]);\n txb.mergeCoins(\n coin,\n coins.map((c) => c.coinObjectId),\n );\n const [depositCoin] = txb.splitCoins(coin, [amount]);\n let someReceipt: any;\n if (receipt.length == 0) {\n [someReceipt] = txb.moveCall({\n target: `0x1::option::none`,\n typeArguments: [poolData.receiptType],\n arguments: [],\n });\n } else {\n [someReceipt] = txb.moveCall({\n target: `0x1::option::some`,\n typeArguments: [receipt[0].content.type],\n arguments: [txb.object(receipt[0].objectId)],\n });\n }\n\n txb.moveCall({\n target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_deposit`,\n arguments: [\n txb.object(C.ALPHA_3_VERSION),\n txb.object(C.VERSION),\n someReceipt,\n txb.object(poolData.poolId),\n depositCoin,\n txb.object(poolData.investorId),\n txb.object(C.ALPHA_DISTRIBUTOR),\n txb.object(C.BUCKET_PROTOCOL),\n txb.object(C.FOUNTAIN),\n txb.object(C.FLASK),\n txb.object(cetusPoolMap[\"USDC-SUI\"]),\n txb.object(C.CETUS_GLOBAL_CONFIG_ID),\n txb.object(C.CLOCK_PACKAGE_ID),\n ],\n });\n txb.transferObjects([coin], address);\n } else {\n throw new Error(\"No coin\");\n }\n return txb;\n}\n\nexport async function bucketWithdrawTx(\n xTokens: string,\n options: { address: string },\n): Promise<Transaction> {\n const C = await getConf();\n const address = options.address;\n const txb = new Transaction();\n const poolData = poolInfo[\"BUCKET-BUCK\"];\n\n const receipt: Receipt[] = await getReceipts(\n \"BUCKET-BUCK\" as PoolName,\n address,\n true,\n );\n\n const alphaReceipt: Receipt[] = await getReceipts(\"ALPHA\", address, true);\n\n if (receipt.length > 0) {\n let alpha_receipt: any;\n if (alphaReceipt.length == 0) {\n [alpha_receipt] = txb.moveCall({\n target: `0x1::option::none`,\n typeArguments: [C.ALPHA_POOL_RECEIPT],\n arguments: [],\n });\n } else {\n [alpha_receipt] = txb.moveCall({\n target: `0x1::option::some`,\n typeArguments: [alphaReceipt[0].content.type],\n arguments: [txb.object(alphaReceipt[0].objectId)],\n });\n }\n\n const [buck] = txb.moveCall({\n target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_withdraw`,\n arguments: [\n txb.object(C.ALPHA_3_VERSION),\n txb.object(C.VERSION),\n txb.object(receipt[0].objectId),\n alpha_receipt,\n txb.object(C.ALPHA_POOL),\n txb.object(poolData.poolId),\n txb.pure.u64(xTokens),\n txb.object(poolData.investorId),\n txb.object(C.ALPHA_DISTRIBUTOR),\n txb.object(C.BUCKET_PROTOCOL),\n txb.object(C.FOUNTAIN),\n txb.object(C.FLASK),\n txb.object(cetusPoolMap[\"USDC-SUI\"]),\n txb.object(C.CETUS_GLOBAL_CONFIG_ID),\n txb.object(C.CLOCK_PACKAGE_ID),\n ],\n });\n txb.moveCall({\n target: `0x2::transfer::public_transfer`,\n typeArguments: [`0x2::coin::Coin<${coinsList[\"BUCK\"].type}>`],\n arguments: [buck, txb.pure.address(address)],\n });\n } else {\n throw new Error(`No ${\"BUCKET-BUCK\"} Receipt`);\n }\n\n return txb;\n}\n"]}
1
+ {"version":3,"file":"bucket.js","sourceRoot":"","sources":["../../../src/transactions/bucket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,QAAQ,EAGR,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,OAA4B;IAE5B,MAAM,CAAC,GAAG,MAAM,OAAO,EAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAc,MAAM,WAAW,CAC1C,aAAyB,EACzB,OAAO,EACP,IAAI,CACL,CAAC;IACF,IAAI,KAAK,GAAiB,EAAE,CAAC;IAE7B,IAAI,aAAa,GAA8B,IAAI,CAAC;IAEpD,GAAG,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC;YACxC,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,SAAS,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI;YACpE,MAAM,EAAE,aAAa;SACtB,CAAC,CAAC;QAEH,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEpC,+BAA+B;QAC/B,IAAI,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,UA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AAC,eAAe,CAAC;gBAC7B,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;gBACtB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;gBACnB,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBACpC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,sBAAsB,CAAC;gBACpC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC;aAC/B;SACF,CAAC,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC;YACX,MAAM,EAAE,gCAAgC;YACxC,aAAa,EAAE,CAAC,mBAAmB,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC;YAC7D,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,MAAM,aAAa,UAAU,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { CoinStruct } from \"@mysten/sui/client\";\nimport { Transaction } from \"@mysten/sui/transactions\";\nimport {\n bluefinPoolMap,\n cetusPoolMap,\n coinsList,\n getConf,\n getReceipts,\n getSuiClient,\n poolInfo,\n PoolName,\n Receipt,\n singleAssetPoolCoinMap,\n} from \"../index.js\";\n\nexport async function bucketDepositTx(\n amount: string,\n options: { address: string },\n): Promise<Transaction> {\n const C = await getConf();\n const suiClient = getSuiClient();\n const address = options.address;\n const txb = new Transaction();\n const poolData = poolInfo[\"BUCKET-BUCK\"];\n\n const receipt: Receipt[] = await getReceipts(\n \"BUCKET-BUCK\" as PoolName,\n address,\n true,\n );\n let coins: CoinStruct[] = [];\n\n let currentCursor: string | null | undefined = null;\n\n do {\n const response = await suiClient.getCoins({\n owner: address,\n coinType: coinsList[singleAssetPoolCoinMap[\"BUCKET-BUCK\"].coin].type,\n cursor: currentCursor,\n });\n\n coins = coins.concat(response.data);\n\n // Check if there's a next page\n if (response.hasNextPage && response.nextCursor) {\n currentCursor = response.nextCursor;\n } else {\n // No more pages available\n // console.log(\"No more receipts available.\");\n break;\n }\n } while (true);\n\n if (coins.length >= 1) {\n const [coin] = txb.splitCoins(txb.object(coins[0].coinObjectId), [0]);\n txb.mergeCoins(\n coin,\n coins.map((c) => c.coinObjectId),\n );\n const [depositCoin] = txb.splitCoins(coin, [amount]);\n let someReceipt: any;\n if (receipt.length == 0) {\n [someReceipt] = txb.moveCall({\n target: `0x1::option::none`,\n typeArguments: [poolData.receiptType],\n arguments: [],\n });\n } else {\n [someReceipt] = txb.moveCall({\n target: `0x1::option::some`,\n typeArguments: [receipt[0].content.type],\n arguments: [txb.object(receipt[0].objectId)],\n });\n }\n txb.moveCall({\n target: `${poolData.packageId}::alphafi_bucket_investor_v1::collect_and_convert_reward_to_buck`,\n arguments: [\n txb.object(C.ALPHA_3_VERSION),\n txb.object(poolData.investorId),\n txb.object(C.BUCKET_PROTOCOL),\n txb.object(C.FOUNTAIN),\n txb.object(bluefinPoolMap[\"SUI-USDC\"]),\n txb.object(C.BLUEFIN_GLOBAL_CONFIG),\n txb.object(C.CLOCK_PACKAGE_ID),\n ],\n });\n txb.moveCall({\n target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_deposit`,\n arguments: [\n txb.object(C.ALPHA_3_VERSION),\n txb.object(C.VERSION),\n someReceipt,\n txb.object(poolData.poolId),\n depositCoin,\n txb.object(poolData.investorId),\n txb.object(C.ALPHA_DISTRIBUTOR),\n txb.object(C.BUCKET_PROTOCOL),\n txb.object(C.FOUNTAIN),\n txb.object(C.FLASK),\n txb.object(cetusPoolMap[\"USDC-SUI\"]),\n txb.object(C.CETUS_GLOBAL_CONFIG_ID),\n txb.object(C.CLOCK_PACKAGE_ID),\n ],\n });\n txb.transferObjects([coin], address);\n } else {\n throw new Error(\"No coin\");\n }\n return txb;\n}\n\nexport async function bucketWithdrawTx(\n xTokens: string,\n options: { address: string },\n): Promise<Transaction> {\n const C = await getConf();\n const address = options.address;\n const txb = new Transaction();\n const poolData = poolInfo[\"BUCKET-BUCK\"];\n\n const receipt: Receipt[] = await getReceipts(\n \"BUCKET-BUCK\" as PoolName,\n address,\n true,\n );\n\n const alphaReceipt: Receipt[] = await getReceipts(\"ALPHA\", address, true);\n\n if (receipt.length > 0) {\n let alpha_receipt: any;\n if (alphaReceipt.length == 0) {\n [alpha_receipt] = txb.moveCall({\n target: `0x1::option::none`,\n typeArguments: [C.ALPHA_POOL_RECEIPT],\n arguments: [],\n });\n } else {\n [alpha_receipt] = txb.moveCall({\n target: `0x1::option::some`,\n typeArguments: [alphaReceipt[0].content.type],\n arguments: [txb.object(alphaReceipt[0].objectId)],\n });\n }\n txb.moveCall({\n target: `${poolData.packageId}::alphafi_bucket_investor_v1::collect_and_convert_reward_to_buck`,\n arguments: [\n txb.object(C.ALPHA_3_VERSION),\n txb.object(poolData.investorId),\n txb.object(C.BUCKET_PROTOCOL),\n txb.object(C.FOUNTAIN),\n txb.object(bluefinPoolMap[\"SUI-USDC\"]),\n txb.object(C.BLUEFIN_GLOBAL_CONFIG),\n txb.object(C.CLOCK_PACKAGE_ID),\n ],\n });\n const [buck] = txb.moveCall({\n target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_withdraw`,\n arguments: [\n txb.object(C.ALPHA_3_VERSION),\n txb.object(C.VERSION),\n txb.object(receipt[0].objectId),\n alpha_receipt,\n txb.object(C.ALPHA_POOL),\n txb.object(poolData.poolId),\n txb.pure.u64(xTokens),\n txb.object(poolData.investorId),\n txb.object(C.ALPHA_DISTRIBUTOR),\n txb.object(C.BUCKET_PROTOCOL),\n txb.object(C.FOUNTAIN),\n txb.object(C.FLASK),\n txb.object(cetusPoolMap[\"USDC-SUI\"]),\n txb.object(C.CETUS_GLOBAL_CONFIG_ID),\n txb.object(C.CLOCK_PACKAGE_ID),\n ],\n });\n txb.moveCall({\n target: `0x2::transfer::public_transfer`,\n typeArguments: [`0x2::coin::Coin<${coinsList[\"BUCK\"].type}>`],\n arguments: [buck, txb.pure.address(address)],\n });\n } else {\n throw new Error(`No ${\"BUCKET-BUCK\"} Receipt`);\n }\n\n return txb;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"navi-looping.d.ts","sourceRoot":"","sources":["../../../src/transactions/navi-looping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAYvD,OAAO,EAAE,QAAQ,EAAW,MAAM,oBAAoB,CAAC;AAMvD,wBAAsB,cAAc,CAClC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,wBA2B7B;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,wBA2B7B;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAkMtB;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CA4JtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAwKtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAgMtB;AAED,wBAAsB,yBAAyB,CAC7C,MAAM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AA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAsKtB;AAED,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CA2LtB"}
@@ -1,7 +1,7 @@
1
1
  import { Transaction } from "@mysten/sui/transactions";
2
2
  import { getConf } from "../common/constants.js";
3
3
  import { getSuiClient } from "../sui-sdk/client.js";
4
- import { cetusPoolMap, loopingAccountAddresses, loopingPoolCoinMap, naviPriceFeedMap, poolInfo, singleAssetPoolCoinMap, } from "../common/maps.js";
4
+ import { bluefinPoolMap, cetusPoolMap, loopingAccountAddresses, loopingPoolCoinMap, naviPriceFeedMap, poolInfo, singleAssetPoolCoinMap, } from "../common/maps.js";
5
5
  import { coinsList } from "../common/coins.js";
6
6
  import { getReceipts } from "../sui-sdk/functions/getReceipts.js";
7
7
  import { updateSingleTokenPrice } from "./naviOracle.js";
@@ -252,8 +252,8 @@ export async function naviSuiVsuiLoopDepositTx(amount, options) {
252
252
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
253
253
  rewardCoinSet.add(reward.reward_coin_type);
254
254
  txb.moveCall({
255
- target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2`,
256
- typeArguments: [coinsList["NAVX"].type],
255
+ target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
256
+ typeArguments: [coinsList["NAVX"].type, coinsList["SUI"].type],
257
257
  arguments: [
258
258
  txb.object(poolData.investorId),
259
259
  txb.object(C.ALPHA_2_VERSION),
@@ -264,9 +264,9 @@ export async function naviSuiVsuiLoopDepositTx(amount, options) {
264
264
  txb.object(C.VOLO_STAKE_POOL),
265
265
  txb.object(C.VOLO_METADATA),
266
266
  txb.object(C.SUI_SYSTEM_STATE),
267
- txb.object(cetusPoolMap[`NAVX-SUI`]),
268
- txb.object(cetusPoolMap[`VSUI-SUI`]),
269
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
267
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
268
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
269
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
270
270
  ],
271
271
  });
272
272
  }
@@ -292,8 +292,8 @@ export async function naviSuiVsuiLoopDepositTx(amount, options) {
292
292
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
293
293
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
294
294
  txb.moveCall({
295
- target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2`,
296
- typeArguments: [coinsList["NAVX"].type],
295
+ target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
296
+ typeArguments: [coinsList["NAVX"].type, coinsList["SUI"].type],
297
297
  arguments: [
298
298
  txb.object(poolData.investorId),
299
299
  txb.object(C.ALPHA_2_VERSION),
@@ -304,9 +304,9 @@ export async function naviSuiVsuiLoopDepositTx(amount, options) {
304
304
  txb.object(C.VOLO_STAKE_POOL),
305
305
  txb.object(C.VOLO_METADATA),
306
306
  txb.object(C.SUI_SYSTEM_STATE),
307
- txb.object(cetusPoolMap[`NAVX-SUI`]),
308
- txb.object(cetusPoolMap[`VSUI-SUI`]),
309
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
307
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
308
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
309
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
310
310
  ],
311
311
  });
312
312
  }
@@ -387,7 +387,7 @@ export async function naviSuiStsuiLoopDepositTx(amount, options) {
387
387
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
388
388
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
389
389
  txb.moveCall({
390
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
390
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
391
391
  typeArguments: [coinsList["NAVX"].type],
392
392
  arguments: [
393
393
  txb.object(C.ALPHA_5_VERSION),
@@ -397,15 +397,15 @@ export async function naviSuiStsuiLoopDepositTx(amount, options) {
397
397
  txb.object(C.NAVI_NAVX_REWARDS_POOL),
398
398
  txb.object(C.LST_INFO),
399
399
  txb.object(C.SUI_SYSTEM_STATE),
400
- txb.object(cetusPoolMap[`NAVX-SUI`]),
401
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
400
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
401
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
402
402
  txb.object(C.CLOCK_PACKAGE_ID),
403
403
  ],
404
404
  });
405
405
  }
406
406
  else if (reward.reward_coin_type === coinsList["VSUI"].type.substring(2)) {
407
407
  txb.moveCall({
408
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
408
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
409
409
  typeArguments: [coinsList["VSUI"].type],
410
410
  arguments: [
411
411
  txb.object(C.ALPHA_5_VERSION),
@@ -415,8 +415,8 @@ export async function naviSuiStsuiLoopDepositTx(amount, options) {
415
415
  txb.object(C.NAVI_VSUI_REWARDS_POOL),
416
416
  txb.object(C.LST_INFO),
417
417
  txb.object(C.SUI_SYSTEM_STATE),
418
- txb.object(cetusPoolMap[`VSUI-SUI`]),
419
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
418
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
419
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
420
420
  txb.object(C.CLOCK_PACKAGE_ID),
421
421
  ],
422
422
  });
@@ -443,7 +443,7 @@ export async function naviSuiStsuiLoopDepositTx(amount, options) {
443
443
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
444
444
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
445
445
  txb.moveCall({
446
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
446
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
447
447
  typeArguments: [coinsList["NAVX"].type],
448
448
  arguments: [
449
449
  txb.object(C.ALPHA_5_VERSION),
@@ -453,15 +453,15 @@ export async function naviSuiStsuiLoopDepositTx(amount, options) {
453
453
  txb.object(C.NAVI_NAVX_REWARDS_POOL),
454
454
  txb.object(C.LST_INFO),
455
455
  txb.object(C.SUI_SYSTEM_STATE),
456
- txb.object(cetusPoolMap[`NAVX-SUI`]),
457
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
456
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
457
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
458
458
  txb.object(C.CLOCK_PACKAGE_ID),
459
459
  ],
460
460
  });
461
461
  }
462
462
  else if (reward.reward_coin_type === coinsList["VSUI"].type.substring(2)) {
463
463
  txb.moveCall({
464
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
464
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
465
465
  typeArguments: [coinsList["VSUI"].type],
466
466
  arguments: [
467
467
  txb.object(C.ALPHA_5_VERSION),
@@ -471,8 +471,8 @@ export async function naviSuiStsuiLoopDepositTx(amount, options) {
471
471
  txb.object(C.NAVI_VSUI_REWARDS_POOL),
472
472
  txb.object(C.LST_INFO),
473
473
  txb.object(C.SUI_SYSTEM_STATE),
474
- txb.object(cetusPoolMap[`VSUI-SUI`]),
475
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
474
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
475
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
476
476
  txb.object(C.CLOCK_PACKAGE_ID),
477
477
  ],
478
478
  });
@@ -938,8 +938,8 @@ export async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
938
938
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
939
939
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
940
940
  txb.moveCall({
941
- target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2`,
942
- typeArguments: [coinsList["NAVX"].type],
941
+ target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
942
+ typeArguments: [coinsList["NAVX"].type, coinsList["SUI"].type],
943
943
  arguments: [
944
944
  txb.object(poolData.investorId),
945
945
  txb.object(C.ALPHA_2_VERSION),
@@ -950,9 +950,9 @@ export async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
950
950
  txb.object(C.VOLO_STAKE_POOL),
951
951
  txb.object(C.VOLO_METADATA),
952
952
  txb.object(C.SUI_SYSTEM_STATE),
953
- txb.object(cetusPoolMap[`NAVX-SUI`]),
954
- txb.object(cetusPoolMap[`VSUI-SUI`]),
955
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
953
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
954
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
955
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
956
956
  ],
957
957
  });
958
958
  }
@@ -978,8 +978,8 @@ export async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
978
978
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
979
979
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
980
980
  txb.moveCall({
981
- target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2`,
982
- typeArguments: [coinsList["NAVX"].type],
981
+ target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
982
+ typeArguments: [coinsList["NAVX"].type, coinsList["SUI"].type],
983
983
  arguments: [
984
984
  txb.object(poolData.investorId),
985
985
  txb.object(C.ALPHA_2_VERSION),
@@ -990,9 +990,9 @@ export async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
990
990
  txb.object(C.VOLO_STAKE_POOL),
991
991
  txb.object(C.VOLO_METADATA),
992
992
  txb.object(C.SUI_SYSTEM_STATE),
993
- txb.object(cetusPoolMap[`NAVX-SUI`]),
994
- txb.object(cetusPoolMap[`VSUI-SUI`]),
995
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
993
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
994
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
995
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
996
996
  ],
997
997
  });
998
998
  }
@@ -1085,7 +1085,7 @@ export async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
1085
1085
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
1086
1086
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
1087
1087
  txb.moveCall({
1088
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
1088
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
1089
1089
  typeArguments: [coinsList["NAVX"].type],
1090
1090
  arguments: [
1091
1091
  txb.object(C.ALPHA_5_VERSION),
@@ -1095,15 +1095,15 @@ export async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
1095
1095
  txb.object(C.NAVI_NAVX_REWARDS_POOL),
1096
1096
  txb.object(C.LST_INFO),
1097
1097
  txb.object(C.SUI_SYSTEM_STATE),
1098
- txb.object(cetusPoolMap[`NAVX-SUI`]),
1099
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
1098
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
1099
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
1100
1100
  txb.object(C.CLOCK_PACKAGE_ID),
1101
1101
  ],
1102
1102
  });
1103
1103
  }
1104
1104
  else if (reward.reward_coin_type === coinsList["VSUI"].type.substring(2)) {
1105
1105
  txb.moveCall({
1106
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
1106
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
1107
1107
  typeArguments: [coinsList["VSUI"].type],
1108
1108
  arguments: [
1109
1109
  txb.object(C.ALPHA_5_VERSION),
@@ -1113,8 +1113,8 @@ export async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
1113
1113
  txb.object(C.NAVI_VSUI_REWARDS_POOL),
1114
1114
  txb.object(C.LST_INFO),
1115
1115
  txb.object(C.SUI_SYSTEM_STATE),
1116
- txb.object(cetusPoolMap[`VSUI-SUI`]),
1117
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
1116
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
1117
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
1118
1118
  txb.object(C.CLOCK_PACKAGE_ID),
1119
1119
  ],
1120
1120
  });
@@ -1141,7 +1141,7 @@ export async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
1141
1141
  if (rewardCoinSet.has(reward.reward_coin_type) === false) {
1142
1142
  if (reward.reward_coin_type === coinsList["NAVX"].type.substring(2)) {
1143
1143
  txb.moveCall({
1144
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
1144
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
1145
1145
  typeArguments: [coinsList["NAVX"].type],
1146
1146
  arguments: [
1147
1147
  txb.object(C.ALPHA_5_VERSION),
@@ -1151,15 +1151,15 @@ export async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
1151
1151
  txb.object(C.NAVI_NAVX_REWARDS_POOL),
1152
1152
  txb.object(C.LST_INFO),
1153
1153
  txb.object(C.SUI_SYSTEM_STATE),
1154
- txb.object(cetusPoolMap[`NAVX-SUI`]),
1155
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
1154
+ txb.object(bluefinPoolMap[`NAVX-SUI`]),
1155
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
1156
1156
  txb.object(C.CLOCK_PACKAGE_ID),
1157
1157
  ],
1158
1158
  });
1159
1159
  }
1160
1160
  else if (reward.reward_coin_type === coinsList["VSUI"].type.substring(2)) {
1161
1161
  txb.moveCall({
1162
- target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps`,
1162
+ target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
1163
1163
  typeArguments: [coinsList["VSUI"].type],
1164
1164
  arguments: [
1165
1165
  txb.object(C.ALPHA_5_VERSION),
@@ -1169,8 +1169,8 @@ export async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
1169
1169
  txb.object(C.NAVI_VSUI_REWARDS_POOL),
1170
1170
  txb.object(C.LST_INFO),
1171
1171
  txb.object(C.SUI_SYSTEM_STATE),
1172
- txb.object(cetusPoolMap[`VSUI-SUI`]),
1173
- txb.object(C.CETUS_GLOBAL_CONFIG_ID),
1172
+ txb.object(bluefinPoolMap[`VSUI-SUI`]),
1173
+ txb.object(C.BLUEFIN_GLOBAL_CONFIG),
1174
1174
  txb.object(C.CLOCK_PACKAGE_ID),
1175
1175
  ],
1176
1176
  });