@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
|
@@ -3,7 +3,7 @@ import { type Address, erc20Abi } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { assertPublicClient } from "
|
|
6
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
7
7
|
|
|
8
8
|
export function useTotalSupply({ address }: { address: Address | undefined }) {
|
|
9
9
|
const publicClient = usePublicClient();
|
|
@@ -2,9 +2,9 @@ import useSWRImmutable from "swr/immutable";
|
|
|
2
2
|
|
|
3
3
|
import { useConfig } from "@berachain/wagmi/hooks";
|
|
4
4
|
|
|
5
|
-
import { getUnderlyingToken } from "
|
|
6
|
-
import type { MinimalERC20 } from "
|
|
7
|
-
import { isToken } from "
|
|
5
|
+
import { getUnderlyingToken } from "../../actions/tokens/getUnderlyingToken";
|
|
6
|
+
import type { MinimalERC20 } from "../../types/dex";
|
|
7
|
+
import { isToken } from "../../utils/tokens";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* SWR hook that resolves the underlying asset of an ERC4626 vault token.
|
|
@@ -2,11 +2,11 @@ import useSWRImmutable from "swr/immutable";
|
|
|
2
2
|
|
|
3
3
|
import { useBlockNumber, usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
4
|
|
|
5
|
-
import { getBlockTimestamp } from "
|
|
6
|
-
import { useBlockTime } from "
|
|
7
|
-
import { assertPublicClient } from "
|
|
8
|
-
import { parseBaseArgs } from "
|
|
9
|
-
import { msToSeconds, seconds } from "
|
|
5
|
+
import { getBlockTimestamp } from "../actions/misc/getBlockTimestamp";
|
|
6
|
+
import { useBlockTime } from "../contexts/block-time-provider";
|
|
7
|
+
import { assertPublicClient } from "../errors/assert";
|
|
8
|
+
import { parseBaseArgs } from "../utils/parseBaseArgs";
|
|
9
|
+
import { msToSeconds, seconds } from "../utils/time";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
@@ -7,8 +7,8 @@ import type {
|
|
|
7
7
|
WalletCallReceipt,
|
|
8
8
|
} from "viem";
|
|
9
9
|
|
|
10
|
-
import type { BeraError } from "
|
|
11
|
-
import type { IContractWrite, IContractWriteFn } from "
|
|
10
|
+
import type { BeraError } from "../../errors/BeraError";
|
|
11
|
+
import type { IContractWrite, IContractWriteFn } from "../../types/global";
|
|
12
12
|
|
|
13
13
|
export interface UseContractWriteApi {
|
|
14
14
|
isLoading: boolean;
|
|
@@ -3,13 +3,12 @@ import type { Abi, ContractFunctionArgs, ContractFunctionName } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import { useBeraWagmi, useConfig } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { beraWriteContract } from "
|
|
7
|
-
import { useBeraFlag } from "
|
|
8
|
-
import { TransactionFailedError } from "
|
|
9
|
-
import type {
|
|
10
|
-
import type { IContractWrite } from "~/types/global";
|
|
6
|
+
import { beraWriteContract } from "../../actions/transactions/beraWriteContract";
|
|
7
|
+
import { useBeraFlag } from "../../contexts/BeraFlags/BeraFlags";
|
|
8
|
+
import { TransactionFailedError } from "../../errors/TransactionFailedError";
|
|
9
|
+
import type { IContractWrite } from "../../types/global";
|
|
11
10
|
import { ActionEnum, initialState, reducer } from "./stateReducer";
|
|
12
|
-
import type { UseContractWriteApi } from "./types";
|
|
11
|
+
import type { IUseContractWriteArgs, UseContractWriteApi } from "./types";
|
|
13
12
|
|
|
14
13
|
function useBeraContractWrite({
|
|
15
14
|
onlyPermissionless,
|
|
@@ -6,10 +6,13 @@ import type {
|
|
|
6
6
|
GqlChain,
|
|
7
7
|
} from "@berachain/graphql/pol/api";
|
|
8
8
|
|
|
9
|
-
import { getAllValidators } from "
|
|
10
|
-
import { POLLING } from "
|
|
11
|
-
import type {
|
|
12
|
-
|
|
9
|
+
import { getAllValidators } from "../../actions/validators/getAllValidators";
|
|
10
|
+
import { POLLING } from "../../enum/polling";
|
|
11
|
+
import type {
|
|
12
|
+
DefaultHookOptions,
|
|
13
|
+
DefaultHookReturnType,
|
|
14
|
+
} from "../../types/global";
|
|
15
|
+
import { parseBaseArgs } from "../../utils/parseBaseArgs";
|
|
13
16
|
|
|
14
17
|
export const useAllValidatorsQueryKey = ({
|
|
15
18
|
variables,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import useSWR from "swr";
|
|
2
2
|
|
|
3
|
-
import { getApiEnrichedAllocation } from "
|
|
4
|
-
import type { ValidatorRewardAllocation } from "
|
|
3
|
+
import { getApiEnrichedAllocation } from "../../actions/validators/getApiEnrichedAllocation";
|
|
4
|
+
import type { ValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
|
|
5
5
|
|
|
6
6
|
export function useApiEnrichedAllocation({
|
|
7
7
|
allocation,
|
|
@@ -3,8 +3,11 @@ import { type Address, isHex } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import type { GetValidatorQuery } from "@berachain/graphql/pol/api";
|
|
5
5
|
|
|
6
|
-
import { getApiValidator } from "
|
|
7
|
-
import type {
|
|
6
|
+
import { getApiValidator } from "../../actions/validators/getApiValidator";
|
|
7
|
+
import type {
|
|
8
|
+
DefaultHookOptions,
|
|
9
|
+
DefaultHookReturnType,
|
|
10
|
+
} from "../../types/global";
|
|
8
11
|
|
|
9
12
|
export interface UsePollValidatorInfoResponse
|
|
10
13
|
extends DefaultHookReturnType<GetValidatorQuery> {}
|
|
@@ -2,8 +2,8 @@ import useSWR from "swr";
|
|
|
2
2
|
|
|
3
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
4
|
|
|
5
|
-
import { getBaselineRewardAllocation } from "
|
|
6
|
-
import { assertPublicClient } from "
|
|
5
|
+
import { getBaselineRewardAllocation } from "../../actions/validators/getBaselineRewardAllocation";
|
|
6
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
7
7
|
|
|
8
8
|
export function useBaselineRewardAllocation() {
|
|
9
9
|
const publicClient = usePublicClient();
|
|
@@ -3,9 +3,9 @@ import type { Address } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import type { GetValidatorBlockStatsQuery } from "@berachain/graphql/pol/subgraph";
|
|
5
5
|
|
|
6
|
-
import { getDailyValidatorBlockStats } from "
|
|
7
|
-
import { POLLING } from "
|
|
8
|
-
import type { DefaultHookReturnType } from "
|
|
6
|
+
import { getDailyValidatorBlockStats } from "../../actions/validators/getDailyValidatorBlockStats";
|
|
7
|
+
import { POLLING } from "../../enum/polling";
|
|
8
|
+
import type { DefaultHookReturnType } from "../../types/global";
|
|
9
9
|
|
|
10
10
|
export const useDailyValidatorBlockStats = ({
|
|
11
11
|
pubKey,
|
|
@@ -2,10 +2,10 @@ import useSWR from "swr";
|
|
|
2
2
|
|
|
3
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
4
|
|
|
5
|
-
import { getDefaultRewardAllocation } from "
|
|
6
|
-
import type { ValidatorRewardAllocation } from "
|
|
7
|
-
import { assertPublicClient } from "
|
|
8
|
-
import type { DefaultHookOptions } from "
|
|
5
|
+
import { getDefaultRewardAllocation } from "../../actions/validators/getDefaultRewardAllocation";
|
|
6
|
+
import type { ValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
|
|
7
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
8
|
+
import type { DefaultHookOptions } from "../../types/global";
|
|
9
9
|
|
|
10
10
|
export function useDefaultRewardAllocation(options?: DefaultHookOptions) {
|
|
11
11
|
const publicClient = usePublicClient();
|
|
@@ -4,11 +4,14 @@ import type { Address, PublicClient } from "viem";
|
|
|
4
4
|
|
|
5
5
|
import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
|
|
6
6
|
|
|
7
|
-
import { getValidatorOperatorAddress } from "
|
|
8
|
-
import { getValidatorRewardAllocatorAddress } from "
|
|
9
|
-
import { useBeraFlag } from "
|
|
10
|
-
import { assertPublicClient } from "
|
|
11
|
-
import type {
|
|
7
|
+
import { getValidatorOperatorAddress } from "../../actions/validators/getValidatorOperatorAddress";
|
|
8
|
+
import { getValidatorRewardAllocatorAddress } from "../../actions/validators/getValidatorRewardAllocatorAddress";
|
|
9
|
+
import { useBeraFlag } from "../../contexts/BeraFlags/BeraFlags";
|
|
10
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
11
|
+
import type {
|
|
12
|
+
DefaultHookOptions,
|
|
13
|
+
DefaultHookReturnType,
|
|
14
|
+
} from "../../types/global";
|
|
12
15
|
|
|
13
16
|
export type ManagedValidatorRole = {
|
|
14
17
|
operator: Address | null;
|
|
@@ -8,9 +8,12 @@ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
|
|
|
8
8
|
import type { ApiValidatorFragment } from "@berachain/graphql/pol/api";
|
|
9
9
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
10
10
|
|
|
11
|
-
import { assertPublicClient } from "
|
|
12
|
-
import type {
|
|
13
|
-
|
|
11
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
12
|
+
import type {
|
|
13
|
+
DefaultHookOptions,
|
|
14
|
+
DefaultHookReturnType,
|
|
15
|
+
} from "../../types/global";
|
|
16
|
+
import { parseBaseArgs } from "../../utils/parseBaseArgs";
|
|
14
17
|
|
|
15
18
|
export const useOnChainValidator = (
|
|
16
19
|
{ pubkey }: { pubkey: Address },
|
|
@@ -3,10 +3,13 @@ import type { Address } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { getStakingPoolBatch } from "
|
|
7
|
-
import { POLLING } from "
|
|
8
|
-
import { assertPublicClient } from "
|
|
9
|
-
import type {
|
|
6
|
+
import { getStakingPoolBatch } from "../../actions/validators/getStakingPoolBatch";
|
|
7
|
+
import { POLLING } from "../../enum/polling";
|
|
8
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
9
|
+
import type {
|
|
10
|
+
DefaultHookOptions,
|
|
11
|
+
DefaultHookReturnType,
|
|
12
|
+
} from "../../types/global";
|
|
10
13
|
|
|
11
14
|
export const useStakingPoolBatch = ({
|
|
12
15
|
valPubKey,
|
|
@@ -5,9 +5,12 @@ import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
|
|
|
5
5
|
import {
|
|
6
6
|
getUserActiveValidators,
|
|
7
7
|
type ValidatorWithUserBoost,
|
|
8
|
-
} from "
|
|
9
|
-
import { POLLING } from "
|
|
10
|
-
import type {
|
|
8
|
+
} from "../../actions/validators/getUserActiveValidators";
|
|
9
|
+
import { POLLING } from "../../enum/polling";
|
|
10
|
+
import type {
|
|
11
|
+
DefaultHookOptions,
|
|
12
|
+
DefaultHookReturnType,
|
|
13
|
+
} from "../../types/global";
|
|
11
14
|
|
|
12
15
|
interface UseUserActiveValidatorsResponse
|
|
13
16
|
extends DefaultHookReturnType<ValidatorWithUserBoost[] | undefined> {}
|
|
@@ -6,9 +6,9 @@ import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
|
|
|
6
6
|
import {
|
|
7
7
|
getUserBoostsOnValidator,
|
|
8
8
|
type UserBoostsOnValidator,
|
|
9
|
-
} from "
|
|
10
|
-
import { POLLING } from "
|
|
11
|
-
import type { DefaultHookReturnType } from "
|
|
9
|
+
} from "../../actions/validators/getUserBoostsOnValidator";
|
|
10
|
+
import { POLLING } from "../../enum/polling";
|
|
11
|
+
import type { DefaultHookReturnType } from "../../types/global";
|
|
12
12
|
|
|
13
13
|
export const useUserBoostsOnValidator = ({
|
|
14
14
|
pubkey,
|
|
@@ -3,15 +3,15 @@ import useSWR from "swr";
|
|
|
3
3
|
|
|
4
4
|
import { useBeraWallet } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { getRewardProofsByValidator } from "
|
|
7
|
-
import { getUserClaimableIncentives } from "
|
|
8
|
-
import { POLLING } from "
|
|
9
|
-
import { BeraError } from "
|
|
10
|
-
import { BeraMonitoring } from "
|
|
11
|
-
import { InvalidArgumentError } from "
|
|
12
|
-
import type { BribeBoostRewardProof } from "
|
|
13
|
-
import type { DefaultHookReturnType } from "
|
|
14
|
-
import { formatIncentivesTokenMap } from "
|
|
6
|
+
import { getRewardProofsByValidator } from "../../actions/pol/getRewardProofsByValidator";
|
|
7
|
+
import { getUserClaimableIncentives } from "../../actions/pol/getUserClaimableIncentives";
|
|
8
|
+
import { POLLING } from "../../enum/polling";
|
|
9
|
+
import { BeraError } from "../../errors/BeraError";
|
|
10
|
+
import { BeraMonitoring } from "../../errors/BeraMonitoring";
|
|
11
|
+
import { InvalidArgumentError } from "../../errors/InvalidArgumentError";
|
|
12
|
+
import type { BribeBoostRewardProof } from "../../types/bribe-boost";
|
|
13
|
+
import type { DefaultHookReturnType } from "../../types/global";
|
|
14
|
+
import { formatIncentivesTokenMap } from "../../utils/formatIncentivesTokenMap";
|
|
15
15
|
|
|
16
16
|
interface UseUserClaimableIncentivesReturnType
|
|
17
17
|
extends DefaultHookReturnType<BribeBoostRewardProof[]> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import useSWRImmutable from "swr/immutable";
|
|
2
2
|
import type { Address } from "viem";
|
|
3
3
|
|
|
4
|
-
import { getUserStakingPositions } from "
|
|
4
|
+
import { getUserStakingPositions } from "../../actions/validators/getUserStakingPositions";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Hook to fetch and manage user staking positions for validators
|
|
@@ -3,7 +3,7 @@ import { type Address, keccak256 } from "viem";
|
|
|
3
3
|
import type { GqlValidatorDynamicData } from "@berachain/graphql/dex/api";
|
|
4
4
|
import type { ApiValidatorFragment } from "@berachain/graphql/pol/api";
|
|
5
5
|
|
|
6
|
-
import type { DefaultHookOptions } from "
|
|
6
|
+
import type { DefaultHookOptions } from "../../types/global";
|
|
7
7
|
import { useApiValidator } from "./useApiValidator";
|
|
8
8
|
import { useOnChainValidator } from "./useOnChainValidator";
|
|
9
9
|
|
|
@@ -3,9 +3,9 @@ import type { Address } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import type { GetValidatorAnalyticsQuery } from "@berachain/graphql/pol/subgraph";
|
|
5
5
|
|
|
6
|
-
import { getValidatorAnalytics } from "
|
|
7
|
-
import { POLLING } from "
|
|
8
|
-
import type { DefaultHookReturnType } from "
|
|
6
|
+
import { getValidatorAnalytics } from "../../actions/validators/getValidatorAnalytics";
|
|
7
|
+
import { POLLING } from "../../enum/polling";
|
|
8
|
+
import type { DefaultHookReturnType } from "../../types/global";
|
|
9
9
|
|
|
10
10
|
export function useValidatorAnalytics({
|
|
11
11
|
pubkey,
|
|
@@ -3,8 +3,11 @@ import type { Address, PublicClient } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { getValidatorCommission } from "
|
|
7
|
-
import type {
|
|
6
|
+
import { getValidatorCommission } from "../../actions/validators/getValidatorCommission";
|
|
7
|
+
import type {
|
|
8
|
+
DefaultHookOptions,
|
|
9
|
+
DefaultHookReturnType,
|
|
10
|
+
} from "../../types/global";
|
|
8
11
|
|
|
9
12
|
export const useValidatorCommission = (
|
|
10
13
|
pubKey: Address,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ApiValidatorMinimalFragment } from "@berachain/graphql/pol/api";
|
|
2
2
|
|
|
3
|
-
import { getValidatorEstimatedBgtPerYear } from "
|
|
4
|
-
import { useBlockTime } from "
|
|
5
|
-
import { usePollGlobalData } from "
|
|
3
|
+
import { getValidatorEstimatedBgtPerYear } from "../../actions/validators/getValidatorEstimatedBgtPerYear";
|
|
4
|
+
import { useBlockTime } from "../../contexts/block-time-provider";
|
|
5
|
+
import { usePollGlobalData } from "../pol/usePollGlobalData";
|
|
6
6
|
|
|
7
7
|
export const useValidatorEstimatedBgtPerYear = (
|
|
8
8
|
validator: ApiValidatorMinimalFragment,
|
|
@@ -6,9 +6,12 @@ import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
|
6
6
|
import {
|
|
7
7
|
getValidatorQueuedCommission,
|
|
8
8
|
type ValidatorQueuedCommission,
|
|
9
|
-
} from "
|
|
10
|
-
import { assertPublicClient } from "
|
|
11
|
-
import type {
|
|
9
|
+
} from "../../actions/validators/getValidatorQueuedCommission";
|
|
10
|
+
import { assertPublicClient } from "../../errors/assert";
|
|
11
|
+
import type {
|
|
12
|
+
DefaultHookOptions,
|
|
13
|
+
DefaultHookReturnType,
|
|
14
|
+
} from "../../types/global";
|
|
12
15
|
|
|
13
16
|
export function useValidatorQueuedCommission(
|
|
14
17
|
pubKey: Address,
|
|
@@ -6,8 +6,11 @@ import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
|
6
6
|
import {
|
|
7
7
|
getValidatorQueuedOperatorAddress,
|
|
8
8
|
type ValidatorQueuedOperatorAddress,
|
|
9
|
-
} from "
|
|
10
|
-
import type {
|
|
9
|
+
} from "../../actions/validators/getValidatorQueuedOperatorAddress";
|
|
10
|
+
import type {
|
|
11
|
+
DefaultHookOptions,
|
|
12
|
+
DefaultHookReturnType,
|
|
13
|
+
} from "../../types/global";
|
|
11
14
|
|
|
12
15
|
export const useValidatorQueuedOperatorAddress = (
|
|
13
16
|
pubKey: Address,
|
|
@@ -3,9 +3,12 @@ import type { Address, PublicClient } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { getValidatorQueuedRewardAllocation } from "
|
|
7
|
-
import type { ValidatorRewardAllocation } from "
|
|
8
|
-
import type {
|
|
6
|
+
import { getValidatorQueuedRewardAllocation } from "../../actions/validators/getValidatorQueuedRewardAllocation";
|
|
7
|
+
import type { ValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
|
|
8
|
+
import type {
|
|
9
|
+
DefaultHookOptions,
|
|
10
|
+
DefaultHookReturnType,
|
|
11
|
+
} from "../../types/global";
|
|
9
12
|
|
|
10
13
|
export const useValidatorQueuedRewardAllocation = (
|
|
11
14
|
pubKey: Address,
|
|
@@ -3,8 +3,8 @@ import type { Address, PublicClient } from "viem";
|
|
|
3
3
|
|
|
4
4
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
5
5
|
|
|
6
|
-
import { getValidatorRewardAllocation } from "
|
|
7
|
-
import type { DefaultHookOptions } from "
|
|
6
|
+
import { getValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
|
|
7
|
+
import type { DefaultHookOptions } from "../../types/global";
|
|
8
8
|
|
|
9
9
|
export function useValidatorRewardAllocation(
|
|
10
10
|
pubKey: Address,
|
package/src/types/dex.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SwapKind } from "@berachain-foundation/berancer-sdk";
|
|
2
2
|
import type { Abi, Address, Hex, PublicClient } from "viem";
|
|
3
3
|
|
|
4
|
-
import type { HoneyConfigContextReturn } from "
|
|
4
|
+
import type { HoneyConfigContextReturn } from "../contexts/HoneyConfigProvider";
|
|
5
5
|
|
|
6
6
|
export type MinimalERC20 = {
|
|
7
7
|
address: Address;
|
package/src/types/enso.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BundleData, EnsoClient } from "@ensofinance/sdk";
|
|
2
2
|
import type { Address, Hex, PublicClient, TransactionRequest } from "viem";
|
|
3
3
|
|
|
4
|
+
import type { MinimalERC20 } from "./dex";
|
|
5
|
+
|
|
4
6
|
export type Quantity = string | number;
|
|
5
7
|
export type ActionOutputReference<T> = T | StrictOutputReference<T>;
|
|
6
8
|
type StrictOutputReference<T> = {
|
|
@@ -36,7 +38,39 @@ export interface GetZapTransactionsArgs {
|
|
|
36
38
|
bundle: BundleData;
|
|
37
39
|
publicClient: PublicClient;
|
|
38
40
|
}
|
|
41
|
+
|
|
42
|
+
export interface GetEnsoWalletTransactionsWithApprovalArgs {
|
|
43
|
+
fromAddress: Address;
|
|
44
|
+
amountIn: Quantity;
|
|
45
|
+
tokenIn: MinimalERC20;
|
|
46
|
+
bundle: BundleData;
|
|
47
|
+
publicClient: PublicClient;
|
|
48
|
+
}
|
|
39
49
|
export interface GetZapTransactionResponse {
|
|
40
50
|
bundle: BundleData;
|
|
41
51
|
transactions: GetZapTransactions;
|
|
42
52
|
}
|
|
53
|
+
|
|
54
|
+
interface BendPositionEstimate {
|
|
55
|
+
/**
|
|
56
|
+
* Collateral amount in human-readable format.
|
|
57
|
+
* For multiply: total collateral after leveraging.
|
|
58
|
+
* For demultiply: collateral reduction from unwinding.
|
|
59
|
+
*/
|
|
60
|
+
finalCollateral: string;
|
|
61
|
+
/**
|
|
62
|
+
* Borrow amount in loan tokens (human-readable).
|
|
63
|
+
* For multiply: total debt after leveraging.
|
|
64
|
+
* For demultiply: debt reduction from unwinding.
|
|
65
|
+
*/
|
|
66
|
+
totalBorrow: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BendMultiplyBundleResponse extends GetZapTransactionResponse {
|
|
70
|
+
positionEstimate: BendPositionEstimate;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface BendDemultiplyBundleResponse
|
|
74
|
+
extends GetZapTransactionResponse {
|
|
75
|
+
positionEstimate: BendPositionEstimate;
|
|
76
|
+
}
|
package/src/types/global.d.ts
CHANGED
|
@@ -13,12 +13,12 @@ import type {
|
|
|
13
13
|
|
|
14
14
|
import type { BeraConfig, ChainId } from "@berachain/config";
|
|
15
15
|
|
|
16
|
-
import type { ContractName } from "
|
|
17
|
-
import type { TransactionActionType } from "
|
|
16
|
+
import type { ContractName } from "../enum/contracts";
|
|
17
|
+
import type { TransactionActionType } from "../enum/txnEnum";
|
|
18
18
|
import type {
|
|
19
19
|
IUseContractWriteArgs,
|
|
20
20
|
TxnEventKeys,
|
|
21
|
-
} from "
|
|
21
|
+
} from "../hooks/useContractWrite/types";
|
|
22
22
|
|
|
23
23
|
export type DefaultHookOptions = {
|
|
24
24
|
opts?: SWRConfiguration & { isEnabled?: boolean };
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
ProposalWithVotesFragment,
|
|
6
6
|
} from "@berachain/graphql/governance";
|
|
7
7
|
|
|
8
|
-
import type { ProposalErrorCodes, ProposalTypeEnum } from "
|
|
8
|
+
import type { ProposalErrorCodes, ProposalTypeEnum } from "../enum/governance";
|
|
9
9
|
|
|
10
10
|
export type Proposal = ProposalWithVotesFragment;
|
|
11
11
|
|
package/src/types/honeySwap.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Address, Hex } from "viem";
|
|
2
2
|
|
|
3
|
-
import type { HoneyPreviewResult } from "
|
|
4
|
-
import type { TokenWithOrder } from "
|
|
5
|
-
import type { HoneySwapAction } from "
|
|
3
|
+
import type { HoneyPreviewResult } from "../actions/honey/getHoneyPreview";
|
|
4
|
+
import type { TokenWithOrder } from "../contexts/HoneyConfigProvider";
|
|
5
|
+
import type { HoneySwapAction } from "../enum/honey";
|
|
6
6
|
|
|
7
7
|
export type PythPriceFeedMap = Record<Address, Hex>;
|
|
8
8
|
|
package/src/utils/beraFetch.ts
CHANGED
|
@@ -70,7 +70,7 @@ export interface EmitterMixin<Events extends EventsMap = DefaultEvents> {
|
|
|
70
70
|
* Create event emitter.
|
|
71
71
|
*
|
|
72
72
|
* ```js
|
|
73
|
-
* import { createEmitter } from '
|
|
73
|
+
* import { createEmitter } from './createEmitter'
|
|
74
74
|
*
|
|
75
75
|
* class Ticker {
|
|
76
76
|
* constructor() {
|
|
@@ -2,7 +2,7 @@ import type { Address } from "viem";
|
|
|
2
2
|
|
|
3
3
|
import { type ChainId, defaultChainId } from "@berachain/config/internal";
|
|
4
4
|
|
|
5
|
-
import { contracts } from "
|
|
5
|
+
import { contracts } from "../data/contracts";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Get a human readable name for a contract address.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
|
|
3
|
-
import type { IHoneySwapState } from "
|
|
3
|
+
import type { IHoneySwapState } from "../hooks/honey/useHoneySwapState";
|
|
4
4
|
import { getHoneySwapMessage as getMessage } from "./getHoneySwapMessage";
|
|
5
5
|
|
|
6
6
|
describe("getMessage", () => {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
defaultChainId,
|
|
5
5
|
} from "@berachain/config/internal";
|
|
6
6
|
|
|
7
|
-
import { InvalidArgumentError } from "
|
|
7
|
+
import { InvalidArgumentError } from "../errors/InvalidArgumentError";
|
|
8
8
|
|
|
9
9
|
export function parseBaseArgs(args: BeraJS.BaseFunctionArgs) {
|
|
10
10
|
const chainId = args.chainId ?? defaultChainId;
|
|
@@ -5,7 +5,7 @@ import { bepolia } from "@berachain/config/bepolia";
|
|
|
5
5
|
import { chainConfigs, defaultChainId } from "@berachain/config/internal";
|
|
6
6
|
import { mainnet } from "@berachain/config/mainnet";
|
|
7
7
|
|
|
8
|
-
import { InvalidArgumentError } from "
|
|
8
|
+
import { InvalidArgumentError } from "../errors/InvalidArgumentError";
|
|
9
9
|
import { parseBaseArgs } from "./parseBaseArgs";
|
|
10
10
|
|
|
11
11
|
describe("parseBaseArgs", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TokenInfoFragmentFragment } from "@berachain/graphql/bend/whisk";
|
|
2
2
|
|
|
3
|
-
import type { TokenWithMetadata } from "
|
|
3
|
+
import type { TokenWithMetadata } from "../types/dex";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Parse a token from the Whisk API into a TokenWithMetadata object.
|
package/src/utils/poolNamings.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PoolType } from "@berachain-foundation/berancer-sdk";
|
|
2
2
|
import { formatUnits } from "viem";
|
|
3
3
|
|
|
4
|
-
import type { Token } from "
|
|
4
|
+
import type { Token } from "../types/dex";
|
|
5
5
|
|
|
6
6
|
// Utility function to sort tokens by their address without modifying the original array
|
|
7
7
|
const sortTokensByAddress = (tokens: Token[]): Token[] => {
|
package/src/utils/tokens.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Address, ethAddress, isAddress, zeroAddress } from "viem";
|
|
|
2
2
|
|
|
3
3
|
import { mainnet } from "@berachain/config/mainnet";
|
|
4
4
|
|
|
5
|
-
import { InvalidArgumentError } from "
|
|
5
|
+
import { InvalidArgumentError } from "../errors/InvalidArgumentError";
|
|
6
6
|
import type { TokenWithMetadata } from "../types/dex";
|
|
7
7
|
import { parseBaseArgs } from "./parseBaseArgs";
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ export const beraToken = {
|
|
|
12
12
|
name: "Bera",
|
|
13
13
|
symbol: "BERA",
|
|
14
14
|
logoURI:
|
|
15
|
-
"https://
|
|
15
|
+
"https://imagedelivery.net/qNj7Q3MCke89zoKzav7eDQ/tokens/0x0000000000000000000000000000000000000000.png/public",
|
|
16
16
|
} as const satisfies Omit<TokenWithMetadata, "chainId">;
|
|
17
17
|
|
|
18
18
|
export const wBeraToken = {
|