@alphafi/alphafi-sdk 0.0.92 → 0.0.94
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 +33 -0
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +40 -5
- 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 +24 -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 +5 -19
- 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 +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -2
- 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.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/blueRewards.d.ts.map +1 -1
- package/dist/cjs/transactions/blueRewards.js +135 -10
- 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 +33 -0
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +40 -5
- 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 +24 -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 +5 -19
- 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 +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -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.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/blueRewards.d.ts.map +1 -1
- package/dist/esm/transactions/blueRewards.js +119 -4
- package/dist/esm/transactions/blueRewards.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 -1
- 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 -207
- 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 +38 -22
- 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
|
@@ -9,8 +9,7 @@ const getReceipts_js_1 = require("../sui-sdk/functions/getReceipts.js");
|
|
|
9
9
|
const constants_js_1 = require("../common/constants.js");
|
|
10
10
|
const client_js_1 = require("../sui-sdk/client.js");
|
|
11
11
|
const naviOracle_js_1 = require("./naviOracle.js");
|
|
12
|
-
const
|
|
13
|
-
// import { getAvailableRewards } from "navi-sdk";
|
|
12
|
+
const get_navi_rewards_js_1 = require("./get_navi_rewards.js");
|
|
14
13
|
async function naviDepositTx(amount, poolName, options) {
|
|
15
14
|
const C = (0, constants_js_1.getConf)();
|
|
16
15
|
const suiClient = (0, client_js_1.getSuiClient)();
|
|
@@ -37,12 +36,12 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
const [depositCoin] = txb.splitCoins(txb.gas, [amount]);
|
|
40
|
-
const claimableRewards = await (0,
|
|
39
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_SUI_ACCOUNT_ADDRESS);
|
|
41
40
|
if (claimableRewards) {
|
|
42
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
43
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
41
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
42
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
44
43
|
: []) {
|
|
45
|
-
if (reward.
|
|
44
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
46
45
|
txb.moveCall({
|
|
47
46
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap_bluefin`,
|
|
48
47
|
typeArguments: [
|
|
@@ -62,7 +61,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
62
61
|
],
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
|
-
else if (reward.
|
|
64
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
66
65
|
txb.moveCall({
|
|
67
66
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap`,
|
|
68
67
|
typeArguments: [
|
|
@@ -144,12 +143,12 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
144
143
|
});
|
|
145
144
|
}
|
|
146
145
|
if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "VSUI") {
|
|
147
|
-
const claimableRewards = await (0,
|
|
146
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_VSUI_ACCOUNT_ADDRESS);
|
|
148
147
|
if (claimableRewards) {
|
|
149
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
150
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
148
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
149
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
151
150
|
: []) {
|
|
152
|
-
if (reward.
|
|
151
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
153
152
|
txb.moveCall({
|
|
154
153
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
155
154
|
typeArguments: [
|
|
@@ -171,7 +170,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
171
170
|
],
|
|
172
171
|
});
|
|
173
172
|
}
|
|
174
|
-
else if (reward.
|
|
173
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
175
174
|
txb.moveCall({
|
|
176
175
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_no_swap`,
|
|
177
176
|
typeArguments: [
|
|
@@ -214,12 +213,12 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
214
213
|
}
|
|
215
214
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "WETH" ||
|
|
216
215
|
maps_js_1.singleAssetPoolCoinMap[poolName].coin == "USDT") {
|
|
217
|
-
const claimableRewards = await (0,
|
|
216
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
218
217
|
if (claimableRewards) {
|
|
219
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
220
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
218
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
219
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
221
220
|
: []) {
|
|
222
|
-
if (reward.
|
|
221
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
223
222
|
txb.moveCall({
|
|
224
223
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
225
224
|
typeArguments: [
|
|
@@ -243,7 +242,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
243
242
|
],
|
|
244
243
|
});
|
|
245
244
|
}
|
|
246
|
-
else if (reward.
|
|
245
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
247
246
|
txb.moveCall({
|
|
248
247
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
249
248
|
typeArguments: [
|
|
@@ -292,12 +291,12 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
292
291
|
});
|
|
293
292
|
}
|
|
294
293
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "WUSDC") {
|
|
295
|
-
const claimableRewards = await (0,
|
|
294
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
296
295
|
if (claimableRewards) {
|
|
297
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
298
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
296
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
297
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
299
298
|
: []) {
|
|
300
|
-
if (reward.
|
|
299
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
301
300
|
txb.moveCall({
|
|
302
301
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
303
302
|
typeArguments: [
|
|
@@ -319,7 +318,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
319
318
|
],
|
|
320
319
|
});
|
|
321
320
|
}
|
|
322
|
-
else if (reward.
|
|
321
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
323
322
|
txb.moveCall({
|
|
324
323
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin_v2`,
|
|
325
324
|
typeArguments: [
|
|
@@ -366,12 +365,12 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
366
365
|
});
|
|
367
366
|
}
|
|
368
367
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "USDC") {
|
|
369
|
-
const claimableRewards = await (0,
|
|
368
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
370
369
|
if (claimableRewards) {
|
|
371
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
372
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
370
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
371
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
373
372
|
: []) {
|
|
374
|
-
if (reward.
|
|
373
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
375
374
|
txb.moveCall({
|
|
376
375
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
377
376
|
typeArguments: [
|
|
@@ -393,7 +392,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
393
392
|
],
|
|
394
393
|
});
|
|
395
394
|
}
|
|
396
|
-
else if (reward.
|
|
395
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
397
396
|
txb.moveCall({
|
|
398
397
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
399
398
|
typeArguments: [
|
|
@@ -440,12 +439,12 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
440
439
|
});
|
|
441
440
|
}
|
|
442
441
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "USDY") {
|
|
443
|
-
const claimableRewards = await (0,
|
|
442
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
444
443
|
if (claimableRewards) {
|
|
445
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
446
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
444
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
445
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
447
446
|
: []) {
|
|
448
|
-
if (reward.
|
|
447
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
449
448
|
txb.moveCall({
|
|
450
449
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
451
450
|
typeArguments: [
|
|
@@ -469,7 +468,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
469
468
|
],
|
|
470
469
|
});
|
|
471
470
|
}
|
|
472
|
-
else if (reward.
|
|
471
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
473
472
|
txb.moveCall({
|
|
474
473
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
475
474
|
typeArguments: [
|
|
@@ -519,10 +518,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
519
518
|
}
|
|
520
519
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "AUSD" ||
|
|
521
520
|
maps_js_1.singleAssetPoolCoinMap[poolName].coin == "ETH") {
|
|
522
|
-
const claimableRewards = await (0,
|
|
521
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
523
522
|
if (claimableRewards) {
|
|
524
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
525
|
-
if (reward.
|
|
523
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
524
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
526
525
|
txb.moveCall({
|
|
527
526
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
528
527
|
typeArguments: [
|
|
@@ -539,7 +538,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
539
538
|
],
|
|
540
539
|
});
|
|
541
540
|
}
|
|
542
|
-
else if (reward.
|
|
541
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
543
542
|
txb.moveCall({
|
|
544
543
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps_bluefin`,
|
|
545
544
|
typeArguments: [
|
|
@@ -589,10 +588,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
589
588
|
});
|
|
590
589
|
}
|
|
591
590
|
else if (poolName === "NAVI-NS") {
|
|
592
|
-
const claimableRewards = await (0,
|
|
591
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_NS_ACCOUNT_ADDRESS);
|
|
593
592
|
if (claimableRewards) {
|
|
594
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
595
|
-
if (reward.
|
|
593
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
594
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
596
595
|
txb.moveCall({
|
|
597
596
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
598
597
|
typeArguments: [
|
|
@@ -613,7 +612,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
613
612
|
],
|
|
614
613
|
});
|
|
615
614
|
}
|
|
616
|
-
else if (reward.
|
|
615
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["DEEP"].type) {
|
|
617
616
|
txb.moveCall({
|
|
618
617
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
619
618
|
typeArguments: [
|
|
@@ -634,7 +633,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
634
633
|
],
|
|
635
634
|
});
|
|
636
635
|
}
|
|
637
|
-
else if (reward.
|
|
636
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
638
637
|
txb.moveCall({
|
|
639
638
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
640
639
|
typeArguments: [
|
|
@@ -656,7 +655,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
656
655
|
],
|
|
657
656
|
});
|
|
658
657
|
}
|
|
659
|
-
else if (reward.
|
|
658
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["NS"].type) {
|
|
660
659
|
txb.moveCall({
|
|
661
660
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
662
661
|
typeArguments: [
|
|
@@ -725,10 +724,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
725
724
|
});
|
|
726
725
|
}
|
|
727
726
|
else if (poolName === "NAVI-NAVX") {
|
|
728
|
-
const claimableRewards = await (0,
|
|
727
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_NAVX_ACCOUNT_ADDRESS);
|
|
729
728
|
if (claimableRewards) {
|
|
730
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
731
|
-
if (reward.
|
|
729
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
730
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
732
731
|
txb.moveCall({
|
|
733
732
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
734
733
|
typeArguments: [
|
|
@@ -745,7 +744,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
745
744
|
],
|
|
746
745
|
});
|
|
747
746
|
}
|
|
748
|
-
else if (reward.
|
|
747
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
749
748
|
txb.moveCall({
|
|
750
749
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
751
750
|
typeArguments: [
|
|
@@ -819,10 +818,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
819
818
|
});
|
|
820
819
|
}
|
|
821
820
|
else if (poolName === "NAVI-STSUI") {
|
|
822
|
-
const claimableRewards = await (0,
|
|
821
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_STSUI_ACCOUNT_ADDRESS);
|
|
823
822
|
if (claimableRewards) {
|
|
824
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
825
|
-
if (reward.
|
|
823
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
824
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
826
825
|
txb.moveCall({
|
|
827
826
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
828
827
|
typeArguments: [
|
|
@@ -839,7 +838,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
839
838
|
],
|
|
840
839
|
});
|
|
841
840
|
}
|
|
842
|
-
else if (reward.
|
|
841
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
843
842
|
txb.moveCall({
|
|
844
843
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
845
844
|
typeArguments: [
|
|
@@ -861,7 +860,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
861
860
|
],
|
|
862
861
|
});
|
|
863
862
|
}
|
|
864
|
-
else if (reward.
|
|
863
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["STSUI"].type) {
|
|
865
864
|
txb.moveCall({
|
|
866
865
|
target: `${poolData.packageId}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
867
866
|
typeArguments: [coins_js_1.coinsList["STSUI"].type],
|
|
@@ -928,10 +927,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
928
927
|
});
|
|
929
928
|
}
|
|
930
929
|
else if (poolName === "NAVI-SUIBTC") {
|
|
931
|
-
const claimableRewards = await (0,
|
|
930
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_SUIBTC_ACCOUNT_ADDRESS);
|
|
932
931
|
if (claimableRewards) {
|
|
933
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
934
|
-
if (reward.
|
|
932
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
933
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
935
934
|
txb.moveCall({
|
|
936
935
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
937
936
|
typeArguments: [
|
|
@@ -953,7 +952,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
953
952
|
],
|
|
954
953
|
});
|
|
955
954
|
}
|
|
956
|
-
else if (reward.
|
|
955
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["DEEP"].type) {
|
|
957
956
|
txb.moveCall({
|
|
958
957
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
959
958
|
typeArguments: [
|
|
@@ -975,7 +974,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
975
974
|
],
|
|
976
975
|
});
|
|
977
976
|
}
|
|
978
|
-
else if (reward.
|
|
977
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
979
978
|
txb.moveCall({
|
|
980
979
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
981
980
|
typeArguments: [
|
|
@@ -1054,10 +1053,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
1054
1053
|
});
|
|
1055
1054
|
}
|
|
1056
1055
|
else if (poolName === "NAVI-SUIUSDT") {
|
|
1057
|
-
const claimableRewards = await (0,
|
|
1056
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_SUIUSDT_ACCOUNT_ADDRESS);
|
|
1058
1057
|
if (claimableRewards) {
|
|
1059
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1060
|
-
if (reward.
|
|
1058
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1059
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1061
1060
|
txb.moveCall({
|
|
1062
1061
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1063
1062
|
typeArguments: [
|
|
@@ -1074,7 +1073,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
1074
1073
|
],
|
|
1075
1074
|
});
|
|
1076
1075
|
}
|
|
1077
|
-
else if (reward.
|
|
1076
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1078
1077
|
txb.moveCall({
|
|
1079
1078
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps`,
|
|
1080
1079
|
typeArguments: [
|
|
@@ -1124,15 +1123,15 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
1124
1123
|
});
|
|
1125
1124
|
}
|
|
1126
1125
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "WAL") {
|
|
1127
|
-
const claimableRewards = await (0,
|
|
1126
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1128
1127
|
if (claimableRewards) {
|
|
1129
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1128
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1130
1129
|
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type.substring(2)]
|
|
1131
1130
|
: [
|
|
1132
|
-
{
|
|
1133
|
-
{
|
|
1131
|
+
{ rewardCoinType: coins_js_1.coinsList["WAL"].type },
|
|
1132
|
+
{ rewardCoinType: coins_js_1.coinsList["VSUI"].type },
|
|
1134
1133
|
]) {
|
|
1135
|
-
if (reward.
|
|
1134
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["WAL"].type) {
|
|
1136
1135
|
txb.moveCall({
|
|
1137
1136
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1138
1137
|
typeArguments: [
|
|
@@ -1149,7 +1148,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
1149
1148
|
],
|
|
1150
1149
|
});
|
|
1151
1150
|
}
|
|
1152
|
-
else if (reward.
|
|
1151
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1153
1152
|
txb.moveCall({
|
|
1154
1153
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
1155
1154
|
typeArguments: [
|
|
@@ -1197,10 +1196,10 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
1197
1196
|
});
|
|
1198
1197
|
}
|
|
1199
1198
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "DEEP") {
|
|
1200
|
-
const claimableRewards = await (0,
|
|
1199
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1201
1200
|
if (claimableRewards) {
|
|
1202
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1203
|
-
if (reward.
|
|
1201
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1202
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["DEEP"].type) {
|
|
1204
1203
|
txb.moveCall({
|
|
1205
1204
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1206
1205
|
typeArguments: [
|
|
@@ -1217,7 +1216,7 @@ async function naviDepositTx(amount, poolName, options) {
|
|
|
1217
1216
|
],
|
|
1218
1217
|
});
|
|
1219
1218
|
}
|
|
1220
|
-
else if (reward.
|
|
1219
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1221
1220
|
txb.moveCall({
|
|
1222
1221
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
1223
1222
|
typeArguments: [
|
|
@@ -1328,12 +1327,12 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1328
1327
|
}
|
|
1329
1328
|
(0, naviOracle_js_1.updateSingleTokenPrice)(maps_js_1.naviPriceFeedMap[maps_js_1.singleAssetPoolCoinMap[poolName].coin].pythPriceInfo, maps_js_1.naviPriceFeedMap[maps_js_1.singleAssetPoolCoinMap[poolName].coin].feedId, txb);
|
|
1330
1329
|
if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "SUI") {
|
|
1331
|
-
const claimableRewards = await (0,
|
|
1330
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_SUI_ACCOUNT_ADDRESS);
|
|
1332
1331
|
if (claimableRewards) {
|
|
1333
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1334
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1332
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1333
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1335
1334
|
: []) {
|
|
1336
|
-
if (reward.
|
|
1335
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1337
1336
|
txb.moveCall({
|
|
1338
1337
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap_bluefin`,
|
|
1339
1338
|
typeArguments: [
|
|
@@ -1353,7 +1352,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1353
1352
|
],
|
|
1354
1353
|
});
|
|
1355
1354
|
}
|
|
1356
|
-
else if (reward.
|
|
1355
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1357
1356
|
txb.moveCall({
|
|
1358
1357
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_one_swap`,
|
|
1359
1358
|
typeArguments: [
|
|
@@ -1398,12 +1397,12 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1398
1397
|
});
|
|
1399
1398
|
}
|
|
1400
1399
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "VSUI") {
|
|
1401
|
-
const claimableRewards = await (0,
|
|
1400
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_VSUI_ACCOUNT_ADDRESS);
|
|
1402
1401
|
if (claimableRewards) {
|
|
1403
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1404
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1402
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1403
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1405
1404
|
: []) {
|
|
1406
|
-
if (reward.
|
|
1405
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1407
1406
|
txb.moveCall({
|
|
1408
1407
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps_bluefin`,
|
|
1409
1408
|
typeArguments: [
|
|
@@ -1425,7 +1424,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1425
1424
|
],
|
|
1426
1425
|
});
|
|
1427
1426
|
}
|
|
1428
|
-
else if (reward.
|
|
1427
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1429
1428
|
txb.moveCall({
|
|
1430
1429
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_no_swap`,
|
|
1431
1430
|
typeArguments: [
|
|
@@ -1468,10 +1467,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1468
1467
|
}
|
|
1469
1468
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "WETH" ||
|
|
1470
1469
|
maps_js_1.singleAssetPoolCoinMap[poolName].coin == "USDT") {
|
|
1471
|
-
const claimableRewards = await (0,
|
|
1470
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1472
1471
|
if (claimableRewards) {
|
|
1473
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1474
|
-
if (reward.
|
|
1472
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1473
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1475
1474
|
txb.moveCall({
|
|
1476
1475
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1477
1476
|
typeArguments: [
|
|
@@ -1495,7 +1494,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1495
1494
|
],
|
|
1496
1495
|
});
|
|
1497
1496
|
}
|
|
1498
|
-
else if (reward.
|
|
1497
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1499
1498
|
txb.moveCall({
|
|
1500
1499
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1501
1500
|
typeArguments: [
|
|
@@ -1544,12 +1543,12 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1544
1543
|
});
|
|
1545
1544
|
}
|
|
1546
1545
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "WUSDC") {
|
|
1547
|
-
const claimableRewards = await (0,
|
|
1546
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1548
1547
|
if (claimableRewards) {
|
|
1549
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1550
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1548
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1549
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1551
1550
|
: []) {
|
|
1552
|
-
if (reward.
|
|
1551
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1553
1552
|
txb.moveCall({
|
|
1554
1553
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1555
1554
|
typeArguments: [
|
|
@@ -1573,7 +1572,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1573
1572
|
],
|
|
1574
1573
|
});
|
|
1575
1574
|
}
|
|
1576
|
-
else if (reward.
|
|
1575
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1577
1576
|
txb.moveCall({
|
|
1578
1577
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1579
1578
|
typeArguments: [
|
|
@@ -1622,12 +1621,12 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1622
1621
|
});
|
|
1623
1622
|
}
|
|
1624
1623
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "USDC") {
|
|
1625
|
-
const claimableRewards = await (0,
|
|
1624
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1626
1625
|
if (claimableRewards) {
|
|
1627
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1628
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1626
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1627
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
1629
1628
|
: []) {
|
|
1630
|
-
if (reward.
|
|
1629
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1631
1630
|
txb.moveCall({
|
|
1632
1631
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
1633
1632
|
typeArguments: [
|
|
@@ -1649,7 +1648,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1649
1648
|
],
|
|
1650
1649
|
});
|
|
1651
1650
|
}
|
|
1652
|
-
else if (reward.
|
|
1651
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1653
1652
|
txb.moveCall({
|
|
1654
1653
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_two_swaps`,
|
|
1655
1654
|
typeArguments: [
|
|
@@ -1696,10 +1695,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1696
1695
|
});
|
|
1697
1696
|
}
|
|
1698
1697
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "USDY") {
|
|
1699
|
-
const claimableRewards = await (0,
|
|
1698
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1700
1699
|
if (claimableRewards) {
|
|
1701
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1702
|
-
if (reward.
|
|
1700
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1701
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1703
1702
|
txb.moveCall({
|
|
1704
1703
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1705
1704
|
typeArguments: [
|
|
@@ -1723,7 +1722,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1723
1722
|
],
|
|
1724
1723
|
});
|
|
1725
1724
|
}
|
|
1726
|
-
else if (reward.
|
|
1725
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1727
1726
|
txb.moveCall({
|
|
1728
1727
|
target: `${C.ALPHA_LATEST_PACKAGE_ID}::alphafi_navi_investor::collect_v3_rewards_with_three_swaps`,
|
|
1729
1728
|
typeArguments: [
|
|
@@ -1773,10 +1772,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1773
1772
|
}
|
|
1774
1773
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "AUSD" ||
|
|
1775
1774
|
maps_js_1.singleAssetPoolCoinMap[poolName].coin == "ETH") {
|
|
1776
|
-
const claimableRewards = await (0,
|
|
1775
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
1777
1776
|
if (claimableRewards) {
|
|
1778
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1779
|
-
if (reward.
|
|
1777
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1778
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1780
1779
|
txb.moveCall({
|
|
1781
1780
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1782
1781
|
typeArguments: [
|
|
@@ -1793,12 +1792,13 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1793
1792
|
],
|
|
1794
1793
|
});
|
|
1795
1794
|
}
|
|
1796
|
-
else if (reward.
|
|
1795
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1797
1796
|
txb.moveCall({
|
|
1798
|
-
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::
|
|
1797
|
+
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps`,
|
|
1799
1798
|
typeArguments: [
|
|
1800
1799
|
coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type,
|
|
1801
1800
|
coins_js_1.coinsList["USDC"].type,
|
|
1801
|
+
coins_js_1.coinsList["SUI"].type,
|
|
1802
1802
|
coins_js_1.coinsList["VSUI"].type,
|
|
1803
1803
|
],
|
|
1804
1804
|
arguments: [
|
|
@@ -1808,9 +1808,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1808
1808
|
txb.pure.u8(Number(maps_js_1.naviAssetMap[maps_js_1.singleAssetPoolCoinMap[poolName].coin])),
|
|
1809
1809
|
txb.object(C.NAVI_INCENTIVE_V3),
|
|
1810
1810
|
txb.object(C.NAVI_VSUI_REWARDS_POOL),
|
|
1811
|
-
txb.object(C.
|
|
1812
|
-
txb.object(maps_js_1.
|
|
1813
|
-
txb.object(maps_js_1.
|
|
1811
|
+
txb.object(C.CETUS_GLOBAL_CONFIG_ID),
|
|
1812
|
+
txb.object(maps_js_1.cetusPoolMap["VSUI-SUI"]),
|
|
1813
|
+
txb.object(maps_js_1.cetusPoolMap["USDC-SUI"]),
|
|
1814
|
+
txb.object(maps_js_1.cetusPoolMap[`USDC-${maps_js_1.singleAssetPoolCoinMap[poolName].coin}`]),
|
|
1814
1815
|
txb.object(C.CLOCK_PACKAGE_ID),
|
|
1815
1816
|
],
|
|
1816
1817
|
});
|
|
@@ -1841,10 +1842,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1841
1842
|
});
|
|
1842
1843
|
}
|
|
1843
1844
|
else if (poolName === "NAVI-NS") {
|
|
1844
|
-
const claimableRewards = await (0,
|
|
1845
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_NS_ACCOUNT_ADDRESS);
|
|
1845
1846
|
if (claimableRewards) {
|
|
1846
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1847
|
-
if (reward.
|
|
1847
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1848
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1848
1849
|
txb.moveCall({
|
|
1849
1850
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1850
1851
|
typeArguments: [
|
|
@@ -1865,7 +1866,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1865
1866
|
],
|
|
1866
1867
|
});
|
|
1867
1868
|
}
|
|
1868
|
-
else if (reward.
|
|
1869
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["DEEP"].type) {
|
|
1869
1870
|
txb.moveCall({
|
|
1870
1871
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1871
1872
|
typeArguments: [
|
|
@@ -1886,7 +1887,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1886
1887
|
],
|
|
1887
1888
|
});
|
|
1888
1889
|
}
|
|
1889
|
-
else if (reward.
|
|
1890
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
1890
1891
|
txb.moveCall({
|
|
1891
1892
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
1892
1893
|
typeArguments: [
|
|
@@ -1908,7 +1909,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1908
1909
|
],
|
|
1909
1910
|
});
|
|
1910
1911
|
}
|
|
1911
|
-
else if (reward.
|
|
1912
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["NS"].type) {
|
|
1912
1913
|
txb.moveCall({
|
|
1913
1914
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1914
1915
|
typeArguments: [
|
|
@@ -1977,10 +1978,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1977
1978
|
});
|
|
1978
1979
|
}
|
|
1979
1980
|
else if (poolName === "NAVI-NAVX") {
|
|
1980
|
-
const claimableRewards = await (0,
|
|
1981
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_NAVX_ACCOUNT_ADDRESS);
|
|
1981
1982
|
if (claimableRewards) {
|
|
1982
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
1983
|
-
if (reward.
|
|
1983
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
1984
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
1984
1985
|
txb.moveCall({
|
|
1985
1986
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
1986
1987
|
typeArguments: [
|
|
@@ -1997,7 +1998,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
1997
1998
|
],
|
|
1998
1999
|
});
|
|
1999
2000
|
}
|
|
2000
|
-
else if (reward.
|
|
2001
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
2001
2002
|
txb.moveCall({
|
|
2002
2003
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
2003
2004
|
typeArguments: [
|
|
@@ -2071,10 +2072,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2071
2072
|
});
|
|
2072
2073
|
}
|
|
2073
2074
|
else if (poolName === "NAVI-STSUI") {
|
|
2074
|
-
const claimableRewards = await (0,
|
|
2075
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_STSUI_ACCOUNT_ADDRESS);
|
|
2075
2076
|
if (claimableRewards) {
|
|
2076
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
2077
|
-
if (reward.
|
|
2077
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2078
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
2078
2079
|
txb.moveCall({
|
|
2079
2080
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2080
2081
|
typeArguments: [
|
|
@@ -2091,7 +2092,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2091
2092
|
],
|
|
2092
2093
|
});
|
|
2093
2094
|
}
|
|
2094
|
-
else if (reward.
|
|
2095
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
2095
2096
|
txb.moveCall({
|
|
2096
2097
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps`,
|
|
2097
2098
|
typeArguments: [
|
|
@@ -2113,7 +2114,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2113
2114
|
],
|
|
2114
2115
|
});
|
|
2115
2116
|
}
|
|
2116
|
-
else if (reward.
|
|
2117
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["STSUI"].type) {
|
|
2117
2118
|
txb.moveCall({
|
|
2118
2119
|
target: `${poolData.packageId}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2119
2120
|
typeArguments: [coins_js_1.coinsList["STSUI"].type],
|
|
@@ -2180,10 +2181,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2180
2181
|
});
|
|
2181
2182
|
}
|
|
2182
2183
|
else if (poolName === "NAVI-SUIBTC") {
|
|
2183
|
-
const claimableRewards = await (0,
|
|
2184
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_SUIBTC_ACCOUNT_ADDRESS);
|
|
2184
2185
|
if (claimableRewards) {
|
|
2185
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
2186
|
-
if (reward.
|
|
2186
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2187
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
2187
2188
|
txb.moveCall({
|
|
2188
2189
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2189
2190
|
typeArguments: [
|
|
@@ -2205,7 +2206,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2205
2206
|
],
|
|
2206
2207
|
});
|
|
2207
2208
|
}
|
|
2208
|
-
else if (reward.
|
|
2209
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["DEEP"].type) {
|
|
2209
2210
|
txb.moveCall({
|
|
2210
2211
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2211
2212
|
typeArguments: [
|
|
@@ -2227,7 +2228,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2227
2228
|
],
|
|
2228
2229
|
});
|
|
2229
2230
|
}
|
|
2230
|
-
else if (reward.
|
|
2231
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
2231
2232
|
txb.moveCall({
|
|
2232
2233
|
target: `${C.ALPHA_NAVI_V2_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2233
2234
|
typeArguments: [
|
|
@@ -2306,10 +2307,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2306
2307
|
});
|
|
2307
2308
|
}
|
|
2308
2309
|
else if (poolName === "NAVI-SUIUSDT") {
|
|
2309
|
-
const claimableRewards = await (0,
|
|
2310
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)((0, constants_js_1.getConf)().NAVI_SUIUSDT_ACCOUNT_ADDRESS);
|
|
2310
2311
|
if (claimableRewards) {
|
|
2311
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
2312
|
-
if (reward.
|
|
2312
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2313
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["NAVX"].type) {
|
|
2313
2314
|
txb.moveCall({
|
|
2314
2315
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2315
2316
|
typeArguments: [
|
|
@@ -2326,7 +2327,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2326
2327
|
],
|
|
2327
2328
|
});
|
|
2328
2329
|
}
|
|
2329
|
-
else if (reward.
|
|
2330
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
2330
2331
|
txb.moveCall({
|
|
2331
2332
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_three_swaps`,
|
|
2332
2333
|
typeArguments: [
|
|
@@ -2376,15 +2377,15 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2376
2377
|
});
|
|
2377
2378
|
}
|
|
2378
2379
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "WAL") {
|
|
2379
|
-
const claimableRewards = await (0,
|
|
2380
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
2380
2381
|
if (claimableRewards) {
|
|
2381
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
2382
|
-
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
2382
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
2383
|
+
? claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]
|
|
2383
2384
|
: [
|
|
2384
|
-
{
|
|
2385
|
-
{
|
|
2385
|
+
{ rewardCoinType: coins_js_1.coinsList["WAL"].type },
|
|
2386
|
+
{ rewardCoinType: coins_js_1.coinsList["VSUI"].type },
|
|
2386
2387
|
]) {
|
|
2387
|
-
if (reward.
|
|
2388
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["WAL"].type) {
|
|
2388
2389
|
txb.moveCall({
|
|
2389
2390
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2390
2391
|
typeArguments: [
|
|
@@ -2401,7 +2402,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2401
2402
|
],
|
|
2402
2403
|
});
|
|
2403
2404
|
}
|
|
2404
|
-
else if (reward.
|
|
2405
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
2405
2406
|
txb.moveCall({
|
|
2406
2407
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2407
2408
|
typeArguments: [
|
|
@@ -2449,10 +2450,10 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2449
2450
|
});
|
|
2450
2451
|
}
|
|
2451
2452
|
else if (maps_js_1.singleAssetPoolCoinMap[poolName].coin == "DEEP") {
|
|
2452
|
-
const claimableRewards = await (0,
|
|
2453
|
+
const claimableRewards = await (0, get_navi_rewards_js_1.getAvailableRewards)(maps_js_1.loopingAccountAddresses[poolName]);
|
|
2453
2454
|
if (claimableRewards) {
|
|
2454
|
-
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type
|
|
2455
|
-
if (reward.
|
|
2455
|
+
for (const reward of claimableRewards[coins_js_1.coinsList[maps_js_1.singleAssetPoolCoinMap[poolName].coin].type]) {
|
|
2456
|
+
if (reward.rewardCoinType === coins_js_1.coinsList["DEEP"].type) {
|
|
2456
2457
|
txb.moveCall({
|
|
2457
2458
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_no_swap`,
|
|
2458
2459
|
typeArguments: [
|
|
@@ -2469,7 +2470,7 @@ async function naviWithdrawTx(xTokens, poolName, options) {
|
|
|
2469
2470
|
],
|
|
2470
2471
|
});
|
|
2471
2472
|
}
|
|
2472
|
-
else if (reward.
|
|
2473
|
+
else if (reward.rewardCoinType === coins_js_1.coinsList["VSUI"].type) {
|
|
2473
2474
|
txb.moveCall({
|
|
2474
2475
|
target: `${C.ALPHA_3_LATEST_PACKAGE_ID}::alphafi_navi_pool_v2::collect_reward_with_two_swaps_bluefin`,
|
|
2475
2476
|
typeArguments: [
|