@alphafi/alphafi-sdk 0.0.80 → 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.
- package/dist/cjs/common/constants.d.ts +6 -0
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +25 -7
- package/dist/cjs/common/constants.js.map +1 -1
- package/dist/cjs/common/maps.d.ts.map +1 -1
- package/dist/cjs/common/maps.js +3 -0
- package/dist/cjs/common/maps.js.map +1 -1
- package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
- package/dist/cjs/transactions/bluefin.js +337 -9
- package/dist/cjs/transactions/bluefin.js.map +1 -1
- package/dist/cjs/transactions/bucket.d.ts.map +1 -1
- package/dist/cjs/transactions/bucket.js +24 -0
- package/dist/cjs/transactions/bucket.js.map +1 -1
- package/dist/cjs/transactions/navi-looping.d.ts.map +1 -1
- package/dist/cjs/transactions/navi-looping.js +44 -44
- package/dist/cjs/transactions/navi-looping.js.map +1 -1
- package/dist/cjs/transactions/navi.d.ts.map +1 -1
- package/dist/cjs/transactions/navi.js +66 -186
- package/dist/cjs/transactions/navi.js.map +1 -1
- package/dist/esm/common/constants.d.ts +6 -0
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +25 -7
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/maps.d.ts.map +1 -1
- package/dist/esm/common/maps.js +3 -0
- package/dist/esm/common/maps.js.map +1 -1
- package/dist/esm/transactions/bluefin.d.ts.map +1 -1
- package/dist/esm/transactions/bluefin.js +337 -9
- package/dist/esm/transactions/bluefin.js.map +1 -1
- package/dist/esm/transactions/bucket.d.ts.map +1 -1
- package/dist/esm/transactions/bucket.js +25 -1
- package/dist/esm/transactions/bucket.js.map +1 -1
- package/dist/esm/transactions/navi-looping.d.ts.map +1 -1
- package/dist/esm/transactions/navi-looping.js +45 -45
- package/dist/esm/transactions/navi-looping.js.map +1 -1
- package/dist/esm/transactions/navi.d.ts.map +1 -1
- package/dist/esm/transactions/navi.js +66 -186
- package/dist/esm/transactions/navi.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/functions/alphaLpBreakdown.html +1 -1
- package/docs/functions/cetusLpBreakdown.html +1 -1
- package/docs/functions/claimBlueRewardTxb.html +1 -1
- package/docs/functions/claimRewardTxb.html +1 -1
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -1
- package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -1
- package/docs/functions/coinsInPool.html +1 -1
- package/docs/functions/collectRewards.html +1 -1
- package/docs/functions/deposit.html +1 -1
- package/docs/functions/depositDoubleAssetTxb.html +1 -1
- package/docs/functions/depositSingleAssetTxb.html +1 -1
- package/docs/functions/fetchAfterTransactionEvents.html +1 -1
- package/docs/functions/fetchAirdropClaimEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -1
- package/docs/functions/fetchCetusPools.html +1 -1
- package/docs/functions/fetchChainIdentifier.html +1 -1
- package/docs/functions/fetchCheckRatioEvents.html +1 -1
- package/docs/functions/fetchEvents.html +1 -1
- package/docs/functions/fetchLiquidityChangeEvents.html +1 -1
- package/docs/functions/fetchMultiCategoryEvents.html +1 -1
- package/docs/functions/fetchMultiReceipts.html +1 -1
- package/docs/functions/fetchNftHolders.html +1 -1
- package/docs/functions/fetchPools.html +1 -1
- package/docs/functions/fetchPortfolioData.html +1 -1
- package/docs/functions/fetchProtocolData.html +1 -1
- package/docs/functions/fetchTVL.html +1 -1
- package/docs/functions/fetchTransactions.html +1 -1
- package/docs/functions/fetchUserVaultBalances.html +1 -1
- package/docs/functions/fetchUserVaults.html +1 -1
- package/docs/functions/fetchUserWalletData.html +1 -1
- package/docs/functions/fetchVoloExchangeRate.html +1 -1
- package/docs/functions/fetchWithdrawV2Events.html +1 -1
- package/docs/functions/getAirdropShare.html +1 -1
- package/docs/functions/getAllDoubleAssetVaults.html +1 -1
- package/docs/functions/getAllSingleAssetVaults.html +1 -1
- package/docs/functions/getAllVaultBalances.html +1 -1
- package/docs/functions/getAllVaults.html +1 -1
- package/docs/functions/getAlphaUnlocks.html +1 -1
- package/docs/functions/getAlphaVaultBalance.html +1 -1
- package/docs/functions/getAmounts.html +1 -1
- package/docs/functions/getApr.html +1 -1
- package/docs/functions/getAprs.html +1 -1
- package/docs/functions/getApy.html +1 -1
- package/docs/functions/getApys.html +1 -1
- package/docs/functions/getCetusInvestorTicksMap.html +1 -1
- package/docs/functions/getCetusPool.html +1 -1
- package/docs/functions/getCetusSqrtPriceMap.html +1 -1
- package/docs/functions/getCoinAmountsFromLiquidity.html +1 -1
- package/docs/functions/getConf.html +1 -1
- package/docs/functions/getCurrentTick.html +1 -1
- package/docs/functions/getDistributor.html +1 -1
- package/docs/functions/getDoubleAssetVaultBalance.html +1 -1
- package/docs/functions/getDoubleAssetVaults.html +1 -1
- package/docs/functions/getInvestor.html +1 -1
- package/docs/functions/getInvestorPoolMap.html +1 -1
- package/docs/functions/getLastAutoCompoundTime.html +1 -1
- package/docs/functions/getLatestPrices.html +1 -1
- package/docs/functions/getLiquidity.html +1 -1
- package/docs/functions/getMultiCetusPool.html +1 -1
- package/docs/functions/getMultiInvestor.html +1 -1
- package/docs/functions/getMultiLatestPrices.html +1 -1
- package/docs/functions/getMultiParentPool.html +1 -1
- package/docs/functions/getMultiPool.html +1 -1
- package/docs/functions/getMultiReceipts.html +1 -1
- package/docs/functions/getParentPool.html +1 -1
- package/docs/functions/getPool.html +1 -1
- package/docs/functions/getPoolExchangeRate.html +1 -1
- package/docs/functions/getPoolExchangeRateMap.html +1 -1
- package/docs/functions/getPoolsWeightDistribution.html +1 -1
- package/docs/functions/getPositionRange.html +1 -1
- package/docs/functions/getPositionRanges.html +1 -1
- package/docs/functions/getPositionTicks.html +1 -1
- package/docs/functions/getPriceToTick.html +1 -1
- package/docs/functions/getRebalanceHistories.html +1 -1
- package/docs/functions/getRebalanceHistory.html +1 -1
- package/docs/functions/getReceipts.html +1 -1
- package/docs/functions/getSingleAssetVaultBalance.html +1 -1
- package/docs/functions/getSingleAssetVaults.html +1 -1
- package/docs/functions/getSuiClient.html +2 -2
- package/docs/functions/getSuiNodeUrl.html +2 -2
- package/docs/functions/getTVLs-1.html +1 -1
- package/docs/functions/getTickSpacing.html +1 -1
- package/docs/functions/getTickToPrice.html +1 -1
- package/docs/functions/getTvls.html +1 -1
- package/docs/functions/getVaultBalance.html +1 -1
- package/docs/functions/getVaults.html +1 -1
- package/docs/functions/getZapAmounts.html +1 -1
- package/docs/functions/lastAutocompoundTime.html +1 -1
- package/docs/functions/liquidityToTokens.html +1 -1
- package/docs/functions/multiLiquidityToTokens.html +1 -1
- package/docs/functions/multiTokensToUsd.html +1 -1
- package/docs/functions/multiXTokensToLiquidity.html +1 -1
- package/docs/functions/parseUserWalletData.html +1 -1
- package/docs/functions/pendingBlueRewardAmount.html +1 -1
- package/docs/functions/setCustomSuiClient.html +2 -2
- package/docs/functions/setSuiClient.html +2 -2
- package/docs/functions/setSuiNodeUrl.html +2 -2
- package/docs/functions/setWeights.html +1 -1
- package/docs/functions/withdraw.html +1 -1
- package/docs/functions/withdrawAlphaTxb.html +1 -1
- package/docs/functions/withdrawTxb.html +1 -1
- package/docs/functions/zapDepositTxb.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/Coin.html +6 -6
- package/docs/interfaces/CoinPair.html +2 -2
- package/docs/interfaces/CommonEventAttributes.html +2 -2
- package/docs/interfaces/NaviVoloData.html +2 -2
- package/docs/interfaces/PoolData.html +2 -2
- package/docs/interfaces/PoolWeightDistribution.html +2 -2
- package/docs/interfaces/RebalanceHistoryType.html +2 -2
- package/docs/modules.html +2 -2
- package/docs/types/AfterTransactionEventNode.html +1 -1
- package/docs/types/AirdropClaimEventNode.html +1 -1
- package/docs/types/Allocator.html +1 -1
- package/docs/types/AlphaFiDoubleAssetVault.html +1 -1
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
- package/docs/types/AlphaFiSingleAssetVault.html +1 -1
- package/docs/types/AlphaFiVault.html +1 -1
- package/docs/types/AlphaFiVaultBalance.html +1 -1
- package/docs/types/AlphaPoolType.html +1 -1
- package/docs/types/AlphaReceipt.html +1 -1
- package/docs/types/AlphaReceiptFields.html +1 -1
- package/docs/types/AlphaVaultBalance.html +1 -1
- package/docs/types/AutoBalancePoolNames.html +1 -1
- package/docs/types/AutoCompoundingEventNode.html +1 -1
- package/docs/types/BluefinInvestor.html +1 -1
- package/docs/types/BluefinPoolType.html +1 -1
- package/docs/types/BucketInvestor.html +1 -1
- package/docs/types/CetusInvestor.html +1 -1
- package/docs/types/CetusPoolType.html +1 -1
- package/docs/types/CetusSwapOptions.html +1 -1
- package/docs/types/CoinAmounts.html +1 -1
- package/docs/types/CoinName.html +1 -1
- package/docs/types/CoinType.html +1 -1
- package/docs/types/CommonInvestorFields.html +1 -1
- package/docs/types/CreatePoolOptions.html +1 -1
- package/docs/types/Distributor.html +1 -1
- package/docs/types/DoubleAssetMultiVaultBalance.html +1 -1
- package/docs/types/DoubleAssetPoolNames.html +1 -1
- package/docs/types/DoubleAssetTokenHoldings.html +1 -1
- package/docs/types/DoubleAssetVaultBalance.html +1 -1
- package/docs/types/EventCategory.html +1 -1
- package/docs/types/EventNode.html +1 -1
- package/docs/types/GetHoldersParams.html +1 -1
- package/docs/types/GetTokenHoldingsParams.html +1 -1
- package/docs/types/GetUserTokensFromTransactionsParams.html +1 -1
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +1 -1
- package/docs/types/GetVaultBalanceParams.html +1 -1
- package/docs/types/HoldingsObj.html +1 -1
- package/docs/types/Icon.html +1 -1
- package/docs/types/Investor.html +1 -1
- package/docs/types/LiquidityChangeEventNode.html +1 -1
- package/docs/types/LiquidityToTokensParams.html +1 -1
- package/docs/types/LiquidityToUsdParams.html +1 -1
- package/docs/types/LoopingDebt.html +1 -1
- package/docs/types/LoopingPoolNames.html +1 -1
- package/docs/types/LpBreakdownType.html +1 -1
- package/docs/types/MemberPoolDataType.html +1 -1
- package/docs/types/MemberType.html +1 -1
- package/docs/types/MultiGetVaultBalancesParams.html +1 -1
- package/docs/types/NaviInvestor.html +1 -1
- package/docs/types/OtherReceiptFields.html +1 -1
- package/docs/types/PoolName.html +1 -1
- package/docs/types/PoolReceipt.html +1 -1
- package/docs/types/PoolType.html +1 -1
- package/docs/types/Receipt.html +1 -1
- package/docs/types/ReceiptGQL.html +1 -1
- package/docs/types/SingleAssetMultiVaultBalance.html +1 -1
- package/docs/types/SingleAssetPoolNames.html +1 -1
- package/docs/types/SingleAssetTokenHoldings.html +1 -1
- package/docs/types/SingleAssetVaultBalance.html +1 -1
- package/docs/types/SingleGetVaultBalancesParams.html +1 -1
- package/docs/types/StrategyType.html +1 -1
- package/docs/types/SuiNetwork.html +1 -1
- package/docs/types/SwapOptions.html +1 -1
- package/docs/types/TickSpacing.html +1 -1
- package/docs/types/TotalWeightType.html +1 -1
- package/docs/types/TransactionBlockType.html +1 -1
- package/docs/types/UserPoolLiquidity.html +1 -1
- package/docs/types/UserPoolTokenHoldings.html +1 -1
- package/docs/types/UserUsdHoldings.html +1 -1
- package/docs/types/VaultBalance.html +1 -1
- package/docs/types/VoteCastEvent.html +1 -1
- package/docs/types/WithdrawV2EventNode.html +1 -1
- package/docs/variables/bluefinPoolMap.html +1 -1
- package/docs/variables/cetusPoolMap.html +1 -1
- package/docs/variables/coinsList.html +1 -1
- package/docs/variables/defunctPoolsSet.html +1 -1
- package/docs/variables/doubleAssetPoolCoinMap.html +1 -1
- package/docs/variables/eventCategories.html +1 -1
- package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -1
- package/docs/variables/loopingAccountAddresses.html +1 -1
- package/docs/variables/loopingPoolCoinMap.html +1 -1
- package/docs/variables/naviAssetMap.html +1 -1
- package/docs/variables/poolIdPoolNameMap.html +1 -1
- package/docs/variables/poolInfo.html +1 -1
- package/docs/variables/singleAssetPoolCoinMap.html +1 -1
- package/docs/variables/stableCoins.html +1 -1
- 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;
|
|
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"}
|
|
@@ -49,6 +49,18 @@ async function bucketDepositTx(amount, options) {
|
|
|
49
49
|
arguments: [txb.object(receipt[0].objectId)],
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
+
txb.moveCall({
|
|
53
|
+
target: `${poolData.packageId}::alphafi_bucket_investor_v1::collect_and_convert_reward_to_buck`,
|
|
54
|
+
arguments: [
|
|
55
|
+
txb.object(C.ALPHA_3_VERSION),
|
|
56
|
+
txb.object(poolData.investorId),
|
|
57
|
+
txb.object(C.BUCKET_PROTOCOL),
|
|
58
|
+
txb.object(C.FOUNTAIN),
|
|
59
|
+
txb.object(index_js_1.bluefinPoolMap["SUI-USDC"]),
|
|
60
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
61
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
62
|
+
],
|
|
63
|
+
});
|
|
52
64
|
txb.moveCall({
|
|
53
65
|
target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_deposit`,
|
|
54
66
|
arguments: [
|
|
@@ -97,6 +109,18 @@ async function bucketWithdrawTx(xTokens, options) {
|
|
|
97
109
|
arguments: [txb.object(alphaReceipt[0].objectId)],
|
|
98
110
|
});
|
|
99
111
|
}
|
|
112
|
+
txb.moveCall({
|
|
113
|
+
target: `${poolData.packageId}::alphafi_bucket_investor_v1::collect_and_convert_reward_to_buck`,
|
|
114
|
+
arguments: [
|
|
115
|
+
txb.object(C.ALPHA_3_VERSION),
|
|
116
|
+
txb.object(poolData.investorId),
|
|
117
|
+
txb.object(C.BUCKET_PROTOCOL),
|
|
118
|
+
txb.object(C.FOUNTAIN),
|
|
119
|
+
txb.object(index_js_1.bluefinPoolMap["SUI-USDC"]),
|
|
120
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
121
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
122
|
+
],
|
|
123
|
+
});
|
|
100
124
|
const [buck] = txb.moveCall({
|
|
101
125
|
target: `${poolData.packageId}::alphafi_bucket_pool_v1::user_withdraw`,
|
|
102
126
|
arguments: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucket.js","sourceRoot":"","sources":["../../../src/transactions/bucket.ts"],"names":[],"mappings":";;AAcA,0CAmFC;AAED,4CA+DC;AAjKD,2DAAuD;AACvD,0CAUqB;AAEd,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,OAA4B;IAE5B,MAAM,CAAC,GAAG,MAAM,IAAA,kBAAO,GAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAA,uBAAY,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI,0BAAW,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,mBAAQ,CAAC,aAAa,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAc,MAAM,IAAA,sBAAW,EAC1C,aAAyB,EACzB,OAAO,EACP,IAAI,CACL,CAAC;IACF,IAAI,KAAK,GAA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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 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":";;AAeA,0CA8FC;AAED,4CA0EC;AAxLD,2DAAuD;AACvD,0CAWqB;AAEd,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,OAA4B;IAE5B,MAAM,CAAC,GAAG,MAAM,IAAA,kBAAO,GAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAA,uBAAY,GAAE,CAAC;IACjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI,0BAAW,EAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,mBAAQ,CAAC,aAAa,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAc,MAAM,IAAA,sBAAW,EAC1C,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,oBAAS,CAAC,iCAAsB,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,UAAU,EAAE,CAAC;YACh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C,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,uBAAY,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,oBAAS,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;
|
|
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;AAavD,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,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CA2FtB;AAED,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CA6KtB;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAyKtB;AACD,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAC3B,OAAO,CAAC,WAAW,CAAC,CAsLtB;AAED,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;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"}
|
|
@@ -266,8 +266,8 @@ async function naviSuiVsuiLoopDepositTx(amount, options) {
|
|
|
266
266
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
267
267
|
rewardCoinSet.add(reward.reward_coin_type);
|
|
268
268
|
txb.moveCall({
|
|
269
|
-
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::
|
|
270
|
-
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
269
|
+
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
|
|
270
|
+
typeArguments: [coins_js_1.coinsList["NAVX"].type, coins_js_1.coinsList["SUI"].type],
|
|
271
271
|
arguments: [
|
|
272
272
|
txb.object(poolData.investorId),
|
|
273
273
|
txb.object(C.ALPHA_2_VERSION),
|
|
@@ -278,9 +278,9 @@ async function naviSuiVsuiLoopDepositTx(amount, options) {
|
|
|
278
278
|
txb.object(C.VOLO_STAKE_POOL),
|
|
279
279
|
txb.object(C.VOLO_METADATA),
|
|
280
280
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
281
|
-
txb.object(maps_js_1.
|
|
282
|
-
txb.object(maps_js_1.
|
|
283
|
-
txb.object(C.
|
|
281
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
282
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
283
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
284
284
|
],
|
|
285
285
|
});
|
|
286
286
|
}
|
|
@@ -306,8 +306,8 @@ async function naviSuiVsuiLoopDepositTx(amount, options) {
|
|
|
306
306
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
307
307
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
308
308
|
txb.moveCall({
|
|
309
|
-
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::
|
|
310
|
-
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
309
|
+
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
|
|
310
|
+
typeArguments: [coins_js_1.coinsList["NAVX"].type, coins_js_1.coinsList["SUI"].type],
|
|
311
311
|
arguments: [
|
|
312
312
|
txb.object(poolData.investorId),
|
|
313
313
|
txb.object(C.ALPHA_2_VERSION),
|
|
@@ -318,9 +318,9 @@ async function naviSuiVsuiLoopDepositTx(amount, options) {
|
|
|
318
318
|
txb.object(C.VOLO_STAKE_POOL),
|
|
319
319
|
txb.object(C.VOLO_METADATA),
|
|
320
320
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
321
|
-
txb.object(maps_js_1.
|
|
322
|
-
txb.object(maps_js_1.
|
|
323
|
-
txb.object(C.
|
|
321
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
322
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
323
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
324
324
|
],
|
|
325
325
|
});
|
|
326
326
|
}
|
|
@@ -401,7 +401,7 @@ async function naviSuiStsuiLoopDepositTx(amount, options) {
|
|
|
401
401
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
402
402
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
403
403
|
txb.moveCall({
|
|
404
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
404
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
405
405
|
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
406
406
|
arguments: [
|
|
407
407
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -411,15 +411,15 @@ async function naviSuiStsuiLoopDepositTx(amount, options) {
|
|
|
411
411
|
txb.object(C.NAVI_NAVX_REWARDS_POOL),
|
|
412
412
|
txb.object(C.LST_INFO),
|
|
413
413
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
414
|
-
txb.object(maps_js_1.
|
|
415
|
-
txb.object(C.
|
|
414
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
415
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
416
416
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
417
417
|
],
|
|
418
418
|
});
|
|
419
419
|
}
|
|
420
420
|
else if (reward.reward_coin_type === coins_js_1.coinsList["VSUI"].type.substring(2)) {
|
|
421
421
|
txb.moveCall({
|
|
422
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
422
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
423
423
|
typeArguments: [coins_js_1.coinsList["VSUI"].type],
|
|
424
424
|
arguments: [
|
|
425
425
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -429,8 +429,8 @@ async function naviSuiStsuiLoopDepositTx(amount, options) {
|
|
|
429
429
|
txb.object(C.NAVI_VSUI_REWARDS_POOL),
|
|
430
430
|
txb.object(C.LST_INFO),
|
|
431
431
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
432
|
-
txb.object(maps_js_1.
|
|
433
|
-
txb.object(C.
|
|
432
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
433
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
434
434
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
435
435
|
],
|
|
436
436
|
});
|
|
@@ -457,7 +457,7 @@ async function naviSuiStsuiLoopDepositTx(amount, options) {
|
|
|
457
457
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
458
458
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
459
459
|
txb.moveCall({
|
|
460
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
460
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
461
461
|
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
462
462
|
arguments: [
|
|
463
463
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -467,15 +467,15 @@ async function naviSuiStsuiLoopDepositTx(amount, options) {
|
|
|
467
467
|
txb.object(C.NAVI_NAVX_REWARDS_POOL),
|
|
468
468
|
txb.object(C.LST_INFO),
|
|
469
469
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
470
|
-
txb.object(maps_js_1.
|
|
471
|
-
txb.object(C.
|
|
470
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
471
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
472
472
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
473
473
|
],
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
else if (reward.reward_coin_type === coins_js_1.coinsList["VSUI"].type.substring(2)) {
|
|
477
477
|
txb.moveCall({
|
|
478
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
478
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
479
479
|
typeArguments: [coins_js_1.coinsList["VSUI"].type],
|
|
480
480
|
arguments: [
|
|
481
481
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -485,8 +485,8 @@ async function naviSuiStsuiLoopDepositTx(amount, options) {
|
|
|
485
485
|
txb.object(C.NAVI_VSUI_REWARDS_POOL),
|
|
486
486
|
txb.object(C.LST_INFO),
|
|
487
487
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
488
|
-
txb.object(maps_js_1.
|
|
489
|
-
txb.object(C.
|
|
488
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
489
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
490
490
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
491
491
|
],
|
|
492
492
|
});
|
|
@@ -952,8 +952,8 @@ async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
|
|
|
952
952
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
953
953
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
954
954
|
txb.moveCall({
|
|
955
|
-
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::
|
|
956
|
-
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
955
|
+
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
|
|
956
|
+
typeArguments: [coins_js_1.coinsList["NAVX"].type, coins_js_1.coinsList["SUI"].type],
|
|
957
957
|
arguments: [
|
|
958
958
|
txb.object(poolData.investorId),
|
|
959
959
|
txb.object(C.ALPHA_2_VERSION),
|
|
@@ -964,9 +964,9 @@ async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
|
|
|
964
964
|
txb.object(C.VOLO_STAKE_POOL),
|
|
965
965
|
txb.object(C.VOLO_METADATA),
|
|
966
966
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
967
|
-
txb.object(maps_js_1.
|
|
968
|
-
txb.object(maps_js_1.
|
|
969
|
-
txb.object(C.
|
|
967
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
968
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
969
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
970
970
|
],
|
|
971
971
|
});
|
|
972
972
|
}
|
|
@@ -992,8 +992,8 @@ async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
|
|
|
992
992
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
993
993
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
994
994
|
txb.moveCall({
|
|
995
|
-
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::
|
|
996
|
-
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
995
|
+
target: `${poolData.packageId}::alphafi_navi_sui_vsui_investor::collect_reward_with_two_swaps_v2_bluefin`,
|
|
996
|
+
typeArguments: [coins_js_1.coinsList["NAVX"].type, coins_js_1.coinsList["SUI"].type],
|
|
997
997
|
arguments: [
|
|
998
998
|
txb.object(poolData.investorId),
|
|
999
999
|
txb.object(C.ALPHA_2_VERSION),
|
|
@@ -1004,9 +1004,9 @@ async function naviSuiVsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1004
1004
|
txb.object(C.VOLO_STAKE_POOL),
|
|
1005
1005
|
txb.object(C.VOLO_METADATA),
|
|
1006
1006
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
1007
|
-
txb.object(maps_js_1.
|
|
1008
|
-
txb.object(maps_js_1.
|
|
1009
|
-
txb.object(C.
|
|
1007
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
1008
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
1009
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
1010
1010
|
],
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
@@ -1099,7 +1099,7 @@ async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1099
1099
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
1100
1100
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
1101
1101
|
txb.moveCall({
|
|
1102
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
1102
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
1103
1103
|
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
1104
1104
|
arguments: [
|
|
1105
1105
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -1109,15 +1109,15 @@ async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1109
1109
|
txb.object(C.NAVI_NAVX_REWARDS_POOL),
|
|
1110
1110
|
txb.object(C.LST_INFO),
|
|
1111
1111
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
1112
|
-
txb.object(maps_js_1.
|
|
1113
|
-
txb.object(C.
|
|
1112
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
1113
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
1114
1114
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
1115
1115
|
],
|
|
1116
1116
|
});
|
|
1117
1117
|
}
|
|
1118
1118
|
else if (reward.reward_coin_type === coins_js_1.coinsList["VSUI"].type.substring(2)) {
|
|
1119
1119
|
txb.moveCall({
|
|
1120
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
1120
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
1121
1121
|
typeArguments: [coins_js_1.coinsList["VSUI"].type],
|
|
1122
1122
|
arguments: [
|
|
1123
1123
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -1127,8 +1127,8 @@ async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1127
1127
|
txb.object(C.NAVI_VSUI_REWARDS_POOL),
|
|
1128
1128
|
txb.object(C.LST_INFO),
|
|
1129
1129
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
1130
|
-
txb.object(maps_js_1.
|
|
1131
|
-
txb.object(C.
|
|
1130
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
1131
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
1132
1132
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
1133
1133
|
],
|
|
1134
1134
|
});
|
|
@@ -1155,7 +1155,7 @@ async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1155
1155
|
if (rewardCoinSet.has(reward.reward_coin_type) === false) {
|
|
1156
1156
|
if (reward.reward_coin_type === coins_js_1.coinsList["NAVX"].type.substring(2)) {
|
|
1157
1157
|
txb.moveCall({
|
|
1158
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
1158
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
1159
1159
|
typeArguments: [coins_js_1.coinsList["NAVX"].type],
|
|
1160
1160
|
arguments: [
|
|
1161
1161
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -1165,15 +1165,15 @@ async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1165
1165
|
txb.object(C.NAVI_NAVX_REWARDS_POOL),
|
|
1166
1166
|
txb.object(C.LST_INFO),
|
|
1167
1167
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
1168
|
-
txb.object(maps_js_1.
|
|
1169
|
-
txb.object(C.
|
|
1168
|
+
txb.object(maps_js_1.bluefinPoolMap[`NAVX-SUI`]),
|
|
1169
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
1170
1170
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
1171
1171
|
],
|
|
1172
1172
|
});
|
|
1173
1173
|
}
|
|
1174
1174
|
else if (reward.reward_coin_type === coins_js_1.coinsList["VSUI"].type.substring(2)) {
|
|
1175
1175
|
txb.moveCall({
|
|
1176
|
-
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::
|
|
1176
|
+
target: `${poolData.packageId}::alphafi_navi_sui_stsui_pool::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
1177
1177
|
typeArguments: [coins_js_1.coinsList["VSUI"].type],
|
|
1178
1178
|
arguments: [
|
|
1179
1179
|
txb.object(C.ALPHA_5_VERSION),
|
|
@@ -1183,8 +1183,8 @@ async function naviSuiStsuiLoopWithdrawTx(xTokens, options) {
|
|
|
1183
1183
|
txb.object(C.NAVI_VSUI_REWARDS_POOL),
|
|
1184
1184
|
txb.object(C.LST_INFO),
|
|
1185
1185
|
txb.object(C.SUI_SYSTEM_STATE),
|
|
1186
|
-
txb.object(maps_js_1.
|
|
1187
|
-
txb.object(C.
|
|
1186
|
+
txb.object(maps_js_1.bluefinPoolMap[`VSUI-SUI`]),
|
|
1187
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
1188
1188
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
1189
1189
|
],
|
|
1190
1190
|
});
|