@alphafi/alphafi-sdk 0.0.83 → 0.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common/coins.d.ts.map +1 -1
- package/dist/cjs/common/coins.js +30 -0
- package/dist/cjs/common/coins.js.map +1 -1
- package/dist/cjs/common/constants.d.ts +125 -24
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +171 -53
- package/dist/cjs/common/constants.js.map +1 -1
- package/dist/cjs/common/maps.d.ts +6 -0
- package/dist/cjs/common/maps.d.ts.map +1 -1
- package/dist/cjs/common/maps.js +115 -43
- 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 +6 -5
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/getAllVaults.d.ts.map +1 -1
- package/dist/cjs/getAllVaults.js +2 -1
- package/dist/cjs/getAllVaults.js.map +1 -1
- package/dist/cjs/getAprs.d.ts.map +1 -1
- package/dist/cjs/getAprs.js +22 -1
- package/dist/cjs/getAprs.js.map +1 -1
- package/dist/cjs/getTvls.d.ts.map +1 -1
- package/dist/cjs/getTvls.js +11 -0
- package/dist/cjs/getTvls.js.map +1 -1
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.js +24 -14
- package/dist/cjs/sui-sdk/events/fetchAutoCompoundingEvents.js.map +1 -1
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.js +2 -1
- package/dist/cjs/sui-sdk/events/fetchCheckRatioEvents.js.map +1 -1
- package/dist/cjs/sui-sdk/events/fetchEvents.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/events/fetchEvents.js +9 -8
- package/dist/cjs/sui-sdk/events/fetchEvents.js.map +1 -1
- package/dist/cjs/sui-sdk/events/types.d.ts +4 -4
- package/dist/cjs/sui-sdk/events/types.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/events/types.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.js +2 -1
- package/dist/cjs/sui-sdk/functions/fetchUserVaults.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js +5 -4
- package/dist/cjs/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +3 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +15 -3
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.js +2 -42
- package/dist/cjs/sui-sdk/transactions/fetchTransactions.js.map +1 -1
- package/dist/cjs/transactions/alphalend.d.ts +23 -0
- package/dist/cjs/transactions/alphalend.d.ts.map +1 -0
- package/dist/cjs/transactions/alphalend.js +637 -0
- package/dist/cjs/transactions/alphalend.js.map +1 -0
- package/dist/cjs/transactions/blueRewards.d.ts +4 -3
- package/dist/cjs/transactions/blueRewards.d.ts.map +1 -1
- package/dist/cjs/transactions/blueRewards.js +347 -55
- package/dist/cjs/transactions/blueRewards.js.map +1 -1
- package/dist/cjs/transactions/bluefin.d.ts +2 -1
- package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
- package/dist/cjs/transactions/bluefin.js +175 -40
- package/dist/cjs/transactions/bluefin.js.map +1 -1
- package/dist/cjs/transactions/collect_rewards.d.ts.map +1 -1
- package/dist/cjs/transactions/collect_rewards.js +21 -1
- package/dist/cjs/transactions/collect_rewards.js.map +1 -1
- package/dist/cjs/transactions/deposit.d.ts.map +1 -1
- package/dist/cjs/transactions/deposit.js +11 -0
- package/dist/cjs/transactions/deposit.js.map +1 -1
- package/dist/cjs/transactions/navi-looping.d.ts +3 -0
- package/dist/cjs/transactions/navi-looping.d.ts.map +1 -1
- package/dist/cjs/transactions/navi-looping.js +287 -54
- 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 +40 -34
- package/dist/cjs/transactions/navi.js.map +1 -1
- package/dist/cjs/transactions/types.d.ts +3 -0
- package/dist/cjs/transactions/types.d.ts.map +1 -1
- package/dist/cjs/transactions/types.js.map +1 -1
- package/dist/cjs/transactions/withdraw.d.ts.map +1 -1
- package/dist/cjs/transactions/withdraw.js +13 -0
- package/dist/cjs/transactions/withdraw.js.map +1 -1
- package/dist/cjs/utils/getReceipts.d.ts.map +1 -1
- package/dist/cjs/utils/getReceipts.js +2 -0
- package/dist/cjs/utils/getReceipts.js.map +1 -1
- package/dist/cjs/utils/prices.d.ts +3 -0
- package/dist/cjs/utils/prices.d.ts.map +1 -1
- package/dist/cjs/utils/prices.js +77 -36
- package/dist/cjs/utils/prices.js.map +1 -1
- package/dist/cjs/utils/userHoldings.d.ts.map +1 -1
- package/dist/cjs/utils/userHoldings.js +5 -3
- package/dist/cjs/utils/userHoldings.js.map +1 -1
- package/dist/cjs/vaultFunctions.d.ts.map +1 -1
- package/dist/cjs/vaultFunctions.js +1 -0
- package/dist/cjs/vaultFunctions.js.map +1 -1
- package/dist/esm/common/coins.d.ts.map +1 -1
- package/dist/esm/common/coins.js +30 -0
- package/dist/esm/common/coins.js.map +1 -1
- package/dist/esm/common/constants.d.ts +125 -24
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +171 -53
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/maps.d.ts +6 -0
- package/dist/esm/common/maps.d.ts.map +1 -1
- package/dist/esm/common/maps.js +114 -42
- 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 +6 -5
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/getAllVaults.d.ts.map +1 -1
- package/dist/esm/getAllVaults.js +2 -1
- package/dist/esm/getAllVaults.js.map +1 -1
- package/dist/esm/getAprs.d.ts.map +1 -1
- package/dist/esm/getAprs.js +22 -1
- package/dist/esm/getAprs.js.map +1 -1
- package/dist/esm/getTvls.d.ts.map +1 -1
- package/dist/esm/getTvls.js +12 -1
- package/dist/esm/getTvls.js.map +1 -1
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.d.ts.map +1 -1
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.js +25 -15
- package/dist/esm/sui-sdk/events/fetchAutoCompoundingEvents.js.map +1 -1
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.d.ts.map +1 -1
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.js +2 -1
- package/dist/esm/sui-sdk/events/fetchCheckRatioEvents.js.map +1 -1
- package/dist/esm/sui-sdk/events/fetchEvents.d.ts.map +1 -1
- package/dist/esm/sui-sdk/events/fetchEvents.js +9 -8
- package/dist/esm/sui-sdk/events/fetchEvents.js.map +1 -1
- package/dist/esm/sui-sdk/events/types.d.ts +4 -4
- package/dist/esm/sui-sdk/events/types.d.ts.map +1 -1
- package/dist/esm/sui-sdk/events/types.js.map +1 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaults.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaults.js +2 -1
- package/dist/esm/sui-sdk/functions/fetchUserVaults.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js +5 -4
- package/dist/esm/sui-sdk/functions/getPortfolioAmounts.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts +3 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +15 -3
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/esm/sui-sdk/transactions/fetchTransactions.d.ts.map +1 -1
- package/dist/esm/sui-sdk/transactions/fetchTransactions.js +2 -42
- package/dist/esm/sui-sdk/transactions/fetchTransactions.js.map +1 -1
- package/dist/esm/transactions/alphalend.d.ts +23 -0
- package/dist/esm/transactions/alphalend.d.ts.map +1 -0
- package/dist/esm/transactions/alphalend.js +628 -0
- package/dist/esm/transactions/alphalend.js.map +1 -0
- package/dist/esm/transactions/blueRewards.d.ts +4 -3
- package/dist/esm/transactions/blueRewards.d.ts.map +1 -1
- package/dist/esm/transactions/blueRewards.js +346 -54
- package/dist/esm/transactions/blueRewards.js.map +1 -1
- package/dist/esm/transactions/bluefin.d.ts +2 -1
- package/dist/esm/transactions/bluefin.d.ts.map +1 -1
- package/dist/esm/transactions/bluefin.js +173 -39
- package/dist/esm/transactions/bluefin.js.map +1 -1
- package/dist/esm/transactions/collect_rewards.d.ts.map +1 -1
- package/dist/esm/transactions/collect_rewards.js +21 -1
- package/dist/esm/transactions/collect_rewards.js.map +1 -1
- package/dist/esm/transactions/deposit.d.ts.map +1 -1
- package/dist/esm/transactions/deposit.js +11 -0
- package/dist/esm/transactions/deposit.js.map +1 -1
- package/dist/esm/transactions/navi-looping.d.ts +3 -0
- package/dist/esm/transactions/navi-looping.d.ts.map +1 -1
- package/dist/esm/transactions/navi-looping.js +286 -54
- 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 +40 -34
- package/dist/esm/transactions/navi.js.map +1 -1
- package/dist/esm/transactions/types.d.ts +3 -0
- package/dist/esm/transactions/types.d.ts.map +1 -1
- package/dist/esm/transactions/types.js.map +1 -1
- package/dist/esm/transactions/withdraw.d.ts.map +1 -1
- package/dist/esm/transactions/withdraw.js +13 -0
- package/dist/esm/transactions/withdraw.js.map +1 -1
- package/dist/esm/utils/getReceipts.d.ts.map +1 -1
- package/dist/esm/utils/getReceipts.js +2 -0
- package/dist/esm/utils/getReceipts.js.map +1 -1
- package/dist/esm/utils/prices.d.ts +3 -0
- package/dist/esm/utils/prices.d.ts.map +1 -1
- package/dist/esm/utils/prices.js +76 -36
- package/dist/esm/utils/prices.js.map +1 -1
- package/dist/esm/utils/userHoldings.d.ts.map +1 -1
- package/dist/esm/utils/userHoldings.js +5 -3
- package/dist/esm/utils/userHoldings.js.map +1 -1
- package/dist/esm/vaultFunctions.d.ts.map +1 -1
- package/dist/esm/vaultFunctions.js +1 -0
- package/dist/esm/vaultFunctions.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/functions/alphaLpBreakdown.html +1 -1
- package/docs/functions/cetusLpBreakdown.html +1 -1
- package/docs/functions/claimRewardTxb.html +1 -1
- package/docs/functions/claimRewardsTxb.html +1 -0
- package/docs/functions/coinAmountToXTokensDoubleAsset.html +1 -1
- package/docs/functions/coinAmountToXTokensSingleAsset.html +1 -1
- package/docs/functions/coinsInPool.html +1 -1
- package/docs/functions/collectRewards.html +1 -1
- package/docs/functions/deposit.html +1 -1
- package/docs/functions/depositDoubleAssetTxb.html +1 -1
- package/docs/functions/depositSingleAssetTxb.html +1 -1
- package/docs/functions/fetchAfterTransactionEvents.html +1 -1
- package/docs/functions/fetchAirdropClaimEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEvents.html +1 -1
- package/docs/functions/fetchAutoCompoundingEventsGql.html +1 -1
- package/docs/functions/fetchCetusPools.html +1 -1
- package/docs/functions/fetchChainIdentifier.html +1 -1
- package/docs/functions/fetchCheckRatioEvents.html +1 -1
- package/docs/functions/fetchEvents.html +1 -1
- package/docs/functions/fetchLiquidityChangeEvents.html +1 -1
- package/docs/functions/fetchMultiCategoryEvents.html +1 -1
- package/docs/functions/fetchMultiReceipts.html +1 -1
- package/docs/functions/fetchNftHolders.html +1 -1
- package/docs/functions/fetchPools.html +1 -1
- package/docs/functions/fetchPortfolioData.html +1 -1
- package/docs/functions/fetchProtocolData.html +1 -1
- package/docs/functions/fetchRequiredPrices.html +1 -0
- package/docs/functions/fetchTVL.html +1 -1
- package/docs/functions/fetchTransactions.html +1 -1
- package/docs/functions/fetchUserVaultBalances.html +1 -1
- package/docs/functions/fetchUserVaults.html +1 -1
- package/docs/functions/fetchUserWalletData.html +1 -1
- package/docs/functions/fetchVoloExchangeRate.html +1 -1
- package/docs/functions/fetchWithdrawV2Events.html +1 -1
- package/docs/functions/getAirdropShare.html +1 -1
- package/docs/functions/getAllDoubleAssetVaults.html +1 -1
- package/docs/functions/getAllSingleAssetVaults.html +1 -1
- package/docs/functions/getAllVaultBalances.html +1 -1
- package/docs/functions/getAllVaults.html +1 -1
- package/docs/functions/getAlphaUnlocks.html +1 -1
- package/docs/functions/getAlphaVaultBalance.html +1 -1
- package/docs/functions/getAmounts.html +1 -1
- package/docs/functions/getApr.html +1 -1
- package/docs/functions/getAprs.html +1 -1
- package/docs/functions/getApy.html +1 -1
- package/docs/functions/getApys.html +1 -1
- package/docs/functions/getCetusInvestorTicksMap.html +1 -1
- package/docs/functions/getCetusPool.html +1 -1
- package/docs/functions/getCetusSqrtPriceMap.html +1 -1
- package/docs/functions/getCoinAmountsFromLiquidity.html +1 -1
- package/docs/functions/getConf.html +1 -1
- package/docs/functions/getCurrentTick.html +1 -1
- package/docs/functions/getDistributor.html +1 -1
- package/docs/functions/getDoubleAssetVaultBalance.html +1 -1
- package/docs/functions/getDoubleAssetVaults.html +1 -1
- package/docs/functions/getInvestor.html +1 -1
- package/docs/functions/getInvestorPoolMap.html +1 -1
- package/docs/functions/getLastAutoCompoundTime.html +1 -1
- package/docs/functions/getLatestPrices.html +1 -1
- package/docs/functions/getLiquidity.html +1 -1
- package/docs/functions/getMultiCetusPool.html +1 -1
- package/docs/functions/getMultiInvestor.html +1 -1
- package/docs/functions/getMultiLatestPrices.html +1 -1
- package/docs/functions/getMultiParentPool.html +1 -1
- package/docs/functions/getMultiPool.html +1 -1
- package/docs/functions/getMultiReceipts.html +1 -1
- package/docs/functions/getParentPool.html +1 -1
- package/docs/functions/getPool.html +1 -1
- package/docs/functions/getPoolExchangeRate.html +1 -1
- package/docs/functions/getPoolExchangeRateMap.html +1 -1
- package/docs/functions/getPoolsWeightDistribution.html +1 -1
- package/docs/functions/getPositionRange.html +1 -1
- package/docs/functions/getPositionRanges.html +1 -1
- package/docs/functions/getPositionTicks.html +1 -1
- package/docs/functions/getPriceToTick.html +1 -1
- package/docs/functions/getRebalanceHistories.html +1 -1
- package/docs/functions/getRebalanceHistory.html +1 -1
- package/docs/functions/getReceipts.html +1 -1
- package/docs/functions/getSingleAssetVaultBalance.html +1 -1
- package/docs/functions/getSingleAssetVaults.html +1 -1
- package/docs/functions/getSuiClient.html +2 -2
- package/docs/functions/getSuiNodeUrl.html +2 -2
- package/docs/functions/getTVLs-1.html +1 -1
- package/docs/functions/getTickSpacing.html +1 -1
- package/docs/functions/getTickToPrice.html +1 -1
- package/docs/functions/getTvls.html +1 -1
- package/docs/functions/getVaultBalance.html +1 -1
- package/docs/functions/getVaults.html +1 -1
- package/docs/functions/getZapAmounts.html +1 -1
- package/docs/functions/lastAutocompoundTime.html +1 -1
- package/docs/functions/liquidityToTokens.html +1 -1
- package/docs/functions/migrateBoostedToLoop.html +1 -0
- 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 -0
- package/docs/functions/setCustomSuiClient.html +2 -2
- package/docs/functions/setSuiClient.html +2 -2
- package/docs/functions/setSuiNodeUrl.html +2 -2
- package/docs/functions/setWeights.html +1 -1
- package/docs/functions/withdraw.html +1 -1
- package/docs/functions/withdrawAlphaTxb.html +1 -1
- package/docs/functions/withdrawTxb.html +1 -1
- package/docs/functions/zapDepositTxb.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/Coin.html +6 -6
- package/docs/interfaces/CoinPair.html +2 -2
- package/docs/interfaces/CommonEventAttributes.html +2 -2
- package/docs/interfaces/NaviVoloData.html +2 -2
- package/docs/interfaces/PoolData.html +2 -2
- package/docs/interfaces/PoolWeightDistribution.html +2 -2
- package/docs/interfaces/RebalanceHistoryType.html +2 -2
- package/docs/modules.html +9 -5
- package/docs/types/AfterTransactionEventNode.html +1 -1
- package/docs/types/AirdropClaimEventNode.html +1 -1
- package/docs/types/Allocator.html +1 -1
- package/docs/types/AlphaFiDoubleAssetVault.html +1 -1
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
- package/docs/types/AlphaFiSingleAssetVault.html +1 -1
- package/docs/types/AlphaFiVault.html +1 -1
- package/docs/types/AlphaFiVaultBalance.html +1 -1
- package/docs/types/AlphaLendInvestor.html +1 -0
- package/docs/types/AlphaPoolType.html +1 -1
- package/docs/types/AlphaReceipt.html +1 -1
- package/docs/types/AlphaReceiptFields.html +1 -1
- package/docs/types/AlphaVaultBalance.html +1 -1
- package/docs/types/AutoBalancePoolNames.html +1 -1
- package/docs/types/AutoCompoundingEventNode.html +1 -1
- package/docs/types/BluefinInvestor.html +1 -1
- package/docs/types/BluefinPoolType.html +1 -1
- package/docs/types/BucketInvestor.html +1 -1
- package/docs/types/CetusInvestor.html +1 -1
- package/docs/types/CetusPoolType.html +1 -1
- package/docs/types/CetusSwapOptions.html +1 -1
- package/docs/types/CoinAmounts.html +1 -1
- package/docs/types/CoinName.html +1 -1
- package/docs/types/CoinType.html +1 -1
- package/docs/types/CommonInvestorFields.html +1 -1
- package/docs/types/CreatePoolOptions.html +1 -1
- package/docs/types/Distributor.html +1 -1
- package/docs/types/DoubleAssetMultiVaultBalance.html +1 -1
- package/docs/types/DoubleAssetPoolNames.html +1 -1
- package/docs/types/DoubleAssetTokenHoldings.html +1 -1
- package/docs/types/DoubleAssetVaultBalance.html +1 -1
- package/docs/types/EventCategory.html +1 -1
- package/docs/types/EventNode.html +1 -1
- package/docs/types/GetHoldersParams.html +1 -1
- package/docs/types/GetTokenHoldingsParams.html +1 -1
- package/docs/types/GetUserTokensFromTransactionsParams.html +1 -1
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +1 -1
- package/docs/types/GetVaultBalanceParams.html +1 -1
- package/docs/types/HoldingsObj.html +1 -1
- package/docs/types/Icon.html +1 -1
- package/docs/types/Investor.html +1 -1
- package/docs/types/LiquidityChangeEventNode.html +1 -1
- package/docs/types/LiquidityToTokensParams.html +1 -1
- package/docs/types/LiquidityToUsdParams.html +1 -1
- package/docs/types/LoopingDebt.html +1 -1
- package/docs/types/LoopingPoolNames.html +1 -1
- package/docs/types/LpBreakdownType.html +1 -1
- package/docs/types/MemberPoolDataType.html +1 -1
- package/docs/types/MemberType.html +1 -1
- package/docs/types/MultiGetVaultBalancesParams.html +1 -1
- package/docs/types/NaviInvestor.html +1 -1
- package/docs/types/OtherReceiptFields.html +1 -1
- package/docs/types/PoolName.html +1 -1
- package/docs/types/PoolReceipt.html +1 -1
- package/docs/types/PoolType.html +1 -1
- package/docs/types/Receipt.html +1 -1
- package/docs/types/ReceiptGQL.html +1 -1
- package/docs/types/SingleAssetMultiVaultBalance.html +1 -1
- package/docs/types/SingleAssetPoolNames.html +1 -1
- package/docs/types/SingleAssetTokenHoldings.html +1 -1
- package/docs/types/SingleAssetVaultBalance.html +1 -1
- package/docs/types/SingleGetVaultBalancesParams.html +1 -1
- package/docs/types/StrategyType.html +1 -1
- package/docs/types/SuiNetwork.html +1 -1
- package/docs/types/SwapOptions.html +1 -1
- package/docs/types/TickSpacing.html +1 -1
- package/docs/types/TotalWeightType.html +1 -1
- package/docs/types/TransactionBlockType.html +1 -1
- package/docs/types/UserPoolLiquidity.html +1 -1
- package/docs/types/UserPoolTokenHoldings.html +1 -1
- package/docs/types/UserUsdHoldings.html +1 -1
- package/docs/types/VaultBalance.html +1 -1
- package/docs/types/VoteCastEvent.html +1 -1
- package/docs/types/WithdrawV2EventNode.html +1 -1
- package/docs/variables/alphalendMarketIdMap.html +1 -0
- package/docs/variables/bluefinPoolMap.html +1 -1
- package/docs/variables/cetusPoolMap.html +1 -1
- package/docs/variables/coinsList.html +1 -1
- package/docs/variables/defunctPoolsSet.html +1 -1
- package/docs/variables/doubleAssetPoolCoinMap.html +1 -1
- package/docs/variables/eventCategories.html +1 -1
- package/docs/variables/ignoredWalletsForDailyRevenue.html +1 -1
- package/docs/variables/loopingAccountAddresses.html +1 -1
- package/docs/variables/loopingPoolCoinMap.html +1 -1
- package/docs/variables/naviAssetMap.html +1 -1
- package/docs/variables/poolIdPoolNameMap.html +1 -1
- package/docs/variables/poolInfo.html +1 -1
- package/docs/variables/singleAssetPoolCoinMap.html +1 -1
- package/docs/variables/stableCoins.html +1 -1
- package/package.json +3 -2
- package/#t.ts# +0 -8
- package/dist/cjs/collectReward.d.ts +0 -2
- package/dist/cjs/collectReward.d.ts.map +0 -1
- package/dist/cjs/collectReward.js +0 -7
- package/dist/cjs/collectReward.js.map +0 -1
- package/dist/cjs/getHoldersFromTransactions.d.ts +0 -9
- package/dist/cjs/getHoldersFromTransactions.d.ts.map +0 -1
- package/dist/cjs/getHoldersFromTransactions.js +0 -87
- package/dist/cjs/getHoldersFromTransactions.js.map +0 -1
- package/dist/cjs/getTVL.d.ts +0 -5
- package/dist/cjs/getTVL.d.ts.map +0 -1
- package/dist/cjs/getTVL.js +0 -109
- package/dist/cjs/getTVL.js.map +0 -1
- package/dist/cjs/transactions/deposit1.d.ts +0 -1
- package/dist/cjs/transactions/deposit1.d.ts.map +0 -1
- package/dist/cjs/transactions/deposit1.js +0 -86
- package/dist/cjs/transactions/deposit1.js.map +0 -1
- package/dist/cjs/utils/getHoldersFromTransactionsUtils.d.ts +0 -6
- package/dist/cjs/utils/getHoldersFromTransactionsUtils.d.ts.map +0 -1
- package/dist/cjs/utils/getHoldersFromTransactionsUtils.js +0 -132
- package/dist/cjs/utils/getHoldersFromTransactionsUtils.js.map +0 -1
- package/dist/esm/collectReward.d.ts +0 -2
- package/dist/esm/collectReward.d.ts.map +0 -1
- package/dist/esm/collectReward.js +0 -4
- package/dist/esm/collectReward.js.map +0 -1
- package/dist/esm/getHoldersFromTransactions.d.ts +0 -9
- package/dist/esm/getHoldersFromTransactions.d.ts.map +0 -1
- package/dist/esm/getHoldersFromTransactions.js +0 -82
- package/dist/esm/getHoldersFromTransactions.js.map +0 -1
- package/dist/esm/getTVL.d.ts +0 -5
- package/dist/esm/getTVL.d.ts.map +0 -1
- package/dist/esm/getTVL.js +0 -103
- package/dist/esm/getTVL.js.map +0 -1
- package/dist/esm/transactions/deposit1.d.ts +0 -2
- package/dist/esm/transactions/deposit1.d.ts.map +0 -1
- package/dist/esm/transactions/deposit1.js +0 -86
- package/dist/esm/transactions/deposit1.js.map +0 -1
- package/dist/esm/utils/getHoldersFromTransactionsUtils.d.ts +0 -6
- package/dist/esm/utils/getHoldersFromTransactionsUtils.d.ts.map +0 -1
- package/dist/esm/utils/getHoldersFromTransactionsUtils.js +0 -127
- package/dist/esm/utils/getHoldersFromTransactionsUtils.js.map +0 -1
- package/docs/functions/claimBlueRewardTxb.html +0 -1
- package/docs/functions/pendingBlueRewardAmount.html +0 -1
|
@@ -23,18 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
26
|
+
exports.claimRewardsTxb = claimRewardsTxb;
|
|
27
|
+
exports.pendingRewardAmount = pendingRewardAmount;
|
|
28
28
|
const decimal_js_1 = require("decimal.js");
|
|
29
29
|
const index_js_1 = require("../index.js");
|
|
30
30
|
const transactions_1 = require("@mysten/sui/transactions");
|
|
31
|
-
|
|
31
|
+
const maps_js_1 = require("../common/maps.js");
|
|
32
|
+
async function claimRewardsTxb(userAddress, poolName) {
|
|
32
33
|
const { getReceipts } = await Promise.resolve().then(() => __importStar(require("../index.js")));
|
|
33
34
|
try {
|
|
34
35
|
const receipts = await getReceipts(poolName, userAddress, true);
|
|
35
36
|
const txb = new transactions_1.Transaction();
|
|
36
37
|
const pool = index_js_1.poolInfo[poolName];
|
|
37
|
-
|
|
38
|
+
const coin1 = index_js_1.doubleAssetPoolCoinMap[poolName].coin1;
|
|
39
|
+
const coin2 = index_js_1.doubleAssetPoolCoinMap[poolName].coin2;
|
|
40
|
+
const rewards = [];
|
|
38
41
|
if (poolName === "BLUEFIN-AUTOBALANCE-USDT-USDC") {
|
|
39
42
|
txb.moveCall({
|
|
40
43
|
target: `${pool.packageId}::alphafi_bluefin_type_1_pool::collect_and_swap_trade_fee`,
|
|
@@ -52,7 +55,7 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
52
55
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
53
56
|
],
|
|
54
57
|
});
|
|
55
|
-
blueBalance = txb.moveCall({
|
|
58
|
+
const blueBalance = txb.moveCall({
|
|
56
59
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_v2`,
|
|
57
60
|
typeArguments: [
|
|
58
61
|
index_js_1.coinsList["USDT"].type,
|
|
@@ -77,15 +80,72 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
77
80
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
78
81
|
],
|
|
79
82
|
});
|
|
83
|
+
const blueCoin = txb.moveCall({
|
|
84
|
+
target: "0x2::coin::from_balance",
|
|
85
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
86
|
+
arguments: [blueBalance],
|
|
87
|
+
});
|
|
88
|
+
rewards.push(blueCoin);
|
|
80
89
|
}
|
|
81
90
|
else if (poolName === "BLUEFIN-AUTOBALANCE-SUI-USDC") {
|
|
82
|
-
|
|
83
|
-
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::
|
|
91
|
+
txb.moveCall({
|
|
92
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
93
|
+
typeArguments: [
|
|
94
|
+
index_js_1.coinsList[coin1].type,
|
|
95
|
+
index_js_1.coinsList[coin2].type,
|
|
96
|
+
index_js_1.coinsList["BLUE"].type,
|
|
97
|
+
],
|
|
98
|
+
arguments: [
|
|
99
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
100
|
+
txb.object(pool.poolId),
|
|
101
|
+
txb.object(pool.investorId),
|
|
102
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
103
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
104
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
105
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
106
|
+
],
|
|
107
|
+
});
|
|
108
|
+
txb.moveCall({
|
|
109
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
110
|
+
typeArguments: [
|
|
111
|
+
index_js_1.coinsList[coin1].type,
|
|
112
|
+
index_js_1.coinsList[coin2].type,
|
|
113
|
+
index_js_1.coinsList["STSUI"].type,
|
|
114
|
+
],
|
|
115
|
+
arguments: [
|
|
116
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
117
|
+
txb.object(pool.poolId),
|
|
118
|
+
txb.object(pool.investorId),
|
|
119
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
120
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
121
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
122
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
123
|
+
],
|
|
124
|
+
});
|
|
125
|
+
const blueBalance = txb.moveCall({
|
|
126
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
84
127
|
typeArguments: [
|
|
85
128
|
index_js_1.coinsList["SUI"].type,
|
|
86
129
|
index_js_1.coinsList["USDC"].type,
|
|
87
130
|
index_js_1.coinsList["BLUE"].type,
|
|
131
|
+
],
|
|
132
|
+
arguments: [
|
|
133
|
+
txb.object(receipts[0].objectId),
|
|
134
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
135
|
+
txb.object(pool.poolId),
|
|
136
|
+
txb.object(pool.investorId),
|
|
137
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
138
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
139
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
140
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
141
|
+
],
|
|
142
|
+
});
|
|
143
|
+
const stsuiBalance = txb.moveCall({
|
|
144
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
145
|
+
typeArguments: [
|
|
88
146
|
index_js_1.coinsList["SUI"].type,
|
|
147
|
+
index_js_1.coinsList["USDC"].type,
|
|
148
|
+
index_js_1.coinsList["STSUI"].type,
|
|
89
149
|
],
|
|
90
150
|
arguments: [
|
|
91
151
|
txb.object(receipts[0].objectId),
|
|
@@ -94,15 +154,70 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
94
154
|
txb.object(pool.investorId),
|
|
95
155
|
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
96
156
|
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
97
|
-
txb.object((0, index_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
|
|
98
157
|
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
99
|
-
txb.object((0, index_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
100
|
-
txb.object(index_js_1.cetusPoolMap["USDC-SUI"]),
|
|
101
|
-
txb.object((0, index_js_1.getConf)().LST_INFO),
|
|
102
|
-
txb.object((0, index_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
103
158
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
104
159
|
],
|
|
105
160
|
});
|
|
161
|
+
const suiBalance = txb.moveCall({
|
|
162
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
163
|
+
typeArguments: [
|
|
164
|
+
index_js_1.coinsList["SUI"].type,
|
|
165
|
+
index_js_1.coinsList["USDC"].type,
|
|
166
|
+
index_js_1.coinsList["SUI"].type,
|
|
167
|
+
],
|
|
168
|
+
arguments: [
|
|
169
|
+
txb.object(receipts[0].objectId),
|
|
170
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
171
|
+
txb.object(pool.poolId),
|
|
172
|
+
txb.object(pool.investorId),
|
|
173
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
174
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
175
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
176
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
177
|
+
],
|
|
178
|
+
});
|
|
179
|
+
const usdcBalance = txb.moveCall({
|
|
180
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
181
|
+
typeArguments: [
|
|
182
|
+
index_js_1.coinsList["SUI"].type,
|
|
183
|
+
index_js_1.coinsList["USDC"].type,
|
|
184
|
+
index_js_1.coinsList["USDC"].type,
|
|
185
|
+
],
|
|
186
|
+
arguments: [
|
|
187
|
+
txb.object(receipts[0].objectId),
|
|
188
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
189
|
+
txb.object(pool.poolId),
|
|
190
|
+
txb.object(pool.investorId),
|
|
191
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
192
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
193
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_USDC_POOL),
|
|
194
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
195
|
+
],
|
|
196
|
+
});
|
|
197
|
+
const blueCoin = txb.moveCall({
|
|
198
|
+
target: "0x2::coin::from_balance",
|
|
199
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
200
|
+
arguments: [blueBalance],
|
|
201
|
+
});
|
|
202
|
+
const stsuiCoin = txb.moveCall({
|
|
203
|
+
target: "0x2::coin::from_balance",
|
|
204
|
+
typeArguments: [index_js_1.coinsList["STSUI"].type],
|
|
205
|
+
arguments: [stsuiBalance],
|
|
206
|
+
});
|
|
207
|
+
const suiCoin = txb.moveCall({
|
|
208
|
+
target: "0x2::coin::from_balance",
|
|
209
|
+
typeArguments: [index_js_1.coinsList["SUI"].type],
|
|
210
|
+
arguments: [suiBalance],
|
|
211
|
+
});
|
|
212
|
+
const usdcCoin = txb.moveCall({
|
|
213
|
+
target: "0x2::coin::from_balance",
|
|
214
|
+
typeArguments: [index_js_1.coinsList["USDC"].type],
|
|
215
|
+
arguments: [usdcBalance],
|
|
216
|
+
});
|
|
217
|
+
rewards.push(blueCoin);
|
|
218
|
+
rewards.push(stsuiCoin);
|
|
219
|
+
rewards.push(suiCoin);
|
|
220
|
+
rewards.push(usdcCoin);
|
|
106
221
|
}
|
|
107
222
|
else if (poolName === "BLUEFIN-AUTOBALANCE-SUIUSDT-USDC") {
|
|
108
223
|
txb.moveCall({
|
|
@@ -121,7 +236,7 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
121
236
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
122
237
|
],
|
|
123
238
|
});
|
|
124
|
-
blueBalance = txb.moveCall({
|
|
239
|
+
const blueBalance = txb.moveCall({
|
|
125
240
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_v2`,
|
|
126
241
|
typeArguments: [
|
|
127
242
|
index_js_1.coinsList["SUIUSDT"].type,
|
|
@@ -146,9 +261,15 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
146
261
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
147
262
|
],
|
|
148
263
|
});
|
|
264
|
+
const blueCoin = txb.moveCall({
|
|
265
|
+
target: "0x2::coin::from_balance",
|
|
266
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
267
|
+
arguments: [blueBalance],
|
|
268
|
+
});
|
|
269
|
+
rewards.push(blueCoin);
|
|
149
270
|
}
|
|
150
271
|
else if (poolName === "BLUEFIN-AUTOBALANCE-DEEP-BLUE") {
|
|
151
|
-
blueBalance = txb.moveCall({
|
|
272
|
+
const blueBalance = txb.moveCall({
|
|
152
273
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_v2`,
|
|
153
274
|
typeArguments: [
|
|
154
275
|
index_js_1.coinsList["DEEP"].type,
|
|
@@ -173,9 +294,15 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
173
294
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
174
295
|
],
|
|
175
296
|
});
|
|
297
|
+
const blueCoin = txb.moveCall({
|
|
298
|
+
target: "0x2::coin::from_balance",
|
|
299
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
300
|
+
arguments: [blueBalance],
|
|
301
|
+
});
|
|
302
|
+
rewards.push(blueCoin);
|
|
176
303
|
}
|
|
177
304
|
else if (poolName === "BLUEFIN-AUTOBALANCE-DEEP-SUI") {
|
|
178
|
-
blueBalance = txb.moveCall({
|
|
305
|
+
const blueBalance = txb.moveCall({
|
|
179
306
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_sui_second_pool::get_user_rewards_v2`,
|
|
180
307
|
typeArguments: [
|
|
181
308
|
index_js_1.coinsList["DEEP"].type,
|
|
@@ -198,9 +325,15 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
198
325
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
199
326
|
],
|
|
200
327
|
});
|
|
328
|
+
const blueCoin = txb.moveCall({
|
|
329
|
+
target: "0x2::coin::from_balance",
|
|
330
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
331
|
+
arguments: [blueBalance],
|
|
332
|
+
});
|
|
333
|
+
rewards.push(blueCoin);
|
|
201
334
|
}
|
|
202
335
|
else if (poolName === "BLUEFIN-AUTOBALANCE-BLUE-SUI") {
|
|
203
|
-
blueBalance = txb.moveCall({
|
|
336
|
+
const blueBalance = txb.moveCall({
|
|
204
337
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_sui_second_pool::get_user_rewards_v2`,
|
|
205
338
|
typeArguments: [
|
|
206
339
|
index_js_1.coinsList["BLUE"].type,
|
|
@@ -223,15 +356,142 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
223
356
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
224
357
|
],
|
|
225
358
|
});
|
|
359
|
+
const blueCoin = txb.moveCall({
|
|
360
|
+
target: "0x2::coin::from_balance",
|
|
361
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
362
|
+
arguments: [blueBalance],
|
|
363
|
+
});
|
|
364
|
+
rewards.push(blueCoin);
|
|
226
365
|
}
|
|
227
366
|
else if (poolName === "BLUEFIN-AUTOBALANCE-SUI-LBTC") {
|
|
228
|
-
|
|
229
|
-
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::
|
|
367
|
+
txb.moveCall({
|
|
368
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
369
|
+
typeArguments: [
|
|
370
|
+
index_js_1.coinsList[coin1].type,
|
|
371
|
+
index_js_1.coinsList[coin2].type,
|
|
372
|
+
index_js_1.coinsList["BLUE"].type,
|
|
373
|
+
],
|
|
374
|
+
arguments: [
|
|
375
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
376
|
+
txb.object(pool.poolId),
|
|
377
|
+
txb.object(pool.investorId),
|
|
378
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
379
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
380
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
381
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
382
|
+
],
|
|
383
|
+
});
|
|
384
|
+
txb.moveCall({
|
|
385
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
386
|
+
typeArguments: [
|
|
387
|
+
index_js_1.coinsList[coin1].type,
|
|
388
|
+
index_js_1.coinsList[coin2].type,
|
|
389
|
+
index_js_1.coinsList["STSUI"].type,
|
|
390
|
+
],
|
|
391
|
+
arguments: [
|
|
392
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
393
|
+
txb.object(pool.poolId),
|
|
394
|
+
txb.object(pool.investorId),
|
|
395
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
396
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
397
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
398
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
399
|
+
],
|
|
400
|
+
});
|
|
401
|
+
txb.moveCall({
|
|
402
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::collect_reward`,
|
|
403
|
+
typeArguments: [
|
|
404
|
+
index_js_1.coinsList[coin1].type,
|
|
405
|
+
index_js_1.coinsList[coin2].type,
|
|
406
|
+
index_js_1.coinsList["DEEP"].type,
|
|
407
|
+
],
|
|
408
|
+
arguments: [
|
|
409
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
410
|
+
txb.object(pool.poolId),
|
|
411
|
+
txb.object(pool.investorId),
|
|
412
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
413
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
414
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
415
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
416
|
+
],
|
|
417
|
+
});
|
|
418
|
+
const blueBalance = txb.moveCall({
|
|
419
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
230
420
|
typeArguments: [
|
|
231
421
|
index_js_1.coinsList["SUI"].type,
|
|
232
422
|
index_js_1.coinsList["LBTC"].type,
|
|
233
423
|
index_js_1.coinsList["BLUE"].type,
|
|
424
|
+
],
|
|
425
|
+
arguments: [
|
|
426
|
+
txb.object(receipts[0].objectId),
|
|
427
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
428
|
+
txb.object(pool.poolId),
|
|
429
|
+
txb.object(pool.investorId),
|
|
430
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
431
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
432
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
433
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
434
|
+
],
|
|
435
|
+
});
|
|
436
|
+
const stsuiBalance = txb.moveCall({
|
|
437
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
438
|
+
typeArguments: [
|
|
234
439
|
index_js_1.coinsList["SUI"].type,
|
|
440
|
+
index_js_1.coinsList["LBTC"].type,
|
|
441
|
+
index_js_1.coinsList["STSUI"].type,
|
|
442
|
+
],
|
|
443
|
+
arguments: [
|
|
444
|
+
txb.object(receipts[0].objectId),
|
|
445
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
446
|
+
txb.object(pool.poolId),
|
|
447
|
+
txb.object(pool.investorId),
|
|
448
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
449
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
450
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
451
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
452
|
+
],
|
|
453
|
+
});
|
|
454
|
+
const suiBalance = txb.moveCall({
|
|
455
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
456
|
+
typeArguments: [
|
|
457
|
+
index_js_1.coinsList["SUI"].type,
|
|
458
|
+
index_js_1.coinsList["LBTC"].type,
|
|
459
|
+
index_js_1.coinsList["SUI"].type,
|
|
460
|
+
],
|
|
461
|
+
arguments: [
|
|
462
|
+
txb.object(receipts[0].objectId),
|
|
463
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
464
|
+
txb.object(pool.poolId),
|
|
465
|
+
txb.object(pool.investorId),
|
|
466
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
467
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
468
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
469
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
470
|
+
],
|
|
471
|
+
});
|
|
472
|
+
const lbtcBalance = txb.moveCall({
|
|
473
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
474
|
+
typeArguments: [
|
|
475
|
+
index_js_1.coinsList["SUI"].type,
|
|
476
|
+
index_js_1.coinsList["LBTC"].type,
|
|
477
|
+
index_js_1.coinsList["LBTC"].type,
|
|
478
|
+
],
|
|
479
|
+
arguments: [
|
|
480
|
+
txb.object(receipts[0].objectId),
|
|
481
|
+
txb.object((0, index_js_1.getConf)().ALPHA_BLUEFIN_AUTOBALANCE_VERSION),
|
|
482
|
+
txb.object(pool.poolId),
|
|
483
|
+
txb.object(pool.investorId),
|
|
484
|
+
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
485
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
486
|
+
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
487
|
+
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
488
|
+
],
|
|
489
|
+
});
|
|
490
|
+
const deepBalance = txb.moveCall({
|
|
491
|
+
target: `${pool.packageId}::alphafi_bluefin_sui_first_pool::get_user_rewards_v4`,
|
|
492
|
+
typeArguments: [
|
|
493
|
+
index_js_1.coinsList["SUI"].type,
|
|
494
|
+
index_js_1.coinsList["LBTC"].type,
|
|
235
495
|
index_js_1.coinsList["DEEP"].type,
|
|
236
496
|
],
|
|
237
497
|
arguments: [
|
|
@@ -241,16 +501,40 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
241
501
|
txb.object(pool.investorId),
|
|
242
502
|
txb.object((0, index_js_1.getConf)().ALPHA_DISTRIBUTOR),
|
|
243
503
|
txb.object((0, index_js_1.getConf)().BLUEFIN_GLOBAL_CONFIG),
|
|
244
|
-
txb.object((0, index_js_1.getConf)().CETUS_GLOBAL_CONFIG_ID),
|
|
245
504
|
txb.object((0, index_js_1.getConf)().BLUEFIN_SUI_LBTC_POOL),
|
|
246
|
-
txb.object((0, index_js_1.getConf)().BLUEFIN_BLUE_SUI_POOL),
|
|
247
|
-
txb.object(index_js_1.bluefinPoolMap["DEEP-SUI"]),
|
|
248
|
-
txb.object(index_js_1.cetusPoolMap["LBTC-SUI"]),
|
|
249
|
-
txb.object((0, index_js_1.getConf)().LST_INFO),
|
|
250
|
-
txb.object((0, index_js_1.getConf)().SUI_SYSTEM_STATE),
|
|
251
505
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
252
506
|
],
|
|
253
507
|
});
|
|
508
|
+
const blueCoin = txb.moveCall({
|
|
509
|
+
target: "0x2::coin::from_balance",
|
|
510
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
511
|
+
arguments: [blueBalance],
|
|
512
|
+
});
|
|
513
|
+
const stsuiCoin = txb.moveCall({
|
|
514
|
+
target: "0x2::coin::from_balance",
|
|
515
|
+
typeArguments: [index_js_1.coinsList["STSUI"].type],
|
|
516
|
+
arguments: [stsuiBalance],
|
|
517
|
+
});
|
|
518
|
+
const suiCoin = txb.moveCall({
|
|
519
|
+
target: "0x2::coin::from_balance",
|
|
520
|
+
typeArguments: [index_js_1.coinsList["SUI"].type],
|
|
521
|
+
arguments: [suiBalance],
|
|
522
|
+
});
|
|
523
|
+
const lbtcCoin = txb.moveCall({
|
|
524
|
+
target: "0x2::coin::from_balance",
|
|
525
|
+
typeArguments: [index_js_1.coinsList["LBTC"].type],
|
|
526
|
+
arguments: [lbtcBalance],
|
|
527
|
+
});
|
|
528
|
+
const deepCoin = txb.moveCall({
|
|
529
|
+
target: "0x2::coin::from_balance",
|
|
530
|
+
typeArguments: [index_js_1.coinsList["DEEP"].type],
|
|
531
|
+
arguments: [deepBalance],
|
|
532
|
+
});
|
|
533
|
+
rewards.push(blueCoin);
|
|
534
|
+
rewards.push(stsuiCoin);
|
|
535
|
+
rewards.push(suiCoin);
|
|
536
|
+
rewards.push(lbtcCoin);
|
|
537
|
+
rewards.push(deepCoin);
|
|
254
538
|
}
|
|
255
539
|
else if (poolName === "BLUEFIN-AUTOBALANCE-WAL-USDC") {
|
|
256
540
|
txb.moveCall({
|
|
@@ -269,7 +553,7 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
269
553
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
270
554
|
],
|
|
271
555
|
});
|
|
272
|
-
blueBalance = txb.moveCall({
|
|
556
|
+
const blueBalance = txb.moveCall({
|
|
273
557
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_v2`,
|
|
274
558
|
typeArguments: [
|
|
275
559
|
index_js_1.coinsList["WAL"].type,
|
|
@@ -294,6 +578,12 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
294
578
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
295
579
|
],
|
|
296
580
|
});
|
|
581
|
+
const blueCoin = txb.moveCall({
|
|
582
|
+
target: "0x2::coin::from_balance",
|
|
583
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
584
|
+
arguments: [blueBalance],
|
|
585
|
+
});
|
|
586
|
+
rewards.push(blueCoin);
|
|
297
587
|
}
|
|
298
588
|
else if (poolName === "BLUEFIN-AUTOBALANCE-SUIUSDT-USDC-ZERO-ZERO") {
|
|
299
589
|
txb.moveCall({
|
|
@@ -312,7 +602,7 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
312
602
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
313
603
|
],
|
|
314
604
|
});
|
|
315
|
-
blueBalance = txb.moveCall({
|
|
605
|
+
const blueBalance = txb.moveCall({
|
|
316
606
|
target: `${index_js_1.poolInfo[poolName].packageId}::alphafi_bluefin_type_1_pool::get_user_rewards_v2`,
|
|
317
607
|
typeArguments: [
|
|
318
608
|
index_js_1.coinsList["SUIUSDT"].type,
|
|
@@ -337,59 +627,61 @@ async function claimBlueRewardTxb(userAddress, poolName) {
|
|
|
337
627
|
txb.object((0, index_js_1.getConf)().CLOCK_PACKAGE_ID),
|
|
338
628
|
],
|
|
339
629
|
});
|
|
630
|
+
const blueCoin = txb.moveCall({
|
|
631
|
+
target: "0x2::coin::from_balance",
|
|
632
|
+
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
633
|
+
arguments: [blueBalance],
|
|
634
|
+
});
|
|
635
|
+
rewards.push(blueCoin);
|
|
340
636
|
}
|
|
341
|
-
|
|
342
|
-
target: "0x2::coin::from_balance",
|
|
343
|
-
typeArguments: [index_js_1.coinsList["BLUE"].type],
|
|
344
|
-
arguments: [blueBalance],
|
|
345
|
-
});
|
|
346
|
-
return { txb: txb, coinOut: blueCoin };
|
|
637
|
+
return { txb: txb, coinOut: rewards };
|
|
347
638
|
}
|
|
348
639
|
catch (e) {
|
|
349
640
|
console.error("error in claim blue rewards", e);
|
|
350
641
|
}
|
|
351
642
|
}
|
|
352
|
-
async function
|
|
643
|
+
async function pendingRewardAmount(userAddress, poolName) {
|
|
353
644
|
const { getReceipts } = await Promise.resolve().then(() => __importStar(require("../index.js")));
|
|
354
645
|
try {
|
|
355
646
|
const receipts = await getReceipts(poolName, userAddress, true);
|
|
356
647
|
const receipt = receipts[0];
|
|
357
648
|
const userXtokenBalance = receipt.content.fields.xTokenBalance;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
649
|
+
const totalPendingRewardAmounts = {};
|
|
650
|
+
const userPendingReward = {};
|
|
651
|
+
const curAcc = {};
|
|
652
|
+
const lastAcc = {};
|
|
361
653
|
const userPendingRewardsAll = receipt.content.fields.pending_rewards.fields.contents;
|
|
362
654
|
for (let i = 0; i < userPendingRewardsAll.length; i++) {
|
|
363
|
-
|
|
364
|
-
index_js_1.coinsList["BLUE"].type.substring(2)) {
|
|
365
|
-
userBluePendingReward = new decimal_js_1.Decimal(userPendingRewardsAll[i].fields.value);
|
|
366
|
-
break;
|
|
367
|
-
}
|
|
655
|
+
userPendingReward["0x" + userPendingRewardsAll[i].fields.key.fields.name] = userPendingRewardsAll[i].fields.value;
|
|
368
656
|
}
|
|
369
657
|
const pool = await (0, index_js_1.getPool)(poolName, false);
|
|
370
658
|
const currAccForAllRewards = pool.content.fields.acc_rewards_per_xtoken.fields.contents;
|
|
371
659
|
currAccForAllRewards?.forEach((reward) => {
|
|
372
|
-
|
|
373
|
-
curAcc = new decimal_js_1.Decimal(reward.fields.value);
|
|
374
|
-
}
|
|
660
|
+
curAcc["0x" + reward.fields.key.fields.name] = reward.fields.value;
|
|
375
661
|
});
|
|
376
662
|
const lastAccAll = receipt.content.fields.last_acc_reward_per_xtoken.fields.contents;
|
|
377
663
|
lastAccAll.forEach((reward) => {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
664
|
+
lastAcc["0x" + reward.fields.key.fields.name] = reward.fields.value;
|
|
665
|
+
});
|
|
666
|
+
const coinTypeToCoin = maps_js_1.coinTypeMap;
|
|
667
|
+
Object.keys(curAcc).forEach((type) => {
|
|
668
|
+
const cur = new decimal_js_1.Decimal(curAcc[type]);
|
|
669
|
+
const last = new decimal_js_1.Decimal(type in lastAcc ? lastAcc[type] : "0");
|
|
670
|
+
const pending = new decimal_js_1.Decimal(type in userPendingReward ? userPendingReward[type] : "0");
|
|
671
|
+
const totalPending = cur
|
|
672
|
+
.minus(last)
|
|
673
|
+
.mul(userXtokenBalance)
|
|
674
|
+
.div(1e36)
|
|
675
|
+
.plus(pending)
|
|
676
|
+
.div(Math.pow(10, index_js_1.coinsList[coinTypeToCoin[type]].expo))
|
|
677
|
+
.toString();
|
|
678
|
+
totalPendingRewardAmounts[type] = totalPending.toString();
|
|
381
679
|
});
|
|
382
|
-
return
|
|
383
|
-
.minus(lastAcc)
|
|
384
|
-
.mul(userXtokenBalance)
|
|
385
|
-
.div(1e36)
|
|
386
|
-
.plus(userBluePendingReward)
|
|
387
|
-
.div(Math.pow(10, index_js_1.coinsList["BLUE"].expo))
|
|
388
|
-
.toString();
|
|
680
|
+
return totalPendingRewardAmounts;
|
|
389
681
|
}
|
|
390
682
|
catch (e) {
|
|
391
683
|
console.error("error in calculate pending blue rewards", e);
|
|
392
|
-
return
|
|
684
|
+
return {};
|
|
393
685
|
}
|
|
394
686
|
}
|
|
395
687
|
//# sourceMappingURL=blueRewards.js.map
|