@berachain/berajs 0.2.5 → 0.2.6-patch.2
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/abi/exports.cjs +1 -1
- package/dist/abi/exports.cjs.map +1 -1
- package/dist/abi/exports.d.cts +17 -1
- package/dist/abi/exports.d.ts +17 -1
- package/dist/abi/exports.mjs +1 -1
- package/dist/abi/exports.mjs.map +1 -1
- package/dist/actions/exports.cjs +1 -1
- package/dist/actions/exports.cjs.map +1 -1
- package/dist/actions/exports.d.cts +9 -38
- package/dist/actions/exports.d.ts +9 -38
- package/dist/actions/exports.mjs +1 -1
- package/dist/actions/exports.mjs.map +1 -1
- package/dist/chunk-2YBHAMDV.cjs +2 -0
- package/dist/chunk-2YBHAMDV.cjs.map +1 -0
- package/dist/{chunk-7SMWQ6SN.mjs → chunk-3ZTAIOHH.mjs} +2 -2
- package/dist/chunk-3ZTAIOHH.mjs.map +1 -0
- package/dist/chunk-57RINXU6.cjs +2 -0
- package/dist/chunk-57RINXU6.cjs.map +1 -0
- package/dist/{chunk-AX2YQQFQ.mjs → chunk-74QD4JAH.mjs} +2 -2
- package/dist/chunk-74QD4JAH.mjs.map +1 -0
- package/dist/chunk-74WA35RI.cjs +2 -0
- package/dist/chunk-74WA35RI.cjs.map +1 -0
- package/dist/{chunk-7WRTK7RJ.mjs → chunk-BEKH5EYT.mjs} +2 -2
- package/dist/chunk-BEKH5EYT.mjs.map +1 -0
- package/dist/chunk-DDEQFR3M.cjs +2 -0
- package/dist/chunk-DDEQFR3M.cjs.map +1 -0
- package/dist/{chunk-6LDOG5RL.cjs → chunk-DK42F2ZM.cjs} +2 -2
- package/dist/chunk-DK42F2ZM.cjs.map +1 -0
- package/dist/chunk-I4V54RRZ.cjs +4 -0
- package/dist/chunk-I4V54RRZ.cjs.map +1 -0
- package/dist/chunk-I7M43BB4.cjs +2 -0
- package/dist/chunk-I7M43BB4.cjs.map +1 -0
- package/dist/chunk-IDFMLLDY.mjs +2 -0
- package/dist/chunk-IDFMLLDY.mjs.map +1 -0
- package/dist/chunk-KRVNPZLF.mjs +2 -0
- package/dist/chunk-KRVNPZLF.mjs.map +1 -0
- package/dist/{chunk-3YXSUBA5.mjs → chunk-MJZHJFZO.mjs} +2 -2
- package/dist/chunk-MK5NS5B5.mjs +2 -0
- package/dist/chunk-MK5NS5B5.mjs.map +1 -0
- package/dist/{chunk-C6ZGUO4H.cjs → chunk-NMH7LHPW.cjs} +2 -2
- package/dist/chunk-NMH7LHPW.cjs.map +1 -0
- package/dist/{chunk-PKXAW6MO.cjs → chunk-NVHV2LDK.cjs} +2 -2
- package/dist/chunk-NVHV2LDK.cjs.map +1 -0
- package/dist/{chunk-FCWDGE62.cjs → chunk-NVOJIQUM.cjs} +2 -2
- package/dist/chunk-NVOJIQUM.cjs.map +1 -0
- package/dist/chunk-OGBD5YOG.mjs +2 -0
- package/dist/chunk-OGBD5YOG.mjs.map +1 -0
- package/dist/chunk-OIYXOKTT.cjs.map +1 -1
- package/dist/chunk-OUD27MU7.cjs.map +1 -1
- package/dist/{chunk-ECRMUMTA.mjs → chunk-PLIH6KQM.mjs} +2 -2
- package/dist/chunk-PLIH6KQM.mjs.map +1 -0
- package/dist/chunk-QRAIGQF2.mjs +2 -0
- package/dist/chunk-QRAIGQF2.mjs.map +1 -0
- package/dist/{chunk-YZV5LKIP.cjs → chunk-QXNF3YT7.cjs} +2 -2
- package/dist/chunk-QXNF3YT7.cjs.map +1 -0
- package/dist/chunk-RWOICHRW.cjs +2 -0
- package/dist/chunk-RWOICHRW.cjs.map +1 -0
- package/dist/chunk-T5FSQ3YE.mjs +2 -0
- package/dist/chunk-T5FSQ3YE.mjs.map +1 -0
- package/dist/chunk-WIN4PK2Z.mjs +4 -0
- package/dist/chunk-WIN4PK2Z.mjs.map +1 -0
- package/dist/chunk-WRFDB3QJ.cjs.map +1 -1
- package/dist/chunk-XNJLSA6P.cjs.map +1 -1
- package/dist/contexts/exports.cjs +1 -1
- package/dist/contexts/exports.cjs.map +1 -1
- package/dist/contexts/exports.d.cts +1 -1
- package/dist/contexts/exports.d.ts +1 -1
- package/dist/contexts/exports.mjs +1 -1
- package/dist/contexts/exports.mjs.map +1 -1
- package/dist/{defaultFlags-d0kPbT0i.d.cts → defaultFlags-D6KfkTZx.d.cts} +1 -1
- package/dist/{defaultFlags-d0kPbT0i.d.ts → defaultFlags-D6KfkTZx.d.ts} +1 -1
- package/dist/enum/exports.cjs +1 -1
- package/dist/enum/exports.cjs.map +1 -1
- package/dist/enum/exports.d.cts +1 -1
- package/dist/enum/exports.d.ts +1 -1
- package/dist/enum/exports.mjs +1 -1
- package/dist/errors/exports.cjs +1 -1
- package/dist/errors/exports.cjs.map +1 -1
- package/dist/errors/exports.d.cts +8 -3
- package/dist/errors/exports.d.ts +8 -3
- package/dist/errors/exports.mjs +1 -1
- package/dist/{getValidatorQueuedOperatorAddress-DZgrPmZ2.d.cts → getValidatorQueuedOperatorAddress-BdDYHycN.d.cts} +15 -4
- package/dist/{getValidatorQueuedOperatorAddress-CqR6cyqC.d.ts → getValidatorQueuedOperatorAddress-CmiPJmsr.d.ts} +15 -4
- package/dist/{global.d-BeYWDreg.d.ts → global.d-3GQMgC9k.d.ts} +1 -1
- package/dist/{global.d-DghRxpHd.d.cts → global.d-CwT1Phzf.d.cts} +1 -1
- package/dist/hooks/exports.cjs +3 -3
- package/dist/hooks/exports.cjs.map +1 -1
- package/dist/hooks/exports.d.cts +54 -75
- package/dist/hooks/exports.d.ts +54 -75
- package/dist/hooks/exports.mjs +3 -3
- package/dist/hooks/exports.mjs.map +1 -1
- package/dist/{txnEnum-DxPRHSJt.d.cts → txnEnum-CCuQUFlh.d.cts} +7 -0
- package/dist/{txnEnum-DxPRHSJt.d.ts → txnEnum-CCuQUFlh.d.ts} +7 -0
- package/dist/types/exports.cjs.map +1 -1
- package/dist/types/exports.d.cts +37 -4
- package/dist/types/exports.d.ts +37 -4
- package/dist/utils/exports.cjs +1 -1
- package/dist/utils/exports.cjs.map +1 -1
- package/dist/utils/exports.d.cts +2 -2
- package/dist/utils/exports.d.ts +2 -2
- package/dist/utils/exports.mjs +1 -1
- package/dist/utils/exports.mjs.map +1 -1
- package/package.json +6 -7
- package/src/abi/enso/ensoWalletV2Factory.ts +9 -0
- package/src/abi/exports.ts +1 -0
- package/src/actions/clients/BeraApolloClient.ts +3 -3
- package/src/actions/clients/getApolloClient.ts +5 -5
- package/src/actions/clients/getEnsoClient.ts +1 -1
- package/src/actions/dex/__tests__/aggregators.unit.test.ts +3 -3
- package/src/actions/dex/__tests__/getOnChainPool.unit.test.ts +1 -1
- package/src/actions/dex/aggregators/base.ts +12 -8
- package/src/actions/dex/aggregators/bex.ts +8 -8
- package/src/actions/dex/aggregators/bgt.ts +4 -4
- package/src/actions/dex/aggregators/enso/enso.ts +28 -20
- package/src/actions/dex/aggregators/enso/ensoErc4626.debug.test.ts +1 -1
- package/src/actions/dex/aggregators/enso/ensoErc4626.ts +7 -4
- package/src/actions/dex/aggregators/erc4626.ts +10 -6
- package/src/actions/dex/aggregators/fly.ts +9 -5
- package/src/actions/dex/aggregators/haiku.integration.test.ts +3 -3
- package/src/actions/dex/aggregators/haiku.ts +9 -5
- package/src/actions/dex/aggregators/honey.ts +15 -15
- package/src/actions/dex/aggregators/kyberswap.ts +8 -4
- package/src/actions/dex/aggregators/oogabooga.ts +8 -4
- package/src/actions/dex/aggregators/openOcean.ts +12 -8
- package/src/actions/dex/aggregators/wbera.ts +8 -4
- package/src/actions/dex/b-sdk.ts +2 -2
- package/src/actions/dex/getAllPools.ts +2 -2
- package/src/actions/dex/getApiPool.ts +2 -2
- package/src/actions/dex/getGlobalLiquidityAndSwapVolume.ts +2 -2
- package/src/actions/dex/getIsTokenExploited.ts +1 -1
- package/src/actions/dex/getOnChainPool.ts +3 -3
- package/src/actions/dex/getPoolEvents.ts +2 -2
- package/src/actions/dex/getPoolHistoricalData.ts +2 -2
- package/src/actions/dex/getVaultPausedState.ts +1 -1
- package/src/actions/enso/__tests__/getBendDemultiplyBundle.action.unit.test.ts +175 -0
- package/src/actions/enso/__tests__/getBendDemultiplyBundle.unit.test.ts +150 -0
- package/src/actions/enso/__tests__/getBendMultiplyBundle.action.unit.test.ts +138 -0
- package/src/actions/enso/__tests__/getBendMultiplyBundle.unit.test.ts +194 -0
- package/src/actions/enso/{getEnsoUserTokensWithBalances.debug.test.ts → __tests__/getEnsoUserTokensWithBalances.debug.test.ts} +3 -3
- package/src/actions/enso/__tests__/helpers.ts +42 -0
- package/src/actions/enso/__tests__/util.unit.test.ts +95 -0
- package/src/actions/enso/flashloan.ts +127 -0
- package/src/actions/enso/getBendDemultiplyBundle.ts +325 -0
- package/src/actions/enso/getBendMultiplyBundle.ts +348 -0
- package/src/actions/enso/getEnsoSwapBundle.ts +2 -2
- package/src/actions/enso/getEnsoUserTokensWithBalances.ts +5 -5
- package/src/actions/enso/util.ts +150 -5
- package/src/actions/exports.ts +0 -2
- package/src/actions/governance/__tests__/checkProposalField.unit.test.ts +2 -2
- package/src/actions/governance/__tests__/getDecodedFunctionData.integration.test.ts +2 -2
- package/src/actions/governance/__tests__/getQuorum.integration.test.ts +2 -2
- package/src/actions/governance/checkProposalField.ts +1 -1
- package/src/actions/governance/computeActualStatus.ts +1 -1
- package/src/actions/governance/getAllProposals.ts +1 -1
- package/src/actions/governance/getBodyErrors.ts +1 -1
- package/src/actions/governance/getProposalDetails.ts +1 -1
- package/src/actions/governance/getProposalFromTx.ts +1 -1
- package/src/actions/governance/getProposalParams.ts +3 -3
- package/src/actions/governance/getProposalVotes.ts +1 -1
- package/src/actions/governance/getQuorum.ts +2 -2
- package/src/actions/honey/getCollateralWeights.ts +2 -2
- package/src/actions/honey/getGlobalCapLimit.ts +4 -4
- package/src/actions/honey/getHoneyCollaterals.ts +5 -5
- package/src/actions/honey/getHoneyFees.ts +1 -1
- package/src/actions/honey/getHoneyPausedState.ts +1 -1
- package/src/actions/honey/getHoneyPreview.ts +3 -3
- package/src/actions/honey/getHoneyRootPriceOracle.ts +1 -1
- package/src/actions/honey/getHoneyVaultsBalance.ts +2 -2
- package/src/actions/honey/getRelativeCapLimit.ts +3 -3
- package/src/actions/honey/getSharesWithoutFees.ts +1 -1
- package/src/actions/honey/getSwapPayload.ts +6 -6
- package/src/actions/honey/isBadCollateralAsset.ts +2 -2
- package/src/actions/honey/isBasketModeEnabled.ts +2 -2
- package/src/actions/honey/tests/pyth.integration.test.ts +3 -3
- package/src/actions/misc/getBlockTimestamp.ts +2 -2
- package/src/actions/pol/__tests__/getAllValidators.integration.test.ts +2 -2
- package/src/actions/pol/__tests__/rewardVaults.integration.test.ts +1 -1
- package/src/actions/pol/getBGTGlobalInfo.ts +2 -2
- package/src/actions/pol/getBgtAprSimulation.ts +1 -1
- package/src/actions/pol/getBgtAprSimultaion.unit.test.ts +1 -1
- package/src/actions/pol/getBgtTokenTotalBoosts.ts +2 -2
- package/src/actions/pol/getBgtTokenTotalSupply.ts +2 -2
- package/src/actions/pol/getBlockTime.debug.test.ts +13 -0
- package/src/actions/pol/getBlockTime.ts +14 -23
- package/src/actions/pol/getEarnedStakedBeraVault.ts +3 -3
- package/src/actions/pol/getGlobalData.ts +2 -2
- package/src/actions/pol/getIncentiveFeeClaimStats.ts +4 -4
- package/src/actions/pol/getLSTStakeConfig.ts +5 -5
- package/src/actions/pol/getMarkets.ts +2 -2
- package/src/actions/pol/getRewardProofsByValidator.ts +4 -4
- package/src/actions/pol/getRewardTokenToBeraRate.ts +1 -1
- package/src/actions/pol/getRewardVault.ts +3 -3
- package/src/actions/pol/getRewardVaultBeaconImplementation.integration.test.ts +1 -1
- package/src/actions/pol/getRewardVaultBeaconImplementation.ts +3 -3
- package/src/actions/pol/getRewardVaultDurationConstants.integration.test.ts +1 -1
- package/src/actions/pol/getRewardVaultDurationConstants.ts +1 -1
- package/src/actions/pol/getRewardVaultFromToken.ts +1 -1
- package/src/actions/pol/getRewardVaultIncentives.ts +2 -2
- package/src/actions/pol/getRewardVaultRewards.ts +1 -1
- package/src/actions/pol/getRewardVaults.ts +1 -1
- package/src/actions/pol/getSWBeraVaultMetadata.ts +20 -22
- package/src/actions/pol/getSWBeraWithdrawal.ts +4 -4
- package/src/actions/pol/getStakedBeraAPR.ts +2 -2
- package/src/actions/pol/getStakedBeraSnapshots.ts +2 -2
- package/src/actions/pol/getStakingDailyAssets.ts +3 -3
- package/src/actions/pol/getStakingTokenInformation.ts +2 -2
- package/src/actions/pol/getTotalStakedAmount.ts +1 -1
- package/src/actions/pol/getUserClaimableIncentives.ts +4 -4
- package/src/actions/pol/getUserVaultInfo.ts +1 -1
- package/src/actions/pol/getUserVaults.ts +4 -4
- package/src/actions/pol/getUserVaultsBalance.ts +1 -1
- package/src/actions/pol/getVaultHistory.ts +2 -2
- package/src/actions/pol/getVaultValidators.ts +1 -1
- package/src/actions/prices/__tests__/prices.integration.test.ts +2 -2
- package/src/actions/prices/getTokenCurrentPrices.ts +5 -5
- package/src/actions/pyth/getHoneyPythFeeds.ts +2 -2
- package/src/actions/pyth/getUpdateFee.ts +2 -2
- package/src/actions/tokens/getAllowances.ts +2 -2
- package/src/actions/tokens/getTokenInformation.ts +2 -2
- package/src/actions/tokens/getTokens.ts +3 -3
- package/src/actions/tokens/getUnderlyingToken.ts +4 -4
- package/src/actions/tokens/getWalletBalances.integration.test.ts +1 -1
- package/src/actions/tokens/getWalletBalances.ts +4 -4
- package/src/actions/transactions/beraWriteContract.integration.test.ts +6 -6
- package/src/actions/transactions/beraWriteContract.ts +12 -12
- package/src/actions/validators/getActiveBoostAndCommissionChangeDelay.integration.test.ts +1 -1
- package/src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts +1 -1
- package/src/actions/validators/getAllValidators.ts +2 -2
- package/src/actions/validators/getApiValidator.ts +2 -2
- package/src/actions/validators/getBaselineRewardAllocation.ts +1 -1
- package/src/actions/validators/getDailyValidatorBlockStats.ts +1 -1
- package/src/actions/validators/getDefaultRewardAllocation.ts +1 -1
- package/src/actions/validators/getUserActiveValidators.ts +31 -33
- package/src/actions/validators/getUserBoosts.ts +12 -8
- package/src/actions/validators/getUserBoostsOnValidator.ts +15 -3
- package/src/actions/validators/getUserStakingPositions.ts +1 -1
- package/src/actions/validators/getValidatorAnalytics.ts +2 -2
- package/src/actions/validators/getValidatorCommission.ts +1 -1
- package/src/actions/validators/getValidatorEstimatedBgtPerYear.ts +1 -1
- package/src/actions/validators/getValidatorOperatorAddress.ts +1 -1
- package/src/actions/validators/getValidatorQueuedCommission.ts +1 -1
- package/src/actions/validators/getValidatorQueuedOperatorAddress.ts +1 -1
- package/src/actions/validators/getValidatorQueuedRewardAllocation.ts +1 -1
- package/src/actions/validators/getValidatorRewardAllocation.ts +1 -1
- package/src/actions/validators/getValidatorRewardAllocatorAddress.ts +1 -1
- package/src/actions/validators/utils/__tests__/validatorUtils.integration.test.ts +4 -4
- package/src/contexts/BeraFlags/defaultFlags.ts +4 -0
- package/src/contexts/BexStatusProvider.tsx +1 -1
- package/src/contexts/HoneyConfigProvider.tsx +3 -3
- package/src/contexts/SwrFallback.tsx +2 -2
- package/src/contexts/TokensProvider.tsx +3 -3
- package/src/contexts/block-time-provider.tsx +1 -1
- package/src/data/contracts.ts +10 -0
- package/src/enum/txnEnum.ts +9 -0
- package/src/errors/BeraMonitoring.ts +2 -2
- package/src/errors/BeraTracing.ts +2 -2
- package/src/errors/RequestError.ts +1 -1
- package/src/errors/assert.ts +18 -0
- package/src/errors/getRevertReason.integration.test.ts +7 -7
- package/src/errors/getRevertReason.ts +1 -1
- package/src/errors/parseViemError.ts +1 -1
- package/src/hooks/bend/useGetConvertToAssets.ts +4 -4
- package/src/hooks/dex/useAggregatorsQuotes.ts +19 -19
- package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +2 -2
- package/src/hooks/dex/useAllUserPools.ts +3 -3
- package/src/hooks/dex/useApiPool.ts +3 -3
- package/src/hooks/dex/useBexStatus.ts +1 -1
- package/src/hooks/dex/useCreatePool.ts +9 -9
- package/src/hooks/dex/useExploitedTokens.ts +3 -3
- package/src/hooks/dex/useGlobalLiquidityAndSwapVolume.ts +1 -1
- package/src/hooks/dex/useLiquidityMismatch.ts +3 -3
- package/src/hooks/dex/useLpPosition.ts +7 -4
- package/src/hooks/dex/useMultipleTokenApprovalsWithSlippage.ts +4 -4
- package/src/hooks/dex/useOnChainPoolData.ts +3 -3
- package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +3 -3
- package/src/hooks/dex/usePool.ts +7 -40
- package/src/hooks/dex/usePoolEvents.ts +2 -2
- package/src/hooks/dex/usePoolHistoricalData.ts +6 -3
- package/src/hooks/dex/usePools.ts +3 -3
- package/src/hooks/dex/usePriceImpact.ts +2 -2
- package/src/hooks/dex/useSingleAggregatorQuote.ts +13 -13
- package/src/hooks/enso/useBendDemultiply.ts +158 -0
- package/src/hooks/enso/useBendMultiply.ts +163 -0
- package/src/hooks/enso/useBendZapSupply.ts +7 -7
- package/src/hooks/enso/useEnsoSwapBundle.ts +6 -6
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +5 -5
- package/src/hooks/enso/useEnsoWalletV2Address.ts +38 -0
- package/src/hooks/enso/useIsBendAuthorized.ts +47 -0
- package/src/hooks/enso/useZapStakeBera.ts +4 -4
- package/src/hooks/exports.ts +4 -3
- package/src/hooks/governance/useCreateProposal.ts +3 -3
- package/src/hooks/governance/useGetPastVotes.ts +2 -2
- package/src/hooks/governance/useHasVoted.ts +2 -2
- package/src/hooks/governance/useIsCanceller.ts +4 -4
- package/src/hooks/governance/usePollAllProposals.ts +3 -3
- package/src/hooks/governance/usePollProposal.ts +7 -4
- package/src/hooks/governance/usePollProposalThreshold.ts +3 -3
- package/src/hooks/governance/usePollProposalVotes.ts +1 -1
- package/src/hooks/governance/usePollUserDelegates.ts +7 -4
- package/src/hooks/governance/useProposalFromTx.ts +1 -1
- package/src/hooks/governance/useProposalSnapshot.ts +2 -2
- package/src/hooks/governance/useProposalState.ts +2 -2
- package/src/hooks/governance/useProposalTimelockState.ts +2 -2
- package/src/hooks/governance/useQuorum.ts +1 -1
- package/src/hooks/honey/useCappedGlobally.ts +8 -5
- package/src/hooks/honey/useCappedRelatively.ts +7 -4
- package/src/hooks/honey/useCollateralWeights.ts +8 -5
- package/src/hooks/honey/useHoneyAlerts.ts +5 -5
- package/src/hooks/honey/useHoneyBalances.ts +7 -7
- package/src/hooks/honey/useHoneyChartData.ts +1 -1
- package/src/hooks/honey/useHoneySwapState.ts +4 -4
- package/src/hooks/honey/useHoneyVaultsBalance.ts +8 -5
- package/src/hooks/honey/useIsBadCollateralAsset.ts +9 -6
- package/src/hooks/honey/useIsBasketModeEnabled.ts +8 -5
- package/src/hooks/honey/usePythLatestPrices.ts +4 -4
- package/src/hooks/perps/usePythUpdateFee.ts +4 -4
- package/src/hooks/pol/useBgtAprSimulation.ts +1 -1
- package/src/hooks/pol/useBgtUnstakedBalance.ts +7 -4
- package/src/hooks/pol/useClaimableFees.ts +4 -4
- package/src/hooks/pol/useOnChainRewardVault.ts +7 -7
- package/src/hooks/pol/usePollGlobalData.ts +9 -3
- package/src/hooks/pol/usePollMarkets.ts +5 -2
- package/src/hooks/pol/useQueuedBeraUnlock.ts +4 -4
- package/src/hooks/pol/useRewardTokenToBeraRate.ts +4 -4
- package/src/hooks/pol/useRewardVault.ts +5 -2
- package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +2 -2
- package/src/hooks/pol/useRewardVaultFromToken.ts +2 -2
- package/src/hooks/pol/useRewardVaultIncentives.ts +2 -2
- package/src/hooks/pol/useRewardVaultRewards.ts +3 -3
- package/src/hooks/pol/useRewardVaults.ts +2 -2
- package/src/hooks/pol/useStakedAPR.ts +3 -3
- package/src/hooks/pol/useStakedData.ts +10 -10
- package/src/hooks/pol/useStakedSnapshots.ts +3 -3
- package/src/hooks/pol/useStakingVaultsMetadata.ts +40 -0
- package/src/hooks/pol/useTotalStakedAmount.ts +2 -2
- package/src/hooks/pol/useUserVaultInfo.ts +8 -5
- package/src/hooks/pol/useUserVaults.ts +7 -4
- package/src/hooks/pol/useVaultAddress.ts +2 -2
- package/src/hooks/pol/useVaultHistory.ts +2 -2
- package/src/hooks/pol/useVaultValidators.ts +5 -2
- package/src/hooks/tokens/useBeraCurrentPrice.ts +1 -1
- package/src/hooks/tokens/useMultipleTokenInformation.ts +7 -4
- package/src/hooks/tokens/usePollAllowances.ts +7 -4
- package/src/hooks/tokens/usePollBalance.ts +8 -5
- package/src/hooks/tokens/usePollWalletBalances.ts +8 -5
- package/src/hooks/tokens/useStakingTokenInformation.ts +7 -4
- package/src/hooks/tokens/useTokenCurrentPrice.ts +1 -1
- package/src/hooks/tokens/useTokenCurrentPrices.ts +6 -6
- package/src/hooks/tokens/useTokenInformation.ts +8 -5
- package/src/hooks/tokens/useTokenPrice.ts +1 -1
- package/src/hooks/tokens/useTokenPrices.ts +4 -4
- package/src/hooks/tokens/useTokens.ts +3 -3
- package/src/hooks/tokens/useTotalSupply.ts +1 -1
- package/src/hooks/tokens/useUnderlyingAsset.ts +3 -3
- package/src/hooks/useBlockToTimestamp.ts +5 -5
- package/src/hooks/useContractWrite/types.ts +2 -2
- package/src/hooks/useContractWrite/useBeraContractWrite.ts +5 -6
- package/src/hooks/useGetVerifiedAbi.ts +1 -1
- package/src/hooks/validators/useAllValidators.ts +7 -4
- package/src/hooks/validators/useApiEnrichedAllocation.ts +2 -2
- package/src/hooks/validators/useApiValidator.ts +5 -2
- package/src/hooks/validators/useBaselineRewardAllocation.ts +2 -2
- package/src/hooks/validators/useDailyValidatorBlockStats.ts +3 -3
- package/src/hooks/validators/useDefaultRewardAllocation.ts +4 -4
- package/src/hooks/validators/useManagedValidatorRole.ts +8 -5
- package/src/hooks/validators/useOnChainValidator.ts +6 -3
- package/src/hooks/validators/useStakingPoolBatch.ts +7 -4
- package/src/hooks/validators/useUserActiveValidators.ts +6 -3
- package/src/hooks/validators/useUserBoostsOnValidator.ts +3 -3
- package/src/hooks/validators/useUserClaimableIncentives.ts +9 -9
- package/src/hooks/validators/useUserStakingPositions.ts +1 -1
- package/src/hooks/validators/useValidator.ts +1 -1
- package/src/hooks/validators/useValidatorAnalytics.ts +3 -3
- package/src/hooks/validators/useValidatorCommission.ts +5 -2
- package/src/hooks/validators/useValidatorEstimatedBgtPerYear.ts +3 -3
- package/src/hooks/validators/useValidatorQueuedCommission.ts +6 -3
- package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +5 -2
- package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +6 -3
- package/src/hooks/validators/useValidatorRewardAllocation.ts +2 -2
- package/src/types/dex.d.ts +1 -1
- package/src/types/enso.d.ts +34 -0
- package/src/types/global.d.ts +3 -3
- package/src/types/governance.d.ts +1 -1
- package/src/types/honeySwap.d.ts +3 -3
- package/src/utils/beraFetch.ts +1 -1
- package/src/utils/createEmitter.ts +1 -1
- package/src/utils/formatIncentivesTokenMap.ts +1 -1
- package/src/utils/getContractName.ts +1 -1
- package/src/utils/getHoneySwapMessage.test.ts +1 -1
- package/src/utils/getHoneySwapMessage.ts +1 -1
- package/src/utils/parseBaseArgs.ts +1 -1
- package/src/utils/parseBaseArgs.unit.test.ts +1 -1
- package/src/utils/parseWhiskToken.ts +1 -1
- package/src/utils/poolNamings.ts +1 -1
- package/src/utils/tokens.ts +2 -2
- package/src/utils/tokens.unit.test.ts +1 -1
- package/.claude/skills/berajs/SKILL.md +0 -222
- package/.claude/skills/berajs/references/dex.md +0 -235
- package/.claude/skills/berajs/references/pol.md +0 -194
- package/.claude/skills/berajs/references/staking.md +0 -198
- package/.claude/skills/berajs/references/tokens.md +0 -170
- package/dist/chunk-22J3YJDN.cjs +0 -2
- package/dist/chunk-22J3YJDN.cjs.map +0 -1
- package/dist/chunk-2LL3P5PN.mjs +0 -2
- package/dist/chunk-2LL3P5PN.mjs.map +0 -1
- package/dist/chunk-55L7STYD.mjs +0 -2
- package/dist/chunk-55L7STYD.mjs.map +0 -1
- package/dist/chunk-6LDOG5RL.cjs.map +0 -1
- package/dist/chunk-7LNBSOVV.cjs +0 -2
- package/dist/chunk-7LNBSOVV.cjs.map +0 -1
- package/dist/chunk-7SMWQ6SN.mjs.map +0 -1
- package/dist/chunk-7WRTK7RJ.mjs.map +0 -1
- package/dist/chunk-AX2YQQFQ.mjs.map +0 -1
- package/dist/chunk-BKDBIBVO.mjs +0 -4
- package/dist/chunk-BKDBIBVO.mjs.map +0 -1
- package/dist/chunk-C3FHGFLK.mjs +0 -2
- package/dist/chunk-C3FHGFLK.mjs.map +0 -1
- package/dist/chunk-C6ZGUO4H.cjs.map +0 -1
- package/dist/chunk-ECRMUMTA.mjs.map +0 -1
- package/dist/chunk-FCWDGE62.cjs.map +0 -1
- package/dist/chunk-P2Q7CMUD.cjs +0 -2
- package/dist/chunk-P2Q7CMUD.cjs.map +0 -1
- package/dist/chunk-PKXAW6MO.cjs.map +0 -1
- package/dist/chunk-SWMJQOH6.cjs +0 -2
- package/dist/chunk-SWMJQOH6.cjs.map +0 -1
- package/dist/chunk-THATXCJK.mjs +0 -2
- package/dist/chunk-THATXCJK.mjs.map +0 -1
- package/dist/chunk-UXGB54NE.cjs +0 -4
- package/dist/chunk-UXGB54NE.cjs.map +0 -1
- package/dist/chunk-VXL2ZZ4X.cjs +0 -2
- package/dist/chunk-VXL2ZZ4X.cjs.map +0 -1
- package/dist/chunk-YXLFOEZN.mjs +0 -2
- package/dist/chunk-YXLFOEZN.mjs.map +0 -1
- package/dist/chunk-YZV5LKIP.cjs.map +0 -1
- package/src/actions/dex/getSubgraphPool.ts +0 -30
- package/src/actions/validators/getManagedValidatorByAccount.ts +0 -32
- package/src/hooks/pol/useSWBeraVaultMetadata.ts +0 -35
- package/src/hooks/validators/useManagedValidatorByAccount.ts +0 -40
- package/src/hooks/validators/useSubgraphUserValidators.ts +0 -36
- /package/dist/{chunk-3YXSUBA5.mjs.map → chunk-MJZHJFZO.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/hooks/exports.cjs","../../src/hooks/bend/useGetConvertToAssets.ts","../../src/hooks/dex/useAggregatorsQuotes.ts","../../src/actions/dex/aggregators/bex.ts","../../src/actions/dex/aggregators/bgt.ts","../../src/actions/dex/aggregators/enso/enso.ts","../../src/hooks/dex/useLiquidityMismatch.ts","../../src/hooks/tokens/useMultipleTokenInformation.ts"],"names":["useGetConvertToAssets","sharesAmount","vaultAddress","vaultChainId","options","publicClient","usePublicClient","swrResponse","useSWR","_","assertPublicClient","getConvertToAssets","DEFAULT_DEADLINE","STALE_PRICE_THRESHOLD","swapKind","SwapKind","BexAggregator","BaseAggregator","ChainId","getUriFromLink","address","isToken","priceImpact","onChainAmount","sorPaths","sorAmount","queryData","deltaFromSorAmount","formatEther","error","BeraError","p","BeraMonitoring","args","balancerApi","BalancerApi","tokenIn","tokenOut","amount","slippage","account","zeroAddress","wberaIsBera","tokenInV3","Token","tokenOutV3","tokenAmount","TokenAmount","RequestError","swap","Swap","queryOutput","callData","Slippage","params","functionName","decodeFunctionData","balancerVaultAbi","bex","RedeemBgtAggregator","beraToken","InvalidArgumentError","bgtRedeem","EnsoAggregator","aggregatorsFeeBps","proxyAggregatorsThroughVercel","rewardVault","tokenInAddress","tokenOutAddress","isTokenInNative","isTokenOutNative","inputAmountAfterFees"],"mappings":"AAAA,wnDAAqpB,iCAA8B,yDAAwE,yDAAmD,iCAA8B,iCAA8B,iCAA8B,iCAA8B,yDAA2C,yDAAgF,yDAAmD,yDAAkF,iCAA8B,yDAAgE,yDAAwD,oECAzyC,+CAEa,IAOnBA,EAAAA,CAAwB,CACnC,CACE,YAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACAC,CAAAA,CAAAA,EACG,CACH,IAAMC,CAAAA,CAAeC,oCAAAA,CAAkB,OAAA,CAASH,CAAa,CAAC,CAAA,CACxDI,CAAAA,CAAcC,2BAAAA,CAClBH,EAAgBJ,CAAAA,EAAgBC,CAAAA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AAAA,CAAgC,CAAA,CAAA,CAChC,WAAA,CAAAC,CACF,CAAA,CAAkD,CAChD,IAAA,CAAK,kBAAA,CAAmB,CAAE,OAAA,CAAA9B,CAAAA,CAAS,QAAA,CAAAC,CAAS,CAAC,CAAA,CAE7C,GAAM,CACJ,cAAA,CAAA8B,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CACF,CAAA,CAAI,IAAA,CAAK,cAAA,CAAelC,CAAAA,CAAQ,OAAA,CAASC,CAAAA,CAAS,OAAO,CAAA,CAEnDkC,CAAAA,CAAuB,IAAA,CAAK,kBAAA,CAChCjC,CAAAA,CACA0B,CACF,CAAA,CAEA,IAAA,CAAK,GAAA,CAAMC,CAAAA,CACP,kCAAA,CACA,CAAA,EAAA;ACsHS,gEAAA;ACxGC,mFAAA","file":"/Users/liammcaweeney/Work/bera/monobera/packages/berajs/dist/hooks/exports.cjs","sourcesContent":[null,"import useSWR from \"swr\";\n\nimport { usePublicClient } from \"@berachain/wagmi/hooks\";\n\nimport type { GetConvertToAssetsProps } from \"~/actions/bend/getConvertToAssets\";\nimport { getConvertToAssets } from \"~/actions/bend/getConvertToAssets\";\nimport { assertPublicClient } from \"~/errors/assert\";\nimport type { DefaultHookOptions } from \"~/types/global\";\n\nexport const useGetConvertToAssets = (\n {\n sharesAmount,\n vaultAddress,\n vaultChainId,\n }: Omit<GetConvertToAssetsProps, \"publicClient\"> & { vaultChainId?: number },\n options?: DefaultHookOptions,\n) => {\n const publicClient = usePublicClient({ chainId: vaultChainId });\n const swrResponse = useSWR(\n publicClient && sharesAmount && vaultAddress\n ? [\"useGetConvertToAssets\", sharesAmount, vaultAddress, vaultChainId]\n : null,\n async ([_, sharesAmount, vaultAddress]) => {\n assertPublicClient(publicClient);\n\n return getConvertToAssets({\n sharesAmount,\n vaultAddress,\n publicClient,\n });\n },\n {\n ...options?.opts,\n },\n );\n\n return {\n ...swrResponse,\n refresh: () => {\n swrResponse.mutate();\n },\n };\n};\n","import { useMemo } from \"react\";\nimport { type Address, zeroAddress } from \"viem\";\n\nimport { defaultChainId } from \"@berachain/config/internal\";\n\nimport { useBeraWallet, usePublicClient } from \"@berachain/wagmi/hooks\";\n\nimport { bex } from \"~/actions/dex/aggregators/bex\";\nimport { bgtRedeem } from \"~/actions/dex/aggregators/bgt\";\nimport { enso } from \"~/actions/dex/aggregators/enso/enso\";\nimport { erc4626Deposit } from \"~/actions/dex/aggregators/erc4626\";\nimport { fly } from \"~/actions/dex/aggregators/fly\";\nimport { haiku } from \"~/actions/dex/aggregators/haiku\";\nimport { honeyNative } from \"~/actions/dex/aggregators/honey\";\nimport { kyberswap } from \"~/actions/dex/aggregators/kyberswap\";\nimport { oogabooga } from \"~/actions/dex/aggregators/oogabooga\";\nimport { openOcean } from \"~/actions/dex/aggregators/openOcean\";\nimport { wberaSwap } from \"~/actions/dex/aggregators/wbera\";\nimport { useBeraFlag } from \"~/contexts/BeraFlags/BeraFlags\";\nimport type { HoneyConfigContextReturn } from \"~/contexts/HoneyConfigProvider\";\nimport type { SwapReferrer } from \"~/enum/dex\";\nimport { useAggregatorsRouterFeeBps } from \"~/hooks/dex/useAggregatorsRouterFeeBps\";\nimport type { IRawAggregatorQuote, MinimalERC20 } from \"~/types/dex\";\nimport type { DefaultHookOptions } from \"~/types/global\";\nimport { parseBaseArgs } from \"~/utils/parseBaseArgs\";\nimport { isToken } from \"~/utils/tokens\";\nimport { useUnderlyingAsset } from \"../tokens/useUnderlyingAsset\";\nimport { useBexStatus } from \"./useBexStatus\";\nimport {\n getAggregatorsSWROptions,\n raw_useSingleAggregatorQuote,\n} from \"./useSingleAggregatorQuote\";\n\nconst AGGREGATORS = [\n oogabooga,\n fly,\n kyberswap,\n openOcean,\n haiku,\n enso,\n bex,\n honeyNative,\n erc4626Deposit,\n];\n\ntype IUseAggregatorsQuotesArgs = BeraJS.BaseFunctionArgs & {\n tokenIn: MinimalERC20;\n tokenOut: MinimalERC20;\n amount: string;\n slippage: number;\n referrer?: SwapReferrer;\n rewardVault?: Address;\n /**\n * Useful cause the collaterals are provided byt he honeyContext and this way we can\n * use the Provider only in the swap page where is needed.\n *\n * The collaterals for the honey mint/redeem aggregator.\n */\n honeyNativeState?: Pick<\n HoneyConfigContextReturn,\n \"collateralList\" | \"protocol\"\n >;\n};\n\nexport function useAggregatorsQuotes(\n args: IUseAggregatorsQuotesArgs,\n options?: DefaultHookOptions,\n) {\n const { address: account } = useBeraWallet();\n const proxyAggregatorsThroughVercel = useBeraFlag(\n \"proxyAggregatorsThroughVercel\",\n );\n const activeAggregators = useBeraFlag(\"aggregators\");\n const publicClient = usePublicClient();\n const { data: feeBps } = useAggregatorsRouterFeeBps();\n\n const isWrapOrUnwrap =\n (isToken(args.tokenIn.address, \"BERA\") ||\n isToken(args.tokenIn.address, \"WBERA\")) &&\n (isToken(args.tokenOut.address, \"BERA\") ||\n isToken(args.tokenOut.address, \"WBERA\"));\n\n const isBgtRedeem = isToken(args.tokenIn.address, \"BGT\", {\n chainId: defaultChainId,\n });\n\n const { data: underlyingToken } = useUnderlyingAsset({\n token: args.tokenOut,\n });\n\n /**\n * Whether it's a native swap (wrap/unwrap) or BGT redeem\n */\n const isNativeSwap = isWrapOrUnwrap || isBgtRedeem;\n\n const { config } = parseBaseArgs(args);\n\n const isMAEnabled = config.bex.aggregatorsRouter !== zeroAddress;\n\n const swrOptions = getAggregatorsSWROptions(options);\n\n const sharedArgs = {\n activeAggregators,\n isMAEnabled,\n underlyingToken,\n isNativeSwap,\n account,\n publicClient,\n proxyAggregatorsThroughVercel,\n feeBps,\n } as const;\n\n // we're using independent useSWRs so we can show quotes as they come\n // instead of waiting for all of them to load\n const oogaBogaResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: oogabooga,\n },\n { opts: swrOptions },\n );\n\n const flyResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: fly,\n },\n { opts: swrOptions },\n );\n\n const erc4626Result = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: erc4626Deposit,\n },\n { opts: swrOptions },\n );\n\n const kyberswapResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: kyberswap,\n },\n { opts: swrOptions },\n );\n\n const openOceanResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: openOcean,\n },\n { opts: swrOptions },\n );\n\n const haikuResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: haiku,\n },\n { opts: swrOptions },\n );\n\n const ensoResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: enso,\n },\n { opts: swrOptions },\n );\n\n const { protocol: bexProtocol } = useBexStatus();\n\n const bexResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: bex,\n },\n { opts: { ...swrOptions, isEnabled: bexProtocol.isPaused === false } },\n );\n\n const wberaSwapResult = raw_useSingleAggregatorQuote({\n ...sharedArgs,\n ...args,\n aggregator: wberaSwap,\n });\n\n const bgtRedeemResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: bgtRedeem,\n },\n { opts: swrOptions },\n );\n\n const honeyResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: honeyNative,\n },\n { opts: swrOptions },\n );\n\n const results = isWrapOrUnwrap\n ? [wberaSwapResult]\n : isBgtRedeem\n ? [bgtRedeemResult]\n : [\n oogaBogaResult,\n erc4626Result,\n flyResult,\n kyberswapResult,\n openOceanResult,\n haikuResult,\n ensoResult,\n honeyResult,\n bexProtocol.isPaused === false ? bexResult : null,\n ].filter((i): i is NonNullable<typeof i> => i !== null);\n\n const data = useMemo(() => {\n const error = results.reduce<(typeof results)[number][\"error\"]>(\n (error, result) => error || result.error,\n undefined,\n );\n\n const loadingAggregatorsNames = results\n .map((r, i) =>\n r.isLoading\n ? isNativeSwap\n ? wberaSwap.name\n : AGGREGATORS[i].name\n : null,\n )\n .filter(Boolean);\n\n const quotes = results\n .filter(\n (result) =>\n result !== undefined &&\n !result.isLoading &&\n !result.error &&\n result.data?.amountOut,\n )\n .map(({ data }) => data) as IRawAggregatorQuote[];\n\n const isLoading = quotes.length === 0 && loadingAggregatorsNames.length > 0;\n return { quotes, loadingAggregatorsNames, isLoading, error };\n }, [results]);\n\n return {\n ...data,\n refresh: () => results.map((r) => r.mutate()),\n };\n}\n","import {\n type Address,\n Slippage,\n type SorSwapResult,\n Swap,\n SwapKind,\n Token,\n TokenAmount,\n} from \"@berachain-foundation/berancer-sdk\";\nimport { decodeFunctionData, formatEther, zeroAddress } from \"viem\";\n\nimport { getUriFromLink } from \"@berachain/config\";\nimport { ChainId } from \"@berachain/config/internal\";\n\nimport { vaultAbi as balancerVaultAbi } from \"@berachain/abis/bex/vault\";\n\nimport { BalancerApi } from \"~/actions/dex/b-sdk\";\nimport { Aggregators } from \"~/enum/dex\";\nimport { assertPublicClient } from \"~/errors/assert\";\nimport { BeraError } from \"~/errors/BeraError\";\nimport { BeraMonitoring } from \"~/errors/BeraMonitoring\";\nimport { RequestError } from \"~/errors/RequestError\";\nimport type { IAggregatorArgs, IRawAggregatorQuote } from \"~/types/dex\";\nimport { isToken } from \"~/utils/tokens\";\nimport { BaseAggregator } from \"./base\";\n\n// Constants\nconst DEFAULT_DEADLINE = 60 * 5; // default transaction deadline in seconds\nconst STALE_PRICE_THRESHOLD = 0.05; // 5% threshold for stale prices\nconst swapKind = SwapKind.GivenIn;\n\nclass BexAggregator extends BaseAggregator {\n name = Aggregators.HubPools;\n supportedChains = [ChainId.MAINNET, ChainId.BEPOLIA];\n readonly url = getUriFromLink(this.config.api);\n readonly type = \"graphql\";\n\n /**\n * Helper function to convert zero address to wrapped token address\n */\n private convertZeroToWrapped(address: Address): Address {\n return isToken(address, \"BERA\") ? this.config.tokens.wbera : address;\n }\n\n /**\n * Helper to calculate price impact percentage\n */\n private calculatePriceImpact(priceImpact: {\n error: string | null;\n priceImpact?: string;\n }): number {\n if (priceImpact.error) {\n console.error(\"Swap price impact error\", priceImpact);\n return 0;\n }\n\n return Number(priceImpact.priceImpact);\n }\n\n /**\n * Helper to check for stale SOR prices\n */\n private checkStalePrices({\n onChainAmount,\n sorPaths,\n sorAmount,\n queryData,\n }: {\n onChainAmount: TokenAmount;\n sorPaths: { pools: string[] }[];\n sorAmount: string;\n queryData: IAggregatorArgs;\n }): void {\n // Check for stale prices\n const deltaFromSorAmount =\n Number.parseFloat(formatEther(onChainAmount.scale18)) /\n Number.parseFloat(sorAmount);\n\n if (Math.abs(1 - deltaFromSorAmount) > STALE_PRICE_THRESHOLD) {\n console.warn(\n \"SOR returned stale prices. Delta from return amount is more than 5%\",\n {\n deltaFromSorAmount,\n },\n );\n\n const error = new BeraError({\n reason: \"SOR_STALE_PRICES\",\n level: \"warning\",\n message:\n \"SOR returned stale prices. Delta from return amount is more than 5%\",\n extra: {\n deltaFromSorAmount,\n pools: sorPaths.map((p) => p.pools),\n onChainAmount: formatEther(onChainAmount.scale18),\n sorAmount,\n queryData,\n },\n fingerprint: [\"SOR_STALE_PRICES\"],\n });\n BeraMonitoring.captureException(error);\n }\n }\n\n async getQuote(args: IAggregatorArgs): Promise<IRawAggregatorQuote> {\n const balancerApi = new BalancerApi(\n this.url,\n // @ts-expect-error b-sdk has more chains than berajs\n this.chainId,\n );\n const {\n tokenIn,\n tokenOut,\n amount,\n slippage,\n account = zeroAddress,\n publicClient,\n } = args;\n this.assertChainSupport({ tokenIn, tokenOut });\n\n assertPublicClient(publicClient);\n\n const wberaIsBera = isToken(tokenIn, \"BERA\") || isToken(tokenOut, \"BERA\");\n\n // Initialize tokens\n const tokenInV3 = new Token(\n this.chainId,\n this.convertZeroToWrapped(tokenIn.address),\n tokenIn.decimals,\n );\n const tokenOutV3 = new Token(\n this.chainId,\n this.convertZeroToWrapped(tokenOut.address),\n tokenOut.decimals,\n );\n\n const tokenAmount = TokenAmount.fromRawAmount(\n tokenInV3,\n amount as `${number}`,\n );\n\n // swap paths\n const {\n paths: sorPaths,\n priceImpact,\n returnAmount: sorAmount,\n }: SorSwapResult = await balancerApi.sorSwapPaths.fetchSorSwapPaths({\n // @ts-expect-error b-sdk has more chains than berajs\n chainId: this.chainId,\n tokenIn: tokenInV3.address,\n tokenOut: tokenOutV3.address,\n swapKind,\n swapAmount: tokenAmount,\n });\n\n if (!sorPaths?.length) {\n throw new RequestError({\n response: undefined,\n endpoint: {\n url: this.url,\n name: this.name,\n type: this.type,\n },\n reason: BaseAggregator.PATH_NOT_FOUND_REASON,\n chainId: this.chainId,\n payload: {\n tokenIn: tokenInV3.address,\n tokenOut: tokenOutV3.address,\n swapKind,\n swapAmount: tokenAmount,\n },\n message: `No swap paths returned from Balancer API`,\n });\n }\n\n // execute swap query\n const swap = new Swap({\n chainId: this.chainId,\n paths: sorPaths,\n swapKind,\n userData: \"0x\" as `0x${string}`,\n });\n const queryOutput = await swap.query(publicClient.transport.url);\n\n if (!(\"expectedAmountOut\" in queryOutput)) {\n throw new Error(\"No Bex paths found\");\n }\n\n this.checkStalePrices({\n onChainAmount: queryOutput.expectedAmountOut,\n sorPaths,\n sorAmount,\n queryData: args,\n });\n\n // format quote response\n return {\n amountOut: queryOutput.expectedAmountOut.amount.toString(),\n amountIn: amount,\n allowanceRequirements: this.parseAllowanceRequirements({\n tokenIn,\n rawAmount: amount,\n spender: queryOutput.to,\n }),\n name: this.name,\n priceImpactPercentage: this.calculatePriceImpact(priceImpact),\n swapFeeBps: 0,\n getCalldata: ({ account }) => {\n // generate user transaction data\n const callData = swap.buildCall({\n slippage: Slippage.fromPercentage(slippage.toString() as `${number}`),\n deadline: BigInt(Math.round(Date.now() / 1000) + DEFAULT_DEADLINE),\n queryOutput,\n sender: account as Address,\n recipient: account as Address,\n wethIsEth: wberaIsBera,\n });\n\n const { args: params, functionName } = decodeFunctionData({\n abi: balancerVaultAbi,\n data: callData.callData,\n });\n\n return {\n params,\n functionName,\n abi: balancerVaultAbi,\n address: callData.to,\n value: callData.value || BigInt(0),\n };\n },\n };\n }\n}\n\nexport const bex = new BexAggregator();\n","import { ChainId } from \"@berachain/config/internal\";\n\nimport { Aggregators } from \"~/enum/dex\";\nimport { InvalidArgumentError } from \"~/errors/InvalidArgumentError\";\nimport type {\n IAggregatorArgs,\n IRawAggregatorQuote,\n MinimalERC20,\n} from \"~/types/dex\";\nimport { beraToken, isToken } from \"~/utils/tokens\";\nimport { BaseAggregator } from \"./base\";\n\nclass RedeemBgtAggregator extends BaseAggregator {\n name = Aggregators.RedeemBgt;\n supportedChains = [ChainId.MAINNET, ChainId.BEPOLIA];\n readonly type = \"rpc\";\n\n checkChainSupport({\n tokenIn,\n tokenOut,\n }: {\n tokenIn: MinimalERC20;\n tokenOut: MinimalERC20;\n }): boolean {\n if (!super.checkChainSupport({ tokenIn, tokenOut })) {\n return false;\n }\n\n return (\n // only supported on same chain\n tokenIn.chainId === tokenOut.chainId &&\n isToken(tokenIn, \"BGT\", { chainId: tokenIn.chainId }) &&\n isToken(tokenOut, \"BERA\")\n );\n }\n // handles native swaps: wrap and unwrap\n async getQuote({\n tokenIn,\n amount,\n }: Omit<\n IAggregatorArgs,\n \"slippage\" | \"feeBps\" | \"tokenOut\" | \"account\"\n >): Promise<IRawAggregatorQuote> {\n this.assertChainSupport({\n tokenIn,\n tokenOut: { ...beraToken, chainId: tokenIn.chainId },\n });\n\n if (!isToken(tokenIn, \"BGT\", { config: this.config })) {\n throw new InvalidArgumentError({\n property: \"tokenIn\",\n value: tokenIn,\n expected: \"BGT\",\n level: \"warning\",\n });\n }\n\n return {\n amountOut: amount,\n amountIn: amount,\n allowanceRequirements: [],\n name: Aggregators.RedeemBgt,\n isNativeSwap: true,\n swapFeeBps: 0,\n // not adding calldata here because it depends on the connected wallet\n // bgt redeem requires a receiver address\n // moreover this is a sensitive operation, better be sure of what data is being sent\n // by controlling it on the consumer side\n } as const;\n }\n}\n\nexport const bgtRedeem = new RedeemBgtAggregator();\n","import { zeroAddress } from \"viem\";\n\nimport { ChainId } from \"@berachain/config/internal\";\n\nimport { metaAggregatorAbi as aggregatorsRouterAbi } from \"@berachain/abis/meta-aggregator/metaAggregator\";\n\nimport { Aggregators } from \"~/enum/dex\";\nimport type { IAggregatorArgs, IRawAggregatorQuote } from \"~/types/dex\";\nimport { BaseAggregator } from \"../base\";\n\nclass EnsoAggregator extends BaseAggregator {\n name = Aggregators.Enso;\n supportedChains = [ChainId.MAINNET];\n readonly type = \"rest\";\n needsAccountForQuote = true;\n\n notFoundMessages: string[] = [\n \"Could not build shortcuts for route\",\n \"Could not quote shortcuts for route\",\n \"Swap not found for a required underlying of defi route,\",\n \"No route found from\",\n ];\n\n async getQuote({\n tokenIn,\n tokenOut,\n amount,\n slippage,\n account = zeroAddress,\n aggregatorsFeeBps,\n proxyAggregatorsThroughVercel = false,\n rewardVault,\n }: IAggregatorArgs): Promise<IRawAggregatorQuote> {\n this.assertChainSupport({ tokenIn, tokenOut });\n\n const {\n tokenInAddress,\n tokenOutAddress,\n isTokenInNative,\n isTokenOutNative,\n } = this.parseAddresses(tokenIn.address, tokenOut.address);\n\n const inputAmountAfterFees = this.getAmountAfterFees(\n amount,\n aggregatorsFeeBps,\n );\n\n this.url = proxyAggregatorsThroughVercel\n ? `/api/aggregators?aggregator=enso`\n : `${this.config.bex.aggregatorsProxyUrl}/enso/api/v1/shortcuts/route?`;\n\n const url = new URL(this.url);\n url.searchParams.set(\n \"fromAddress\",\n this.config.bex.aggregatorsRouterExecutor,\n );\n url.searchParams.set(\"receiver\", this.config.bex.aggregatorsRouterExecutor);\n url.searchParams.set(\"spender\", this.config.bex.aggregatorsRouterExecutor);\n url.searchParams.set(\"amountIn\", inputAmountAfterFees);\n url.searchParams.set(\"tokenIn\", tokenInAddress);\n url.searchParams.set(\"tokenOut\", tokenOutAddress);\n url.searchParams.set(\"chainId\", ChainId.MAINNET.toString());\n url.searchParams.set(\"slippage\", (Number(slippage) * 100).toString());\n url.searchParams.set(\"refundReceiver\", account);\n\n const response = await this.fetch(url);\n\n const quote = await response.json();\n\n const inputData = this.getInputData({\n tokenIn: tokenInAddress,\n amountIn: amount,\n isNative: isTokenInNative,\n });\n\n const outputData = {\n tokenOut: tokenOutAddress,\n receiver: account,\n minAmountOut: this.getMinAmountOut(quote.amountOut.toString(), slippage),\n isNative: isTokenOutNative,\n };\n\n const aggregatorData = {\n aggregator: quote.tx?.to,\n data: quote.tx?.data,\n };\n\n return {\n amountOut: quote.amountOut.toString(),\n amountIn: amount,\n allowanceRequirements: this.parseAllowanceRequirements({\n tokenIn,\n rawAmount: amount,\n spender: this.config.bex.aggregatorsRouter,\n }),\n name: this.name,\n swapFeeBps: aggregatorsFeeBps!,\n getCalldata: () => ({\n params: [\n inputData,\n outputData,\n aggregatorData,\n {\n rewardVault: rewardVault ?? zeroAddress,\n isSwapAndStake: !!rewardVault,\n },\n ],\n functionName: \"swap\",\n abi: aggregatorsRouterAbi,\n // send full amount to router first, which will deduct the swap fee before executing trade\n value: isTokenInNative ? BigInt(amount) : BigInt(\"0\"),\n address: this.config.bex.aggregatorsRouter,\n }),\n };\n }\n}\n\nexport const enso = new EnsoAggregator();\n","import { useEffect, useState } from \"react\";\nimport { PoolType } from \"@berachain-foundation/berancer-sdk\";\n\nimport { PoolCreationStep } from \"~/enum/dex\";\nimport type { TokenCurrentPriceMap, TokenWithAmount } from \"~/types/dex\";\nimport { wrapNativeTokens } from \"~/utils/tokenWrapping\";\nimport { type Oracle, OracleMode } from \"./useCreatePool\";\n\nconst DEFAULT_LIQUIDITY_MISMATCH_TOLERANCE_PERCENT = 0.05; // 5%\n\nexport type LiquidityMismatchInfo = {\n title: string | null;\n message: string | null;\n suggestWeighted?: boolean;\n};\n\ninterface UseLiquidityMismatchParams {\n currentStep: PoolCreationStep;\n tokenPrices?: TokenCurrentPriceMap;\n isLoadingTokenPrices: boolean;\n tokens: TokenWithAmount[] | null;\n weights: bigint[] | null;\n weightsError: string | null;\n poolType: PoolType;\n liquidityMismatchTolerancePercent?: number;\n oracles: Oracle[];\n}\n\n/**\n * Hook for detecting liquidity mismatches.\n *\n * @param {PoolCreationStep} currentStep - The current step of the pool creation process.\n * @param {Record<string, number>} tokenPrices - The current token prices.\n * @param {boolean} isLoadingTokenPrices - Whether the token prices are still loading.\n * @param {Array<{ address: string, amount: number }>} tokens - The tokens in the pool, including their addresses and amounts.\n * @param {Record<string, number>} weights - The per-token weights in the pool we are creating.\n * @param {string | null} weightsError - An error message for the weights indicating that the weights are invalid.\n * @param {string} poolType - The type of pool being created.\n * @param {number} liquidityMismatchTolerancePercent - The tolerance for liquidity mismatches in percent.\n * @returns {Object} The liquidity mismatch info.\n */\nexport const useLiquidityMismatch = ({\n currentStep,\n tokenPrices,\n isLoadingTokenPrices,\n tokens,\n weights,\n weightsError,\n poolType,\n liquidityMismatchTolerancePercent = DEFAULT_LIQUIDITY_MISMATCH_TOLERANCE_PERCENT,\n oracles,\n}: UseLiquidityMismatchParams): LiquidityMismatchInfo => {\n // NOTE: would be nice to use Maps/Records more in here, as the zipping/unzipping is cumbersome.\n // NOTE: if we pull in string literal for currentStep things would also be a bit clearer in here.\n const [liquidityMismatchInfo, setLiquidityMismatchInfo] =\n useState<LiquidityMismatchInfo>({ title: null, message: null });\n\n useEffect(() => {\n // If we are either using custom rate-providing oracles or have incorrect/loading token prices, we cant do validation.\n if (\n !tokenPrices ||\n isLoadingTokenPrices ||\n !tokens ||\n !weights ||\n weightsError ||\n tokens.some((token) => !token.address) ||\n oracles.some((oracle) => oracle.mode === OracleMode.Custom) // Oracles give prices on their own, we dont support that here yet.\n ) {\n setLiquidityMismatchInfo({ title: null, message: null });\n return;\n }\n\n // Calculate some basic metrics we'll use to determine per-token contributions and model potential losses from arbitrage.\n let totalLiquidityUSD = 0;\n const tokenUSDAmounts: number[] = [];\n const numTokens = tokens.length;\n const wrappedTokens = wrapNativeTokens(tokens);\n const tokenUSDPrices = wrappedTokens.map((token) => {\n const tokenPriceUSD =\n tokenPrices[token.address.toLowerCase()]?.price ?? 0;\n if (!tokenPriceUSD || tokenPriceUSD === 0) {\n tokenUSDAmounts.push(0);\n return null;\n }\n const tokenAmountUSD = tokenPriceUSD * Number.parseFloat(token.amount);\n tokenUSDAmounts.push(tokenAmountUSD);\n totalLiquidityUSD += tokenAmountUSD;\n return tokenPriceUSD;\n });\n\n // Doesn't matter what step it is, if we have missing token prices for tokens we have selected, we cant issue a real warning.\n if (\n tokenUSDPrices.some((price) => price === null) ||\n tokenUSDPrices.length !== numTokens\n ) {\n setLiquidityMismatchInfo({\n title: \"Missing token price data\",\n message: `One or more token(s) do not have valid market price data. Please verify that token market prices align with the pool\n weightings and your initial liquidity amounts.`,\n });\n return;\n }\n\n // Step 1 - During token selection we check for a deviation in the quote prices of the tokens selected (for stable pools).\n if (\n currentStep === PoolCreationStep.SELECT_TOKENS &&\n poolType === PoolType.ComposableStable\n ) {\n const normalizedUSDPrices = tokenUSDPrices.map(\n (priceUSD) => priceUSD! / tokenUSDPrices[0]!, // always normalize on the first token's price\n );\n const maxDifference =\n Math.max(...normalizedUSDPrices) - Math.min(...normalizedUSDPrices);\n\n if (maxDifference > liquidityMismatchTolerancePercent) {\n setLiquidityMismatchInfo({\n title: \"Selected tokens have a significant price deviation\",\n message: \"Did you mean to create a Weighted pool instead?\",\n suggestWeighted: true,\n });\n } else {\n setLiquidityMismatchInfo({ title: null, message: null });\n }\n\n return;\n }\n\n // Validation During Liquidity Input and onwards.\n if (\n totalLiquidityUSD === 0 ||\n tokenUSDAmounts.some((value) => value === 0)\n ) {\n // User has not yet entered fully their liquidity values, so return early.\n setLiquidityMismatchInfo({ title: null, message: null });\n return;\n }\n\n // Simulate arbitrage for the pool to determine potential losses from arbitrageurs.\n // NOTE: we assume shortfalls and excesses are losses, but in reality the actual losses would be more complex to realise.\n // Balancer does this similarily https://github.com/balancer/frontend-v2/blob/8563b8d33b6bff266148bd48d7ebc89f921374f4/src/components/cards/CreatePool/InitialLiquidity.vue#L75\n let totalLossUSD = 0;\n if (poolType === PoolType.ComposableStable) {\n const expectedPerTokenLiquidityUSD = totalLiquidityUSD / numTokens;\n tokenUSDAmounts.forEach((value) => {\n totalLossUSD += Math.abs(expectedPerTokenLiquidityUSD - value);\n });\n } else if (poolType === PoolType.Weighted) {\n tokenUSDAmounts.forEach((value, index) => {\n const weightProportion = Number(weights[index]) / 1e18;\n const expectedValueUSD = totalLiquidityUSD * weightProportion;\n totalLossUSD += Math.abs(expectedValueUSD - value);\n });\n }\n\n // We'll show a total loss if it's 90% or more\n const isTotalLoss = totalLossUSD >= totalLiquidityUSD * 0.9;\n totalLossUSD = Math.min(totalLossUSD, totalLiquidityUSD);\n const totalLossPercentage = totalLossUSD / totalLiquidityUSD;\n\n if (totalLossPercentage > liquidityMismatchTolerancePercent) {\n setLiquidityMismatchInfo({\n // If it's a total loss we dont display a percentage\n title: isTotalLoss\n ? \"You could lose all of your initial liquidity\"\n : `You could lose $${totalLossUSD.toFixed(2)} (~${(\n totalLossPercentage * 100\n ).toFixed(2)}%)`,\n message: `Based on the market token prices, the value of tokens does not align with the specified pool weights. \n This discrepancy could expose you to potential losses from arbitrageurs. ${\n poolType === PoolType.ComposableStable\n ? \"Did you mean to create a Weighted pool instead?\"\n : \"\"\n }`,\n suggestWeighted: poolType === PoolType.ComposableStable,\n });\n } else {\n // All good bb bb\n setLiquidityMismatchInfo({ title: null, message: null });\n }\n }, [\n currentStep,\n tokenPrices,\n isLoadingTokenPrices,\n tokens,\n weights,\n weightsError,\n poolType,\n liquidityMismatchTolerancePercent,\n oracles,\n ]);\n return liquidityMismatchInfo;\n};\n","import useSWRImmutable from \"swr/immutable\";\nimport { isAddress } from \"viem\";\n\nimport { defaultChainId } from \"@berachain/config/internal\";\n\nimport { usePublicClient } from \"@berachain/wagmi/hooks\";\n\nimport { getTokenInformation } from \"~/actions/tokens/getTokenInformation\";\nimport { assertPublicClient } from \"~/errors/assert\";\nimport type { Token } from \"~/types/dex\";\nimport type { DefaultHookOptions, DefaultHookReturnType } from \"~/types/global\";\n\nexport type UseMultipleTokenInformationResponse = DefaultHookReturnType<\n Token[]\n>;\n\nexport type useMultipleTokenInformationArgs = {\n addresses: string[] | readonly string[] | undefined;\n chainId?: number;\n};\nexport function useMultipleTokenInformation(\n args: useMultipleTokenInformationArgs,\n options?: DefaultHookOptions,\n): UseMultipleTokenInformationResponse {\n const publicClient = usePublicClient();\n\n const QUERY_KEY =\n publicClient && args.addresses\n ? ([\n \"useMultipleTokenInformation\",\n args.addresses,\n args.chainId ?? defaultChainId,\n ] as const)\n : null;\n\n const swrResponse = useSWRImmutable<Token[], unknown, typeof QUERY_KEY>(\n QUERY_KEY,\n async ([, addresses, chainId]) => {\n // We already checked for publicClient in the QUERY_KEY\n // so we can safely assume that publicClient is defined\n // but we need this for correct type inference\n assertPublicClient(publicClient);\n\n return Promise.all(\n addresses.map(async (address) => {\n if (!address || !isAddress(address, { strict: false })) {\n throw new Error(\"Invalid address\");\n }\n\n const tk = await getTokenInformation({\n address: address,\n publicClient,\n chainId,\n });\n\n if (!tk) {\n throw new Error(`Token ${address} not found`);\n }\n\n return tk;\n }),\n );\n },\n { ...options?.opts },\n );\n\n return {\n ...swrResponse,\n refresh: () => swrResponse?.mutate?.(),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/snowbera/Documents/workspace/monobera/packages/berajs/dist/hooks/exports.cjs","../../src/hooks/bend/useGetConvertToAssets.ts","../../src/hooks/dex/useAggregatorsQuotes.ts","../../src/actions/dex/aggregators/bex.ts","../../src/actions/dex/aggregators/bgt.ts","../../src/actions/dex/aggregators/enso/enso.ts","../../src/hooks/dex/useLiquidityMismatch.ts","../../src/hooks/tokens/useMultipleTokenInformation.ts"],"names":["useGetConvertToAssets","sharesAmount","vaultAddress","vaultChainId","options","publicClient","usePublicClient","swrResponse","useSWR","_","assertPublicClient","getConvertToAssets","DEFAULT_DEADLINE","STALE_PRICE_THRESHOLD","swapKind","SwapKind","BexAggregator","BaseAggregator","ChainId","getUriFromLink","address","isToken","priceImpact","onChainAmount","sorPaths","sorAmount","queryData","deltaFromSorAmount","formatEther","error","BeraError","p","BeraMonitoring","args","balancerApi","BalancerApi","tokenIn","tokenOut","amount","slippage","account","zeroAddress","wberaIsBera","tokenInV3","Token","tokenOutV3","tokenAmount","TokenAmount","RequestError","swap","Swap","queryOutput","callData","Slippage","params","functionName","decodeFunctionData","balancerVaultAbi","bex","RedeemBgtAggregator","beraToken","InvalidArgumentError","bgtRedeem","EnsoAggregator","aggregatorsFeeBps","proxyAggregatorsThroughVercel","rewardVault","tokenInAddress","tokenOutAddress","isTokenInNative","isTokenOutNative","inputAmountAfterFees"],"mappings":"AAAA,wnDAA0C,yDAAsoB,iCAA8B,yDAAiF,yDAAkD,iCAA8B,iCAA8B,iCAA8B,iCAA8B,yDAAmD,yDAAkF,iCAA8B,yDAAgE,yDAA2C,yDAAwF,yDAAyD,oECAr1C,+CAEa,IAOnBA,EAAAA,CAAwB,CACnC,CACE,YAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CACF,CAAA,CACAC,CAAAA,CAAAA,EACG,CACH,IAAMC,CAAAA,CAAeC,oCAAAA,CAAkB,OAAA,CAASH,CAAa,CAAC,CAAA,CACxDI,CAAAA,CAAcC,2BAAAA,CAClBH,EAAgBJ,CAAAA,EAAgBC,CAAAA,CAC5B,CAAC,uBAAA,CAAyBD,CAAAA,CAAcC,CAAAA,CAAcC,CAAY,CAAA,CAClE,IAAA,CACJ,KAAA,CAAO,CAACM,CAAAA,CAAGR,CAAAA,CAAcC,CAAY,CAAA,CAAA,EAAA,CACnCQ,iCAAAA,CAA+B,CAAA,CAExBC,iCAAAA,CACL,YAAA,CAAAV,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,YAAA,CAAAG,CACF,CAAC,CAAA,CAAA,CAEH,CACE,mBAAGD,CAAAA,6BAAS,MACd,CACF,CAAA,CAEA,MAAO,C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AAA,CAEnDkC,CAAAA,CAAuB,IAAA,CAAK,kBAAA,CAChCjC,CAAAA,CACA0B,CACF,CAAA,CAEA,IAAA,CAAK,GAAA,CAAMC,CAAAA,CACP,kCAAA,CACA,CAAA,EAAA;ACkHS,gEAAA;AChGJ,mFAAA","file":"/Users/snowbera/Documents/workspace/monobera/packages/berajs/dist/hooks/exports.cjs","sourcesContent":[null,"import useSWR from \"swr\";\n\nimport { usePublicClient } from \"@berachain/wagmi/hooks\";\n\nimport type { GetConvertToAssetsProps } from \"../../actions/bend/getConvertToAssets\";\nimport { getConvertToAssets } from \"../../actions/bend/getConvertToAssets\";\nimport { assertPublicClient } from \"../../errors/assert\";\nimport type { DefaultHookOptions } from \"../../types/global\";\n\nexport const useGetConvertToAssets = (\n {\n sharesAmount,\n vaultAddress,\n vaultChainId,\n }: Omit<GetConvertToAssetsProps, \"publicClient\"> & { vaultChainId?: number },\n options?: DefaultHookOptions,\n) => {\n const publicClient = usePublicClient({ chainId: vaultChainId });\n const swrResponse = useSWR(\n publicClient && sharesAmount && vaultAddress\n ? [\"useGetConvertToAssets\", sharesAmount, vaultAddress, vaultChainId]\n : null,\n async ([_, sharesAmount, vaultAddress]) => {\n assertPublicClient(publicClient);\n\n return getConvertToAssets({\n sharesAmount,\n vaultAddress,\n publicClient,\n });\n },\n {\n ...options?.opts,\n },\n );\n\n return {\n ...swrResponse,\n refresh: () => {\n swrResponse.mutate();\n },\n };\n};\n","import { useMemo } from \"react\";\nimport { type Address, zeroAddress } from \"viem\";\n\nimport { defaultChainId } from \"@berachain/config/internal\";\n\nimport { useBeraWallet, usePublicClient } from \"@berachain/wagmi/hooks\";\n\nimport { bex } from \"../../actions/dex/aggregators/bex\";\nimport { bgtRedeem } from \"../../actions/dex/aggregators/bgt\";\nimport { enso } from \"../../actions/dex/aggregators/enso/enso\";\nimport { erc4626Deposit } from \"../../actions/dex/aggregators/erc4626\";\nimport { fly } from \"../../actions/dex/aggregators/fly\";\nimport { haiku } from \"../../actions/dex/aggregators/haiku\";\nimport { honeyNative } from \"../../actions/dex/aggregators/honey\";\nimport { kyberswap } from \"../../actions/dex/aggregators/kyberswap\";\nimport { oogabooga } from \"../../actions/dex/aggregators/oogabooga\";\nimport { openOcean } from \"../../actions/dex/aggregators/openOcean\";\nimport { wberaSwap } from \"../../actions/dex/aggregators/wbera\";\nimport { useBeraFlag } from \"../../contexts/BeraFlags/BeraFlags\";\nimport type { HoneyConfigContextReturn } from \"../../contexts/HoneyConfigProvider\";\nimport type { SwapReferrer } from \"../../enum/dex\";\nimport type { IRawAggregatorQuote, MinimalERC20 } from \"../../types/dex\";\nimport type { DefaultHookOptions } from \"../../types/global\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\nimport { isToken } from \"../../utils/tokens\";\nimport { useUnderlyingAsset } from \"../tokens/useUnderlyingAsset\";\nimport { useAggregatorsRouterFeeBps } from \"./useAggregatorsRouterFeeBps\";\nimport { useBexStatus } from \"./useBexStatus\";\nimport {\n getAggregatorsSWROptions,\n raw_useSingleAggregatorQuote,\n} from \"./useSingleAggregatorQuote\";\n\nconst AGGREGATORS = [\n oogabooga,\n fly,\n kyberswap,\n openOcean,\n haiku,\n enso,\n bex,\n honeyNative,\n erc4626Deposit,\n];\n\ntype IUseAggregatorsQuotesArgs = BeraJS.BaseFunctionArgs & {\n tokenIn: MinimalERC20;\n tokenOut: MinimalERC20;\n amount: string;\n slippage: number;\n referrer?: SwapReferrer;\n rewardVault?: Address;\n /**\n * Useful cause the collaterals are provided byt he honeyContext and this way we can\n * use the Provider only in the swap page where is needed.\n *\n * The collaterals for the honey mint/redeem aggregator.\n */\n honeyNativeState?: Pick<\n HoneyConfigContextReturn,\n \"collateralList\" | \"protocol\"\n >;\n};\n\nexport function useAggregatorsQuotes(\n args: IUseAggregatorsQuotesArgs,\n options?: DefaultHookOptions,\n) {\n const { address: account } = useBeraWallet();\n const proxyAggregatorsThroughVercel = useBeraFlag(\n \"proxyAggregatorsThroughVercel\",\n );\n const activeAggregators = useBeraFlag(\"aggregators\");\n const publicClient = usePublicClient();\n const { data: feeBps } = useAggregatorsRouterFeeBps();\n\n const isWrapOrUnwrap =\n (isToken(args.tokenIn.address, \"BERA\") ||\n isToken(args.tokenIn.address, \"WBERA\")) &&\n (isToken(args.tokenOut.address, \"BERA\") ||\n isToken(args.tokenOut.address, \"WBERA\"));\n\n const isBgtRedeem = isToken(args.tokenIn.address, \"BGT\", {\n chainId: defaultChainId,\n });\n\n const { data: underlyingToken } = useUnderlyingAsset({\n token: args.tokenOut,\n });\n\n /**\n * Whether it's a native swap (wrap/unwrap) or BGT redeem\n */\n const isNativeSwap = isWrapOrUnwrap || isBgtRedeem;\n\n const { config } = parseBaseArgs(args);\n\n const isMAEnabled = config.bex.aggregatorsRouter !== zeroAddress;\n\n const swrOptions = getAggregatorsSWROptions(options);\n\n const sharedArgs = {\n activeAggregators,\n isMAEnabled,\n underlyingToken,\n isNativeSwap,\n account,\n publicClient,\n proxyAggregatorsThroughVercel,\n feeBps,\n } as const;\n\n // we're using independent useSWRs so we can show quotes as they come\n // instead of waiting for all of them to load\n const oogaBogaResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: oogabooga,\n },\n { opts: swrOptions },\n );\n\n const flyResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: fly,\n },\n { opts: swrOptions },\n );\n\n const erc4626Result = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: erc4626Deposit,\n },\n { opts: swrOptions },\n );\n\n const kyberswapResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: kyberswap,\n },\n { opts: swrOptions },\n );\n\n const openOceanResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: openOcean,\n },\n { opts: swrOptions },\n );\n\n const haikuResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: haiku,\n },\n { opts: swrOptions },\n );\n\n const ensoResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: enso,\n },\n { opts: swrOptions },\n );\n\n const { protocol: bexProtocol } = useBexStatus();\n\n const bexResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: bex,\n },\n { opts: { ...swrOptions, isEnabled: bexProtocol.isPaused === false } },\n );\n\n const wberaSwapResult = raw_useSingleAggregatorQuote({\n ...sharedArgs,\n ...args,\n aggregator: wberaSwap,\n });\n\n const bgtRedeemResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: bgtRedeem,\n },\n { opts: swrOptions },\n );\n\n const honeyResult = raw_useSingleAggregatorQuote(\n {\n ...sharedArgs,\n ...args,\n aggregator: honeyNative,\n },\n { opts: swrOptions },\n );\n\n const results = isWrapOrUnwrap\n ? [wberaSwapResult]\n : isBgtRedeem\n ? [bgtRedeemResult]\n : [\n oogaBogaResult,\n erc4626Result,\n flyResult,\n kyberswapResult,\n openOceanResult,\n haikuResult,\n ensoResult,\n honeyResult,\n bexProtocol.isPaused === false ? bexResult : null,\n ].filter((i): i is NonNullable<typeof i> => i !== null);\n\n const data = useMemo(() => {\n const error = results.reduce<(typeof results)[number][\"error\"]>(\n (error, result) => error || result.error,\n undefined,\n );\n\n const loadingAggregatorsNames = results\n .map((r, i) =>\n r.isLoading\n ? isNativeSwap\n ? wberaSwap.name\n : AGGREGATORS[i].name\n : null,\n )\n .filter(Boolean);\n\n const quotes = results\n .filter(\n (result) =>\n result !== undefined &&\n !result.isLoading &&\n !result.error &&\n result.data?.amountOut,\n )\n .map(({ data }) => data) as IRawAggregatorQuote[];\n\n const isLoading = quotes.length === 0 && loadingAggregatorsNames.length > 0;\n return { quotes, loadingAggregatorsNames, isLoading, error };\n }, [results]);\n\n return {\n ...data,\n refresh: () => results.map((r) => r.mutate()),\n };\n}\n","import {\n type Address,\n Slippage,\n type SorSwapResult,\n Swap,\n SwapKind,\n Token,\n TokenAmount,\n} from \"@berachain-foundation/berancer-sdk\";\nimport { decodeFunctionData, formatEther, zeroAddress } from \"viem\";\n\nimport { getUriFromLink } from \"@berachain/config\";\nimport { ChainId } from \"@berachain/config/internal\";\n\nimport { vaultAbi as balancerVaultAbi } from \"@berachain/abis/bex/vault\";\n\nimport { Aggregators } from \"../../../enum/dex\";\nimport { assertPublicClient } from \"../../../errors/assert\";\nimport { BeraError } from \"../../../errors/BeraError\";\nimport { BeraMonitoring } from \"../../../errors/BeraMonitoring\";\nimport { RequestError } from \"../../../errors/RequestError\";\nimport type { IAggregatorArgs, IRawAggregatorQuote } from \"../../../types/dex\";\nimport { isToken } from \"../../../utils/tokens\";\nimport { BalancerApi } from \"../b-sdk\";\nimport { BaseAggregator } from \"./base\";\n\n// Constants\nconst DEFAULT_DEADLINE = 60 * 5; // default transaction deadline in seconds\nconst STALE_PRICE_THRESHOLD = 0.05; // 5% threshold for stale prices\nconst swapKind = SwapKind.GivenIn;\n\nclass BexAggregator extends BaseAggregator {\n name = Aggregators.HubPools;\n supportedChains = [ChainId.MAINNET, ChainId.BEPOLIA];\n readonly url = getUriFromLink(this.config.api);\n readonly type = \"graphql\";\n\n /**\n * Helper function to convert zero address to wrapped token address\n */\n private convertZeroToWrapped(address: Address): Address {\n return isToken(address, \"BERA\") ? this.config.tokens.wbera : address;\n }\n\n /**\n * Helper to calculate price impact percentage\n */\n private calculatePriceImpact(priceImpact: {\n error: string | null;\n priceImpact?: string;\n }): number {\n if (priceImpact.error) {\n console.error(\"Swap price impact error\", priceImpact);\n return 0;\n }\n\n return Number(priceImpact.priceImpact);\n }\n\n /**\n * Helper to check for stale SOR prices\n */\n private checkStalePrices({\n onChainAmount,\n sorPaths,\n sorAmount,\n queryData,\n }: {\n onChainAmount: TokenAmount;\n sorPaths: { pools: string[] }[];\n sorAmount: string;\n queryData: IAggregatorArgs;\n }): void {\n // Check for stale prices\n const deltaFromSorAmount =\n Number.parseFloat(formatEther(onChainAmount.scale18)) /\n Number.parseFloat(sorAmount);\n\n if (Math.abs(1 - deltaFromSorAmount) > STALE_PRICE_THRESHOLD) {\n console.warn(\n \"SOR returned stale prices. Delta from return amount is more than 5%\",\n {\n deltaFromSorAmount,\n },\n );\n\n const error = new BeraError({\n reason: \"SOR_STALE_PRICES\",\n level: \"warning\",\n message:\n \"SOR returned stale prices. Delta from return amount is more than 5%\",\n extra: {\n deltaFromSorAmount,\n pools: sorPaths.map((p) => p.pools),\n onChainAmount: formatEther(onChainAmount.scale18),\n sorAmount,\n queryData,\n },\n fingerprint: [\"SOR_STALE_PRICES\"],\n });\n BeraMonitoring.captureException(error);\n }\n }\n\n async getQuote(args: IAggregatorArgs): Promise<IRawAggregatorQuote> {\n const balancerApi = new BalancerApi(\n this.url,\n // @ts-expect-error b-sdk has more chains than berajs\n this.chainId,\n );\n const {\n tokenIn,\n tokenOut,\n amount,\n slippage,\n account = zeroAddress,\n publicClient,\n } = args;\n this.assertChainSupport({ tokenIn, tokenOut });\n\n assertPublicClient(publicClient);\n\n const wberaIsBera = isToken(tokenIn, \"BERA\") || isToken(tokenOut, \"BERA\");\n\n // Initialize tokens\n const tokenInV3 = new Token(\n this.chainId,\n this.convertZeroToWrapped(tokenIn.address),\n tokenIn.decimals,\n );\n const tokenOutV3 = new Token(\n this.chainId,\n this.convertZeroToWrapped(tokenOut.address),\n tokenOut.decimals,\n );\n\n const tokenAmount = TokenAmount.fromRawAmount(\n tokenInV3,\n amount as `${number}`,\n );\n\n // swap paths\n const {\n paths: sorPaths,\n priceImpact,\n returnAmount: sorAmount,\n }: SorSwapResult = await balancerApi.sorSwapPaths.fetchSorSwapPaths({\n // @ts-expect-error b-sdk has more chains than berajs\n chainId: this.chainId,\n tokenIn: tokenInV3.address,\n tokenOut: tokenOutV3.address,\n swapKind,\n swapAmount: tokenAmount,\n });\n\n if (!sorPaths?.length) {\n throw new RequestError({\n response: undefined,\n endpoint: {\n url: this.url,\n name: this.name,\n type: this.type,\n },\n reason: BaseAggregator.PATH_NOT_FOUND_REASON,\n chainId: this.chainId,\n payload: {\n tokenIn: tokenInV3.address,\n tokenOut: tokenOutV3.address,\n swapKind,\n swapAmount: tokenAmount,\n },\n message: `No swap paths returned from Balancer API`,\n });\n }\n\n // execute swap query\n const swap = new Swap({\n chainId: this.chainId,\n paths: sorPaths,\n swapKind,\n userData: \"0x\" as `0x${string}`,\n });\n const queryOutput = await swap.query(publicClient.transport.url);\n\n if (!(\"expectedAmountOut\" in queryOutput)) {\n throw new Error(\"No Bex paths found\");\n }\n\n this.checkStalePrices({\n onChainAmount: queryOutput.expectedAmountOut,\n sorPaths,\n sorAmount,\n queryData: args,\n });\n\n // format quote response\n return {\n amountOut: queryOutput.expectedAmountOut.amount.toString(),\n amountIn: amount,\n allowanceRequirements: this.parseAllowanceRequirements({\n tokenIn,\n rawAmount: amount,\n spender: queryOutput.to,\n }),\n name: this.name,\n priceImpactPercentage: this.calculatePriceImpact(priceImpact),\n swapFeeBps: 0,\n getCalldata: ({ account }) => {\n // generate user transaction data\n const callData = swap.buildCall({\n slippage: Slippage.fromPercentage(slippage.toString() as `${number}`),\n deadline: BigInt(Math.round(Date.now() / 1000) + DEFAULT_DEADLINE),\n queryOutput,\n sender: account as Address,\n recipient: account as Address,\n wethIsEth: wberaIsBera,\n });\n\n const { args: params, functionName } = decodeFunctionData({\n abi: balancerVaultAbi,\n data: callData.callData,\n });\n\n return {\n params,\n functionName,\n abi: balancerVaultAbi,\n address: callData.to,\n value: callData.value || BigInt(0),\n };\n },\n };\n }\n}\n\nexport const bex = new BexAggregator();\n","import { ChainId } from \"@berachain/config/internal\";\n\nimport { Aggregators } from \"../../../enum/dex\";\nimport { InvalidArgumentError } from \"../../../errors/InvalidArgumentError\";\nimport type {\n IAggregatorArgs,\n IRawAggregatorQuote,\n MinimalERC20,\n} from \"../../../types/dex\";\nimport { beraToken, isToken } from \"../../../utils/tokens\";\nimport { BaseAggregator } from \"./base\";\n\nclass RedeemBgtAggregator extends BaseAggregator {\n name = Aggregators.RedeemBgt;\n supportedChains = [ChainId.MAINNET, ChainId.BEPOLIA];\n readonly type = \"rpc\";\n\n checkChainSupport({\n tokenIn,\n tokenOut,\n }: {\n tokenIn: MinimalERC20;\n tokenOut: MinimalERC20;\n }): boolean {\n if (!super.checkChainSupport({ tokenIn, tokenOut })) {\n return false;\n }\n\n return (\n // only supported on same chain\n tokenIn.chainId === tokenOut.chainId &&\n isToken(tokenIn, \"BGT\", { chainId: tokenIn.chainId }) &&\n isToken(tokenOut, \"BERA\")\n );\n }\n // handles native swaps: wrap and unwrap\n async getQuote({\n tokenIn,\n amount,\n }: Omit<\n IAggregatorArgs,\n \"slippage\" | \"feeBps\" | \"tokenOut\" | \"account\"\n >): Promise<IRawAggregatorQuote> {\n this.assertChainSupport({\n tokenIn,\n tokenOut: { ...beraToken, chainId: tokenIn.chainId },\n });\n\n if (!isToken(tokenIn, \"BGT\", { config: this.config })) {\n throw new InvalidArgumentError({\n property: \"tokenIn\",\n value: tokenIn,\n expected: \"BGT\",\n level: \"warning\",\n });\n }\n\n return {\n amountOut: amount,\n amountIn: amount,\n allowanceRequirements: [],\n name: Aggregators.RedeemBgt,\n isNativeSwap: true,\n swapFeeBps: 0,\n // not adding calldata here because it depends on the connected wallet\n // bgt redeem requires a receiver address\n // moreover this is a sensitive operation, better be sure of what data is being sent\n // by controlling it on the consumer side\n } as const;\n }\n}\n\nexport const bgtRedeem = new RedeemBgtAggregator();\n","import { zeroAddress } from \"viem\";\n\nimport { ChainId } from \"@berachain/config/internal\";\n\nimport aggregatorsRouterAbi from \"@berachain/abis/meta-aggregator/metaAggregatorV2\";\n\nimport { Aggregators } from \"../../../../enum/dex\";\nimport type {\n IAggregatorArgs,\n IRawAggregatorQuote,\n} from \"../../../../types/dex\";\nimport type { IContractWrite } from \"../../../../types/global\";\nimport { BaseAggregator } from \"../base\";\n\nclass EnsoAggregator extends BaseAggregator {\n name = Aggregators.Enso;\n supportedChains = [ChainId.MAINNET];\n readonly type = \"rest\";\n needsAccountForQuote = true;\n\n notFoundMessages: string[] = [\n \"Could not build shortcuts for route\",\n \"Could not quote shortcuts for route\",\n \"Swap not found for a required underlying of defi route,\",\n \"No route found from\",\n ];\n\n async getQuote({\n tokenIn,\n tokenOut,\n amount,\n slippage,\n account = zeroAddress,\n aggregatorsFeeBps,\n proxyAggregatorsThroughVercel = false,\n rewardVault,\n }: IAggregatorArgs): Promise<IRawAggregatorQuote> {\n this.assertChainSupport({ tokenIn, tokenOut });\n\n const {\n tokenInAddress,\n tokenOutAddress,\n isTokenInNative,\n isTokenOutNative,\n } = this.parseAddresses(tokenIn.address, tokenOut.address);\n\n const inputAmountAfterFees = this.getAmountAfterFees(\n amount,\n aggregatorsFeeBps,\n );\n\n this.url = proxyAggregatorsThroughVercel\n ? `/api/aggregators?aggregator=enso`\n : `${this.config.bex.aggregatorsProxyUrl}/enso/api/v1/shortcuts/route?`;\n\n const url = new URL(this.url);\n url.searchParams.set(\n \"fromAddress\",\n this.config.bex.aggregatorsRouterExecutor,\n );\n url.searchParams.set(\"receiver\", this.config.bex.aggregatorsRouterExecutor);\n url.searchParams.set(\"spender\", this.config.bex.aggregatorsRouterExecutor);\n url.searchParams.set(\"amountIn\", inputAmountAfterFees);\n url.searchParams.set(\"tokenIn\", tokenInAddress);\n url.searchParams.set(\"tokenOut\", tokenOutAddress);\n url.searchParams.set(\"chainId\", ChainId.MAINNET.toString());\n url.searchParams.set(\"slippage\", (Number(slippage) * 100).toString());\n url.searchParams.set(\"refundReceiver\", account);\n\n const response = await this.fetch(url);\n\n const quote = await response.json();\n\n const inputData = this.getInputData({\n tokenIn: tokenInAddress,\n amountIn: amount,\n isNative: isTokenInNative,\n });\n\n const outputData = {\n tokenOut: tokenOutAddress,\n receiver: account,\n minAmountOut: this.getMinAmountOut(quote.amountOut.toString(), slippage),\n isNative: isTokenOutNative,\n };\n\n const aggregatorData = {\n aggregator: quote.tx?.to,\n data: quote.tx?.data,\n };\n\n return {\n amountOut: quote.amountOut.toString(),\n amountIn: amount,\n allowanceRequirements: this.parseAllowanceRequirements({\n tokenIn,\n rawAmount: amount,\n spender: this.config.bex.aggregatorsRouter,\n }),\n name: this.name,\n swapFeeBps: aggregatorsFeeBps!,\n getCalldata: () =>\n ({\n params: [\n inputData,\n outputData,\n aggregatorData,\n {\n rewardVault: rewardVault ?? zeroAddress,\n isSwapAndStake: !!rewardVault,\n },\n ],\n functionName: \"swap\",\n abi: aggregatorsRouterAbi,\n // send full amount to router first, which will deduct the swap fee before executing trade\n value: isTokenInNative ? BigInt(amount) : BigInt(\"0\"),\n address: this.config.bex.aggregatorsRouter,\n }) satisfies Omit<\n IContractWrite<typeof aggregatorsRouterAbi, \"swap\">,\n \"message\" | \"actionType\"\n >,\n };\n }\n}\n\nexport const enso = new EnsoAggregator();\n","import { useEffect, useState } from \"react\";\nimport { PoolType } from \"@berachain-foundation/berancer-sdk\";\n\nimport { PoolCreationStep } from \"../../enum/dex\";\nimport type { TokenCurrentPriceMap, TokenWithAmount } from \"../../types/dex\";\nimport { wrapNativeTokens } from \"../../utils/tokenWrapping\";\nimport { type Oracle, OracleMode } from \"./useCreatePool\";\n\nconst DEFAULT_LIQUIDITY_MISMATCH_TOLERANCE_PERCENT = 0.05; // 5%\n\nexport type LiquidityMismatchInfo = {\n title: string | null;\n message: string | null;\n suggestWeighted?: boolean;\n};\n\ninterface UseLiquidityMismatchParams {\n currentStep: PoolCreationStep;\n tokenPrices?: TokenCurrentPriceMap;\n isLoadingTokenPrices: boolean;\n tokens: TokenWithAmount[] | null;\n weights: bigint[] | null;\n weightsError: string | null;\n poolType: PoolType;\n liquidityMismatchTolerancePercent?: number;\n oracles: Oracle[];\n}\n\n/**\n * Hook for detecting liquidity mismatches.\n *\n * @param {PoolCreationStep} currentStep - The current step of the pool creation process.\n * @param {Record<string, number>} tokenPrices - The current token prices.\n * @param {boolean} isLoadingTokenPrices - Whether the token prices are still loading.\n * @param {Array<{ address: string, amount: number }>} tokens - The tokens in the pool, including their addresses and amounts.\n * @param {Record<string, number>} weights - The per-token weights in the pool we are creating.\n * @param {string | null} weightsError - An error message for the weights indicating that the weights are invalid.\n * @param {string} poolType - The type of pool being created.\n * @param {number} liquidityMismatchTolerancePercent - The tolerance for liquidity mismatches in percent.\n * @returns {Object} The liquidity mismatch info.\n */\nexport const useLiquidityMismatch = ({\n currentStep,\n tokenPrices,\n isLoadingTokenPrices,\n tokens,\n weights,\n weightsError,\n poolType,\n liquidityMismatchTolerancePercent = DEFAULT_LIQUIDITY_MISMATCH_TOLERANCE_PERCENT,\n oracles,\n}: UseLiquidityMismatchParams): LiquidityMismatchInfo => {\n // NOTE: would be nice to use Maps/Records more in here, as the zipping/unzipping is cumbersome.\n // NOTE: if we pull in string literal for currentStep things would also be a bit clearer in here.\n const [liquidityMismatchInfo, setLiquidityMismatchInfo] =\n useState<LiquidityMismatchInfo>({ title: null, message: null });\n\n useEffect(() => {\n // If we are either using custom rate-providing oracles or have incorrect/loading token prices, we cant do validation.\n if (\n !tokenPrices ||\n isLoadingTokenPrices ||\n !tokens ||\n !weights ||\n weightsError ||\n tokens.some((token) => !token.address) ||\n oracles.some((oracle) => oracle.mode === OracleMode.Custom) // Oracles give prices on their own, we dont support that here yet.\n ) {\n setLiquidityMismatchInfo({ title: null, message: null });\n return;\n }\n\n // Calculate some basic metrics we'll use to determine per-token contributions and model potential losses from arbitrage.\n let totalLiquidityUSD = 0;\n const tokenUSDAmounts: number[] = [];\n const numTokens = tokens.length;\n const wrappedTokens = wrapNativeTokens(tokens);\n const tokenUSDPrices = wrappedTokens.map((token) => {\n const tokenPriceUSD =\n tokenPrices[token.address.toLowerCase()]?.price ?? 0;\n if (!tokenPriceUSD || tokenPriceUSD === 0) {\n tokenUSDAmounts.push(0);\n return null;\n }\n const tokenAmountUSD = tokenPriceUSD * Number.parseFloat(token.amount);\n tokenUSDAmounts.push(tokenAmountUSD);\n totalLiquidityUSD += tokenAmountUSD;\n return tokenPriceUSD;\n });\n\n // Doesn't matter what step it is, if we have missing token prices for tokens we have selected, we cant issue a real warning.\n if (\n tokenUSDPrices.some((price) => price === null) ||\n tokenUSDPrices.length !== numTokens\n ) {\n setLiquidityMismatchInfo({\n title: \"Missing token price data\",\n message: `One or more token(s) do not have valid market price data. Please verify that token market prices align with the pool\n weightings and your initial liquidity amounts.`,\n });\n return;\n }\n\n // Step 1 - During token selection we check for a deviation in the quote prices of the tokens selected (for stable pools).\n if (\n currentStep === PoolCreationStep.SELECT_TOKENS &&\n poolType === PoolType.ComposableStable\n ) {\n const normalizedUSDPrices = tokenUSDPrices.map(\n (priceUSD) => priceUSD! / tokenUSDPrices[0]!, // always normalize on the first token's price\n );\n const maxDifference =\n Math.max(...normalizedUSDPrices) - Math.min(...normalizedUSDPrices);\n\n if (maxDifference > liquidityMismatchTolerancePercent) {\n setLiquidityMismatchInfo({\n title: \"Selected tokens have a significant price deviation\",\n message: \"Did you mean to create a Weighted pool instead?\",\n suggestWeighted: true,\n });\n } else {\n setLiquidityMismatchInfo({ title: null, message: null });\n }\n\n return;\n }\n\n // Validation During Liquidity Input and onwards.\n if (\n totalLiquidityUSD === 0 ||\n tokenUSDAmounts.some((value) => value === 0)\n ) {\n // User has not yet entered fully their liquidity values, so return early.\n setLiquidityMismatchInfo({ title: null, message: null });\n return;\n }\n\n // Simulate arbitrage for the pool to determine potential losses from arbitrageurs.\n // NOTE: we assume shortfalls and excesses are losses, but in reality the actual losses would be more complex to realise.\n // Balancer does this similarily https://github.com/balancer/frontend-v2/blob/8563b8d33b6bff266148bd48d7ebc89f921374f4/src/components/cards/CreatePool/InitialLiquidity.vue#L75\n let totalLossUSD = 0;\n if (poolType === PoolType.ComposableStable) {\n const expectedPerTokenLiquidityUSD = totalLiquidityUSD / numTokens;\n tokenUSDAmounts.forEach((value) => {\n totalLossUSD += Math.abs(expectedPerTokenLiquidityUSD - value);\n });\n } else if (poolType === PoolType.Weighted) {\n tokenUSDAmounts.forEach((value, index) => {\n const weightProportion = Number(weights[index]) / 1e18;\n const expectedValueUSD = totalLiquidityUSD * weightProportion;\n totalLossUSD += Math.abs(expectedValueUSD - value);\n });\n }\n\n // We'll show a total loss if it's 90% or more\n const isTotalLoss = totalLossUSD >= totalLiquidityUSD * 0.9;\n totalLossUSD = Math.min(totalLossUSD, totalLiquidityUSD);\n const totalLossPercentage = totalLossUSD / totalLiquidityUSD;\n\n if (totalLossPercentage > liquidityMismatchTolerancePercent) {\n setLiquidityMismatchInfo({\n // If it's a total loss we dont display a percentage\n title: isTotalLoss\n ? \"You could lose all of your initial liquidity\"\n : `You could lose $${totalLossUSD.toFixed(2)} (~${(\n totalLossPercentage * 100\n ).toFixed(2)}%)`,\n message: `Based on the market token prices, the value of tokens does not align with the specified pool weights. \n This discrepancy could expose you to potential losses from arbitrageurs. ${\n poolType === PoolType.ComposableStable\n ? \"Did you mean to create a Weighted pool instead?\"\n : \"\"\n }`,\n suggestWeighted: poolType === PoolType.ComposableStable,\n });\n } else {\n // All good bb bb\n setLiquidityMismatchInfo({ title: null, message: null });\n }\n }, [\n currentStep,\n tokenPrices,\n isLoadingTokenPrices,\n tokens,\n weights,\n weightsError,\n poolType,\n liquidityMismatchTolerancePercent,\n oracles,\n ]);\n return liquidityMismatchInfo;\n};\n","import useSWRImmutable from \"swr/immutable\";\nimport { isAddress } from \"viem\";\n\nimport { defaultChainId } from \"@berachain/config/internal\";\n\nimport { usePublicClient } from \"@berachain/wagmi/hooks\";\n\nimport { getTokenInformation } from \"../../actions/tokens/getTokenInformation\";\nimport { assertPublicClient } from \"../../errors/assert\";\nimport type { Token } from \"../../types/dex\";\nimport type {\n DefaultHookOptions,\n DefaultHookReturnType,\n} from \"../../types/global\";\n\nexport type UseMultipleTokenInformationResponse = DefaultHookReturnType<\n Token[]\n>;\n\nexport type useMultipleTokenInformationArgs = {\n addresses: string[] | readonly string[] | undefined;\n chainId?: number;\n};\nexport function useMultipleTokenInformation(\n args: useMultipleTokenInformationArgs,\n options?: DefaultHookOptions,\n): UseMultipleTokenInformationResponse {\n const publicClient = usePublicClient();\n\n const QUERY_KEY =\n publicClient && args.addresses\n ? ([\n \"useMultipleTokenInformation\",\n args.addresses,\n args.chainId ?? defaultChainId,\n ] as const)\n : null;\n\n const swrResponse = useSWRImmutable<Token[], unknown, typeof QUERY_KEY>(\n QUERY_KEY,\n async ([, addresses, chainId]) => {\n // We already checked for publicClient in the QUERY_KEY\n // so we can safely assume that publicClient is defined\n // but we need this for correct type inference\n assertPublicClient(publicClient);\n\n return Promise.all(\n addresses.map(async (address) => {\n if (!address || !isAddress(address, { strict: false })) {\n throw new Error(\"Invalid address\");\n }\n\n const tk = await getTokenInformation({\n address: address,\n publicClient,\n chainId,\n });\n\n if (!tk) {\n throw new Error(`Token ${address} not found`);\n }\n\n return tk;\n }),\n );\n },\n { ...options?.opts },\n );\n\n return {\n ...swrResponse,\n refresh: () => swrResponse?.mutate?.(),\n };\n}\n"]}
|
package/dist/hooks/exports.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as swr__internal from 'swr/_internal';
|
|
2
2
|
import * as swr from 'swr';
|
|
3
3
|
import { SWRResponse } from 'swr';
|
|
4
|
-
import { b as GetConvertToAssetsProps, O as OnChainPool, B as BaseAggregator, d as GetHoneyVaultsBalanceResponse, j as IsBadCollateralResponse, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, i as GlobalData, e as GetMarkets, S as StakedBeraWithdrawal, k as RewardVaultIncentive, f as GetRewardVaultRewardsReturn, c as GetGaugeData, t as VaultMetadata, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, V as ValidatorRewardAllocation, s as ValidatorWithUserBoost, U as UserBoostsOnValidator, l as UserStakingPoolPosition, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress } from '../getValidatorQueuedOperatorAddress-
|
|
5
|
-
import { D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, a as CustomProposalErrors, C as CustomProposal, S as StakingConfig, d as StakedBeraAsset, U as UserVaultInfo, e as IUseContractWriteArgs, f as UseContractWriteApi, B as BribeBoostRewardProof } from '../global.d-
|
|
6
|
-
export { T as TxnEventKeys } from '../global.d-
|
|
4
|
+
import { b as GetConvertToAssetsProps, O as OnChainPool, B as BaseAggregator, d as GetHoneyVaultsBalanceResponse, j as IsBadCollateralResponse, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, i as GlobalData, e as GetMarkets, S as StakedBeraWithdrawal, k as RewardVaultIncentive, f as GetRewardVaultRewardsReturn, c as GetGaugeData, t as VaultMetadata, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, V as ValidatorRewardAllocation, s as ValidatorWithUserBoost, U as UserBoostsOnValidator, l as UserStakingPoolPosition, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress } from '../getValidatorQueuedOperatorAddress-BdDYHycN.cjs';
|
|
5
|
+
import { D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, a as CustomProposalErrors, C as CustomProposal, S as StakingConfig, d as StakedBeraAsset, U as UserVaultInfo, e as IUseContractWriteArgs, f as UseContractWriteApi, B as BribeBoostRewardProof } from '../global.d-CwT1Phzf.cjs';
|
|
6
|
+
export { T as TxnEventKeys } from '../global.d-CwT1Phzf.cjs';
|
|
7
7
|
import { S as SwapReferrer, A as Aggregators, a as PoolCreationStep } from '../dex-C_BB0b0O.cjs';
|
|
8
8
|
import * as viem from 'viem';
|
|
9
9
|
import { Address, Hex } from 'viem';
|
|
@@ -14,7 +14,7 @@ export { u as useBexStatus } from '../BexStatusProvider-DRymVlQf.cjs';
|
|
|
14
14
|
import { PoolType } from '@berachain-foundation/berancer-sdk';
|
|
15
15
|
import { SubgraphPoolFragment } from '@berachain/graphql/dex/subgraph';
|
|
16
16
|
import { P as POLLING } from '../polling-BKnyavLI.cjs';
|
|
17
|
-
import { GetZapTransactionResponse } from '../types/exports.cjs';
|
|
17
|
+
import { BendDemultiplyBundleResponse, BendMultiplyBundleResponse, GetZapTransactionResponse } from '../types/exports.cjs';
|
|
18
18
|
import * as react from 'react';
|
|
19
19
|
import * as swr_infinite from 'swr/infinite';
|
|
20
20
|
import { SWRInfiniteResponse, SWRInfiniteKeyLoader } from 'swr/infinite';
|
|
@@ -27,10 +27,9 @@ import BigNumber from '@berachain/utils/pkg/bignumber.js';
|
|
|
27
27
|
import * as _berachain_graphql_pol_api from '@berachain/graphql/pol/api';
|
|
28
28
|
import { GqlRewardVaultFilter, ApiVaultFragment, GetVaultsQueryVariables, GetVaultHistoryQuery, ApiValidatorFragment, GetValidatorsQueryVariables, GetValidatorsQuery, GqlChain, GetValidatorQuery, ApiValidatorMinimalFragment } from '@berachain/graphql/pol/api';
|
|
29
29
|
import { Address as Address$1 } from '@berachain/config';
|
|
30
|
-
import * as _berachain_graphql_pol_subgraph from '@berachain/graphql/pol/subgraph';
|
|
31
30
|
import { GetValidatorBlockStatsQuery, GetValidatorAnalyticsQuery } from '@berachain/graphql/pol/subgraph';
|
|
32
31
|
import '@berachain/config/internal';
|
|
33
|
-
import '../txnEnum-
|
|
32
|
+
import '../txnEnum-CCuQUFlh.cjs';
|
|
34
33
|
import '@wagmi/core';
|
|
35
34
|
import '../BeraError-_mQdkanr.cjs';
|
|
36
35
|
import 'react/jsx-runtime';
|
|
@@ -377,35 +376,10 @@ declare const usePollPoolCreationRelayerApproval: (options?: DefaultHookOptions)
|
|
|
377
376
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
378
377
|
};
|
|
379
378
|
|
|
380
|
-
declare function
|
|
381
|
-
poolId: string;
|
|
382
|
-
}): string[] | null;
|
|
383
|
-
declare const usePool: ({ poolId }: {
|
|
379
|
+
declare function usePool({ poolId }: {
|
|
384
380
|
poolId: Hex;
|
|
385
|
-
})
|
|
386
|
-
data: readonly [
|
|
387
|
-
__typename?: "Pool";
|
|
388
|
-
id: string;
|
|
389
|
-
name?: string | null;
|
|
390
|
-
address: `0x${string}`;
|
|
391
|
-
factory?: `0x${string}` | null;
|
|
392
|
-
swapFee: string;
|
|
393
|
-
totalShares: string;
|
|
394
|
-
totalLiquidity: string;
|
|
395
|
-
createTime: number;
|
|
396
|
-
owner?: `0x${string}` | null;
|
|
397
|
-
type?: string | null;
|
|
398
|
-
tokens?: Array<{
|
|
399
|
-
__typename?: "PoolToken";
|
|
400
|
-
address: `0x${string}`;
|
|
401
|
-
name: string;
|
|
402
|
-
decimals: number;
|
|
403
|
-
symbol: string;
|
|
404
|
-
index?: number | null;
|
|
405
|
-
weight?: string | null;
|
|
406
|
-
balance: string;
|
|
407
|
-
}> | null;
|
|
408
|
-
} | undefined, _berachain_graphql_dex_api.MinimalPoolFragment | undefined, OnChainPoolFragment | undefined];
|
|
381
|
+
}): {
|
|
382
|
+
data: readonly [undefined, _berachain_graphql_dex_api.MinimalPoolFragment | undefined, OnChainPoolFragment | undefined];
|
|
409
383
|
isLoading: boolean;
|
|
410
384
|
isError: any;
|
|
411
385
|
refresh: () => void;
|
|
@@ -591,6 +565,35 @@ declare function useSingleAggregatorQuote(args: IUseAggregatorsQuotesArgs & {
|
|
|
591
565
|
isEnabled?: boolean;
|
|
592
566
|
}) | undefined> | null;
|
|
593
567
|
|
|
568
|
+
type UseBendDemultiply = {
|
|
569
|
+
collateralToken?: Token;
|
|
570
|
+
loanToken?: Token;
|
|
571
|
+
marketId?: Hex;
|
|
572
|
+
primaryAddress?: Address;
|
|
573
|
+
repayAmount?: string;
|
|
574
|
+
slippage?: number;
|
|
575
|
+
chainId?: number;
|
|
576
|
+
collateralPriceInLoanAsset?: string;
|
|
577
|
+
currentCollateral?: string;
|
|
578
|
+
currentDebt?: string;
|
|
579
|
+
};
|
|
580
|
+
declare function useBendDemultiply({ collateralToken, loanToken, marketId, primaryAddress, repayAmount, slippage, chainId, collateralPriceInLoanAsset, currentCollateral, currentDebt, }: UseBendDemultiply, options?: DefaultHookOptions): swr.SWRResponse<BendDemultiplyBundleResponse, unknown, swr.SWRConfiguration<BendDemultiplyBundleResponse, unknown, (arg: readonly ["useBendDemultiply", `0x${string}`, Token, Token, `0x${string}`, `0x${string}`, number, string, number, string, string, string, `0x${string}`, boolean]) => swr__internal.FetcherResponse<BendDemultiplyBundleResponse>> | undefined>;
|
|
581
|
+
|
|
582
|
+
type UseBendMultiply = {
|
|
583
|
+
collateralToken?: Token;
|
|
584
|
+
loanToken?: Token;
|
|
585
|
+
marketId?: Hex;
|
|
586
|
+
primaryAddress?: Address;
|
|
587
|
+
formattedSupplyCollateralAmount?: string;
|
|
588
|
+
formattedCurrentCollateralAmount?: string;
|
|
589
|
+
formattedCurrentBorrowAmount?: string;
|
|
590
|
+
leverageMultiplier?: number;
|
|
591
|
+
slippage?: number;
|
|
592
|
+
chainId?: number;
|
|
593
|
+
formattedCollateralPriceInLoanAsset?: string;
|
|
594
|
+
};
|
|
595
|
+
declare function useBendMultiply({ collateralToken, loanToken, marketId, primaryAddress, formattedSupplyCollateralAmount, formattedCurrentCollateralAmount, formattedCurrentBorrowAmount, leverageMultiplier, slippage, chainId, formattedCollateralPriceInLoanAsset, }: UseBendMultiply, options?: DefaultHookOptions): swr.SWRResponse<BendMultiplyBundleResponse, unknown, swr.SWRConfiguration<BendMultiplyBundleResponse, unknown, (arg: readonly ["useBendMultiply", `0x${string}`, Token, Token, `0x${string}`, `0x${string}`, number, string, string, string, number, number, string, `0x${string}`, boolean]) => swr__internal.FetcherResponse<BendMultiplyBundleResponse>> | undefined>;
|
|
596
|
+
|
|
594
597
|
type UseBendZapSupplyArgs = {
|
|
595
598
|
tokenIn?: BalanceToken;
|
|
596
599
|
loanToken: MinimalERC20;
|
|
@@ -686,6 +689,17 @@ declare function useEnsoSwapBundle({ tokenIn, tokenOut, amount, slippage, }: {
|
|
|
686
689
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
687
690
|
};
|
|
688
691
|
|
|
692
|
+
declare function useEnsoUserTokensWithBalances({ chainId }?: {
|
|
693
|
+
chainId?: number;
|
|
694
|
+
}, options?: DefaultHookOptions): {
|
|
695
|
+
refresh: () => Promise<BalanceToken[] | undefined>;
|
|
696
|
+
data: BalanceToken[] | undefined;
|
|
697
|
+
error: any;
|
|
698
|
+
mutate: swr.KeyedMutator<BalanceToken[]>;
|
|
699
|
+
isValidating: boolean;
|
|
700
|
+
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
701
|
+
};
|
|
702
|
+
|
|
689
703
|
type UseZapStakeBeraArgs = {
|
|
690
704
|
inputToken: MinimalERC20 | undefined;
|
|
691
705
|
amount: string;
|
|
@@ -1260,7 +1274,11 @@ declare function useStakedSnapshots({ range, addresses, }: {
|
|
|
1260
1274
|
range: 30 | 60 | 90;
|
|
1261
1275
|
}): DefaultHookReturnType<UseStakedBeraSnapshot>;
|
|
1262
1276
|
|
|
1263
|
-
|
|
1277
|
+
type StakingVaultEntry = {
|
|
1278
|
+
address: Address;
|
|
1279
|
+
underlyingAsset: Address;
|
|
1280
|
+
};
|
|
1281
|
+
declare const useStakingVaultsMetadata: (vaults?: StakingVaultEntry[]) => swr.SWRResponse<VaultMetadata[], any, {
|
|
1264
1282
|
refreshInterval: POLLING;
|
|
1265
1283
|
}>;
|
|
1266
1284
|
|
|
@@ -1504,26 +1522,6 @@ declare function useDefaultRewardAllocation(options?: DefaultHookOptions): {
|
|
|
1504
1522
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
1505
1523
|
};
|
|
1506
1524
|
|
|
1507
|
-
/**
|
|
1508
|
-
* Return the validators managed by the account
|
|
1509
|
-
* Roles:
|
|
1510
|
-
* - Validator Operator
|
|
1511
|
-
* - Validator Reward Allocator
|
|
1512
|
-
* @param address
|
|
1513
|
-
* @param options
|
|
1514
|
-
* @returns
|
|
1515
|
-
*/
|
|
1516
|
-
declare const useManagedValidatorByAccount: ({ account }: {
|
|
1517
|
-
account: Address | undefined;
|
|
1518
|
-
}, options?: DefaultHookOptions) => {
|
|
1519
|
-
refresh: () => Promise<_berachain_graphql_pol_subgraph.GetValidatorByAccountQuery | undefined>;
|
|
1520
|
-
data: _berachain_graphql_pol_subgraph.GetValidatorByAccountQuery | undefined;
|
|
1521
|
-
error: any;
|
|
1522
|
-
mutate: swr.KeyedMutator<_berachain_graphql_pol_subgraph.GetValidatorByAccountQuery | undefined>;
|
|
1523
|
-
isValidating: boolean;
|
|
1524
|
-
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
1525
|
type ManagedValidatorRole = {
|
|
1528
1526
|
operator: Address | null;
|
|
1529
1527
|
rewardAllocator: Address | null;
|
|
@@ -1544,25 +1542,6 @@ declare const useStakingPoolBatch: ({ valPubKey, options, }: {
|
|
|
1544
1542
|
options?: DefaultHookOptions;
|
|
1545
1543
|
}) => DefaultHookReturnType<number | undefined>;
|
|
1546
1544
|
|
|
1547
|
-
declare const useSubgraphUserValidators: ({ account: _account, }?: {
|
|
1548
|
-
account?: Address;
|
|
1549
|
-
}) => swr.SWRResponse<{
|
|
1550
|
-
__typename?: "UserBoost";
|
|
1551
|
-
id: `0x${string}`;
|
|
1552
|
-
queuedBoostAmount: string;
|
|
1553
|
-
activeBoostAmount: string;
|
|
1554
|
-
queuedDropBoostAmount: string;
|
|
1555
|
-
queuedDropBoostStartBlock?: string | null;
|
|
1556
|
-
queuedBoostStartBlock?: string | null;
|
|
1557
|
-
user: `0x${string}`;
|
|
1558
|
-
validator: {
|
|
1559
|
-
__typename?: "Validator";
|
|
1560
|
-
id: `0x${string}`;
|
|
1561
|
-
publicKey: `0x${string}`;
|
|
1562
|
-
activeBoostAmount: string;
|
|
1563
|
-
};
|
|
1564
|
-
}[], any, any>;
|
|
1565
|
-
|
|
1566
1545
|
interface UseUserActiveValidatorsResponse extends DefaultHookReturnType<ValidatorWithUserBoost[] | undefined> {
|
|
1567
1546
|
}
|
|
1568
1547
|
declare const useUserActiveValidators: (options?: DefaultHookOptions) => UseUserActiveValidatorsResponse;
|
|
@@ -1766,4 +1745,4 @@ declare function useValidatorRewardAllocation(pubKey: Address, options?: Default
|
|
|
1766
1745
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
1767
1746
|
};
|
|
1768
1747
|
|
|
1769
|
-
export { IHoneySwapState, IUseContractWriteArgs, type LiquidityMismatchInfo, type ManagedValidatorRole, type OnChainPoolFragment, type Oracle, OracleMode, type RewardVault, type TokenPriceInput, type TokenPriceMap, type TokenPriceOutput, USE_AGGREGATORS_QUOTES_QUERY_KEY, type UseCappedGloballyResponse, type UseCappedRelativelyResponse, type UseCollateralWeightsResponse, UseContractWriteApi, type UseIsBadCollateralResponse, type UseMultipleTokenInformationResponse, type UsePollAllowancesArgs, type UsePollAllowancesResponse, type UsePollBalancesResponse, type UsePollMarketsResponse, type UsePollProposalResponse, type UsePollValidatorInfoResponse, type UsePollWalletBalancesArgs, type UseRewardVaultResponse, type UseStakingTokenInformationResponse, type UseTokenInformationArgs, type UseTokenInformationResponse, useAggregatorsQuotes, useAggregatorsRouterFeeBps, useAllUserPools, useAllUserPoolsQueryKey, useAllValidators, useAllValidatorsQueryKey, useApiEnrichedAllocation, useApiPool, useApiPoolQueryKey, useApiValidator, useApiValidatorQueryKey, useBaselineRewardAllocation, useBendZapSupply, useBendZapSupplyHelper, useBeraContractWrite, useBeraCurrentPrice, useBgtAprSimulation, useBgtUnstakedBalance, useBlockToTimestamp, useCappedGlobally, useCappedRelatively, useClaimableFees, useCollateralWeights, useCreatePool, useCreateProposal, useDailyValidatorBlockStats, useDefaultRewardAllocation, useEnsoSwapBundle, useExploitedTokens, useExploitedTokensQueryKey, useGetConvertToAssets, useGetPastVotes, useGetVerifiedAbi, useGlobalLiquidityAndSwapVolume, useHasVoted, useHighestVaultsAPR, useHistoryState, useHoneyAlerts, useHoneyBalances, useHoneyChartData, useHoneyGlobalData, useHoneyVaultsBalance, useIsBadCollateralAsset, useIsBasketModeEnabled, useIsCanceller, useLiquidityMismatch, useLpPosition,
|
|
1748
|
+
export { IHoneySwapState, IUseContractWriteArgs, type LiquidityMismatchInfo, type ManagedValidatorRole, type OnChainPoolFragment, type Oracle, OracleMode, type RewardVault, type StakingVaultEntry, type TokenPriceInput, type TokenPriceMap, type TokenPriceOutput, USE_AGGREGATORS_QUOTES_QUERY_KEY, type UseBendDemultiply, type UseBendMultiply, type UseCappedGloballyResponse, type UseCappedRelativelyResponse, type UseCollateralWeightsResponse, UseContractWriteApi, type UseIsBadCollateralResponse, type UseMultipleTokenInformationResponse, type UsePollAllowancesArgs, type UsePollAllowancesResponse, type UsePollBalancesResponse, type UsePollMarketsResponse, type UsePollProposalResponse, type UsePollValidatorInfoResponse, type UsePollWalletBalancesArgs, type UseRewardVaultResponse, type UseStakingTokenInformationResponse, type UseTokenInformationArgs, type UseTokenInformationResponse, useAggregatorsQuotes, useAggregatorsRouterFeeBps, useAllUserPools, useAllUserPoolsQueryKey, useAllValidators, useAllValidatorsQueryKey, useApiEnrichedAllocation, useApiPool, useApiPoolQueryKey, useApiValidator, useApiValidatorQueryKey, useBaselineRewardAllocation, useBendDemultiply, useBendMultiply, useBendZapSupply, useBendZapSupplyHelper, useBeraContractWrite, useBeraCurrentPrice, useBgtAprSimulation, useBgtUnstakedBalance, useBlockToTimestamp, useCappedGlobally, useCappedRelatively, useClaimableFees, useCollateralWeights, useCreatePool, useCreateProposal, useDailyValidatorBlockStats, useDefaultRewardAllocation, useEnsoSwapBundle, useEnsoUserTokensWithBalances, useExploitedTokens, useExploitedTokensQueryKey, useGetConvertToAssets, useGetPastVotes, useGetVerifiedAbi, useGlobalLiquidityAndSwapVolume, useHasVoted, useHighestVaultsAPR, useHistoryState, useHoneyAlerts, useHoneyBalances, useHoneyChartData, useHoneyGlobalData, useHoneyVaultsBalance, useIsBadCollateralAsset, useIsBasketModeEnabled, useIsCanceller, useLiquidityMismatch, useLpPosition, useManagedValidatorRole, useMultipleTokenApprovalsWithSlippage, useMultipleTokenInformation, type useMultipleTokenInformationArgs, useOnChainPoolData, useOnChainPoolDataQueryKey, useOnChainValidator, usePollAllProposals, usePollAllProposalsQueryKey, usePollAllowances, usePollBalance, usePollGlobalData, usePollMarkets, usePollMarketsQueryKey, usePollPoolCreationRelayerApproval, usePollProposal, usePollProposalThreshold, usePollProposalVotes, usePollProposalVotesQueryKey, usePollUserDelegates, usePollWalletBalances, usePool, usePoolEvents, usePoolHistoricalData, usePools, usePoolsQueryKey, usePrevious, usePriceImpact, useProposalFromTx, useProposalSnapshot, useProposalState, useProposalTimelockState, usePythLatestPrices, usePythUpdateFee, useQueuedBeraUnlock, useQuorum, useRewardTokenToBeraRate, useRewardVault, useRewardVaultBalanceFromStakingToken, useRewardVaultFromToken, useRewardVaultIncentives, useRewardVaultQueryKey, useRewardVaultRewards, useRewardVaults, useRewardVaultsQueryKey, useSingleAggregatorQuote, useStakedAPR, useStakedData, useStakedSnapshots, useStakingPoolBatch, useStakingTokenInformation, type useStakingTokenInformationArgs, useStakingVaultsMetadata, useTokenCurrentPrice, useTokenCurrentPrices, useTokenInformation, useTokenPrice, useTokenPrices, useTokens, useTotalStakedAmount, useTotalSupply, useUserActiveValidators, useUserBoostsOnValidator, useUserClaimableIncentives, useUserStakingPositions, useUserVaultInfo, useUserVaults, useValidator, useValidatorAnalytics, useValidatorCommission, useValidatorEstimatedBgtPerYear, useValidatorQueuedCommission, useValidatorQueuedOperatorAddress, useValidatorQueuedRewardAllocation, useValidatorRewardAllocation, useVaultAddress, useVaultHistory, useVaultValidators, useZapStakeBera };
|
package/dist/hooks/exports.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as swr__internal from 'swr/_internal';
|
|
2
2
|
import * as swr from 'swr';
|
|
3
3
|
import { SWRResponse } from 'swr';
|
|
4
|
-
import { b as GetConvertToAssetsProps, O as OnChainPool, B as BaseAggregator, d as GetHoneyVaultsBalanceResponse, j as IsBadCollateralResponse, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, i as GlobalData, e as GetMarkets, S as StakedBeraWithdrawal, k as RewardVaultIncentive, f as GetRewardVaultRewardsReturn, c as GetGaugeData, t as VaultMetadata, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, V as ValidatorRewardAllocation, s as ValidatorWithUserBoost, U as UserBoostsOnValidator, l as UserStakingPoolPosition, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress } from '../getValidatorQueuedOperatorAddress-
|
|
5
|
-
import { D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, a as CustomProposalErrors, C as CustomProposal, S as StakingConfig, d as StakedBeraAsset, U as UserVaultInfo, e as IUseContractWriteArgs, f as UseContractWriteApi, B as BribeBoostRewardProof } from '../global.d-
|
|
6
|
-
export { T as TxnEventKeys } from '../global.d-
|
|
4
|
+
import { b as GetConvertToAssetsProps, O as OnChainPool, B as BaseAggregator, d as GetHoneyVaultsBalanceResponse, j as IsBadCollateralResponse, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, i as GlobalData, e as GetMarkets, S as StakedBeraWithdrawal, k as RewardVaultIncentive, f as GetRewardVaultRewardsReturn, c as GetGaugeData, t as VaultMetadata, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, V as ValidatorRewardAllocation, s as ValidatorWithUserBoost, U as UserBoostsOnValidator, l as UserStakingPoolPosition, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress } from '../getValidatorQueuedOperatorAddress-CmiPJmsr.js';
|
|
5
|
+
import { D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, a as CustomProposalErrors, C as CustomProposal, S as StakingConfig, d as StakedBeraAsset, U as UserVaultInfo, e as IUseContractWriteArgs, f as UseContractWriteApi, B as BribeBoostRewardProof } from '../global.d-3GQMgC9k.js';
|
|
6
|
+
export { T as TxnEventKeys } from '../global.d-3GQMgC9k.js';
|
|
7
7
|
import { S as SwapReferrer, A as Aggregators, a as PoolCreationStep } from '../dex-C_BB0b0O.js';
|
|
8
8
|
import * as viem from 'viem';
|
|
9
9
|
import { Address, Hex } from 'viem';
|
|
@@ -14,7 +14,7 @@ export { u as useBexStatus } from '../BexStatusProvider-DRymVlQf.js';
|
|
|
14
14
|
import { PoolType } from '@berachain-foundation/berancer-sdk';
|
|
15
15
|
import { SubgraphPoolFragment } from '@berachain/graphql/dex/subgraph';
|
|
16
16
|
import { P as POLLING } from '../polling-BKnyavLI.js';
|
|
17
|
-
import { GetZapTransactionResponse } from '../types/exports.js';
|
|
17
|
+
import { BendDemultiplyBundleResponse, BendMultiplyBundleResponse, GetZapTransactionResponse } from '../types/exports.js';
|
|
18
18
|
import * as react from 'react';
|
|
19
19
|
import * as swr_infinite from 'swr/infinite';
|
|
20
20
|
import { SWRInfiniteResponse, SWRInfiniteKeyLoader } from 'swr/infinite';
|
|
@@ -27,10 +27,9 @@ import BigNumber from '@berachain/utils/pkg/bignumber.js';
|
|
|
27
27
|
import * as _berachain_graphql_pol_api from '@berachain/graphql/pol/api';
|
|
28
28
|
import { GqlRewardVaultFilter, ApiVaultFragment, GetVaultsQueryVariables, GetVaultHistoryQuery, ApiValidatorFragment, GetValidatorsQueryVariables, GetValidatorsQuery, GqlChain, GetValidatorQuery, ApiValidatorMinimalFragment } from '@berachain/graphql/pol/api';
|
|
29
29
|
import { Address as Address$1 } from '@berachain/config';
|
|
30
|
-
import * as _berachain_graphql_pol_subgraph from '@berachain/graphql/pol/subgraph';
|
|
31
30
|
import { GetValidatorBlockStatsQuery, GetValidatorAnalyticsQuery } from '@berachain/graphql/pol/subgraph';
|
|
32
31
|
import '@berachain/config/internal';
|
|
33
|
-
import '../txnEnum-
|
|
32
|
+
import '../txnEnum-CCuQUFlh.js';
|
|
34
33
|
import '@wagmi/core';
|
|
35
34
|
import '../BeraError-_mQdkanr.js';
|
|
36
35
|
import 'react/jsx-runtime';
|
|
@@ -377,35 +376,10 @@ declare const usePollPoolCreationRelayerApproval: (options?: DefaultHookOptions)
|
|
|
377
376
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
378
377
|
};
|
|
379
378
|
|
|
380
|
-
declare function
|
|
381
|
-
poolId: string;
|
|
382
|
-
}): string[] | null;
|
|
383
|
-
declare const usePool: ({ poolId }: {
|
|
379
|
+
declare function usePool({ poolId }: {
|
|
384
380
|
poolId: Hex;
|
|
385
|
-
})
|
|
386
|
-
data: readonly [
|
|
387
|
-
__typename?: "Pool";
|
|
388
|
-
id: string;
|
|
389
|
-
name?: string | null;
|
|
390
|
-
address: `0x${string}`;
|
|
391
|
-
factory?: `0x${string}` | null;
|
|
392
|
-
swapFee: string;
|
|
393
|
-
totalShares: string;
|
|
394
|
-
totalLiquidity: string;
|
|
395
|
-
createTime: number;
|
|
396
|
-
owner?: `0x${string}` | null;
|
|
397
|
-
type?: string | null;
|
|
398
|
-
tokens?: Array<{
|
|
399
|
-
__typename?: "PoolToken";
|
|
400
|
-
address: `0x${string}`;
|
|
401
|
-
name: string;
|
|
402
|
-
decimals: number;
|
|
403
|
-
symbol: string;
|
|
404
|
-
index?: number | null;
|
|
405
|
-
weight?: string | null;
|
|
406
|
-
balance: string;
|
|
407
|
-
}> | null;
|
|
408
|
-
} | undefined, _berachain_graphql_dex_api.MinimalPoolFragment | undefined, OnChainPoolFragment | undefined];
|
|
381
|
+
}): {
|
|
382
|
+
data: readonly [undefined, _berachain_graphql_dex_api.MinimalPoolFragment | undefined, OnChainPoolFragment | undefined];
|
|
409
383
|
isLoading: boolean;
|
|
410
384
|
isError: any;
|
|
411
385
|
refresh: () => void;
|
|
@@ -591,6 +565,35 @@ declare function useSingleAggregatorQuote(args: IUseAggregatorsQuotesArgs & {
|
|
|
591
565
|
isEnabled?: boolean;
|
|
592
566
|
}) | undefined> | null;
|
|
593
567
|
|
|
568
|
+
type UseBendDemultiply = {
|
|
569
|
+
collateralToken?: Token;
|
|
570
|
+
loanToken?: Token;
|
|
571
|
+
marketId?: Hex;
|
|
572
|
+
primaryAddress?: Address;
|
|
573
|
+
repayAmount?: string;
|
|
574
|
+
slippage?: number;
|
|
575
|
+
chainId?: number;
|
|
576
|
+
collateralPriceInLoanAsset?: string;
|
|
577
|
+
currentCollateral?: string;
|
|
578
|
+
currentDebt?: string;
|
|
579
|
+
};
|
|
580
|
+
declare function useBendDemultiply({ collateralToken, loanToken, marketId, primaryAddress, repayAmount, slippage, chainId, collateralPriceInLoanAsset, currentCollateral, currentDebt, }: UseBendDemultiply, options?: DefaultHookOptions): swr.SWRResponse<BendDemultiplyBundleResponse, unknown, swr.SWRConfiguration<BendDemultiplyBundleResponse, unknown, (arg: readonly ["useBendDemultiply", `0x${string}`, Token, Token, `0x${string}`, `0x${string}`, number, string, number, string, string, string, `0x${string}`, boolean]) => swr__internal.FetcherResponse<BendDemultiplyBundleResponse>> | undefined>;
|
|
581
|
+
|
|
582
|
+
type UseBendMultiply = {
|
|
583
|
+
collateralToken?: Token;
|
|
584
|
+
loanToken?: Token;
|
|
585
|
+
marketId?: Hex;
|
|
586
|
+
primaryAddress?: Address;
|
|
587
|
+
formattedSupplyCollateralAmount?: string;
|
|
588
|
+
formattedCurrentCollateralAmount?: string;
|
|
589
|
+
formattedCurrentBorrowAmount?: string;
|
|
590
|
+
leverageMultiplier?: number;
|
|
591
|
+
slippage?: number;
|
|
592
|
+
chainId?: number;
|
|
593
|
+
formattedCollateralPriceInLoanAsset?: string;
|
|
594
|
+
};
|
|
595
|
+
declare function useBendMultiply({ collateralToken, loanToken, marketId, primaryAddress, formattedSupplyCollateralAmount, formattedCurrentCollateralAmount, formattedCurrentBorrowAmount, leverageMultiplier, slippage, chainId, formattedCollateralPriceInLoanAsset, }: UseBendMultiply, options?: DefaultHookOptions): swr.SWRResponse<BendMultiplyBundleResponse, unknown, swr.SWRConfiguration<BendMultiplyBundleResponse, unknown, (arg: readonly ["useBendMultiply", `0x${string}`, Token, Token, `0x${string}`, `0x${string}`, number, string, string, string, number, number, string, `0x${string}`, boolean]) => swr__internal.FetcherResponse<BendMultiplyBundleResponse>> | undefined>;
|
|
596
|
+
|
|
594
597
|
type UseBendZapSupplyArgs = {
|
|
595
598
|
tokenIn?: BalanceToken;
|
|
596
599
|
loanToken: MinimalERC20;
|
|
@@ -686,6 +689,17 @@ declare function useEnsoSwapBundle({ tokenIn, tokenOut, amount, slippage, }: {
|
|
|
686
689
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
687
690
|
};
|
|
688
691
|
|
|
692
|
+
declare function useEnsoUserTokensWithBalances({ chainId }?: {
|
|
693
|
+
chainId?: number;
|
|
694
|
+
}, options?: DefaultHookOptions): {
|
|
695
|
+
refresh: () => Promise<BalanceToken[] | undefined>;
|
|
696
|
+
data: BalanceToken[] | undefined;
|
|
697
|
+
error: any;
|
|
698
|
+
mutate: swr.KeyedMutator<BalanceToken[]>;
|
|
699
|
+
isValidating: boolean;
|
|
700
|
+
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
701
|
+
};
|
|
702
|
+
|
|
689
703
|
type UseZapStakeBeraArgs = {
|
|
690
704
|
inputToken: MinimalERC20 | undefined;
|
|
691
705
|
amount: string;
|
|
@@ -1260,7 +1274,11 @@ declare function useStakedSnapshots({ range, addresses, }: {
|
|
|
1260
1274
|
range: 30 | 60 | 90;
|
|
1261
1275
|
}): DefaultHookReturnType<UseStakedBeraSnapshot>;
|
|
1262
1276
|
|
|
1263
|
-
|
|
1277
|
+
type StakingVaultEntry = {
|
|
1278
|
+
address: Address;
|
|
1279
|
+
underlyingAsset: Address;
|
|
1280
|
+
};
|
|
1281
|
+
declare const useStakingVaultsMetadata: (vaults?: StakingVaultEntry[]) => swr.SWRResponse<VaultMetadata[], any, {
|
|
1264
1282
|
refreshInterval: POLLING;
|
|
1265
1283
|
}>;
|
|
1266
1284
|
|
|
@@ -1504,26 +1522,6 @@ declare function useDefaultRewardAllocation(options?: DefaultHookOptions): {
|
|
|
1504
1522
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
1505
1523
|
};
|
|
1506
1524
|
|
|
1507
|
-
/**
|
|
1508
|
-
* Return the validators managed by the account
|
|
1509
|
-
* Roles:
|
|
1510
|
-
* - Validator Operator
|
|
1511
|
-
* - Validator Reward Allocator
|
|
1512
|
-
* @param address
|
|
1513
|
-
* @param options
|
|
1514
|
-
* @returns
|
|
1515
|
-
*/
|
|
1516
|
-
declare const useManagedValidatorByAccount: ({ account }: {
|
|
1517
|
-
account: Address | undefined;
|
|
1518
|
-
}, options?: DefaultHookOptions) => {
|
|
1519
|
-
refresh: () => Promise<_berachain_graphql_pol_subgraph.GetValidatorByAccountQuery | undefined>;
|
|
1520
|
-
data: _berachain_graphql_pol_subgraph.GetValidatorByAccountQuery | undefined;
|
|
1521
|
-
error: any;
|
|
1522
|
-
mutate: swr.KeyedMutator<_berachain_graphql_pol_subgraph.GetValidatorByAccountQuery | undefined>;
|
|
1523
|
-
isValidating: boolean;
|
|
1524
|
-
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
1525
|
type ManagedValidatorRole = {
|
|
1528
1526
|
operator: Address | null;
|
|
1529
1527
|
rewardAllocator: Address | null;
|
|
@@ -1544,25 +1542,6 @@ declare const useStakingPoolBatch: ({ valPubKey, options, }: {
|
|
|
1544
1542
|
options?: DefaultHookOptions;
|
|
1545
1543
|
}) => DefaultHookReturnType<number | undefined>;
|
|
1546
1544
|
|
|
1547
|
-
declare const useSubgraphUserValidators: ({ account: _account, }?: {
|
|
1548
|
-
account?: Address;
|
|
1549
|
-
}) => swr.SWRResponse<{
|
|
1550
|
-
__typename?: "UserBoost";
|
|
1551
|
-
id: `0x${string}`;
|
|
1552
|
-
queuedBoostAmount: string;
|
|
1553
|
-
activeBoostAmount: string;
|
|
1554
|
-
queuedDropBoostAmount: string;
|
|
1555
|
-
queuedDropBoostStartBlock?: string | null;
|
|
1556
|
-
queuedBoostStartBlock?: string | null;
|
|
1557
|
-
user: `0x${string}`;
|
|
1558
|
-
validator: {
|
|
1559
|
-
__typename?: "Validator";
|
|
1560
|
-
id: `0x${string}`;
|
|
1561
|
-
publicKey: `0x${string}`;
|
|
1562
|
-
activeBoostAmount: string;
|
|
1563
|
-
};
|
|
1564
|
-
}[], any, any>;
|
|
1565
|
-
|
|
1566
1545
|
interface UseUserActiveValidatorsResponse extends DefaultHookReturnType<ValidatorWithUserBoost[] | undefined> {
|
|
1567
1546
|
}
|
|
1568
1547
|
declare const useUserActiveValidators: (options?: DefaultHookOptions) => UseUserActiveValidatorsResponse;
|
|
@@ -1766,4 +1745,4 @@ declare function useValidatorRewardAllocation(pubKey: Address, options?: Default
|
|
|
1766
1745
|
isLoading: swr__internal.IsLoadingResponse<Data, Config>;
|
|
1767
1746
|
};
|
|
1768
1747
|
|
|
1769
|
-
export { IHoneySwapState, IUseContractWriteArgs, type LiquidityMismatchInfo, type ManagedValidatorRole, type OnChainPoolFragment, type Oracle, OracleMode, type RewardVault, type TokenPriceInput, type TokenPriceMap, type TokenPriceOutput, USE_AGGREGATORS_QUOTES_QUERY_KEY, type UseCappedGloballyResponse, type UseCappedRelativelyResponse, type UseCollateralWeightsResponse, UseContractWriteApi, type UseIsBadCollateralResponse, type UseMultipleTokenInformationResponse, type UsePollAllowancesArgs, type UsePollAllowancesResponse, type UsePollBalancesResponse, type UsePollMarketsResponse, type UsePollProposalResponse, type UsePollValidatorInfoResponse, type UsePollWalletBalancesArgs, type UseRewardVaultResponse, type UseStakingTokenInformationResponse, type UseTokenInformationArgs, type UseTokenInformationResponse, useAggregatorsQuotes, useAggregatorsRouterFeeBps, useAllUserPools, useAllUserPoolsQueryKey, useAllValidators, useAllValidatorsQueryKey, useApiEnrichedAllocation, useApiPool, useApiPoolQueryKey, useApiValidator, useApiValidatorQueryKey, useBaselineRewardAllocation, useBendZapSupply, useBendZapSupplyHelper, useBeraContractWrite, useBeraCurrentPrice, useBgtAprSimulation, useBgtUnstakedBalance, useBlockToTimestamp, useCappedGlobally, useCappedRelatively, useClaimableFees, useCollateralWeights, useCreatePool, useCreateProposal, useDailyValidatorBlockStats, useDefaultRewardAllocation, useEnsoSwapBundle, useExploitedTokens, useExploitedTokensQueryKey, useGetConvertToAssets, useGetPastVotes, useGetVerifiedAbi, useGlobalLiquidityAndSwapVolume, useHasVoted, useHighestVaultsAPR, useHistoryState, useHoneyAlerts, useHoneyBalances, useHoneyChartData, useHoneyGlobalData, useHoneyVaultsBalance, useIsBadCollateralAsset, useIsBasketModeEnabled, useIsCanceller, useLiquidityMismatch, useLpPosition,
|
|
1748
|
+
export { IHoneySwapState, IUseContractWriteArgs, type LiquidityMismatchInfo, type ManagedValidatorRole, type OnChainPoolFragment, type Oracle, OracleMode, type RewardVault, type StakingVaultEntry, type TokenPriceInput, type TokenPriceMap, type TokenPriceOutput, USE_AGGREGATORS_QUOTES_QUERY_KEY, type UseBendDemultiply, type UseBendMultiply, type UseCappedGloballyResponse, type UseCappedRelativelyResponse, type UseCollateralWeightsResponse, UseContractWriteApi, type UseIsBadCollateralResponse, type UseMultipleTokenInformationResponse, type UsePollAllowancesArgs, type UsePollAllowancesResponse, type UsePollBalancesResponse, type UsePollMarketsResponse, type UsePollProposalResponse, type UsePollValidatorInfoResponse, type UsePollWalletBalancesArgs, type UseRewardVaultResponse, type UseStakingTokenInformationResponse, type UseTokenInformationArgs, type UseTokenInformationResponse, useAggregatorsQuotes, useAggregatorsRouterFeeBps, useAllUserPools, useAllUserPoolsQueryKey, useAllValidators, useAllValidatorsQueryKey, useApiEnrichedAllocation, useApiPool, useApiPoolQueryKey, useApiValidator, useApiValidatorQueryKey, useBaselineRewardAllocation, useBendDemultiply, useBendMultiply, useBendZapSupply, useBendZapSupplyHelper, useBeraContractWrite, useBeraCurrentPrice, useBgtAprSimulation, useBgtUnstakedBalance, useBlockToTimestamp, useCappedGlobally, useCappedRelatively, useClaimableFees, useCollateralWeights, useCreatePool, useCreateProposal, useDailyValidatorBlockStats, useDefaultRewardAllocation, useEnsoSwapBundle, useEnsoUserTokensWithBalances, useExploitedTokens, useExploitedTokensQueryKey, useGetConvertToAssets, useGetPastVotes, useGetVerifiedAbi, useGlobalLiquidityAndSwapVolume, useHasVoted, useHighestVaultsAPR, useHistoryState, useHoneyAlerts, useHoneyBalances, useHoneyChartData, useHoneyGlobalData, useHoneyVaultsBalance, useIsBadCollateralAsset, useIsBasketModeEnabled, useIsCanceller, useLiquidityMismatch, useLpPosition, useManagedValidatorRole, useMultipleTokenApprovalsWithSlippage, useMultipleTokenInformation, type useMultipleTokenInformationArgs, useOnChainPoolData, useOnChainPoolDataQueryKey, useOnChainValidator, usePollAllProposals, usePollAllProposalsQueryKey, usePollAllowances, usePollBalance, usePollGlobalData, usePollMarkets, usePollMarketsQueryKey, usePollPoolCreationRelayerApproval, usePollProposal, usePollProposalThreshold, usePollProposalVotes, usePollProposalVotesQueryKey, usePollUserDelegates, usePollWalletBalances, usePool, usePoolEvents, usePoolHistoricalData, usePools, usePoolsQueryKey, usePrevious, usePriceImpact, useProposalFromTx, useProposalSnapshot, useProposalState, useProposalTimelockState, usePythLatestPrices, usePythUpdateFee, useQueuedBeraUnlock, useQuorum, useRewardTokenToBeraRate, useRewardVault, useRewardVaultBalanceFromStakingToken, useRewardVaultFromToken, useRewardVaultIncentives, useRewardVaultQueryKey, useRewardVaultRewards, useRewardVaults, useRewardVaultsQueryKey, useSingleAggregatorQuote, useStakedAPR, useStakedData, useStakedSnapshots, useStakingPoolBatch, useStakingTokenInformation, type useStakingTokenInformationArgs, useStakingVaultsMetadata, useTokenCurrentPrice, useTokenCurrentPrices, useTokenInformation, useTokenPrice, useTokenPrices, useTokens, useTotalStakedAmount, useTotalSupply, useUserActiveValidators, useUserBoostsOnValidator, useUserClaimableIncentives, useUserStakingPositions, useUserVaultInfo, useUserVaults, useValidator, useValidatorAnalytics, useValidatorCommission, useValidatorEstimatedBgtPerYear, useValidatorQueuedCommission, useValidatorQueuedOperatorAddress, useValidatorQueuedRewardAllocation, useValidatorRewardAllocation, useVaultAddress, useVaultHistory, useVaultValidators, useZapStakeBera };
|