@alphafi/alphafi-sdk 0.0.39 → 0.0.40
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/adminFunctions.d.ts.map +1 -1
- package/dist/cjs/adminFunctions.js +9 -1
- package/dist/cjs/adminFunctions.js.map +1 -1
- package/dist/cjs/common/coins.d.ts.map +1 -1
- package/dist/cjs/common/coins.js +12 -0
- package/dist/cjs/common/coins.js.map +1 -1
- package/dist/cjs/common/constants.d.ts +135 -0
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +98 -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 +103 -16
- package/dist/cjs/common/maps.js.map +1 -1
- package/dist/cjs/common/types.d.ts +58 -5
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
- package/dist/cjs/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +5 -11
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +2 -2
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/cjs/transactions/bluefin.d.ts +6 -0
- package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
- package/dist/cjs/transactions/bluefin.js +411 -34
- package/dist/cjs/transactions/bluefin.js.map +1 -1
- package/dist/cjs/transactions/cetus.d.ts +1 -1
- package/dist/cjs/transactions/cetus.d.ts.map +1 -1
- package/dist/cjs/transactions/cetus.js +3 -3
- package/dist/cjs/transactions/cetus.js.map +1 -1
- package/dist/cjs/transactions/deposit.d.ts.map +1 -1
- package/dist/cjs/transactions/deposit.js +9 -1
- package/dist/cjs/transactions/deposit.js.map +1 -1
- package/dist/cjs/transactions/withdraw.d.ts.map +1 -1
- package/dist/cjs/transactions/withdraw.js +9 -1
- package/dist/cjs/transactions/withdraw.js.map +1 -1
- package/dist/esm/adminFunctions.d.ts.map +1 -1
- package/dist/esm/adminFunctions.js +10 -2
- package/dist/esm/adminFunctions.js.map +1 -1
- package/dist/esm/common/coins.d.ts.map +1 -1
- package/dist/esm/common/coins.js +12 -0
- package/dist/esm/common/coins.js.map +1 -1
- package/dist/esm/common/constants.d.ts +135 -0
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +98 -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 +103 -16
- package/dist/esm/common/maps.js.map +1 -1
- package/dist/esm/common/types.d.ts +58 -5
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js +2 -3
- package/dist/esm/sui-sdk/functions/fetchUserVaultBalances.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +5 -11
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts +2 -2
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/esm/transactions/bluefin.d.ts +6 -0
- package/dist/esm/transactions/bluefin.d.ts.map +1 -1
- package/dist/esm/transactions/bluefin.js +408 -33
- package/dist/esm/transactions/bluefin.js.map +1 -1
- package/dist/esm/transactions/cetus.d.ts +1 -1
- package/dist/esm/transactions/cetus.d.ts.map +1 -1
- package/dist/esm/transactions/cetus.js +3 -3
- package/dist/esm/transactions/cetus.js.map +1 -1
- package/dist/esm/transactions/deposit.d.ts.map +1 -1
- package/dist/esm/transactions/deposit.js +10 -2
- package/dist/esm/transactions/deposit.js.map +1 -1
- package/dist/esm/transactions/withdraw.d.ts.map +1 -1
- package/dist/esm/transactions/withdraw.js +10 -2
- package/dist/esm/transactions/withdraw.js.map +1 -1
- package/docs/assets/highlight.css +101 -0
- package/docs/assets/icons.js +21 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +2218 -0
- package/docs/assets/navigation.js +2 -0
- package/docs/assets/search.js +2 -0
- package/docs/assets/style.css +1489 -0
- package/docs/functions/alphaLpBreakdown.html +253 -0
- package/docs/functions/bucketDepositTx.html +267 -0
- package/docs/functions/bucketWithdrawTx.html +267 -0
- package/docs/functions/cetusLpBreakdown.html +253 -0
- package/docs/functions/claimRewardTxb.html +243 -0
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +267 -0
- package/docs/functions/coinAmountToXTokensSingleAsset.html +260 -0
- package/docs/functions/coinsInPool.html +438 -0
- package/docs/functions/collectRewards.html +242 -0
- package/docs/functions/deposit.html +246 -0
- package/docs/functions/depositAlphaTxb.html +250 -0
- package/docs/functions/depositBluefinSuiFirstTxb.html +302 -0
- package/docs/functions/depositBluefinType1Txb.html +300 -0
- package/docs/functions/depositBluefinType2Txb.html +300 -0
- package/docs/functions/depositCetusAlphaSuiTxb.html +300 -0
- package/docs/functions/depositCetusSuiTxb.html +298 -0
- package/docs/functions/depositCetusTxb.html +298 -0
- package/docs/functions/depositDoubleAssetTxb.html +270 -0
- package/docs/functions/depositSingleAssetTxb.html +263 -0
- package/docs/functions/fetchAfterTransactionEvents.html +306 -0
- package/docs/functions/fetchAutoCompoundingEvents.html +257 -0
- package/docs/functions/fetchAutoCompoundingEventsGql.html +251 -0
- package/docs/functions/fetchCetusPools.html +231 -0
- package/docs/functions/fetchChainIdentifier.html +233 -0
- package/docs/functions/fetchCheckRatioEvents.html +249 -0
- package/docs/functions/fetchLiquidityChangeEvents.html +257 -0
- package/docs/functions/fetchMultiReceipts.html +261 -0
- package/docs/functions/fetchNftHolders.html +233 -0
- package/docs/functions/fetchPools.html +230 -0
- package/docs/functions/fetchPortfolioData.html +243 -0
- package/docs/functions/fetchProtocolData.html +231 -0
- package/docs/functions/fetchTVL.html +253 -0
- package/docs/functions/fetchUserVaultBalances.html +245 -0
- package/docs/functions/fetchUserVaults.html +243 -0
- package/docs/functions/fetchUserWalletData.html +243 -0
- package/docs/functions/fetchWithdrawV2Events.html +255 -0
- package/docs/functions/getAirdropShare.html +243 -0
- package/docs/functions/getAllDoubleAssetVaults.html +235 -0
- package/docs/functions/getAllSingleAssetVaults.html +235 -0
- package/docs/functions/getAllVaultBalances.html +265 -0
- package/docs/functions/getAllVaults.html +233 -0
- package/docs/functions/getAlphaUnlocks.html +245 -0
- package/docs/functions/getAlphaVaultBalance.html +255 -0
- package/docs/functions/getAmounts.html +272 -0
- package/docs/functions/getApr.html +243 -0
- package/docs/functions/getAprs.html +255 -0
- package/docs/functions/getApy.html +243 -0
- package/docs/functions/getApys.html +255 -0
- package/docs/functions/getCetusInvestorTicksMap.html +284 -0
- package/docs/functions/getCetusSqrtPriceMap.html +249 -0
- package/docs/functions/getCoinAmountsFromLiquidity.html +266 -0
- package/docs/functions/getConf.html +9882 -0
- package/docs/functions/getCurrentTick.html +247 -0
- package/docs/functions/getDoubleAssetVaultBalance.html +268 -0
- package/docs/functions/getDoubleAssetVaults.html +253 -0
- package/docs/functions/getHoldersFromTransactions.html +299 -0
- package/docs/functions/getInvestor.html +259 -0
- package/docs/functions/getInvestorPoolMap.html +241 -0
- package/docs/functions/getLastAutoCompoundTime.html +249 -0
- package/docs/functions/getLiquidity.html +260 -0
- package/docs/functions/getParentPool.html +256 -0
- package/docs/functions/getPool.html +262 -0
- package/docs/functions/getPoolExchangeRateMap.html +249 -0
- package/docs/functions/getPositionTicks.html +249 -0
- package/docs/functions/getPriceToTick.html +254 -0
- package/docs/functions/getRebalanceHistories.html +269 -0
- package/docs/functions/getRebalanceHistory.html +255 -0
- package/docs/functions/getReceipts.html +268 -0
- package/docs/functions/getSingleAssetVaultBalance.html +268 -0
- package/docs/functions/getSingleAssetVaults.html +253 -0
- package/docs/functions/getSuiClient.html +247 -0
- package/docs/functions/getSuiNodeUrl.html +232 -0
- package/docs/functions/getTVLs.html +243 -0
- package/docs/functions/getTickToPrice.html +254 -0
- package/docs/functions/getUserTokensFromTransactions.html +269 -0
- package/docs/functions/getUserTokensInUsdFromTransactions.html +263 -0
- package/docs/functions/getVaultBalance.html +277 -0
- package/docs/functions/getVaultBalanceForActiveUsers.html +261 -0
- package/docs/functions/getVaults.html +250 -0
- package/docs/functions/getXTokenVaultBalanceForActiveUsers.html +261 -0
- package/docs/functions/lastAutocompoundTime.html +249 -0
- package/docs/functions/liquidityToTokens.html +253 -0
- package/docs/functions/loopingDeposit.html +277 -0
- package/docs/functions/loopingWithdraw.html +278 -0
- package/docs/functions/multiLiquidityToTokens.html +271 -0
- package/docs/functions/multiTokensToUsd.html +262 -0
- package/docs/functions/multiXTokensToLiquidity.html +257 -0
- package/docs/functions/naviDepositTx.html +278 -0
- package/docs/functions/naviHasuiSuiLoopDepositTx.html +271 -0
- package/docs/functions/naviHasuiSuiLoopWithdrawTx.html +271 -0
- package/docs/functions/naviSuiVsuiLoopDepositTx.html +271 -0
- package/docs/functions/naviSuiVsuiLoopWithdrawTx.html +271 -0
- package/docs/functions/naviUsdcUsdtLoopDepositTx.html +271 -0
- package/docs/functions/naviUsdcUsdtLoopWithdrawTx.html +271 -0
- package/docs/functions/naviUsdtUsdcLoopDepositTx.html +271 -0
- package/docs/functions/naviUsdtUsdcLoopWithdrawTx.html +271 -0
- package/docs/functions/naviWithdrawTx.html +278 -0
- package/docs/functions/parseUserWalletData.html +243 -0
- package/docs/functions/setSuiClient.html +255 -0
- package/docs/functions/setSuiNodeUrl.html +249 -0
- package/docs/functions/withdraw.html +249 -0
- package/docs/functions/withdrawAlphaTxb.html +257 -0
- package/docs/functions/withdrawBluefinSuiFirstTxb.html +282 -0
- package/docs/functions/withdrawBluefinType1Txb.html +280 -0
- package/docs/functions/withdrawBluefinType2Txb.html +280 -0
- package/docs/functions/withdrawCetusAlphaSuiTxb.html +282 -0
- package/docs/functions/withdrawCetusSuiTxb.html +278 -0
- package/docs/functions/withdrawCetusTxb.html +278 -0
- package/docs/functions/withdrawTxb.html +260 -0
- package/docs/index.html +622 -0
- package/docs/interfaces/Coin.html +474 -0
- package/docs/interfaces/CoinPair.html +358 -0
- package/docs/interfaces/NaviVoloData.html +514 -0
- package/docs/interfaces/RebalanceHistoryType.html +652 -0
- package/docs/modules.html +1440 -0
- package/docs/types/AfterTransactionEventNode.html +305 -0
- package/docs/types/Allocator.html +321 -0
- package/docs/types/AlphaFiDoubleAssetVault.html +258 -0
- package/docs/types/AlphaFiMultiVaultBalance.html +219 -0
- package/docs/types/AlphaFiSingleAssetVault.html +244 -0
- package/docs/types/AlphaFiVault.html +214 -0
- package/docs/types/AlphaFiVaultBalance.html +220 -0
- package/docs/types/AlphaPoolType.html +383 -0
- package/docs/types/AlphaReceipt.html +220 -0
- package/docs/types/AlphaReceiptFields.html +421 -0
- package/docs/types/AlphaVaultBalance.html +245 -0
- package/docs/types/AutoCompoundingEventNode.html +225 -0
- package/docs/types/BluefinInvestor.html +209 -0
- package/docs/types/BluefinPoolType.html +209 -0
- package/docs/types/BucketInvestor.html +249 -0
- package/docs/types/CetusInvestor.html +240 -0
- package/docs/types/CetusPoolType.html +433 -0
- package/docs/types/CetusSwapOptions.html +209 -0
- package/docs/types/CoinAmounts.html +216 -0
- package/docs/types/CoinName.html +281 -0
- package/docs/types/CoinType.html +282 -0
- package/docs/types/CommonInvestorFields.html +276 -0
- package/docs/types/CreatePoolOptions.html +246 -0
- package/docs/types/Distributor.html +341 -0
- package/docs/types/DoubleAssetMultiVaultBalance.html +236 -0
- package/docs/types/DoubleAssetPoolNames.html +267 -0
- package/docs/types/DoubleAssetTokenHoldings.html +232 -0
- package/docs/types/DoubleAssetVaultBalance.html +229 -0
- package/docs/types/GetHoldersParams.html +221 -0
- package/docs/types/GetTokenHoldingsParams.html +227 -0
- package/docs/types/GetUserTokensFromTransactionsParams.html +233 -0
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +244 -0
- package/docs/types/GetVaultBalanceForActiveUsersParams.html +231 -0
- package/docs/types/GetVaultBalanceParams.html +217 -0
- package/docs/types/HoldingsObj.html +223 -0
- package/docs/types/Icon.html +266 -0
- package/docs/types/Investor.html +245 -0
- package/docs/types/LiquidityChangeEventNode.html +220 -0
- package/docs/types/LiquidityToTokensParams.html +255 -0
- package/docs/types/LiquidityToUsdParams.html +267 -0
- package/docs/types/LoopingDebt.html +258 -0
- package/docs/types/LpBreakdownType.html +238 -0
- package/docs/types/MemberPoolDataType.html +276 -0
- package/docs/types/MemberType.html +269 -0
- package/docs/types/MultiGetVaultBalancesParams.html +229 -0
- package/docs/types/NaviInvestor.html +235 -0
- package/docs/types/OtherReceiptFields.html +373 -0
- package/docs/types/PoolName.html +304 -0
- package/docs/types/PoolReceipt.html +253 -0
- package/docs/types/PoolType.html +388 -0
- package/docs/types/Receipt.html +475 -0
- package/docs/types/ReceiptGQL.html +374 -0
- package/docs/types/SingleAssetMultiVaultBalance.html +232 -0
- package/docs/types/SingleAssetPoolNames.html +247 -0
- package/docs/types/SingleAssetTokenHoldings.html +228 -0
- package/docs/types/SingleAssetVaultBalance.html +223 -0
- package/docs/types/SingleGetVaultBalancesParams.html +224 -0
- package/docs/types/StrategyType.html +217 -0
- package/docs/types/SuiNetwork.html +213 -0
- package/docs/types/SwapOptions.html +248 -0
- package/docs/types/TickSpacing.html +212 -0
- package/docs/types/TotalWeightType.html +246 -0
- package/docs/types/TransactionBlockType.html +358 -0
- package/docs/types/UserPoolLiquidity.html +221 -0
- package/docs/types/UserPoolTokenHoldings.html +217 -0
- package/docs/types/UserUsdHoldings.html +223 -0
- package/docs/types/VaultBalance.html +216 -0
- package/docs/types/WithdrawV2EventNode.html +208 -0
- package/docs/variables/bluefinPoolMap.html +214 -0
- package/docs/variables/cetusPoolMap.html +214 -0
- package/docs/variables/coinsList.html +220 -0
- package/docs/variables/defunctPoolsSet.html +209 -0
- package/docs/variables/doubleAssetPoolCoinMap.html +237 -0
- package/docs/variables/loopingAccountAddresses.html +219 -0
- package/docs/variables/loopingPoolCoinMap.html +233 -0
- package/docs/variables/naviAssetMap.html +215 -0
- package/docs/variables/poolIdPoolNameMap.html +218 -0
- package/docs/variables/poolInfo.html +304 -0
- package/docs/variables/singleAssetPoolCoinMap.html +229 -0
- package/docs/variables/stableCoins.html +207 -0
- package/package.json +1 -1
|
@@ -64,14 +64,13 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
64
64
|
arguments: [txb.object(receipt[0].objectId)],
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
console.log(poolinfo.poolId);
|
|
68
67
|
if (poolName === "BLUEFIN-SUI-USDC") {
|
|
69
68
|
txb.moveCall({
|
|
70
69
|
target: `${poolinfo.packageId}::alphafi_bluefin_sui_first_pool::user_deposit`,
|
|
71
70
|
typeArguments: [
|
|
72
71
|
coinsList[pool1].type,
|
|
73
72
|
coinsList[pool2].type,
|
|
74
|
-
coinsList["
|
|
73
|
+
coinsList["BLUE"].type,
|
|
75
74
|
coinsList["SUI"].type,
|
|
76
75
|
],
|
|
77
76
|
arguments: [
|
|
@@ -86,7 +85,7 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
86
85
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
87
86
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
88
87
|
txb.object(getConf().BLUEFIN_SUI_USDC_POOL),
|
|
89
|
-
txb.object(getConf().
|
|
88
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
90
89
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
91
90
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
92
91
|
],
|
|
@@ -98,7 +97,7 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
98
97
|
typeArguments: [
|
|
99
98
|
coinsList[pool1].type,
|
|
100
99
|
coinsList[pool2].type,
|
|
101
|
-
coinsList["
|
|
100
|
+
coinsList["BLUE"].type,
|
|
102
101
|
coinsList["SUI"].type,
|
|
103
102
|
],
|
|
104
103
|
arguments: [
|
|
@@ -113,7 +112,7 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
113
112
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
114
113
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
115
114
|
txb.object(getConf().BLUEFIN_SUI_BUCK_POOL),
|
|
116
|
-
txb.object(getConf().
|
|
115
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
117
116
|
txb.object(cetusPoolMap["BUCK-SUI"]),
|
|
118
117
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
119
118
|
],
|
|
@@ -125,7 +124,7 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
125
124
|
typeArguments: [
|
|
126
125
|
coinsList[pool1].type,
|
|
127
126
|
coinsList[pool2].type,
|
|
128
|
-
coinsList["
|
|
127
|
+
coinsList["BLUE"].type,
|
|
129
128
|
coinsList["SUI"].type,
|
|
130
129
|
],
|
|
131
130
|
arguments: [
|
|
@@ -140,7 +139,7 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
140
139
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
141
140
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
142
141
|
txb.object(getConf().BLUEFIN_SUI_AUSD_POOL),
|
|
143
|
-
txb.object(getConf().
|
|
142
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
144
143
|
txb.object(cetusPoolMap["AUSD-SUI"]),
|
|
145
144
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
146
145
|
],
|
|
@@ -154,6 +153,154 @@ export const depositBluefinSuiFirstTxb = async (amount, poolName, isAmountA, opt
|
|
|
154
153
|
}
|
|
155
154
|
return txb;
|
|
156
155
|
};
|
|
156
|
+
export const depositBluefinSuiSecondTxb = async (amount, poolName, isAmountA, options, transaction = undefined) => {
|
|
157
|
+
const suiClient = getSuiClient();
|
|
158
|
+
const address = options.address;
|
|
159
|
+
let txb;
|
|
160
|
+
if (transaction)
|
|
161
|
+
txb = transaction;
|
|
162
|
+
else
|
|
163
|
+
txb = new Transaction();
|
|
164
|
+
poolName = poolName.toUpperCase();
|
|
165
|
+
const pool1 = doubleAssetPoolCoinMap[poolName].coin1;
|
|
166
|
+
const pool2 = doubleAssetPoolCoinMap[poolName].coin2;
|
|
167
|
+
const receipt = await getReceipts(poolName, address, true);
|
|
168
|
+
let coins1 = [];
|
|
169
|
+
let currentCursor = null;
|
|
170
|
+
do {
|
|
171
|
+
const response = await suiClient.getCoins({
|
|
172
|
+
owner: address,
|
|
173
|
+
coinType: coinsList[pool1].type,
|
|
174
|
+
cursor: currentCursor,
|
|
175
|
+
});
|
|
176
|
+
coins1 = coins1.concat(response.data);
|
|
177
|
+
// Check if there's a next page
|
|
178
|
+
if (response.hasNextPage && response.nextCursor) {
|
|
179
|
+
currentCursor = response.nextCursor;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
// No more pages available
|
|
183
|
+
// console.log("No more receipts available.");
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
} while (true);
|
|
187
|
+
const amounts = await getAmounts(poolName, isAmountA, amount);
|
|
188
|
+
if (amounts) {
|
|
189
|
+
const amount1 = amounts[0];
|
|
190
|
+
const amount2 = amounts[1];
|
|
191
|
+
let coin1;
|
|
192
|
+
if (coins1.length >= 1) {
|
|
193
|
+
//coin1
|
|
194
|
+
[coin1] = txb.splitCoins(txb.object(coins1[0].coinObjectId), [0]);
|
|
195
|
+
txb.mergeCoins(coin1, coins1.map((c) => c.coinObjectId));
|
|
196
|
+
const [depositCoinA] = txb.splitCoins(coin1, [amount1]);
|
|
197
|
+
//coin2
|
|
198
|
+
const [depositCoinB] = txb.splitCoins(txb.gas, [amount2]);
|
|
199
|
+
const poolinfo = poolInfo[poolName];
|
|
200
|
+
let someReceipt;
|
|
201
|
+
if (receipt.length == 0) {
|
|
202
|
+
[someReceipt] = txb.moveCall({
|
|
203
|
+
target: `0x1::option::none`,
|
|
204
|
+
typeArguments: [poolinfo.receiptType],
|
|
205
|
+
arguments: [],
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
[someReceipt] = txb.moveCall({
|
|
210
|
+
target: `0x1::option::some`,
|
|
211
|
+
typeArguments: [receipt[0].content.type],
|
|
212
|
+
arguments: [txb.object(receipt[0].objectId)],
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (poolName === "BLUEFIN-BLUE-SUI") {
|
|
216
|
+
txb.moveCall({
|
|
217
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
|
|
218
|
+
typeArguments: [
|
|
219
|
+
coinsList[pool1].type,
|
|
220
|
+
coinsList[pool2].type,
|
|
221
|
+
coinsList["DEEP"].type,
|
|
222
|
+
coinsList["SUI"].type,
|
|
223
|
+
],
|
|
224
|
+
arguments: [
|
|
225
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
226
|
+
txb.object(getConf().VERSION),
|
|
227
|
+
someReceipt,
|
|
228
|
+
txb.object(poolinfo.poolId),
|
|
229
|
+
depositCoinA,
|
|
230
|
+
depositCoinB,
|
|
231
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
232
|
+
txb.object(poolinfo.investorId),
|
|
233
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
234
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
235
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
|
|
236
|
+
txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
|
|
237
|
+
txb.object(cetusPoolMap["BLUE-SUI"]),
|
|
238
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
239
|
+
],
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
else if (poolName === "BLUEFIN-WBTC-SUI") {
|
|
243
|
+
txb.moveCall({
|
|
244
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
|
|
245
|
+
typeArguments: [
|
|
246
|
+
coinsList[pool1].type,
|
|
247
|
+
coinsList[pool2].type,
|
|
248
|
+
coinsList["BLUE"].type,
|
|
249
|
+
coinsList["SUI"].type,
|
|
250
|
+
],
|
|
251
|
+
arguments: [
|
|
252
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
253
|
+
txb.object(getConf().VERSION),
|
|
254
|
+
someReceipt,
|
|
255
|
+
txb.object(poolinfo.poolId),
|
|
256
|
+
depositCoinA,
|
|
257
|
+
depositCoinB,
|
|
258
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
259
|
+
txb.object(poolinfo.investorId),
|
|
260
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
261
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
262
|
+
txb.object(getConf().BLUEFIN_WBTC_SUI_POOL),
|
|
263
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
|
|
264
|
+
txb.object(cetusPoolMap["WBTC-SUI"]),
|
|
265
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
266
|
+
],
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
else if (poolName === "BLUEFIN-DEEP-SUI") {
|
|
270
|
+
txb.moveCall({
|
|
271
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_deposit`,
|
|
272
|
+
typeArguments: [
|
|
273
|
+
coinsList[pool1].type,
|
|
274
|
+
coinsList[pool2].type,
|
|
275
|
+
coinsList["BLUE"].type,
|
|
276
|
+
coinsList["SUI"].type,
|
|
277
|
+
],
|
|
278
|
+
arguments: [
|
|
279
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
280
|
+
txb.object(getConf().VERSION),
|
|
281
|
+
someReceipt,
|
|
282
|
+
txb.object(poolinfo.poolId),
|
|
283
|
+
depositCoinA,
|
|
284
|
+
depositCoinB,
|
|
285
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
286
|
+
txb.object(poolinfo.investorId),
|
|
287
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
288
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
289
|
+
txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
|
|
290
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
|
|
291
|
+
txb.object(cetusPoolMap["DEEP-SUI"]),
|
|
292
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
293
|
+
],
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
txb.transferObjects([coin1], address);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
throw new Error(`No ${pool1} or ${pool2} Coins`);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return txb;
|
|
303
|
+
};
|
|
157
304
|
export const depositBluefinType1Txb = async (amount, poolName, isAmountA, options, transaction = undefined) => {
|
|
158
305
|
const suiClient = getSuiClient();
|
|
159
306
|
const address = options.address;
|
|
@@ -241,7 +388,7 @@ export const depositBluefinType1Txb = async (amount, poolName, isAmountA, option
|
|
|
241
388
|
typeArguments: [
|
|
242
389
|
coinsList[pool1].type,
|
|
243
390
|
coinsList[pool2].type,
|
|
244
|
-
coinsList["
|
|
391
|
+
coinsList["BLUE"].type,
|
|
245
392
|
coinsList["SUI"].type,
|
|
246
393
|
],
|
|
247
394
|
arguments: [
|
|
@@ -256,7 +403,7 @@ export const depositBluefinType1Txb = async (amount, poolName, isAmountA, option
|
|
|
256
403
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
257
404
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
258
405
|
txb.object(getConf().BLUEFIN_USDT_USDC_POOL),
|
|
259
|
-
txb.object(getConf().
|
|
406
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
260
407
|
txb.object(cetusPoolMap["USDC-USDT"]),
|
|
261
408
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
262
409
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
@@ -269,7 +416,7 @@ export const depositBluefinType1Txb = async (amount, poolName, isAmountA, option
|
|
|
269
416
|
typeArguments: [
|
|
270
417
|
coinsList[pool1].type,
|
|
271
418
|
coinsList[pool2].type,
|
|
272
|
-
coinsList["
|
|
419
|
+
coinsList["BLUE"].type,
|
|
273
420
|
coinsList["SUI"].type,
|
|
274
421
|
],
|
|
275
422
|
arguments: [
|
|
@@ -284,7 +431,7 @@ export const depositBluefinType1Txb = async (amount, poolName, isAmountA, option
|
|
|
284
431
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
285
432
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
286
433
|
txb.object(getConf().BLUEFIN_AUSD_USDC_POOL),
|
|
287
|
-
txb.object(getConf().
|
|
434
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
288
435
|
txb.object(cetusPoolMap["USDC-AUSD"]),
|
|
289
436
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
290
437
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
@@ -297,7 +444,7 @@ export const depositBluefinType1Txb = async (amount, poolName, isAmountA, option
|
|
|
297
444
|
typeArguments: [
|
|
298
445
|
coinsList[pool1].type,
|
|
299
446
|
coinsList[pool2].type,
|
|
300
|
-
coinsList["
|
|
447
|
+
coinsList["BLUE"].type,
|
|
301
448
|
coinsList["SUI"].type,
|
|
302
449
|
],
|
|
303
450
|
arguments: [
|
|
@@ -312,13 +459,41 @@ export const depositBluefinType1Txb = async (amount, poolName, isAmountA, option
|
|
|
312
459
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
313
460
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
314
461
|
txb.object(getConf().BLUEFIN_WBTC_USDC_POOL),
|
|
315
|
-
txb.object(getConf().
|
|
462
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
316
463
|
txb.object(cetusPoolMap["USDC-WBTC"]),
|
|
317
464
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
318
465
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
319
466
|
],
|
|
320
467
|
});
|
|
321
468
|
}
|
|
469
|
+
else if (poolName === "BLUEFIN-SEND-USDC") {
|
|
470
|
+
txb.moveCall({
|
|
471
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_deposit`,
|
|
472
|
+
typeArguments: [
|
|
473
|
+
coinsList[pool1].type,
|
|
474
|
+
coinsList[pool2].type,
|
|
475
|
+
coinsList["BLUE"].type,
|
|
476
|
+
coinsList["SUI"].type,
|
|
477
|
+
],
|
|
478
|
+
arguments: [
|
|
479
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
480
|
+
txb.object(getConf().VERSION),
|
|
481
|
+
someReceipt,
|
|
482
|
+
txb.object(poolinfo.poolId),
|
|
483
|
+
depositCoinA,
|
|
484
|
+
depositCoinB,
|
|
485
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
486
|
+
txb.object(poolinfo.investorId),
|
|
487
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
488
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
489
|
+
txb.object(getConf().BLUEFIN_SEND_USDC_POOL),
|
|
490
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
491
|
+
txb.object(cetusPoolMap["USDC-SEND"]),
|
|
492
|
+
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
493
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
494
|
+
],
|
|
495
|
+
});
|
|
496
|
+
}
|
|
322
497
|
txb.transferObjects([coin1], address);
|
|
323
498
|
txb.transferObjects([coin2], address);
|
|
324
499
|
}
|
|
@@ -415,7 +590,7 @@ export const depositBluefinType2Txb = async (amount, poolName, isAmountA, option
|
|
|
415
590
|
typeArguments: [
|
|
416
591
|
coinsList[pool1].type,
|
|
417
592
|
coinsList[pool2].type,
|
|
418
|
-
coinsList["
|
|
593
|
+
coinsList["BLUE"].type,
|
|
419
594
|
coinsList["SUI"].type,
|
|
420
595
|
],
|
|
421
596
|
arguments: [
|
|
@@ -430,7 +605,7 @@ export const depositBluefinType2Txb = async (amount, poolName, isAmountA, option
|
|
|
430
605
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
431
606
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
432
607
|
txb.object(getConf().BLUEFIN_ALPHA_USDC_POOL),
|
|
433
|
-
txb.object(getConf().
|
|
608
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
434
609
|
txb.object(cetusPoolMap["ALPHA-USDC"]),
|
|
435
610
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
436
611
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
@@ -443,7 +618,7 @@ export const depositBluefinType2Txb = async (amount, poolName, isAmountA, option
|
|
|
443
618
|
typeArguments: [
|
|
444
619
|
coinsList[pool1].type,
|
|
445
620
|
coinsList[pool2].type,
|
|
446
|
-
coinsList["
|
|
621
|
+
coinsList["BLUE"].type,
|
|
447
622
|
coinsList["SUI"].type,
|
|
448
623
|
],
|
|
449
624
|
arguments: [
|
|
@@ -458,13 +633,41 @@ export const depositBluefinType2Txb = async (amount, poolName, isAmountA, option
|
|
|
458
633
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
459
634
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
460
635
|
txb.object(getConf().BLUEFIN_NAVX_VSUI_POOL),
|
|
461
|
-
txb.object(getConf().
|
|
636
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
462
637
|
txb.object(cetusPoolMap["NAVX-VSUI"]),
|
|
463
638
|
txb.object(cetusPoolMap["VSUI-SUI"]),
|
|
464
639
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
465
640
|
],
|
|
466
641
|
});
|
|
467
642
|
}
|
|
643
|
+
else if (poolName === "BLUEFIN-BLUE-USDC") {
|
|
644
|
+
txb.moveCall({
|
|
645
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_deposit`,
|
|
646
|
+
typeArguments: [
|
|
647
|
+
coinsList[pool1].type,
|
|
648
|
+
coinsList[pool2].type,
|
|
649
|
+
coinsList["DEEP"].type,
|
|
650
|
+
coinsList["SUI"].type,
|
|
651
|
+
],
|
|
652
|
+
arguments: [
|
|
653
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
654
|
+
txb.object(getConf().VERSION),
|
|
655
|
+
someReceipt,
|
|
656
|
+
txb.object(poolinfo.poolId),
|
|
657
|
+
depositCoinA,
|
|
658
|
+
depositCoinB,
|
|
659
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
660
|
+
txb.object(poolinfo.investorId),
|
|
661
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
662
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
663
|
+
txb.object(getConf().BLUEFIN_BLUE_USDC_POOL),
|
|
664
|
+
txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
|
|
665
|
+
txb.object(cetusPoolMap["BLUE-USDC"]),
|
|
666
|
+
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
667
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
668
|
+
],
|
|
669
|
+
});
|
|
670
|
+
}
|
|
468
671
|
txb.transferObjects([coin1], address);
|
|
469
672
|
txb.transferObjects([coin2], address);
|
|
470
673
|
}
|
|
@@ -504,7 +707,7 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
504
707
|
typeArguments: [
|
|
505
708
|
coinsList[pool1].type,
|
|
506
709
|
coinsList[pool2].type,
|
|
507
|
-
coinsList["
|
|
710
|
+
coinsList["BLUE"].type,
|
|
508
711
|
coinsList["SUI"].type,
|
|
509
712
|
],
|
|
510
713
|
arguments: [
|
|
@@ -520,7 +723,7 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
520
723
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
521
724
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
522
725
|
txb.object(getConf().BLUEFIN_SUI_USDC_POOL),
|
|
523
|
-
txb.object(getConf().
|
|
726
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
524
727
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
525
728
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
526
729
|
],
|
|
@@ -532,7 +735,7 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
532
735
|
typeArguments: [
|
|
533
736
|
coinsList[pool1].type,
|
|
534
737
|
coinsList[pool2].type,
|
|
535
|
-
coinsList["
|
|
738
|
+
coinsList["BLUE"].type,
|
|
536
739
|
coinsList["SUI"].type,
|
|
537
740
|
],
|
|
538
741
|
arguments: [
|
|
@@ -548,7 +751,7 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
548
751
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
549
752
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
550
753
|
txb.object(getConf().BLUEFIN_SUI_BUCK_POOL),
|
|
551
|
-
txb.object(getConf().
|
|
754
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
552
755
|
txb.object(cetusPoolMap["BUCK-SUI"]),
|
|
553
756
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
554
757
|
],
|
|
@@ -560,7 +763,7 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
560
763
|
typeArguments: [
|
|
561
764
|
coinsList[pool1].type,
|
|
562
765
|
coinsList[pool2].type,
|
|
563
|
-
coinsList["
|
|
766
|
+
coinsList["BLUE"].type,
|
|
564
767
|
coinsList["SUI"].type,
|
|
565
768
|
],
|
|
566
769
|
arguments: [
|
|
@@ -576,7 +779,7 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
576
779
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
577
780
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
578
781
|
txb.object(getConf().BLUEFIN_SUI_AUSD_POOL),
|
|
579
|
-
txb.object(getConf().
|
|
782
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
580
783
|
txb.object(cetusPoolMap["AUSD-SUI"]),
|
|
581
784
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
582
785
|
],
|
|
@@ -588,6 +791,120 @@ export const withdrawBluefinSuiFirstTxb = async (xTokens, poolName, options) =>
|
|
|
588
791
|
}
|
|
589
792
|
return txb;
|
|
590
793
|
};
|
|
794
|
+
export const withdrawBluefinSuiSecondTxb = async (xTokens, poolName, options) => {
|
|
795
|
+
const address = options.address;
|
|
796
|
+
const txb = new Transaction();
|
|
797
|
+
const pool1 = doubleAssetPoolCoinMap[poolName].coin1;
|
|
798
|
+
const pool2 = doubleAssetPoolCoinMap[poolName].coin2;
|
|
799
|
+
const receipt = await getReceipts(poolName, address, true);
|
|
800
|
+
const alphaReceipt = await getReceipts("ALPHA", address, true);
|
|
801
|
+
if (receipt.length > 0) {
|
|
802
|
+
let alpha_receipt;
|
|
803
|
+
if (alphaReceipt.length == 0) {
|
|
804
|
+
[alpha_receipt] = txb.moveCall({
|
|
805
|
+
target: `0x1::option::none`,
|
|
806
|
+
typeArguments: [getConf().ALPHA_POOL_RECEIPT],
|
|
807
|
+
arguments: [],
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
else {
|
|
811
|
+
[alpha_receipt] = txb.moveCall({
|
|
812
|
+
target: `0x1::option::some`,
|
|
813
|
+
typeArguments: [alphaReceipt[0].content.type],
|
|
814
|
+
arguments: [txb.object(alphaReceipt[0].objectId)],
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
const poolinfo = poolInfo[poolName];
|
|
818
|
+
if (poolName === "BLUEFIN-BLUE-SUI") {
|
|
819
|
+
txb.moveCall({
|
|
820
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw`,
|
|
821
|
+
typeArguments: [
|
|
822
|
+
coinsList[pool1].type,
|
|
823
|
+
coinsList[pool2].type,
|
|
824
|
+
coinsList["DEEP"].type,
|
|
825
|
+
coinsList["SUI"].type,
|
|
826
|
+
],
|
|
827
|
+
arguments: [
|
|
828
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
829
|
+
txb.object(getConf().VERSION),
|
|
830
|
+
txb.object(receipt[0].objectId),
|
|
831
|
+
alpha_receipt,
|
|
832
|
+
txb.object(getConf().ALPHA_POOL),
|
|
833
|
+
txb.object(poolinfo.poolId),
|
|
834
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
835
|
+
txb.object(poolinfo.investorId),
|
|
836
|
+
txb.pure.u128(xTokens),
|
|
837
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
838
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
839
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
|
|
840
|
+
txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
|
|
841
|
+
txb.object(cetusPoolMap["BLUE-SUI"]),
|
|
842
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
843
|
+
],
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
else if (poolName === "BLUEFIN-WBTC-SUI") {
|
|
847
|
+
txb.moveCall({
|
|
848
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw`,
|
|
849
|
+
typeArguments: [
|
|
850
|
+
coinsList[pool1].type,
|
|
851
|
+
coinsList[pool2].type,
|
|
852
|
+
coinsList["BLUE"].type,
|
|
853
|
+
coinsList["SUI"].type,
|
|
854
|
+
],
|
|
855
|
+
arguments: [
|
|
856
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
857
|
+
txb.object(getConf().VERSION),
|
|
858
|
+
txb.object(receipt[0].objectId),
|
|
859
|
+
alpha_receipt,
|
|
860
|
+
txb.object(getConf().ALPHA_POOL),
|
|
861
|
+
txb.object(poolinfo.poolId),
|
|
862
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
863
|
+
txb.object(poolinfo.investorId),
|
|
864
|
+
txb.pure.u128(xTokens),
|
|
865
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
866
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
867
|
+
txb.object(getConf().BLUEFIN_WBTC_SUI_POOL),
|
|
868
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
|
|
869
|
+
txb.object(cetusPoolMap["WBTC-SUI"]),
|
|
870
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
871
|
+
],
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
else if (poolName === "BLUEFIN-DEEP-SUI") {
|
|
875
|
+
txb.moveCall({
|
|
876
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_sui_second_pool::user_withdraw`,
|
|
877
|
+
typeArguments: [
|
|
878
|
+
coinsList[pool1].type,
|
|
879
|
+
coinsList[pool2].type,
|
|
880
|
+
coinsList["BLUE"].type,
|
|
881
|
+
coinsList["SUI"].type,
|
|
882
|
+
],
|
|
883
|
+
arguments: [
|
|
884
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
885
|
+
txb.object(getConf().VERSION),
|
|
886
|
+
txb.object(receipt[0].objectId),
|
|
887
|
+
alpha_receipt,
|
|
888
|
+
txb.object(getConf().ALPHA_POOL),
|
|
889
|
+
txb.object(poolinfo.poolId),
|
|
890
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
891
|
+
txb.object(poolinfo.investorId),
|
|
892
|
+
txb.pure.u128(xTokens),
|
|
893
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
894
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
895
|
+
txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
|
|
896
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL),
|
|
897
|
+
txb.object(cetusPoolMap["DEEP-SUI"]),
|
|
898
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
899
|
+
],
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
throw new Error("No receipt found!");
|
|
905
|
+
}
|
|
906
|
+
return txb;
|
|
907
|
+
};
|
|
591
908
|
export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
592
909
|
const address = options.address;
|
|
593
910
|
const txb = new Transaction();
|
|
@@ -618,7 +935,7 @@ export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
|
618
935
|
typeArguments: [
|
|
619
936
|
coinsList[pool1].type,
|
|
620
937
|
coinsList[pool2].type,
|
|
621
|
-
coinsList["
|
|
938
|
+
coinsList["BLUE"].type,
|
|
622
939
|
coinsList["SUI"].type,
|
|
623
940
|
],
|
|
624
941
|
arguments: [
|
|
@@ -634,7 +951,7 @@ export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
|
634
951
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
635
952
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
636
953
|
txb.object(getConf().BLUEFIN_USDT_USDC_POOL),
|
|
637
|
-
txb.object(getConf().
|
|
954
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
638
955
|
txb.object(cetusPoolMap["USDC-USDT"]),
|
|
639
956
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
640
957
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
@@ -647,7 +964,7 @@ export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
|
647
964
|
typeArguments: [
|
|
648
965
|
coinsList[pool1].type,
|
|
649
966
|
coinsList[pool2].type,
|
|
650
|
-
coinsList["
|
|
967
|
+
coinsList["BLUE"].type,
|
|
651
968
|
coinsList["SUI"].type,
|
|
652
969
|
],
|
|
653
970
|
arguments: [
|
|
@@ -663,7 +980,7 @@ export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
|
663
980
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
664
981
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
665
982
|
txb.object(getConf().BLUEFIN_AUSD_USDC_POOL),
|
|
666
|
-
txb.object(getConf().
|
|
983
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
667
984
|
txb.object(cetusPoolMap["USDC-AUSD"]),
|
|
668
985
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
669
986
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
@@ -676,7 +993,7 @@ export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
|
676
993
|
typeArguments: [
|
|
677
994
|
coinsList[pool1].type,
|
|
678
995
|
coinsList[pool2].type,
|
|
679
|
-
coinsList["
|
|
996
|
+
coinsList["BLUE"].type,
|
|
680
997
|
coinsList["SUI"].type,
|
|
681
998
|
],
|
|
682
999
|
arguments: [
|
|
@@ -692,13 +1009,42 @@ export const withdrawBluefinType1Txb = async (xTokens, poolName, options) => {
|
|
|
692
1009
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
693
1010
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
694
1011
|
txb.object(getConf().BLUEFIN_WBTC_USDC_POOL),
|
|
695
|
-
txb.object(getConf().
|
|
1012
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
696
1013
|
txb.object(cetusPoolMap["USDC-WBTC"]),
|
|
697
1014
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
698
1015
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
699
1016
|
],
|
|
700
1017
|
});
|
|
701
1018
|
}
|
|
1019
|
+
else if (poolName === "BLUEFIN-SEND-USDC") {
|
|
1020
|
+
txb.moveCall({
|
|
1021
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_type_1_pool::user_withdraw`,
|
|
1022
|
+
typeArguments: [
|
|
1023
|
+
coinsList[pool1].type,
|
|
1024
|
+
coinsList[pool2].type,
|
|
1025
|
+
coinsList["BLUE"].type,
|
|
1026
|
+
coinsList["SUI"].type,
|
|
1027
|
+
],
|
|
1028
|
+
arguments: [
|
|
1029
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
1030
|
+
txb.object(getConf().VERSION),
|
|
1031
|
+
txb.object(receipt[0].objectId),
|
|
1032
|
+
alpha_receipt,
|
|
1033
|
+
txb.object(getConf().ALPHA_POOL),
|
|
1034
|
+
txb.object(poolinfo.poolId),
|
|
1035
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
1036
|
+
txb.object(poolinfo.investorId),
|
|
1037
|
+
txb.pure.u128(xTokens),
|
|
1038
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
1039
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
1040
|
+
txb.object(getConf().BLUEFIN_SEND_USDC_POOL),
|
|
1041
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
1042
|
+
txb.object(cetusPoolMap["USDC-SEND"]),
|
|
1043
|
+
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
1044
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
1045
|
+
],
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
702
1048
|
}
|
|
703
1049
|
else {
|
|
704
1050
|
throw new Error("No receipt found!");
|
|
@@ -735,7 +1081,7 @@ export const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
|
|
|
735
1081
|
typeArguments: [
|
|
736
1082
|
coinsList[pool1].type,
|
|
737
1083
|
coinsList[pool2].type,
|
|
738
|
-
coinsList["
|
|
1084
|
+
coinsList["BLUE"].type,
|
|
739
1085
|
coinsList["SUI"].type,
|
|
740
1086
|
],
|
|
741
1087
|
arguments: [
|
|
@@ -751,7 +1097,7 @@ export const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
|
|
|
751
1097
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
752
1098
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
753
1099
|
txb.object(getConf().BLUEFIN_ALPHA_USDC_POOL),
|
|
754
|
-
txb.object(getConf().
|
|
1100
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
755
1101
|
txb.object(cetusPoolMap["ALPHA-USDC"]),
|
|
756
1102
|
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
757
1103
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
@@ -764,7 +1110,7 @@ export const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
|
|
|
764
1110
|
typeArguments: [
|
|
765
1111
|
coinsList[pool1].type,
|
|
766
1112
|
coinsList[pool2].type,
|
|
767
|
-
coinsList["
|
|
1113
|
+
coinsList["BLUE"].type,
|
|
768
1114
|
coinsList["SUI"].type,
|
|
769
1115
|
],
|
|
770
1116
|
arguments: [
|
|
@@ -780,13 +1126,42 @@ export const withdrawBluefinType2Txb = async (xTokens, poolName, options) => {
|
|
|
780
1126
|
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
781
1127
|
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
782
1128
|
txb.object(getConf().BLUEFIN_NAVX_VSUI_POOL),
|
|
783
|
-
txb.object(getConf().
|
|
1129
|
+
txb.object(getConf().BLUEFIN_BLUE_SUI_POOL_AUTOCOMPOUND),
|
|
784
1130
|
txb.object(cetusPoolMap["NAVX-VSUI"]),
|
|
785
1131
|
txb.object(cetusPoolMap["VSUI-SUI"]),
|
|
786
1132
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
787
1133
|
],
|
|
788
1134
|
});
|
|
789
1135
|
}
|
|
1136
|
+
else if (poolName === "BLUEFIN-BLUE-USDC") {
|
|
1137
|
+
txb.moveCall({
|
|
1138
|
+
target: `${poolinfo.packageId}::alphafi_bluefin_type_2_pool::user_withdraw`,
|
|
1139
|
+
typeArguments: [
|
|
1140
|
+
coinsList[pool1].type,
|
|
1141
|
+
coinsList[pool2].type,
|
|
1142
|
+
coinsList["DEEP"].type,
|
|
1143
|
+
coinsList["SUI"].type,
|
|
1144
|
+
],
|
|
1145
|
+
arguments: [
|
|
1146
|
+
txb.object(getConf().ALPHA_4_VERSION),
|
|
1147
|
+
txb.object(getConf().VERSION),
|
|
1148
|
+
txb.object(receipt[0].objectId),
|
|
1149
|
+
alpha_receipt,
|
|
1150
|
+
txb.object(getConf().ALPHA_POOL),
|
|
1151
|
+
txb.object(poolinfo.poolId),
|
|
1152
|
+
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
1153
|
+
txb.object(poolinfo.investorId),
|
|
1154
|
+
txb.pure.u128(xTokens),
|
|
1155
|
+
txb.object(getConf().BLUEFIN_GLOBAL_CONFIG),
|
|
1156
|
+
txb.object(getConf().CETUS_GLOBAL_CONFIG_ID),
|
|
1157
|
+
txb.object(getConf().BLUEFIN_BLUE_USDC_POOL),
|
|
1158
|
+
txb.object(getConf().BLUEFIN_DEEP_SUI_POOL),
|
|
1159
|
+
txb.object(cetusPoolMap["BLUE-USDC"]),
|
|
1160
|
+
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
1161
|
+
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
1162
|
+
],
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
790
1165
|
}
|
|
791
1166
|
else {
|
|
792
1167
|
throw new Error("No receipt found!");
|