@alphafi/alphafi-sdk 0.0.102 → 0.0.103
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/FETCH_OVERRIDE_FIX.md +222 -0
- package/dist/cjs/adminFunctions.d.ts +8 -0
- package/dist/cjs/adminFunctions.d.ts.map +1 -1
- package/dist/cjs/adminFunctions.js +97 -3
- package/dist/cjs/adminFunctions.js.map +1 -1
- package/dist/cjs/common/constants.d.ts +79 -10
- package/dist/cjs/common/constants.d.ts.map +1 -1
- package/dist/cjs/common/constants.js +108 -23
- package/dist/cjs/common/constants.js.map +1 -1
- package/dist/cjs/common/maps.d.ts.map +1 -1
- package/dist/cjs/common/maps.js +72 -4
- package/dist/cjs/common/maps.js.map +1 -1
- package/dist/cjs/common/types.d.ts +76 -26
- package/dist/cjs/common/types.d.ts.map +1 -1
- package/dist/cjs/common/types.js.map +1 -1
- package/dist/cjs/getAprs.d.ts.map +1 -1
- package/dist/cjs/getAprs.js +0 -27
- package/dist/cjs/getAprs.js.map +1 -1
- package/dist/cjs/graphql/getMultiReceipts.js +1 -1
- package/dist/cjs/graphql/getMultiReceipts.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +13 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts +4 -0
- package/dist/cjs/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/cjs/sui-sdk/functions/getReceipts.js +31 -15
- package/dist/cjs/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/cjs/transactions/alphaVault.d.ts +26 -0
- package/dist/cjs/transactions/alphaVault.d.ts.map +1 -0
- package/dist/cjs/transactions/alphaVault.js +385 -0
- package/dist/cjs/transactions/alphaVault.js.map +1 -0
- package/dist/cjs/transactions/alphalend.d.ts.map +1 -1
- package/dist/cjs/transactions/alphalend.js +10 -32
- package/dist/cjs/transactions/alphalend.js.map +1 -1
- package/dist/cjs/transactions/bluefin.d.ts.map +1 -1
- package/dist/cjs/transactions/bluefin.js +30 -80
- package/dist/cjs/transactions/bluefin.js.map +1 -1
- package/dist/cjs/transactions/bucket.d.ts.map +1 -1
- package/dist/cjs/transactions/bucket.js +5 -16
- package/dist/cjs/transactions/bucket.js.map +1 -1
- package/dist/cjs/transactions/cetus.d.ts.map +1 -1
- package/dist/cjs/transactions/cetus.js +17 -50
- package/dist/cjs/transactions/cetus.js.map +1 -1
- package/dist/cjs/transactions/collect_rewards.d.ts +1 -0
- package/dist/cjs/transactions/collect_rewards.d.ts.map +1 -1
- package/dist/cjs/transactions/collect_rewards.js +143 -38
- 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 +4 -0
- package/dist/cjs/transactions/deposit.js.map +1 -1
- package/dist/cjs/transactions/navi-looping.d.ts +11 -11
- package/dist/cjs/transactions/navi-looping.d.ts.map +1 -1
- package/dist/cjs/transactions/navi-looping.js +61 -134
- 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 +61 -106
- package/dist/cjs/transactions/navi.js.map +1 -1
- package/dist/cjs/transactions/slush.d.ts +12 -0
- package/dist/cjs/transactions/slush.d.ts.map +1 -0
- package/dist/cjs/transactions/slush.js +143 -0
- package/dist/cjs/transactions/slush.js.map +1 -0
- package/dist/cjs/transactions/withdraw.d.ts.map +1 -1
- package/dist/cjs/transactions/withdraw.js +4 -0
- package/dist/cjs/transactions/withdraw.js.map +1 -1
- package/dist/esm/adminFunctions.d.ts +8 -0
- package/dist/esm/adminFunctions.d.ts.map +1 -1
- package/dist/esm/adminFunctions.js +95 -5
- package/dist/esm/adminFunctions.js.map +1 -1
- package/dist/esm/common/constants.d.ts +79 -10
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +108 -23
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/maps.d.ts.map +1 -1
- package/dist/esm/common/maps.js +72 -4
- package/dist/esm/common/maps.js.map +1 -1
- package/dist/esm/common/types.d.ts +76 -26
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/getAprs.d.ts.map +1 -1
- package/dist/esm/getAprs.js +0 -27
- package/dist/esm/getAprs.js.map +1 -1
- package/dist/esm/graphql/getMultiReceipts.js +1 -1
- package/dist/esm/graphql/getMultiReceipts.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts +4 -0
- package/dist/esm/sui-sdk/functions/getReceipts.d.ts.map +1 -1
- package/dist/esm/sui-sdk/functions/getReceipts.js +31 -15
- package/dist/esm/sui-sdk/functions/getReceipts.js.map +1 -1
- package/dist/esm/transactions/alphaVault.d.ts +26 -0
- package/dist/esm/transactions/alphaVault.d.ts.map +1 -0
- package/dist/esm/transactions/alphaVault.js +377 -0
- package/dist/esm/transactions/alphaVault.js.map +1 -0
- package/dist/esm/transactions/alphalend.d.ts.map +1 -1
- package/dist/esm/transactions/alphalend.js +10 -32
- package/dist/esm/transactions/alphalend.js.map +1 -1
- package/dist/esm/transactions/bluefin.d.ts.map +1 -1
- package/dist/esm/transactions/bluefin.js +30 -80
- package/dist/esm/transactions/bluefin.js.map +1 -1
- package/dist/esm/transactions/bucket.d.ts.map +1 -1
- package/dist/esm/transactions/bucket.js +5 -16
- package/dist/esm/transactions/bucket.js.map +1 -1
- package/dist/esm/transactions/cetus.d.ts.map +1 -1
- package/dist/esm/transactions/cetus.js +17 -50
- package/dist/esm/transactions/cetus.js.map +1 -1
- package/dist/esm/transactions/collect_rewards.d.ts +1 -0
- package/dist/esm/transactions/collect_rewards.d.ts.map +1 -1
- package/dist/esm/transactions/collect_rewards.js +142 -38
- 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 +4 -0
- package/dist/esm/transactions/deposit.js.map +1 -1
- package/dist/esm/transactions/navi-looping.d.ts +11 -11
- package/dist/esm/transactions/navi-looping.d.ts.map +1 -1
- package/dist/esm/transactions/navi-looping.js +61 -134
- 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 +61 -106
- package/dist/esm/transactions/navi.js.map +1 -1
- package/dist/esm/transactions/slush.d.ts +12 -0
- package/dist/esm/transactions/slush.d.ts.map +1 -0
- package/dist/esm/transactions/slush.js +137 -0
- package/dist/esm/transactions/slush.js.map +1 -0
- package/dist/esm/transactions/withdraw.d.ts.map +1 -1
- package/dist/esm/transactions/withdraw.js +4 -0
- package/dist/esm/transactions/withdraw.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/functions/addAirdropCoin.html +1 -0
- package/docs/functions/alphaLpBreakdown.html +1 -1
- package/docs/functions/cetusLpBreakdown.html +1 -1
- package/docs/functions/claimAirdropTx.html +1 -0
- package/docs/functions/claimRewardTxb.html +1 -1
- package/docs/functions/claimRewardsTxb.html +1 -1
- package/docs/functions/claimWithdrawAlphaTx.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/collectAndSwapRewardsLyf.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/collectRewardsAndSwapSlush.html +1 -0
- package/docs/functions/collectUnsuppliedBalance.html +1 -0
- package/docs/functions/deposit.html +1 -1
- package/docs/functions/depositAlphaTx.html +1 -0
- 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/getSlushUserTotalXtokens.html +1 -0
- 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/getWithdrawRequestAndUnsuppliedAmounts.html +1 -0
- package/docs/functions/initiateWithdrawAlpha.html +1 -0
- 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/processWithdrawRequestsManual.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/slushDeposit.html +1 -0
- package/docs/functions/slushWithdraw.html +1 -0
- 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 -1
- package/docs/functions/zapDepositTxb.html +1 -1
- package/docs/hierarchy.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 +1 -1
- package/docs/types/AfterTransactionEventNode.html +1 -1
- package/docs/types/AirdropClaimEventNode.html +1 -1
- package/docs/types/Allocator.html +2 -2
- package/docs/types/AlphaFiDoubleAssetVault.html +2 -2
- package/docs/types/AlphaFiMultiVaultBalance.html +1 -1
- package/docs/types/AlphaFiSingleAssetVault.html +2 -2
- 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 +2 -2
- package/docs/types/AlphaReceipt.html +2 -2
- package/docs/types/AlphaReceiptFields.html +2 -2
- package/docs/types/AlphaVaultBalance.html +2 -2
- package/docs/types/AutoBalancePoolNames.html +1 -1
- package/docs/types/AutoCompoundingEventNode.html +1 -1
- package/docs/types/Bag.html +3 -0
- package/docs/types/BluefinInvestor.html +1 -1
- package/docs/types/BluefinLyfInvestor.html +1 -1
- package/docs/types/BluefinPoolType.html +2 -2
- package/docs/types/BucketInvestor.html +2 -2
- package/docs/types/CetusInvestor.html +2 -2
- package/docs/types/CetusPoolType.html +2 -2
- package/docs/types/CetusSwapOptions.html +1 -1
- package/docs/types/CoinAmounts.html +2 -2
- package/docs/types/CoinName.html +1 -1
- package/docs/types/CoinType.html +1 -1
- package/docs/types/CommonInvestorFields.html +2 -2
- package/docs/types/CreatePoolOptions.html +2 -2
- package/docs/types/Distributor.html +2 -2
- package/docs/types/DoubleAssetMultiVaultBalance.html +2 -2
- package/docs/types/DoubleAssetPoolNames.html +1 -1
- package/docs/types/DoubleAssetTokenHoldings.html +2 -2
- package/docs/types/DoubleAssetVaultBalance.html +2 -2
- package/docs/types/EventCategory.html +1 -1
- package/docs/types/EventNode.html +1 -1
- package/docs/types/GetHoldersParams.html +2 -2
- package/docs/types/GetTokenHoldingsParams.html +2 -2
- package/docs/types/GetUserTokensFromTransactionsParams.html +2 -2
- package/docs/types/GetUserTokensInUsdFromTransactionsParams.html +2 -2
- package/docs/types/GetVaultBalanceParams.html +1 -1
- package/docs/types/HoldingsObj.html +2 -2
- 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 +2 -2
- package/docs/types/LiquidityToUsdParams.html +2 -2
- package/docs/types/LoopingDebt.html +2 -2
- package/docs/types/LoopingPoolNames.html +1 -1
- package/docs/types/LpBreakdownType.html +2 -2
- package/docs/types/MemberPoolDataType.html +2 -2
- package/docs/types/MemberType.html +2 -2
- package/docs/types/MultiGetVaultBalancesParams.html +2 -2
- package/docs/types/NaviInvestor.html +2 -2
- package/docs/types/ObjectTable.html +1 -0
- package/docs/types/OtherReceiptFields.html +2 -2
- package/docs/types/PoolName.html +1 -1
- package/docs/types/PoolReceipt.html +1 -1
- package/docs/types/PoolType.html +2 -2
- package/docs/types/Receipt.html +2 -2
- package/docs/types/ReceiptGQL.html +2 -2
- package/docs/types/SingleAssetMultiVaultBalance.html +2 -2
- package/docs/types/SingleAssetPoolNames.html +1 -1
- package/docs/types/SingleAssetTokenHoldings.html +2 -2
- package/docs/types/SingleAssetVaultBalance.html +2 -2
- package/docs/types/SingleGetVaultBalancesParams.html +2 -2
- 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 +2 -2
- package/docs/types/TransactionBlockType.html +2 -2
- package/docs/types/UserPoolLiquidity.html +2 -2
- package/docs/types/UserPoolTokenHoldings.html +1 -1
- package/docs/types/UserUsdHoldings.html +2 -2
- package/docs/types/VaultBalance.html +1 -1
- package/docs/types/VecMap.html +3 -0
- 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/package.json +2 -1
|
@@ -3,22 +3,12 @@ import { bluefinPoolMap, coinsList, doubleAssetPoolCoinMap, getConf, getMultiRec
|
|
|
3
3
|
export async function claimRewardTxb(address) {
|
|
4
4
|
const txb = new Transaction();
|
|
5
5
|
await getMultiReceipts(address);
|
|
6
|
-
const alphaReceipt = await getReceipts("ALPHA", address, false);
|
|
7
6
|
let alpha_receipt;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
[alpha_receipt] = txb.moveCall({
|
|
17
|
-
target: `0x1::option::some`,
|
|
18
|
-
typeArguments: [alphaReceipt[0].content.type],
|
|
19
|
-
arguments: [txb.object(alphaReceipt[0].objectId)],
|
|
20
|
-
});
|
|
21
|
-
}
|
|
7
|
+
[alpha_receipt] = txb.moveCall({
|
|
8
|
+
target: `0x1::option::none`,
|
|
9
|
+
typeArguments: [getConf().ALPHA_POOL_RECEIPT],
|
|
10
|
+
arguments: [],
|
|
11
|
+
});
|
|
22
12
|
const keys = Object.keys(poolInfo);
|
|
23
13
|
for (const poolName of keys) {
|
|
24
14
|
if (poolInfo[poolName].poolId == "") {
|
|
@@ -40,7 +30,7 @@ export async function claimRewardTxb(address) {
|
|
|
40
30
|
txb.object(receipt.objectId),
|
|
41
31
|
alpha_receipt,
|
|
42
32
|
txb.object(poolInfo[poolName].poolId),
|
|
43
|
-
txb.object(
|
|
33
|
+
txb.object(getConf().ALPHA_POOL),
|
|
44
34
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
45
35
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
46
36
|
],
|
|
@@ -64,7 +54,7 @@ export async function claimRewardTxb(address) {
|
|
|
64
54
|
txb.object(receipt.objectId),
|
|
65
55
|
alpha_receipt,
|
|
66
56
|
txb.object(poolInfo[poolName].poolId),
|
|
67
|
-
txb.object(
|
|
57
|
+
txb.object(getConf().ALPHA_POOL),
|
|
68
58
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
69
59
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
70
60
|
],
|
|
@@ -83,7 +73,7 @@ export async function claimRewardTxb(address) {
|
|
|
83
73
|
txb.object(receipt.objectId),
|
|
84
74
|
alpha_receipt,
|
|
85
75
|
txb.object(poolInfo[poolName].poolId),
|
|
86
|
-
txb.object(
|
|
76
|
+
txb.object(getConf().ALPHA_POOL),
|
|
87
77
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
88
78
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
89
79
|
],
|
|
@@ -100,7 +90,7 @@ export async function claimRewardTxb(address) {
|
|
|
100
90
|
txb.object(receipt.objectId),
|
|
101
91
|
alpha_receipt,
|
|
102
92
|
txb.object(poolInfo[poolName].poolId),
|
|
103
|
-
txb.object(
|
|
93
|
+
txb.object(getConf().ALPHA_POOL),
|
|
104
94
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
105
95
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
106
96
|
],
|
|
@@ -128,7 +118,7 @@ export async function claimRewardTxb(address) {
|
|
|
128
118
|
txb.object(receipt.objectId),
|
|
129
119
|
alpha_receipt,
|
|
130
120
|
txb.object(poolInfo[poolName].poolId),
|
|
131
|
-
txb.object(
|
|
121
|
+
txb.object(getConf().ALPHA_POOL),
|
|
132
122
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
133
123
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
134
124
|
],
|
|
@@ -151,7 +141,7 @@ export async function claimRewardTxb(address) {
|
|
|
151
141
|
txb.object(receipt.objectId),
|
|
152
142
|
alpha_receipt,
|
|
153
143
|
txb.object(poolInfo[poolName].poolId),
|
|
154
|
-
txb.object(
|
|
144
|
+
txb.object(getConf().ALPHA_POOL),
|
|
155
145
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
156
146
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
157
147
|
],
|
|
@@ -171,7 +161,7 @@ export async function claimRewardTxb(address) {
|
|
|
171
161
|
txb.object(receipt.objectId),
|
|
172
162
|
alpha_receipt,
|
|
173
163
|
txb.object(poolInfo[poolName].poolId),
|
|
174
|
-
txb.object(
|
|
164
|
+
txb.object(getConf().ALPHA_POOL),
|
|
175
165
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
176
166
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
177
167
|
],
|
|
@@ -191,7 +181,7 @@ export async function claimRewardTxb(address) {
|
|
|
191
181
|
txb.object(receipt.objectId),
|
|
192
182
|
alpha_receipt,
|
|
193
183
|
txb.object(poolInfo[poolName].poolId),
|
|
194
|
-
txb.object(
|
|
184
|
+
txb.object(getConf().ALPHA_POOL),
|
|
195
185
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
196
186
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
197
187
|
],
|
|
@@ -209,7 +199,7 @@ export async function claimRewardTxb(address) {
|
|
|
209
199
|
txb.object(receipt.objectId),
|
|
210
200
|
alpha_receipt,
|
|
211
201
|
txb.object(poolInfo[poolName].poolId),
|
|
212
|
-
txb.object(
|
|
202
|
+
txb.object(getConf().ALPHA_POOL),
|
|
213
203
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
214
204
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
215
205
|
],
|
|
@@ -231,7 +221,7 @@ export async function claimRewardTxb(address) {
|
|
|
231
221
|
txb.object(receipt.objectId),
|
|
232
222
|
alpha_receipt,
|
|
233
223
|
txb.object(poolInfo[poolName].poolId),
|
|
234
|
-
txb.object(
|
|
224
|
+
txb.object(getConf().ALPHA_POOL),
|
|
235
225
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
236
226
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
237
227
|
],
|
|
@@ -250,7 +240,7 @@ export async function claimRewardTxb(address) {
|
|
|
250
240
|
txb.object(receipt.objectId),
|
|
251
241
|
alpha_receipt,
|
|
252
242
|
txb.object(poolInfo[poolName].poolId),
|
|
253
|
-
txb.object(
|
|
243
|
+
txb.object(getConf().ALPHA_POOL),
|
|
254
244
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
255
245
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
256
246
|
],
|
|
@@ -273,7 +263,7 @@ export async function claimRewardTxb(address) {
|
|
|
273
263
|
txb.object(receipt.objectId),
|
|
274
264
|
alpha_receipt,
|
|
275
265
|
txb.object(poolInfo[poolName].poolId),
|
|
276
|
-
txb.object(
|
|
266
|
+
txb.object(getConf().ALPHA_POOL),
|
|
277
267
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
278
268
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
279
269
|
],
|
|
@@ -290,7 +280,7 @@ export async function claimRewardTxb(address) {
|
|
|
290
280
|
txb.object(receipt.objectId),
|
|
291
281
|
alpha_receipt,
|
|
292
282
|
txb.object(poolInfo[poolName].poolId),
|
|
293
|
-
txb.object(
|
|
283
|
+
txb.object(getConf().ALPHA_POOL),
|
|
294
284
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
295
285
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
296
286
|
],
|
|
@@ -314,7 +304,7 @@ export async function claimRewardTxb(address) {
|
|
|
314
304
|
txb.object(receipt.objectId),
|
|
315
305
|
alpha_receipt,
|
|
316
306
|
txb.object(poolInfo[poolName].poolId),
|
|
317
|
-
txb.object(
|
|
307
|
+
txb.object(getConf().ALPHA_POOL),
|
|
318
308
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
319
309
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
320
310
|
],
|
|
@@ -331,7 +321,7 @@ export async function claimRewardTxb(address) {
|
|
|
331
321
|
txb.object(receipt.objectId),
|
|
332
322
|
alpha_receipt,
|
|
333
323
|
txb.object(poolInfo[poolName].poolId),
|
|
334
|
-
txb.object(
|
|
324
|
+
txb.object(getConf().ALPHA_POOL),
|
|
335
325
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
336
326
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
337
327
|
],
|
|
@@ -348,7 +338,7 @@ export async function claimRewardTxb(address) {
|
|
|
348
338
|
txb.object(receipt.objectId),
|
|
349
339
|
alpha_receipt,
|
|
350
340
|
txb.object(poolInfo[poolName].poolId),
|
|
351
|
-
txb.object(
|
|
341
|
+
txb.object(getConf().ALPHA_POOL),
|
|
352
342
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
353
343
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
354
344
|
],
|
|
@@ -365,7 +355,7 @@ export async function claimRewardTxb(address) {
|
|
|
365
355
|
txb.object(receipt.objectId),
|
|
366
356
|
alpha_receipt,
|
|
367
357
|
txb.object(poolInfo[poolName].poolId),
|
|
368
|
-
txb.object(
|
|
358
|
+
txb.object(getConf().ALPHA_POOL),
|
|
369
359
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
370
360
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
371
361
|
],
|
|
@@ -404,7 +394,7 @@ export async function claimRewardTxb(address) {
|
|
|
404
394
|
txb.object(receipt.objectId),
|
|
405
395
|
alpha_receipt,
|
|
406
396
|
txb.object(poolInfo[poolName].poolId),
|
|
407
|
-
txb.object(
|
|
397
|
+
txb.object(getConf().ALPHA_POOL),
|
|
408
398
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
409
399
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
410
400
|
],
|
|
@@ -424,7 +414,7 @@ export async function claimRewardTxb(address) {
|
|
|
424
414
|
txb.object(receipt.objectId),
|
|
425
415
|
alpha_receipt,
|
|
426
416
|
txb.object(poolInfo[poolName].poolId),
|
|
427
|
-
txb.object(
|
|
417
|
+
txb.object(getConf().ALPHA_POOL),
|
|
428
418
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
429
419
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
430
420
|
],
|
|
@@ -441,7 +431,7 @@ export async function claimRewardTxb(address) {
|
|
|
441
431
|
txb.object(receipt.objectId),
|
|
442
432
|
alpha_receipt,
|
|
443
433
|
txb.object(poolInfo[poolName].poolId),
|
|
444
|
-
txb.object(
|
|
434
|
+
txb.object(getConf().ALPHA_POOL),
|
|
445
435
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
446
436
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
447
437
|
],
|
|
@@ -477,7 +467,7 @@ export async function claimRewardTxb(address) {
|
|
|
477
467
|
txb.object(receipt.objectId),
|
|
478
468
|
alpha_receipt,
|
|
479
469
|
txb.object(poolInfo[poolName].poolId),
|
|
480
|
-
txb.object(
|
|
470
|
+
txb.object(getConf().ALPHA_POOL),
|
|
481
471
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
482
472
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
483
473
|
],
|
|
@@ -497,7 +487,7 @@ export async function claimRewardTxb(address) {
|
|
|
497
487
|
txb.object(receipt.objectId),
|
|
498
488
|
alpha_receipt,
|
|
499
489
|
txb.object(poolInfo[poolName].poolId),
|
|
500
|
-
txb.object(
|
|
490
|
+
txb.object(getConf().ALPHA_POOL),
|
|
501
491
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
502
492
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
503
493
|
],
|
|
@@ -519,7 +509,7 @@ export async function claimRewardTxb(address) {
|
|
|
519
509
|
txb.object(receipt.objectId),
|
|
520
510
|
alpha_receipt,
|
|
521
511
|
txb.object(poolInfo[poolName].poolId),
|
|
522
|
-
txb.object(
|
|
512
|
+
txb.object(getConf().ALPHA_POOL),
|
|
523
513
|
txb.object(getConf().ALPHA_DISTRIBUTOR),
|
|
524
514
|
txb.object(getConf().CLOCK_PACKAGE_ID),
|
|
525
515
|
],
|
|
@@ -895,4 +885,118 @@ export async function collectAndSwapRewardsLyf(poolname, tx) {
|
|
|
895
885
|
}
|
|
896
886
|
return txb;
|
|
897
887
|
}
|
|
888
|
+
export async function collectRewardsAndSwapSlush(poolName, tx) {
|
|
889
|
+
const txb = tx ? tx : new Transaction();
|
|
890
|
+
const C = getConf();
|
|
891
|
+
const poolData = poolInfo[poolName];
|
|
892
|
+
const coinName = singleAssetPoolCoinMap[poolName].coin;
|
|
893
|
+
const coinType = coinsList[coinName].type;
|
|
894
|
+
txb.moveCall({
|
|
895
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
896
|
+
typeArguments: [coinType, coinsList["ALPHA"].type, coinsList["STSUI"].type],
|
|
897
|
+
arguments: [
|
|
898
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
899
|
+
txb.object(poolData.poolId),
|
|
900
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
901
|
+
txb.object(bluefinPoolMap["ALPHA-STSUI"]),
|
|
902
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
903
|
+
txb.pure.bool(true),
|
|
904
|
+
txb.pure.bool(true),
|
|
905
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
906
|
+
],
|
|
907
|
+
});
|
|
908
|
+
txb.moveCall({
|
|
909
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
910
|
+
typeArguments: [coinType, coinsList["STSUI"].type, coinsList["SUI"].type],
|
|
911
|
+
arguments: [
|
|
912
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
913
|
+
txb.object(poolData.poolId),
|
|
914
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
915
|
+
txb.object(bluefinPoolMap["STSUI-SUI"]),
|
|
916
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
917
|
+
txb.pure.bool(true),
|
|
918
|
+
txb.pure.bool(true),
|
|
919
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
920
|
+
],
|
|
921
|
+
});
|
|
922
|
+
txb.moveCall({
|
|
923
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
924
|
+
typeArguments: [coinType, coinsList["BLUE"].type, coinsList["SUI"].type],
|
|
925
|
+
arguments: [
|
|
926
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
927
|
+
txb.object(poolData.poolId),
|
|
928
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
929
|
+
txb.object(bluefinPoolMap["BLUE-SUI"]),
|
|
930
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
931
|
+
txb.pure.bool(true),
|
|
932
|
+
txb.pure.bool(true),
|
|
933
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
934
|
+
],
|
|
935
|
+
});
|
|
936
|
+
if (coinType !== coinsList["DEEP"].type) {
|
|
937
|
+
txb.moveCall({
|
|
938
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
939
|
+
typeArguments: [coinType, coinsList["DEEP"].type, coinsList["SUI"].type],
|
|
940
|
+
arguments: [
|
|
941
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
942
|
+
txb.object(poolData.poolId),
|
|
943
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
944
|
+
txb.object(bluefinPoolMap["DEEP-SUI"]),
|
|
945
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
946
|
+
txb.pure.bool(true),
|
|
947
|
+
txb.pure.bool(true),
|
|
948
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
949
|
+
],
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
if (coinType === coinsList["USDC"].type) {
|
|
953
|
+
txb.moveCall({
|
|
954
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
955
|
+
typeArguments: [coinType, coinsList["SUI"].type, coinType],
|
|
956
|
+
arguments: [
|
|
957
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
958
|
+
txb.object(poolData.poolId),
|
|
959
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
960
|
+
txb.object(bluefinPoolMap["SUI-USDC"]),
|
|
961
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
962
|
+
txb.pure.bool(true),
|
|
963
|
+
txb.pure.bool(false),
|
|
964
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
965
|
+
],
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
else if (coinType === coinsList["WAL"].type) {
|
|
969
|
+
txb.moveCall({
|
|
970
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
971
|
+
typeArguments: [coinType, coinsList["WAL"].type, coinsList["SUI"].type],
|
|
972
|
+
arguments: [
|
|
973
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
974
|
+
txb.object(poolData.poolId),
|
|
975
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
976
|
+
txb.object(bluefinPoolMap["WAL-SUI"]),
|
|
977
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
978
|
+
txb.pure.bool(false),
|
|
979
|
+
txb.pure.bool(true),
|
|
980
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
981
|
+
],
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
else if (coinType === coinsList["DEEP"].type) {
|
|
985
|
+
txb.moveCall({
|
|
986
|
+
target: `${C.ALPHA_SLUSH_LATEST_PACKAGE_ID}::alphalend_slush_pool::collect_reward_and_swap_bluefin`,
|
|
987
|
+
typeArguments: [coinType, coinsList["DEEP"].type, coinsList["SUI"].type],
|
|
988
|
+
arguments: [
|
|
989
|
+
txb.object(C.ALPHA_SLUSH_VERSION),
|
|
990
|
+
txb.object(poolData.poolId),
|
|
991
|
+
txb.object(C.LENDING_PROTOCOL_ID),
|
|
992
|
+
txb.object(bluefinPoolMap["DEEP-SUI"]),
|
|
993
|
+
txb.object(C.BLUEFIN_GLOBAL_CONFIG),
|
|
994
|
+
txb.pure.bool(false),
|
|
995
|
+
txb.pure.bool(true),
|
|
996
|
+
txb.object(C.CLOCK_PACKAGE_ID),
|
|
997
|
+
],
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
return txb;
|
|
1001
|
+
}
|
|
898
1002
|
//# sourceMappingURL=collect_rewards.js.map
|