@alphafi/alphafi-sdk 0.0.91 → 0.0.93
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/#package.json# +98 -0
- package/dist/cjs/adminFunctions.d.ts.map +1 -1
- package/dist/cjs/common/coins.d.ts.map +1 -1
- package/dist/cjs/common/coins.js +18 -0
- package/dist/cjs/common/coins.js.map +1 -1
- package/dist/cjs/common/constants.d.ts +21 -0
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +15 -2
- package/dist/cjs/common/constants.js.map +1 -1
- package/dist/cjs/common/maps.d.ts +1 -0
- package/dist/cjs/common/maps.d.ts.map +1 -1
- package/dist/cjs/common/maps.js +65 -4
- package/dist/cjs/common/maps.js.map +1 -1
- package/dist/cjs/common/pyth.d.ts +1 -1
- package/dist/cjs/common/pyth.d.ts.map +1 -1
- package/dist/cjs/common/pyth.js.map +1 -1
- package/dist/cjs/common/types.d.ts +17 -21
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js +0 -17
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/graphql/client.d.ts +1 -1
- package/dist/cjs/graphql/client.d.ts.map +1 -1
- package/dist/cjs/graphql/executeMutations.d.ts +15 -3
- package/dist/cjs/graphql/executeMutations.d.ts.map +1 -1
- package/dist/cjs/graphql/executeMutations.js +6 -0
- package/dist/cjs/graphql/executeMutations.js.map +1 -1
- package/dist/cjs/graphql/fetchData.d.ts +23 -7
- package/dist/cjs/graphql/fetchData.d.ts.map +1 -1
- package/dist/cjs/graphql/fetchData.js +11 -11
- package/dist/cjs/graphql/fetchData.js.map +1 -1
- package/dist/cjs/graphql/fetchNftHolders.d.ts.map +1 -1
- package/dist/cjs/graphql/fetchNftHolders.js +3 -1
- package/dist/cjs/graphql/fetchNftHolders.js.map +1 -1
- package/dist/cjs/graphql/fetchReceipts.d.ts.map +1 -1
- package/dist/cjs/graphql/fetchReceipts.js +3 -1
- package/dist/cjs/graphql/fetchReceipts.js.map +1 -1
- package/dist/cjs/graphql/getMultiReceipts.d.ts.map +1 -1
- package/dist/cjs/graphql/getMultiReceipts.js +7 -2
- package/dist/cjs/graphql/getMultiReceipts.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 +6 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sui-sdk/client.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +9 -3
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +1 -0
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +2 -2
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/cjs/transactions/7k.d.ts +2 -7
- package/dist/cjs/transactions/7k.d.ts.map +1 -1
- package/dist/cjs/transactions/7k.js +18 -31
- package/dist/cjs/transactions/7k.js.map +1 -1
- package/dist/cjs/transactions/alpha.d.ts.map +1 -1
- package/dist/cjs/transactions/alphalend.d.ts +1 -0
- package/dist/cjs/transactions/alphalend.d.ts.map +1 -1
- package/dist/cjs/transactions/alphalend.js +148 -201
- package/dist/cjs/transactions/alphalend.js.map +1 -1
- package/dist/cjs/transactions/blueRewards.js +17 -7
- package/dist/cjs/transactions/blueRewards.js.map +1 -1
- package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
- package/dist/cjs/transactions/cetus.d.ts.map +1 -1
- package/dist/cjs/transactions/collect_rewards.d.ts.map +1 -1
- package/dist/cjs/transactions/collect_rewards.js +1 -3
- package/dist/cjs/transactions/collect_rewards.js.map +1 -1
- package/dist/cjs/transactions/get_navi_rewards.d.ts +2 -0
- package/dist/cjs/transactions/get_navi_rewards.d.ts.map +1 -0
- package/dist/cjs/transactions/get_navi_rewards.js +42 -0
- package/dist/cjs/transactions/get_navi_rewards.js.map +1 -0
- package/dist/cjs/transactions/navi-looping.d.ts.map +1 -1
- package/dist/cjs/transactions/navi-looping.js +79 -79
- 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 +142 -141
- package/dist/cjs/transactions/navi.js.map +1 -1
- package/dist/cjs/transactions/newZapDeposit.d.ts +15 -0
- package/dist/cjs/transactions/newZapDeposit.d.ts.map +1 -0
- package/dist/cjs/transactions/newZapDeposit.js +1775 -0
- package/dist/cjs/transactions/newZapDeposit.js.map +1 -0
- package/dist/cjs/transactions/zapDeposit.d.ts +3 -3
- package/dist/cjs/transactions/zapDeposit.d.ts.map +1 -1
- package/dist/cjs/transactions/zapDeposit.js +1043 -503
- package/dist/cjs/transactions/zapDeposit.js.map +1 -1
- package/dist/cjs/utils/clmm/prices.d.ts.map +1 -1
- package/dist/cjs/utils/clmm/prices.js +4 -0
- package/dist/cjs/utils/clmm/prices.js.map +1 -1
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.d.ts +0 -1
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.d.ts.map +1 -1
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.js +0 -1
- package/dist/cjs/utils/clmm/tokenAmountFromLiquidity.js.map +1 -1
- package/dist/cjs/utils/getReceipts.js +1 -1
- package/dist/cjs/utils/getReceipts.js.map +1 -1
- package/dist/cjs/utils/prices.js +2 -2
- package/dist/cjs/utils/prices.js.map +1 -1
- package/dist/esm/adminFunctions.d.ts.map +1 -1
- package/dist/esm/common/coins.d.ts.map +1 -1
- package/dist/esm/common/coins.js +18 -0
- package/dist/esm/common/coins.js.map +1 -1
- package/dist/esm/common/constants.d.ts +21 -0
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +15 -2
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/maps.d.ts +1 -0
- package/dist/esm/common/maps.d.ts.map +1 -1
- package/dist/esm/common/maps.js +65 -4
- package/dist/esm/common/maps.js.map +1 -1
- package/dist/esm/common/pyth.d.ts +1 -1
- package/dist/esm/common/pyth.d.ts.map +1 -1
- package/dist/esm/common/pyth.js.map +1 -1
- package/dist/esm/common/types.d.ts +17 -21
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js +1 -17
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/graphql/client.d.ts +1 -1
- package/dist/esm/graphql/client.d.ts.map +1 -1
- package/dist/esm/graphql/executeMutations.d.ts +15 -3
- package/dist/esm/graphql/executeMutations.d.ts.map +1 -1
- package/dist/esm/graphql/executeMutations.js +6 -0
- package/dist/esm/graphql/executeMutations.js.map +1 -1
- package/dist/esm/graphql/fetchData.d.ts +23 -7
- package/dist/esm/graphql/fetchData.d.ts.map +1 -1
- package/dist/esm/graphql/fetchData.js +11 -11
- package/dist/esm/graphql/fetchData.js.map +1 -1
- package/dist/esm/graphql/fetchNftHolders.d.ts.map +1 -1
- package/dist/esm/graphql/fetchNftHolders.js +3 -1
- package/dist/esm/graphql/fetchNftHolders.js.map +1 -1
- package/dist/esm/graphql/fetchReceipts.d.ts.map +1 -1
- package/dist/esm/graphql/fetchReceipts.js +3 -1
- package/dist/esm/graphql/fetchReceipts.js.map +1 -1
- package/dist/esm/graphql/getMultiReceipts.d.ts.map +1 -1
- package/dist/esm/graphql/getMultiReceipts.js +7 -2
- package/dist/esm/graphql/getMultiReceipts.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/client.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +9 -3
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts +1 -0
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +2 -2
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/esm/transactions/7k.d.ts +2 -7
- package/dist/esm/transactions/7k.d.ts.map +1 -1
- package/dist/esm/transactions/7k.js +19 -32
- package/dist/esm/transactions/7k.js.map +1 -1
- package/dist/esm/transactions/alpha.d.ts.map +1 -1
- package/dist/esm/transactions/alphalend.d.ts +1 -0
- package/dist/esm/transactions/alphalend.d.ts.map +1 -1
- package/dist/esm/transactions/alphalend.js +147 -201
- package/dist/esm/transactions/alphalend.js.map +1 -1
- package/dist/esm/transactions/bluefin.d.ts.map +1 -1
- package/dist/esm/transactions/cetus.d.ts.map +1 -1
- package/dist/esm/transactions/collect_rewards.d.ts.map +1 -1
- package/dist/esm/transactions/collect_rewards.js +1 -3
- package/dist/esm/transactions/collect_rewards.js.map +1 -1
- package/dist/esm/transactions/get_navi_rewards.d.ts +2 -0
- package/dist/esm/transactions/get_navi_rewards.d.ts.map +1 -0
- package/dist/esm/transactions/get_navi_rewards.js +39 -0
- package/dist/esm/transactions/get_navi_rewards.js.map +1 -0
- package/dist/esm/transactions/navi-looping.d.ts.map +1 -1
- package/dist/esm/transactions/navi-looping.js +79 -79
- 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 +142 -141
- package/dist/esm/transactions/navi.js.map +1 -1
- package/dist/esm/transactions/newZapDeposit.d.ts +15 -0
- package/dist/esm/transactions/newZapDeposit.d.ts.map +1 -0
- package/dist/esm/transactions/newZapDeposit.js +1771 -0
- package/dist/esm/transactions/newZapDeposit.js.map +1 -0
- package/dist/esm/transactions/zapDeposit.d.ts +3 -3
- package/dist/esm/transactions/zapDeposit.d.ts.map +1 -1
- package/dist/esm/transactions/zapDeposit.js +1043 -502
- package/dist/esm/transactions/zapDeposit.js.map +1 -1
- package/dist/esm/utils/clmm/prices.d.ts.map +1 -1
- package/dist/esm/utils/clmm/prices.js +4 -0
- package/dist/esm/utils/clmm/prices.js.map +1 -1
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.d.ts +0 -1
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.d.ts.map +1 -1
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.js +0 -1
- package/dist/esm/utils/clmm/tokenAmountFromLiquidity.js.map +1 -1
- package/dist/esm/utils/getReceipts.js +1 -1
- package/dist/esm/utils/getReceipts.js.map +1 -1
- package/dist/esm/utils/prices.js +2 -2
- package/dist/esm/utils/prices.js.map +1 -1
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +5 -5
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1428 -1288
- package/docs/functions/alphaLpBreakdown.html +1 -1
- package/docs/functions/cetusLpBreakdown.html +1 -1
- package/docs/functions/claimRewardTxb.html +1 -1
- package/docs/functions/claimRewardsTxb.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/collectAndSwapRewardsSingleLoop.html +1 -0
- package/docs/functions/collectRewardTxb.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/fetchRequiredPrices.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/lastAutocompoundTime.html +1 -1
- package/docs/functions/liquidityToTokens.html +1 -1
- package/docs/functions/migrateBoostedToLoop.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/pendingRewardAmount.html +1 -1
- package/docs/functions/setCustomSuiClient.html +3 -3
- 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/zapDepositQuoteTxb.html +1 -0
- package/docs/functions/zapDepositTxb.html +1 -1
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +19 -19
- package/docs/interfaces/Coin.html +10 -10
- package/docs/interfaces/CoinPair.html +3 -3
- package/docs/interfaces/CommonEventAttributes.html +7 -7
- package/docs/interfaces/NaviVoloData.html +3 -3
- package/docs/interfaces/PoolData.html +8 -8
- package/docs/interfaces/PoolWeightDistribution.html +4 -4
- package/docs/interfaces/RebalanceHistoryType.html +9 -9
- package/docs/modules.html +1 -206
- package/docs/types/AfterTransactionEventNode.html +1 -1
- package/docs/types/AirdropClaimEventNode.html +1 -1
- package/docs/types/Allocator.html +3 -1
- package/docs/types/AlphaFiDoubleAssetVault.html +9 -1
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
- package/docs/types/AlphaFiSingleAssetVault.html +7 -1
- package/docs/types/AlphaFiVault.html +1 -1
- package/docs/types/AlphaFiVaultBalance.html +1 -1
- package/docs/types/AlphaLendInvestor.html +1 -1
- package/docs/types/AlphaPoolType.html +5 -1
- package/docs/types/AlphaReceipt.html +4 -1
- package/docs/types/AlphaReceiptFields.html +11 -1
- package/docs/types/AlphaVaultBalance.html +7 -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 +5 -1
- package/docs/types/BucketInvestor.html +2 -1
- package/docs/types/CetusInvestor.html +2 -1
- package/docs/types/CetusPoolType.html +5 -1
- package/docs/types/CetusSwapOptions.html +1 -1
- package/docs/types/CoinAmounts.html +3 -1
- package/docs/types/CoinName.html +1 -1
- package/docs/types/CoinType.html +1 -1
- package/docs/types/CommonInvestorFields.html +6 -1
- package/docs/types/CreatePoolOptions.html +8 -1
- package/docs/types/Distributor.html +6 -1
- package/docs/types/DoubleAssetMultiVaultBalance.html +6 -1
- package/docs/types/DoubleAssetPoolNames.html +1 -1
- package/docs/types/DoubleAssetTokenHoldings.html +5 -1
- package/docs/types/DoubleAssetVaultBalance.html +4 -1
- package/docs/types/EventCategory.html +1 -1
- package/docs/types/EventNode.html +1 -1
- package/docs/types/GetHoldersParams.html +4 -1
- package/docs/types/GetTokenHoldingsParams.html +4 -1
- package/docs/types/GetUserTokensFromTransactionsParams.html +5 -1
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +6 -1
- package/docs/types/GetVaultBalanceParams.html +1 -1
- package/docs/types/HoldingsObj.html +4 -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 +3 -1
- package/docs/types/LiquidityToUsdParams.html +6 -1
- package/docs/types/LoopingDebt.html +5 -1
- package/docs/types/LoopingPoolNames.html +1 -1
- package/docs/types/LpBreakdownType.html +6 -1
- package/docs/types/MemberPoolDataType.html +3 -1
- package/docs/types/MemberType.html +3 -1
- package/docs/types/MultiGetVaultBalancesParams.html +4 -1
- package/docs/types/NaviInvestor.html +2 -1
- package/docs/types/OtherReceiptFields.html +9 -1
- package/docs/types/PoolName.html +1 -1
- package/docs/types/PoolReceipt.html +1 -1
- package/docs/types/PoolType.html +5 -1
- package/docs/types/Receipt.html +5 -1
- package/docs/types/ReceiptGQL.html +6 -1
- package/docs/types/SingleAssetMultiVaultBalance.html +5 -1
- package/docs/types/SingleAssetPoolNames.html +1 -1
- package/docs/types/SingleAssetTokenHoldings.html +4 -1
- package/docs/types/SingleAssetVaultBalance.html +3 -1
- package/docs/types/SingleGetVaultBalancesParams.html +3 -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 +3 -1
- package/docs/types/TransactionBlockType.html +6 -1
- package/docs/types/UserPoolLiquidity.html +4 -1
- package/docs/types/UserPoolTokenHoldings.html +1 -1
- package/docs/types/UserUsdHoldings.html +4 -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/AUTOBALANCE_SUI_FIRST_POOLS.html +1 -1
- package/docs/variables/AUTOBALANCE_SUI_SECOND_POOLS.html +1 -1
- package/docs/variables/AUTOBALANCE_TYPE_1_POOLS.html +1 -1
- package/docs/variables/alphalendMarketIdMap.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/eslint.config.js +53 -0
- package/package.json +39 -23
- package/scripts/package-lock.json +2506 -0
- package/scripts/package.json +30 -0
- package/scripts/testRun.ts +101 -0
- package/scripts/utils.ts +104 -0
- package/docs/functions/getZapAmounts.html +0 -1
|
@@ -5,8 +5,7 @@ import { getReceipts } from "../sui-sdk/functions/getReceipts.js";
|
|
|
5
5
|
import { getConf } from "../common/constants.js";
|
|
6
6
|
import { getSuiClient } from "../sui-sdk/client.js";
|
|
7
7
|
import { updateSingleTokenPrice } from "./naviOracle.js";
|
|
8
|
-
import { getAvailableRewards } from "
|
|
9
|
-
// import { getAvailableRewards } from "navi-sdk";
|
|
8
|
+
import { getAvailableRewards } from "./get_navi_rewards.js";
|
|
10
9
|
export async function naviDepositTx(amount, poolName, options) {
|
|
11
10
|
const C = getConf();
|
|
12
11
|
const suiClient = getSuiClient();
|
|
@@ -33,12 +32,12 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
const [depositCoin] = txb.splitCoins(txb.gas, [amount]);
|
|
36
|
-
const claimableRewards = await getAvailableRewards(
|
|
35
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_SUI_ACCOUNT_ADDRESS);
|
|
37
36
|
if (claimableRewards) {
|
|
38
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
39
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
37
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
38
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
40
39
|
: []) {
|
|
41
|
-
if (reward.
|
|
40
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
42
41
|
txb.moveCall({
|
|
43
42
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap_bluefin`,
|
|
44
43
|
typeArguments: [
|
|
@@ -58,7 +57,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
58
57
|
],
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
|
-
else if (reward.
|
|
60
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
62
61
|
txb.moveCall({
|
|
63
62
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap`,
|
|
64
63
|
typeArguments: [
|
|
@@ -140,12 +139,12 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
140
139
|
});
|
|
141
140
|
}
|
|
142
141
|
if (singleAssetPoolCoinMap[poolName].coin == "VSUI") {
|
|
143
|
-
const claimableRewards = await getAvailableRewards(
|
|
142
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_VSUI_ACCOUNT_ADDRESS);
|
|
144
143
|
if (claimableRewards) {
|
|
145
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
146
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
144
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
145
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
147
146
|
: []) {
|
|
148
|
-
if (reward.
|
|
147
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
149
148
|
txb.moveCall({
|
|
150
149
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
151
150
|
typeArguments: [
|
|
@@ -167,7 +166,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
167
166
|
],
|
|
168
167
|
});
|
|
169
168
|
}
|
|
170
|
-
else if (reward.
|
|
169
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
171
170
|
txb.moveCall({
|
|
172
171
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_no_swap`,
|
|
173
172
|
typeArguments: [
|
|
@@ -210,12 +209,12 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
210
209
|
}
|
|
211
210
|
else if (singleAssetPoolCoinMap[poolName].coin == "WETH" ||
|
|
212
211
|
singleAssetPoolCoinMap[poolName].coin == "USDT") {
|
|
213
|
-
const claimableRewards = await getAvailableRewards(
|
|
212
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
214
213
|
if (claimableRewards) {
|
|
215
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
216
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
214
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
215
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
217
216
|
: []) {
|
|
218
|
-
if (reward.
|
|
217
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
219
218
|
txb.moveCall({
|
|
220
219
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
221
220
|
typeArguments: [
|
|
@@ -239,7 +238,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
239
238
|
],
|
|
240
239
|
});
|
|
241
240
|
}
|
|
242
|
-
else if (reward.
|
|
241
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
243
242
|
txb.moveCall({
|
|
244
243
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
245
244
|
typeArguments: [
|
|
@@ -288,12 +287,12 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
288
287
|
});
|
|
289
288
|
}
|
|
290
289
|
else if (singleAssetPoolCoinMap[poolName].coin == "WUSDC") {
|
|
291
|
-
const claimableRewards = await getAvailableRewards(
|
|
290
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
292
291
|
if (claimableRewards) {
|
|
293
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
294
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
292
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
293
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
295
294
|
: []) {
|
|
296
|
-
if (reward.
|
|
295
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
297
296
|
txb.moveCall({
|
|
298
297
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
299
298
|
typeArguments: [
|
|
@@ -315,7 +314,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
315
314
|
],
|
|
316
315
|
});
|
|
317
316
|
}
|
|
318
|
-
else if (reward.
|
|
317
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
319
318
|
txb.moveCall({
|
|
320
319
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin_v2`,
|
|
321
320
|
typeArguments: [
|
|
@@ -362,12 +361,12 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
362
361
|
});
|
|
363
362
|
}
|
|
364
363
|
else if (singleAssetPoolCoinMap[poolName].coin == "USDC") {
|
|
365
|
-
const claimableRewards = await getAvailableRewards(
|
|
364
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
366
365
|
if (claimableRewards) {
|
|
367
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
368
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
366
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
367
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
369
368
|
: []) {
|
|
370
|
-
if (reward.
|
|
369
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
371
370
|
txb.moveCall({
|
|
372
371
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
373
372
|
typeArguments: [
|
|
@@ -389,7 +388,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
389
388
|
],
|
|
390
389
|
});
|
|
391
390
|
}
|
|
392
|
-
else if (reward.
|
|
391
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
393
392
|
txb.moveCall({
|
|
394
393
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
395
394
|
typeArguments: [
|
|
@@ -436,12 +435,12 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
436
435
|
});
|
|
437
436
|
}
|
|
438
437
|
else if (singleAssetPoolCoinMap[poolName].coin == "USDY") {
|
|
439
|
-
const claimableRewards = await getAvailableRewards(
|
|
438
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
440
439
|
if (claimableRewards) {
|
|
441
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
442
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
440
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
441
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
443
442
|
: []) {
|
|
444
|
-
if (reward.
|
|
443
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
445
444
|
txb.moveCall({
|
|
446
445
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
447
446
|
typeArguments: [
|
|
@@ -465,7 +464,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
465
464
|
],
|
|
466
465
|
});
|
|
467
466
|
}
|
|
468
|
-
else if (reward.
|
|
467
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
469
468
|
txb.moveCall({
|
|
470
469
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
471
470
|
typeArguments: [
|
|
@@ -515,10 +514,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
515
514
|
}
|
|
516
515
|
else if (singleAssetPoolCoinMap[poolName].coin == "AUSD" ||
|
|
517
516
|
singleAssetPoolCoinMap[poolName].coin == "ETH") {
|
|
518
|
-
const claimableRewards = await getAvailableRewards(
|
|
517
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
519
518
|
if (claimableRewards) {
|
|
520
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
521
|
-
if (reward.
|
|
519
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
520
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
522
521
|
txb.moveCall({
|
|
523
522
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
524
523
|
typeArguments: [
|
|
@@ -535,7 +534,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
535
534
|
],
|
|
536
535
|
});
|
|
537
536
|
}
|
|
538
|
-
else if (reward.
|
|
537
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
539
538
|
txb.moveCall({
|
|
540
539
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps_bluefin`,
|
|
541
540
|
typeArguments: [
|
|
@@ -585,10 +584,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
585
584
|
});
|
|
586
585
|
}
|
|
587
586
|
else if (poolName === "NAVI-NS") {
|
|
588
|
-
const claimableRewards = await getAvailableRewards(
|
|
587
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_NS_ACCOUNT_ADDRESS);
|
|
589
588
|
if (claimableRewards) {
|
|
590
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
591
|
-
if (reward.
|
|
589
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
590
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
592
591
|
txb.moveCall({
|
|
593
592
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
594
593
|
typeArguments: [
|
|
@@ -609,7 +608,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
609
608
|
],
|
|
610
609
|
});
|
|
611
610
|
}
|
|
612
|
-
else if (reward.
|
|
611
|
+
else if (reward.rewardCoinType === coinsList["DEEP"].type) {
|
|
613
612
|
txb.moveCall({
|
|
614
613
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
615
614
|
typeArguments: [
|
|
@@ -630,7 +629,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
630
629
|
],
|
|
631
630
|
});
|
|
632
631
|
}
|
|
633
|
-
else if (reward.
|
|
632
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
634
633
|
txb.moveCall({
|
|
635
634
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
636
635
|
typeArguments: [
|
|
@@ -652,7 +651,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
652
651
|
],
|
|
653
652
|
});
|
|
654
653
|
}
|
|
655
|
-
else if (reward.
|
|
654
|
+
else if (reward.rewardCoinType === coinsList["NS"].type) {
|
|
656
655
|
txb.moveCall({
|
|
657
656
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
658
657
|
typeArguments: [
|
|
@@ -721,10 +720,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
721
720
|
});
|
|
722
721
|
}
|
|
723
722
|
else if (poolName === "NAVI-NAVX") {
|
|
724
|
-
const claimableRewards = await getAvailableRewards(
|
|
723
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_NAVX_ACCOUNT_ADDRESS);
|
|
725
724
|
if (claimableRewards) {
|
|
726
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
727
|
-
if (reward.
|
|
725
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
726
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
728
727
|
txb.moveCall({
|
|
729
728
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
730
729
|
typeArguments: [
|
|
@@ -741,7 +740,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
741
740
|
],
|
|
742
741
|
});
|
|
743
742
|
}
|
|
744
|
-
else if (reward.
|
|
743
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
745
744
|
txb.moveCall({
|
|
746
745
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
747
746
|
typeArguments: [
|
|
@@ -815,10 +814,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
815
814
|
});
|
|
816
815
|
}
|
|
817
816
|
else if (poolName === "NAVI-STSUI") {
|
|
818
|
-
const claimableRewards = await getAvailableRewards(
|
|
817
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_STSUI_ACCOUNT_ADDRESS);
|
|
819
818
|
if (claimableRewards) {
|
|
820
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
821
|
-
if (reward.
|
|
819
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
820
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
822
821
|
txb.moveCall({
|
|
823
822
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
824
823
|
typeArguments: [
|
|
@@ -835,7 +834,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
835
834
|
],
|
|
836
835
|
});
|
|
837
836
|
}
|
|
838
|
-
else if (reward.
|
|
837
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
839
838
|
txb.moveCall({
|
|
840
839
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
841
840
|
typeArguments: [
|
|
@@ -857,7 +856,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
857
856
|
],
|
|
858
857
|
});
|
|
859
858
|
}
|
|
860
|
-
else if (reward.
|
|
859
|
+
else if (reward.rewardCoinType === coinsList["STSUI"].type) {
|
|
861
860
|
txb.moveCall({
|
|
862
861
|
target: `${poolData.packageId}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
863
862
|
typeArguments: [coinsList["STSUI"].type],
|
|
@@ -924,10 +923,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
924
923
|
});
|
|
925
924
|
}
|
|
926
925
|
else if (poolName === "NAVI-SUIBTC") {
|
|
927
|
-
const claimableRewards = await getAvailableRewards(
|
|
926
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_SUIBTC_ACCOUNT_ADDRESS);
|
|
928
927
|
if (claimableRewards) {
|
|
929
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
930
|
-
if (reward.
|
|
928
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
929
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
931
930
|
txb.moveCall({
|
|
932
931
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
933
932
|
typeArguments: [
|
|
@@ -949,7 +948,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
949
948
|
],
|
|
950
949
|
});
|
|
951
950
|
}
|
|
952
|
-
else if (reward.
|
|
951
|
+
else if (reward.rewardCoinType === coinsList["DEEP"].type) {
|
|
953
952
|
txb.moveCall({
|
|
954
953
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
955
954
|
typeArguments: [
|
|
@@ -971,7 +970,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
971
970
|
],
|
|
972
971
|
});
|
|
973
972
|
}
|
|
974
|
-
else if (reward.
|
|
973
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
975
974
|
txb.moveCall({
|
|
976
975
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
977
976
|
typeArguments: [
|
|
@@ -1050,10 +1049,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
1050
1049
|
});
|
|
1051
1050
|
}
|
|
1052
1051
|
else if (poolName === "NAVI-SUIUSDT") {
|
|
1053
|
-
const claimableRewards = await getAvailableRewards(
|
|
1052
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_SUIUSDT_ACCOUNT_ADDRESS);
|
|
1054
1053
|
if (claimableRewards) {
|
|
1055
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1056
|
-
if (reward.
|
|
1054
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1055
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1057
1056
|
txb.moveCall({
|
|
1058
1057
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1059
1058
|
typeArguments: [
|
|
@@ -1070,7 +1069,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
1070
1069
|
],
|
|
1071
1070
|
});
|
|
1072
1071
|
}
|
|
1073
|
-
else if (reward.
|
|
1072
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1074
1073
|
txb.moveCall({
|
|
1075
1074
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps`,
|
|
1076
1075
|
typeArguments: [
|
|
@@ -1120,15 +1119,15 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
1120
1119
|
});
|
|
1121
1120
|
}
|
|
1122
1121
|
else if (singleAssetPoolCoinMap[poolName].coin == "WAL") {
|
|
1123
|
-
const claimableRewards = await getAvailableRewards(
|
|
1122
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1124
1123
|
if (claimableRewards) {
|
|
1125
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1124
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1126
1125
|
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type.substring(2)]
|
|
1127
1126
|
: [
|
|
1128
|
-
{
|
|
1129
|
-
{
|
|
1127
|
+
{ rewardCoinType: coinsList["WAL"].type },
|
|
1128
|
+
{ rewardCoinType: coinsList["VSUI"].type },
|
|
1130
1129
|
]) {
|
|
1131
|
-
if (reward.
|
|
1130
|
+
if (reward.rewardCoinType === coinsList["WAL"].type) {
|
|
1132
1131
|
txb.moveCall({
|
|
1133
1132
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1134
1133
|
typeArguments: [
|
|
@@ -1145,7 +1144,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
1145
1144
|
],
|
|
1146
1145
|
});
|
|
1147
1146
|
}
|
|
1148
|
-
else if (reward.
|
|
1147
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1149
1148
|
txb.moveCall({
|
|
1150
1149
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
1151
1150
|
typeArguments: [
|
|
@@ -1193,10 +1192,10 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
1193
1192
|
});
|
|
1194
1193
|
}
|
|
1195
1194
|
else if (singleAssetPoolCoinMap[poolName].coin == "DEEP") {
|
|
1196
|
-
const claimableRewards = await getAvailableRewards(
|
|
1195
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1197
1196
|
if (claimableRewards) {
|
|
1198
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1199
|
-
if (reward.
|
|
1197
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1198
|
+
if (reward.rewardCoinType === coinsList["DEEP"].type) {
|
|
1200
1199
|
txb.moveCall({
|
|
1201
1200
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1202
1201
|
typeArguments: [
|
|
@@ -1213,7 +1212,7 @@ export async function naviDepositTx(amount, poolName, options) {
|
|
|
1213
1212
|
],
|
|
1214
1213
|
});
|
|
1215
1214
|
}
|
|
1216
|
-
else if (reward.
|
|
1215
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1217
1216
|
txb.moveCall({
|
|
1218
1217
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
1219
1218
|
typeArguments: [
|
|
@@ -1324,12 +1323,12 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1324
1323
|
}
|
|
1325
1324
|
updateSingleTokenPrice(naviPriceFeedMap[singleAssetPoolCoinMap[poolName].coin].pythPriceInfo, naviPriceFeedMap[singleAssetPoolCoinMap[poolName].coin].feedId, txb);
|
|
1326
1325
|
if (singleAssetPoolCoinMap[poolName].coin == "SUI") {
|
|
1327
|
-
const claimableRewards = await getAvailableRewards(
|
|
1326
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_SUI_ACCOUNT_ADDRESS);
|
|
1328
1327
|
if (claimableRewards) {
|
|
1329
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1330
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1328
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1329
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1331
1330
|
: []) {
|
|
1332
|
-
if (reward.
|
|
1331
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1333
1332
|
txb.moveCall({
|
|
1334
1333
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap_bluefin`,
|
|
1335
1334
|
typeArguments: [
|
|
@@ -1349,7 +1348,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1349
1348
|
],
|
|
1350
1349
|
});
|
|
1351
1350
|
}
|
|
1352
|
-
else if (reward.
|
|
1351
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1353
1352
|
txb.moveCall({
|
|
1354
1353
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap`,
|
|
1355
1354
|
typeArguments: [
|
|
@@ -1394,12 +1393,12 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1394
1393
|
});
|
|
1395
1394
|
}
|
|
1396
1395
|
else if (singleAssetPoolCoinMap[poolName].coin == "VSUI") {
|
|
1397
|
-
const claimableRewards = await getAvailableRewards(
|
|
1396
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_VSUI_ACCOUNT_ADDRESS);
|
|
1398
1397
|
if (claimableRewards) {
|
|
1399
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1400
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1398
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1399
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1401
1400
|
: []) {
|
|
1402
|
-
if (reward.
|
|
1401
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1403
1402
|
txb.moveCall({
|
|
1404
1403
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
1405
1404
|
typeArguments: [
|
|
@@ -1421,7 +1420,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1421
1420
|
],
|
|
1422
1421
|
});
|
|
1423
1422
|
}
|
|
1424
|
-
else if (reward.
|
|
1423
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1425
1424
|
txb.moveCall({
|
|
1426
1425
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_no_swap`,
|
|
1427
1426
|
typeArguments: [
|
|
@@ -1464,10 +1463,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1464
1463
|
}
|
|
1465
1464
|
else if (singleAssetPoolCoinMap[poolName].coin == "WETH" ||
|
|
1466
1465
|
singleAssetPoolCoinMap[poolName].coin == "USDT") {
|
|
1467
|
-
const claimableRewards = await getAvailableRewards(
|
|
1466
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1468
1467
|
if (claimableRewards) {
|
|
1469
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1470
|
-
if (reward.
|
|
1468
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1469
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1471
1470
|
txb.moveCall({
|
|
1472
1471
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1473
1472
|
typeArguments: [
|
|
@@ -1491,7 +1490,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1491
1490
|
],
|
|
1492
1491
|
});
|
|
1493
1492
|
}
|
|
1494
|
-
else if (reward.
|
|
1493
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1495
1494
|
txb.moveCall({
|
|
1496
1495
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1497
1496
|
typeArguments: [
|
|
@@ -1540,12 +1539,12 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1540
1539
|
});
|
|
1541
1540
|
}
|
|
1542
1541
|
else if (singleAssetPoolCoinMap[poolName].coin == "WUSDC") {
|
|
1543
|
-
const claimableRewards = await getAvailableRewards(
|
|
1542
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1544
1543
|
if (claimableRewards) {
|
|
1545
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1546
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1544
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1545
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1547
1546
|
: []) {
|
|
1548
|
-
if (reward.
|
|
1547
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1549
1548
|
txb.moveCall({
|
|
1550
1549
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1551
1550
|
typeArguments: [
|
|
@@ -1569,7 +1568,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1569
1568
|
],
|
|
1570
1569
|
});
|
|
1571
1570
|
}
|
|
1572
|
-
else if (reward.
|
|
1571
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1573
1572
|
txb.moveCall({
|
|
1574
1573
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1575
1574
|
typeArguments: [
|
|
@@ -1618,12 +1617,12 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1618
1617
|
});
|
|
1619
1618
|
}
|
|
1620
1619
|
else if (singleAssetPoolCoinMap[poolName].coin == "USDC") {
|
|
1621
|
-
const claimableRewards = await getAvailableRewards(
|
|
1620
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1622
1621
|
if (claimableRewards) {
|
|
1623
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1624
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1622
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1623
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
1625
1624
|
: []) {
|
|
1626
|
-
if (reward.
|
|
1625
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1627
1626
|
txb.moveCall({
|
|
1628
1627
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
1629
1628
|
typeArguments: [
|
|
@@ -1645,7 +1644,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1645
1644
|
],
|
|
1646
1645
|
});
|
|
1647
1646
|
}
|
|
1648
|
-
else if (reward.
|
|
1647
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1649
1648
|
txb.moveCall({
|
|
1650
1649
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
1651
1650
|
typeArguments: [
|
|
@@ -1692,10 +1691,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1692
1691
|
});
|
|
1693
1692
|
}
|
|
1694
1693
|
else if (singleAssetPoolCoinMap[poolName].coin == "USDY") {
|
|
1695
|
-
const claimableRewards = await getAvailableRewards(
|
|
1694
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1696
1695
|
if (claimableRewards) {
|
|
1697
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1698
|
-
if (reward.
|
|
1696
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1697
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1699
1698
|
txb.moveCall({
|
|
1700
1699
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1701
1700
|
typeArguments: [
|
|
@@ -1719,7 +1718,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1719
1718
|
],
|
|
1720
1719
|
});
|
|
1721
1720
|
}
|
|
1722
|
-
else if (reward.
|
|
1721
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1723
1722
|
txb.moveCall({
|
|
1724
1723
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1725
1724
|
typeArguments: [
|
|
@@ -1769,10 +1768,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1769
1768
|
}
|
|
1770
1769
|
else if (singleAssetPoolCoinMap[poolName].coin == "AUSD" ||
|
|
1771
1770
|
singleAssetPoolCoinMap[poolName].coin == "ETH") {
|
|
1772
|
-
const claimableRewards = await getAvailableRewards(
|
|
1771
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
1773
1772
|
if (claimableRewards) {
|
|
1774
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1775
|
-
if (reward.
|
|
1773
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1774
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1776
1775
|
txb.moveCall({
|
|
1777
1776
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1778
1777
|
typeArguments: [
|
|
@@ -1789,12 +1788,13 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1789
1788
|
],
|
|
1790
1789
|
});
|
|
1791
1790
|
}
|
|
1792
|
-
else if (reward.
|
|
1791
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1793
1792
|
txb.moveCall({
|
|
1794
|
-
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::
|
|
1793
|
+
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps`,
|
|
1795
1794
|
typeArguments: [
|
|
1796
1795
|
coinsList[singleAssetPoolCoinMap[poolName].coin].type,
|
|
1797
1796
|
coinsList["USDC"].type,
|
|
1797
|
+
coinsList["SUI"].type,
|
|
1798
1798
|
coinsList["VSUI"].type,
|
|
1799
1799
|
],
|
|
1800
1800
|
arguments: [
|
|
@@ -1804,9 +1804,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1804
1804
|
txb.pure.u8(Number(naviAssetMap[singleAssetPoolCoinMap[poolName].coin])),
|
|
1805
1805
|
txb.object(C.NAVI_INCENTIVE_V3),
|
|
1806
1806
|
txb.object(C.NAVI_VSUI_REWARDS_POOL),
|
|
1807
|
-
txb.object(C.
|
|
1808
|
-
txb.object(
|
|
1809
|
-
txb.object(
|
|
1807
|
+
txb.object(C.CETUS_GLOBAL_CONFIG_ID),
|
|
1808
|
+
txb.object(cetusPoolMap["VSUI-SUI"]),
|
|
1809
|
+
txb.object(cetusPoolMap["USDC-SUI"]),
|
|
1810
|
+
txb.object(cetusPoolMap[`USDC-${singleAssetPoolCoinMap[poolName].coin}`]),
|
|
1810
1811
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
1811
1812
|
],
|
|
1812
1813
|
});
|
|
@@ -1837,10 +1838,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1837
1838
|
});
|
|
1838
1839
|
}
|
|
1839
1840
|
else if (poolName === "NAVI-NS") {
|
|
1840
|
-
const claimableRewards = await getAvailableRewards(
|
|
1841
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_NS_ACCOUNT_ADDRESS);
|
|
1841
1842
|
if (claimableRewards) {
|
|
1842
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1843
|
-
if (reward.
|
|
1843
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1844
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1844
1845
|
txb.moveCall({
|
|
1845
1846
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1846
1847
|
typeArguments: [
|
|
@@ -1861,7 +1862,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1861
1862
|
],
|
|
1862
1863
|
});
|
|
1863
1864
|
}
|
|
1864
|
-
else if (reward.
|
|
1865
|
+
else if (reward.rewardCoinType === coinsList["DEEP"].type) {
|
|
1865
1866
|
txb.moveCall({
|
|
1866
1867
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1867
1868
|
typeArguments: [
|
|
@@ -1882,7 +1883,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1882
1883
|
],
|
|
1883
1884
|
});
|
|
1884
1885
|
}
|
|
1885
|
-
else if (reward.
|
|
1886
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1886
1887
|
txb.moveCall({
|
|
1887
1888
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1888
1889
|
typeArguments: [
|
|
@@ -1904,7 +1905,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1904
1905
|
],
|
|
1905
1906
|
});
|
|
1906
1907
|
}
|
|
1907
|
-
else if (reward.
|
|
1908
|
+
else if (reward.rewardCoinType === coinsList["NS"].type) {
|
|
1908
1909
|
txb.moveCall({
|
|
1909
1910
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1910
1911
|
typeArguments: [
|
|
@@ -1973,10 +1974,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1973
1974
|
});
|
|
1974
1975
|
}
|
|
1975
1976
|
else if (poolName === "NAVI-NAVX") {
|
|
1976
|
-
const claimableRewards = await getAvailableRewards(
|
|
1977
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_NAVX_ACCOUNT_ADDRESS);
|
|
1977
1978
|
if (claimableRewards) {
|
|
1978
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
1979
|
-
if (reward.
|
|
1979
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1980
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
1980
1981
|
txb.moveCall({
|
|
1981
1982
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1982
1983
|
typeArguments: [
|
|
@@ -1993,7 +1994,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1993
1994
|
],
|
|
1994
1995
|
});
|
|
1995
1996
|
}
|
|
1996
|
-
else if (reward.
|
|
1997
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
1997
1998
|
txb.moveCall({
|
|
1998
1999
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1999
2000
|
typeArguments: [
|
|
@@ -2067,10 +2068,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2067
2068
|
});
|
|
2068
2069
|
}
|
|
2069
2070
|
else if (poolName === "NAVI-STSUI") {
|
|
2070
|
-
const claimableRewards = await getAvailableRewards(
|
|
2071
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_STSUI_ACCOUNT_ADDRESS);
|
|
2071
2072
|
if (claimableRewards) {
|
|
2072
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
2073
|
-
if (reward.
|
|
2073
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2074
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
2074
2075
|
txb.moveCall({
|
|
2075
2076
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2076
2077
|
typeArguments: [
|
|
@@ -2087,7 +2088,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2087
2088
|
],
|
|
2088
2089
|
});
|
|
2089
2090
|
}
|
|
2090
|
-
else if (reward.
|
|
2091
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
2091
2092
|
txb.moveCall({
|
|
2092
2093
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
2093
2094
|
typeArguments: [
|
|
@@ -2109,7 +2110,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2109
2110
|
],
|
|
2110
2111
|
});
|
|
2111
2112
|
}
|
|
2112
|
-
else if (reward.
|
|
2113
|
+
else if (reward.rewardCoinType === coinsList["STSUI"].type) {
|
|
2113
2114
|
txb.moveCall({
|
|
2114
2115
|
target: `${poolData.packageId}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2115
2116
|
typeArguments: [coinsList["STSUI"].type],
|
|
@@ -2176,10 +2177,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2176
2177
|
});
|
|
2177
2178
|
}
|
|
2178
2179
|
else if (poolName === "NAVI-SUIBTC") {
|
|
2179
|
-
const claimableRewards = await getAvailableRewards(
|
|
2180
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_SUIBTC_ACCOUNT_ADDRESS);
|
|
2180
2181
|
if (claimableRewards) {
|
|
2181
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
2182
|
-
if (reward.
|
|
2182
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2183
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
2183
2184
|
txb.moveCall({
|
|
2184
2185
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2185
2186
|
typeArguments: [
|
|
@@ -2201,7 +2202,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2201
2202
|
],
|
|
2202
2203
|
});
|
|
2203
2204
|
}
|
|
2204
|
-
else if (reward.
|
|
2205
|
+
else if (reward.rewardCoinType === coinsList["DEEP"].type) {
|
|
2205
2206
|
txb.moveCall({
|
|
2206
2207
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2207
2208
|
typeArguments: [
|
|
@@ -2223,7 +2224,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2223
2224
|
],
|
|
2224
2225
|
});
|
|
2225
2226
|
}
|
|
2226
|
-
else if (reward.
|
|
2227
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
2227
2228
|
txb.moveCall({
|
|
2228
2229
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2229
2230
|
typeArguments: [
|
|
@@ -2302,10 +2303,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2302
2303
|
});
|
|
2303
2304
|
}
|
|
2304
2305
|
else if (poolName === "NAVI-SUIUSDT") {
|
|
2305
|
-
const claimableRewards = await getAvailableRewards(
|
|
2306
|
+
const claimableRewards = await getAvailableRewards(getConf().NAVI_SUIUSDT_ACCOUNT_ADDRESS);
|
|
2306
2307
|
if (claimableRewards) {
|
|
2307
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
2308
|
-
if (reward.
|
|
2308
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2309
|
+
if (reward.rewardCoinType === coinsList["NAVX"].type) {
|
|
2309
2310
|
txb.moveCall({
|
|
2310
2311
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2311
2312
|
typeArguments: [
|
|
@@ -2322,7 +2323,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2322
2323
|
],
|
|
2323
2324
|
});
|
|
2324
2325
|
}
|
|
2325
|
-
else if (reward.
|
|
2326
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
2326
2327
|
txb.moveCall({
|
|
2327
2328
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps`,
|
|
2328
2329
|
typeArguments: [
|
|
@@ -2372,15 +2373,15 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2372
2373
|
});
|
|
2373
2374
|
}
|
|
2374
2375
|
else if (singleAssetPoolCoinMap[poolName].coin == "WAL") {
|
|
2375
|
-
const claimableRewards = await getAvailableRewards(
|
|
2376
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
2376
2377
|
if (claimableRewards) {
|
|
2377
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
2378
|
-
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
2378
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
2379
|
+
? claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]
|
|
2379
2380
|
: [
|
|
2380
|
-
{
|
|
2381
|
-
{
|
|
2381
|
+
{ rewardCoinType: coinsList["WAL"].type },
|
|
2382
|
+
{ rewardCoinType: coinsList["VSUI"].type },
|
|
2382
2383
|
]) {
|
|
2383
|
-
if (reward.
|
|
2384
|
+
if (reward.rewardCoinType === coinsList["WAL"].type) {
|
|
2384
2385
|
txb.moveCall({
|
|
2385
2386
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2386
2387
|
typeArguments: [
|
|
@@ -2397,7 +2398,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2397
2398
|
],
|
|
2398
2399
|
});
|
|
2399
2400
|
}
|
|
2400
|
-
else if (reward.
|
|
2401
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
2401
2402
|
txb.moveCall({
|
|
2402
2403
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2403
2404
|
typeArguments: [
|
|
@@ -2445,10 +2446,10 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2445
2446
|
});
|
|
2446
2447
|
}
|
|
2447
2448
|
else if (singleAssetPoolCoinMap[poolName].coin == "DEEP") {
|
|
2448
|
-
const claimableRewards = await getAvailableRewards(
|
|
2449
|
+
const claimableRewards = await getAvailableRewards(loopingAccountAddresses[poolName]);
|
|
2449
2450
|
if (claimableRewards) {
|
|
2450
|
-
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type
|
|
2451
|
-
if (reward.
|
|
2451
|
+
for (const reward of claimableRewards[coinsList[singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2452
|
+
if (reward.rewardCoinType === coinsList["DEEP"].type) {
|
|
2452
2453
|
txb.moveCall({
|
|
2453
2454
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2454
2455
|
typeArguments: [
|
|
@@ -2465,7 +2466,7 @@ export async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2465
2466
|
],
|
|
2466
2467
|
});
|
|
2467
2468
|
}
|
|
2468
|
-
else if (reward.
|
|
2469
|
+
else if (reward.rewardCoinType === coinsList["VSUI"].type) {
|
|
2469
2470
|
txb.moveCall({
|
|
2470
2471
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2471
2472
|
typeArguments: [
|