@berachain/berajs 0.2.13 → 0.3.1
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/actions/clients/BeraApolloClient.d.ts.map +1 -1
- package/dist/actions/clients/clientName.d.ts +10 -0
- package/dist/actions/clients/clientName.d.ts.map +1 -0
- package/dist/actions/clients/clientName.unit.test.d.ts +2 -0
- package/dist/actions/clients/clientName.unit.test.d.ts.map +1 -0
- package/dist/actions/clients/exports.d.ts +2 -0
- package/dist/actions/clients/exports.d.ts.map +1 -1
- package/dist/actions/clients/exports.mjs +26 -7
- package/dist/actions/clients/exports.mjs.map +1 -1
- package/dist/actions/clients/fetchBeep.d.ts +2 -2
- package/dist/actions/clients/fetchBeep.d.ts.map +1 -1
- package/dist/actions/clients/fetchEnso.d.ts +17 -0
- package/dist/actions/clients/fetchEnso.d.ts.map +1 -0
- package/dist/actions/clients/fetchLayerzero.d.ts +12 -0
- package/dist/actions/clients/fetchLayerzero.d.ts.map +1 -0
- package/dist/actions/clients/fetchOpenApi.d.ts +4 -1
- package/dist/actions/clients/fetchOpenApi.d.ts.map +1 -1
- package/dist/actions/clients/getApolloClient.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/base.d.ts +30 -5
- package/dist/actions/dex/aggregators/base.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/bex.d.ts +11 -1
- package/dist/actions/dex/aggregators/bex.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/bgt.d.ts +2 -2
- package/dist/actions/dex/aggregators/bgt.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/enso/enso.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/enso/ensoErc4626.d.ts +1 -0
- package/dist/actions/dex/aggregators/enso/ensoErc4626.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/erc4626.d.ts +2 -2
- package/dist/actions/dex/aggregators/erc4626.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/fly.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/haiku.d.ts +7 -1
- package/dist/actions/dex/aggregators/haiku.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/honey.d.ts +2 -2
- package/dist/actions/dex/aggregators/honey.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/kyberswap.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/oogabooga.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/openOcean.d.ts.map +1 -1
- package/dist/actions/dex/aggregators/wbera.d.ts +3 -2
- package/dist/actions/dex/aggregators/wbera.d.ts.map +1 -1
- package/dist/actions/dex/getAllPools.d.ts.map +1 -1
- package/dist/actions/dex/getApiPool.d.ts.map +1 -1
- package/dist/actions/enso/getEnsoUserTokensWithBalances.d.ts.map +1 -1
- package/dist/actions/enso/util.d.ts +1 -6
- package/dist/actions/enso/util.d.ts.map +1 -1
- package/dist/actions/exports.d.ts +3 -5
- package/dist/actions/exports.d.ts.map +1 -1
- package/dist/actions/exports.mjs +33 -64
- package/dist/actions/exports.mjs.map +1 -1
- package/dist/actions/governance/exports.mjs +3 -3
- package/dist/actions/honey/getChartData.d.ts +1 -1
- package/dist/actions/honey/getChartData.d.ts.map +1 -1
- package/dist/actions/honey/getHoney24hVolume.d.ts +2 -2
- package/dist/actions/honey/getHoney24hVolume.d.ts.map +1 -1
- package/dist/actions/honey/getHoneyCollaterals.d.ts +1 -1
- package/dist/actions/honey/getHoneyCollaterals.d.ts.map +1 -1
- package/dist/actions/honey/getHoneyTxns.d.ts +1 -1
- package/dist/actions/honey/getHoneyTxns.d.ts.map +1 -1
- package/dist/actions/pol/getBGTGlobalInfo.d.ts +0 -1
- package/dist/actions/pol/getBGTGlobalInfo.d.ts.map +1 -1
- package/dist/actions/pol/getBeraTokenTotalSupply.d.ts.map +1 -1
- package/dist/actions/pol/getEarnedStakedBeraVault.d.ts +4 -27
- package/dist/actions/pol/getEarnedStakedBeraVault.d.ts.map +1 -1
- package/dist/actions/pol/getLSTStakeConfig.d.ts.map +1 -1
- package/dist/actions/pol/getRewardVaults.d.ts.map +1 -1
- package/dist/actions/pol/getSWBeraVaultMetadata.d.ts +1 -14
- package/dist/actions/pol/getSWBeraVaultMetadata.d.ts.map +1 -1
- package/dist/actions/pol/getStakedBeraAPY.d.ts +14 -0
- package/dist/actions/pol/getStakedBeraAPY.d.ts.map +1 -0
- package/dist/actions/pol/getStakedBeraSnapshots.d.ts +14 -4
- package/dist/actions/pol/getStakedBeraSnapshots.d.ts.map +1 -1
- package/dist/actions/pol/getStakingDailyAssets.d.ts +2 -2
- package/dist/actions/pol/getStakingDailyAssets.d.ts.map +1 -1
- package/dist/actions/server/exports.mjs +5 -5
- package/dist/actions/server/exports.mjs.map +1 -1
- package/dist/actions/server/getDailyValidatorBlockStats.d.ts +1 -1
- package/dist/actions/server/getDailyValidatorBlockStats.d.ts.map +1 -1
- package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.d.ts +1 -1
- package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.d.ts.map +1 -1
- package/dist/actions/validators/getUserActiveValidators.d.ts +37 -1
- package/dist/actions/validators/getUserActiveValidators.d.ts.map +1 -1
- package/dist/actions/validators/getValidatorIncentiveDistribution.d.ts +1 -1
- package/dist/actions/validators/getValidatorIncentiveDistribution.d.ts.map +1 -1
- package/dist/actions/validators/getValidatorRewardAllocation.d.ts +4 -0
- package/dist/actions/validators/getValidatorRewardAllocation.d.ts.map +1 -1
- package/dist/chunk-3TRTSTDH.mjs +19 -0
- package/dist/chunk-3TRTSTDH.mjs.map +1 -0
- package/dist/{chunk-ZWTGVIPJ.mjs → chunk-4576RF2K.mjs} +29 -4
- package/dist/chunk-4576RF2K.mjs.map +1 -0
- package/dist/{chunk-PHYZRH4I.mjs → chunk-5MUCX35C.mjs} +9 -13
- package/dist/chunk-5MUCX35C.mjs.map +1 -0
- package/dist/{chunk-UA3Z47LT.mjs → chunk-6D4S3EAC.mjs} +97 -26
- package/dist/chunk-6D4S3EAC.mjs.map +1 -0
- package/dist/{chunk-AEN6IJFU.mjs → chunk-7KN7TDUC.mjs} +2 -2
- package/dist/{chunk-LE4CYW7S.mjs → chunk-FWRYUIJK.mjs} +3 -3
- package/dist/chunk-GDUKRUHE.mjs +29 -0
- package/dist/chunk-GDUKRUHE.mjs.map +1 -0
- package/dist/{chunk-PJRLHTGC.mjs → chunk-HPRLNT6R.mjs} +3 -3
- package/dist/{chunk-DOZJB6IJ.mjs → chunk-KY7JMIIS.mjs} +394 -346
- package/dist/chunk-KY7JMIIS.mjs.map +1 -0
- package/dist/{chunk-P3YZ7F22.mjs → chunk-LL7XR2H5.mjs} +34 -3
- package/dist/chunk-LL7XR2H5.mjs.map +1 -0
- package/dist/{chunk-EJIGERYM.mjs → chunk-M3MIGSH3.mjs} +2 -2
- package/dist/{chunk-NZAH3SGT.mjs → chunk-MVNQY2D4.mjs} +9 -4
- package/dist/chunk-MVNQY2D4.mjs.map +1 -0
- package/dist/{chunk-TGN55GKE.mjs → chunk-SC3BSCTN.mjs} +2 -2
- package/dist/{chunk-QQASX4LJ.mjs → chunk-TXWDUJOY.mjs} +2 -2
- package/dist/{chunk-EGAB6NFQ.mjs → chunk-UWJQ6UKG.mjs} +2 -2
- package/dist/chunk-XO2BFPTB.mjs +50 -0
- package/dist/chunk-XO2BFPTB.mjs.map +1 -0
- package/dist/{chunk-7TFV6UKF.mjs → chunk-XXKPXNQD.mjs} +1 -2
- package/dist/chunk-XXKPXNQD.mjs.map +1 -0
- package/dist/{chunk-IFNIPVTZ.mjs → chunk-Z337NBBW.mjs} +5 -49
- package/dist/chunk-Z337NBBW.mjs.map +1 -0
- package/dist/{chunk-J3LTASDE.mjs → chunk-ZHV3MQ4F.mjs} +4 -4
- package/dist/contexts/BeraFlags/BeraFlags.d.ts +1 -1
- package/dist/contexts/BeraFlags/BeraFlags.d.ts.map +1 -1
- package/dist/contexts/BeraFlags/defaultFlags.d.ts +2 -2
- package/dist/contexts/BeraFlags/defaultFlags.d.ts.map +1 -1
- package/dist/contexts/BexStatusProvider.d.ts +1 -1
- package/dist/contexts/BexStatusProvider.d.ts.map +1 -1
- package/dist/contexts/TokensProvider.d.ts +1 -1
- package/dist/contexts/TokensProvider.d.ts.map +1 -1
- package/dist/contexts/exports.mjs +9 -9
- package/dist/enum/contracts.d.ts +3 -0
- package/dist/enum/contracts.d.ts.map +1 -1
- package/dist/enum/exports.mjs +6 -4
- package/dist/enum/exports.mjs.map +1 -1
- package/dist/enum/txnEnum.d.ts +1 -1
- package/dist/enum/txnEnum.d.ts.map +1 -1
- package/dist/errors/RequestError.d.ts +19 -0
- package/dist/errors/RequestError.d.ts.map +1 -1
- package/dist/errors/errorMap.d.ts +4 -3
- package/dist/errors/errorMap.d.ts.map +1 -1
- package/dist/errors/exports.mjs +5 -5
- package/dist/errors/getErrorMessage.unit.test.d.ts +2 -0
- package/dist/errors/getErrorMessage.unit.test.d.ts.map +1 -0
- package/dist/generated/beep.d.ts +1597 -0
- package/dist/generated/beep.d.ts.map +1 -0
- package/dist/generated/enso.d.ts +4957 -0
- package/dist/generated/enso.d.ts.map +1 -0
- package/dist/generated/layerzero.d.ts +2057 -0
- package/dist/generated/layerzero.d.ts.map +1 -0
- package/dist/hooks/dex/useAggregatorsQuotes.d.ts.map +1 -1
- package/dist/hooks/dex/useAllUserPools.d.ts.map +1 -1
- package/dist/hooks/dex/useCrossChainNativeFee.d.ts +32 -0
- package/dist/hooks/dex/useCrossChainNativeFee.d.ts.map +1 -0
- package/dist/hooks/dex/useCrossChainNativeFee.unit.test.d.ts +2 -0
- package/dist/hooks/dex/useCrossChainNativeFee.unit.test.d.ts.map +1 -0
- package/dist/hooks/dex/useOnChainPoolData.d.ts.map +1 -1
- package/dist/hooks/dex/usePools.d.ts.map +1 -1
- package/dist/hooks/dex/useSingleAggregatorQuote.d.ts.map +1 -1
- package/dist/hooks/dex/useSingleAggregatorQuote.unit.test.d.ts +2 -0
- package/dist/hooks/dex/useSingleAggregatorQuote.unit.test.d.ts.map +1 -0
- package/dist/hooks/enso/useBendZapSupply.d.ts +2 -2
- package/dist/hooks/enso/useBendZapSupply.d.ts.map +1 -1
- package/dist/hooks/enso/useBendZapSupply.unit.test.d.ts +2 -0
- package/dist/hooks/enso/useBendZapSupply.unit.test.d.ts.map +1 -0
- package/dist/hooks/enso/useEnsoUserTokensWithBalances.d.ts.map +1 -1
- package/dist/hooks/enso/useEnsoUserTokensWithBalances.unit.test.d.ts +2 -0
- package/dist/hooks/enso/useEnsoUserTokensWithBalances.unit.test.d.ts.map +1 -0
- package/dist/hooks/enso/useZapStakeBera.d.ts.map +1 -1
- package/dist/hooks/enso/useZapStakeBera.unit.test.d.ts +2 -0
- package/dist/hooks/enso/useZapStakeBera.unit.test.d.ts.map +1 -0
- package/dist/hooks/exports.d.ts +2 -5
- package/dist/hooks/exports.d.ts.map +1 -1
- package/dist/hooks/exports.mjs +615 -911
- package/dist/hooks/exports.mjs.map +1 -1
- package/dist/hooks/governance/exports.mjs +4 -4
- package/dist/hooks/honey/useHoneyChartData.d.ts +4 -4
- package/dist/hooks/honey/useHoneyChartData.d.ts.map +1 -1
- package/dist/hooks/pol/useAutoclaimedIncentives.d.ts.map +1 -1
- package/dist/hooks/pol/useAutoclaimedIncentivesTxHash.d.ts.map +1 -1
- package/dist/hooks/pol/useRewardTokenToBeraRate.d.ts.map +1 -1
- package/dist/hooks/pol/useRewardVaultBalanceFromStakingToken.d.ts.map +1 -1
- package/dist/hooks/pol/useRewardVaults.d.ts.map +1 -1
- package/dist/hooks/pol/useStakedAPY.d.ts +11 -0
- package/dist/hooks/pol/useStakedAPY.d.ts.map +1 -0
- package/dist/hooks/pol/useStakedData.d.ts +4 -2
- package/dist/hooks/pol/useStakedData.d.ts.map +1 -1
- package/dist/hooks/pol/useStakedSnapshots.d.ts +1 -1
- package/dist/hooks/pol/useStakedSnapshots.d.ts.map +1 -1
- package/dist/hooks/pol/useStakingVaultsMetadata.d.ts +0 -1
- package/dist/hooks/pol/useStakingVaultsMetadata.d.ts.map +1 -1
- package/dist/hooks/tokens/useMultipleTokenInformation.d.ts +30 -0
- package/dist/hooks/tokens/useMultipleTokenInformation.d.ts.map +1 -1
- package/dist/hooks/tokens/useMultipleTokenInformation.unit.test.d.ts +2 -0
- package/dist/hooks/tokens/useMultipleTokenInformation.unit.test.d.ts.map +1 -0
- package/dist/hooks/tokens/usePollBalance.d.ts.map +1 -1
- package/dist/hooks/validators/useUserActiveValidators.d.ts +5 -0
- package/dist/hooks/validators/useUserActiveValidators.d.ts.map +1 -1
- package/dist/hooks/validators/useValidator.d.ts +0 -1
- package/dist/hooks/validators/useValidator.d.ts.map +1 -1
- package/dist/hooks/validators/useValidatorIncentiveDistribution.d.ts +4 -5
- package/dist/hooks/validators/useValidatorIncentiveDistribution.d.ts.map +1 -1
- package/dist/hooks/validators/useValidatorRewardAllocation.d.ts +1 -0
- package/dist/hooks/validators/useValidatorRewardAllocation.d.ts.map +1 -1
- package/dist/types/beep/exports.d.ts +2 -0
- package/dist/types/beep/exports.d.ts.map +1 -0
- package/dist/types/beep/exports.mjs +1 -0
- package/dist/types/beep/exports.mjs.map +1 -0
- package/dist/types/bribeBoost.d.ts +0 -49
- package/dist/types/dex.d.ts +17 -0
- package/dist/types/enso.d.ts +1 -27
- package/dist/types/global.d.ts +7 -0
- package/dist/types/pol.d.ts +3 -48
- package/dist/utils/crossChainBridge.d.ts +74 -0
- package/dist/utils/crossChainBridge.d.ts.map +1 -0
- package/dist/utils/crossChainBridge.unit.test.d.ts +2 -0
- package/dist/utils/crossChainBridge.unit.test.d.ts.map +1 -0
- package/dist/utils/exports.d.ts +1 -1
- package/dist/utils/exports.d.ts.map +1 -1
- package/dist/utils/exports.mjs +142 -72
- package/dist/utils/exports.mjs.map +1 -1
- package/dist/utils/getTestClient.d.ts +5 -3
- package/dist/utils/getTestClient.d.ts.map +1 -1
- package/dist/utils/parseWhiskToken.d.ts.map +1 -1
- package/package.json +14 -10
- package/src/actions/clients/BeraApolloClient.ts +4 -2
- package/src/actions/clients/clientName.ts +17 -0
- package/src/actions/clients/clientName.unit.test.ts +39 -0
- package/src/actions/clients/exports.ts +2 -0
- package/src/actions/clients/fetchBeep.ts +6 -4
- package/src/actions/clients/fetchEnso.ts +47 -0
- package/src/actions/clients/fetchLayerzero.ts +33 -0
- package/src/actions/clients/fetchOpenApi.ts +9 -2
- package/src/actions/clients/fetchOpenApi.unit.test.ts +27 -12
- package/src/actions/clients/getApolloClient.ts +3 -11
- package/src/actions/dex/__tests__/aggregators.unit.test.ts +231 -2
- package/src/actions/dex/aggregators/base.ts +75 -17
- package/src/actions/dex/aggregators/bex.ts +41 -1
- package/src/actions/dex/aggregators/bgt.ts +11 -6
- package/src/actions/dex/aggregators/enso/enso.ts +1 -0
- package/src/actions/dex/aggregators/enso/ensoErc4626.ts +27 -9
- package/src/actions/dex/aggregators/erc4626.ts +19 -5
- package/src/actions/dex/aggregators/fly.ts +1 -0
- package/src/actions/dex/aggregators/haiku.ts +33 -2
- package/src/actions/dex/aggregators/honey.ts +17 -6
- package/src/actions/dex/aggregators/kyberswap.ts +1 -0
- package/src/actions/dex/aggregators/oogabooga.ts +1 -0
- package/src/actions/dex/aggregators/openOcean.ts +1 -0
- package/src/actions/dex/aggregators/wbera.ts +17 -11
- package/src/actions/enso/getBendMultiplyBundle.ts +1 -1
- package/src/actions/enso/getEnsoUserTokensWithBalances.ts +4 -8
- package/src/actions/enso/util.ts +0 -59
- package/src/actions/exports.ts +3 -5
- package/src/actions/honey/getChartData.ts +2 -3
- package/src/actions/honey/getHoney24hVolume.ts +4 -13
- package/src/actions/honey/getHoneyCollaterals.ts +1 -1
- package/src/actions/honey/getHoneyTxns.ts +2 -3
- package/src/actions/pol/getBGTGlobalInfo.ts +0 -2
- package/src/actions/pol/getBeraTokenTotalSupply.ts +3 -33
- package/src/actions/pol/getEarnedStakedBeraVault.ts +1 -1
- package/src/actions/pol/getLSTStakeConfig.ts +0 -6
- package/src/actions/pol/getRewardVaults.ts +0 -1
- package/src/actions/pol/getSWBeraVaultMetadata.ts +2 -106
- package/src/actions/pol/getStakedBeraAPY.ts +44 -0
- package/src/actions/pol/getStakedBeraSnapshots.ts +17 -34
- package/src/actions/pol/getStakingDailyAssets.ts +1 -1
- package/src/actions/server/getDailyValidatorBlockStats.ts +1 -2
- package/src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts +1 -1
- package/src/actions/validators/getUserActiveValidators.ts +116 -54
- package/src/actions/validators/getValidatorIncentiveDistribution.ts +1 -2
- package/src/actions/validators/getValidatorRewardAllocation.ts +12 -1
- package/src/contexts/BeraFlags/BeraFlags.tsx +1 -4
- package/src/contexts/BeraFlags/defaultFlags.ts +1 -3
- package/src/contexts/BexStatusProvider.tsx +1 -1
- package/src/contexts/TokensProvider.tsx +1 -4
- package/src/enum/contracts.ts +3 -0
- package/src/enum/txnEnum.ts +1 -1
- package/src/errors/BeraError.unit.test.ts +23 -0
- package/src/errors/RequestError.ts +46 -9
- package/src/errors/RequestError.unit.test.ts +54 -0
- package/src/errors/errorMap.ts +8 -3
- package/src/errors/getErrorMessage.unit.test.ts +32 -0
- package/src/generated/beep.ts +1605 -0
- package/src/generated/enso.ts +4965 -0
- package/src/generated/layerzero.ts +2065 -0
- package/src/hooks/dex/useAggregatorsQuotes.ts +7 -1
- package/src/hooks/dex/useCrossChainNativeFee.ts +83 -0
- package/src/hooks/dex/useCrossChainNativeFee.unit.test.ts +63 -0
- package/src/hooks/dex/useOnChainPoolData.ts +30 -13
- package/src/hooks/dex/useSingleAggregatorQuote.ts +10 -5
- package/src/hooks/dex/useSingleAggregatorQuote.unit.test.ts +86 -0
- package/src/hooks/enso/useBendZapSupply.ts +10 -38
- package/src/hooks/enso/useBendZapSupply.unit.test.ts +98 -0
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +13 -3
- package/src/hooks/enso/useEnsoUserTokensWithBalances.unit.test.ts +69 -0
- package/src/hooks/enso/useZapStakeBera.ts +8 -1
- package/src/hooks/enso/useZapStakeBera.unit.test.ts +97 -0
- package/src/hooks/exports.ts +2 -5
- package/src/hooks/pol/useAutoclaimedIncentives.ts +6 -3
- package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +5 -2
- package/src/hooks/pol/useRewardTokenToBeraRate.ts +5 -4
- package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +0 -1
- package/src/hooks/pol/{useStakedAPR.ts → useStakedAPY.ts} +11 -9
- package/src/hooks/pol/useStakedData.ts +15 -14
- package/src/hooks/pol/useStakedSnapshots.ts +1 -1
- package/src/hooks/pol/useStakingVaultsMetadata.ts +3 -8
- package/src/hooks/tokens/useMultipleTokenInformation.ts +64 -21
- package/src/hooks/tokens/useMultipleTokenInformation.unit.test.ts +91 -0
- package/src/hooks/tokens/usePollBalance.ts +4 -2
- package/src/hooks/validators/useUserActiveValidators.ts +54 -9
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +4 -5
- package/src/types/beep/exports.ts +4 -0
- package/src/types/bribeBoost.d.ts +0 -49
- package/src/types/dex.d.ts +17 -0
- package/src/types/enso.d.ts +1 -27
- package/src/types/global.d.ts +7 -0
- package/src/types/pol.d.ts +3 -48
- package/src/utils/crossChainBridge.ts +290 -0
- package/src/utils/crossChainBridge.unit.test.ts +177 -0
- package/src/utils/exports.ts +1 -1
- package/dist/BeraError-7-A5JYy_.d.ts +0 -123
- package/dist/BexStatusProvider-DRymVlQf.d.ts +0 -70
- package/dist/HoneyConfigProvider-COOuDNra.d.ts +0 -390
- package/dist/RequestError-DkUbo3ro.d.ts +0 -145
- package/dist/actions/dex/b-sdk.d.ts +0 -3
- package/dist/actions/enso/getEnsoSwapBundle.d.ts +0 -3
- package/dist/actions/enso/getEnsoSwapBundle.d.ts.map +0 -1
- package/dist/actions/pol/getBgtIncentiveDistributorPaused.d.ts +0 -10
- package/dist/actions/pol/getBgtIncentiveDistributorPaused.d.ts.map +0 -1
- package/dist/actions/pol/getRewardProofsByValidator.d.ts +0 -9
- package/dist/actions/pol/getRewardProofsByValidator.d.ts.map +0 -1
- package/dist/actions/pol/getStakedBeraAPR.d.ts +0 -12
- package/dist/actions/pol/getStakedBeraAPR.d.ts.map +0 -1
- package/dist/actions/pol/getUserClaimableIncentives.d.ts +0 -9
- package/dist/actions/pol/getUserClaimableIncentives.d.ts.map +0 -1
- package/dist/actions/validators/getValidatorAnalytics.d.ts +0 -12
- package/dist/actions/validators/getValidatorAnalytics.d.ts.map +0 -1
- package/dist/chunk-7TFV6UKF.mjs.map +0 -1
- package/dist/chunk-BSOWLS3W.mjs +0 -40
- package/dist/chunk-BSOWLS3W.mjs.map +0 -1
- package/dist/chunk-DOZJB6IJ.mjs.map +0 -1
- package/dist/chunk-IFNIPVTZ.mjs.map +0 -1
- package/dist/chunk-NZAH3SGT.mjs.map +0 -1
- package/dist/chunk-P3YZ7F22.mjs.map +0 -1
- package/dist/chunk-PHYZRH4I.mjs.map +0 -1
- package/dist/chunk-UA3Z47LT.mjs.map +0 -1
- package/dist/chunk-ZWTGVIPJ.mjs.map +0 -1
- package/dist/contexts/block-time-provider.d.ts +0 -10
- package/dist/defaultFlags-D6KfkTZx.d.ts +0 -10
- package/dist/dex-C_BB0b0O.d.ts +0 -37
- package/dist/getApolloClient-MWm_iq4u.d.ts +0 -39
- package/dist/getProposalVotes-DAUrdX2n.d.ts +0 -12
- package/dist/getValidatorQueuedOperatorAddress-N2I7wHd6.d.ts +0 -511
- package/dist/global.d-CR3zicga.d.ts +0 -231
- package/dist/global.d-CiZJ2eHz.d.ts +0 -231
- package/dist/honey-CYm0RWf4.d.ts +0 -14
- package/dist/hooks/enso/useEnsoSwapBundle.d.ts +0 -26
- package/dist/hooks/enso/useEnsoSwapBundle.d.ts.map +0 -1
- package/dist/hooks/pol/useBgtIncentiveDistributorPaused.d.ts +0 -8
- package/dist/hooks/pol/useBgtIncentiveDistributorPaused.d.ts.map +0 -1
- package/dist/hooks/pol/useStakedAPR.d.ts +0 -11
- package/dist/hooks/pol/useStakedAPR.d.ts.map +0 -1
- package/dist/hooks/validators/useUserClaimableIncentives.d.ts +0 -8
- package/dist/hooks/validators/useUserClaimableIncentives.d.ts.map +0 -1
- package/dist/hooks/validators/useValidatorAnalytics.d.ts +0 -11
- package/dist/hooks/validators/useValidatorAnalytics.d.ts.map +0 -1
- package/dist/pol.d-CeRgXBL8.d.ts +0 -167
- package/dist/txnEnum-ByI5dtDi.d.ts +0 -106
- package/dist/types/bribe-boost.d.ts +0 -69
- package/dist/useHoneySwapState-CXVWAThr.d.ts +0 -32
- package/dist/useHoneySwapState-twi7NTaO.d.ts +0 -32
- package/dist/utils/formatIncentivesTokenMap.d.ts +0 -3
- package/dist/utils/formatIncentivesTokenMap.d.ts.map +0 -1
- package/dist/utils/layerZeroScan.d.ts +0 -39
- package/dist/utils/layerZeroScan.d.ts.map +0 -1
- package/src/actions/enso/getEnsoSwapBundle.ts +0 -72
- package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +0 -28
- package/src/actions/pol/getRewardProofsByValidator.ts +0 -49
- package/src/actions/pol/getStakedBeraAPR.ts +0 -56
- package/src/actions/pol/getUserClaimableIncentives.ts +0 -40
- package/src/actions/validators/getValidatorAnalytics.ts +0 -37
- package/src/hooks/enso/useEnsoSwapBundle.ts +0 -121
- package/src/hooks/pol/useBgtIncentiveDistributorPaused.ts +0 -34
- package/src/hooks/validators/useUserClaimableIncentives.ts +0 -148
- package/src/hooks/validators/useValidatorAnalytics.ts +0 -37
- package/src/utils/formatIncentivesTokenMap.ts +0 -19
- package/src/utils/layerZeroScan.ts +0 -124
- /package/dist/{chunk-AEN6IJFU.mjs.map → chunk-7KN7TDUC.mjs.map} +0 -0
- /package/dist/{chunk-LE4CYW7S.mjs.map → chunk-FWRYUIJK.mjs.map} +0 -0
- /package/dist/{chunk-PJRLHTGC.mjs.map → chunk-HPRLNT6R.mjs.map} +0 -0
- /package/dist/{chunk-EJIGERYM.mjs.map → chunk-M3MIGSH3.mjs.map} +0 -0
- /package/dist/{chunk-TGN55GKE.mjs.map → chunk-SC3BSCTN.mjs.map} +0 -0
- /package/dist/{chunk-QQASX4LJ.mjs.map → chunk-TXWDUJOY.mjs.map} +0 -0
- /package/dist/{chunk-EGAB6NFQ.mjs.map → chunk-UWJQ6UKG.mjs.map} +0 -0
- /package/dist/{chunk-J3LTASDE.mjs.map → chunk-ZHV3MQ4F.mjs.map} +0 -0
package/dist/actions/exports.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import {
|
|
|
3
3
|
BaseAggregator,
|
|
4
4
|
HoneyPreviewMethod,
|
|
5
5
|
RewardVaultDistributionMode,
|
|
6
|
+
StakeSnapshotRange,
|
|
6
7
|
beraWriteContract,
|
|
8
|
+
ensoErc4626,
|
|
7
9
|
formatValidatorRewardAllocation,
|
|
8
10
|
getAllPools,
|
|
9
11
|
getAllValidators,
|
|
@@ -14,11 +16,11 @@ import {
|
|
|
14
16
|
getAutoclaimedIncentives,
|
|
15
17
|
getAutoclaimedIncentivesTxHash,
|
|
16
18
|
getBgtAprSimulation,
|
|
17
|
-
getBgtIncentiveDistributorPaused,
|
|
18
19
|
getBlockTimestamp,
|
|
19
20
|
getChartData,
|
|
20
21
|
getCollateralWeights,
|
|
21
22
|
getConvertToAssets,
|
|
23
|
+
getDefaultRewardAllocation,
|
|
22
24
|
getEarnedStakedBeraVault,
|
|
23
25
|
getGlobalCapLimit,
|
|
24
26
|
getGlobalData,
|
|
@@ -35,7 +37,6 @@ import {
|
|
|
35
37
|
getPythLatestPrices,
|
|
36
38
|
getPythUpdateFee,
|
|
37
39
|
getRelativeCapLimit,
|
|
38
|
-
getRewardProofsByValidator,
|
|
39
40
|
getRewardTokenToBeraRate,
|
|
40
41
|
getRewardVault,
|
|
41
42
|
getRewardVaultEarnedRewards,
|
|
@@ -46,7 +47,7 @@ import {
|
|
|
46
47
|
getSWBeraVaultMetadata,
|
|
47
48
|
getSWBeraWithdrawal,
|
|
48
49
|
getStakeWithdrawalCooldown,
|
|
49
|
-
|
|
50
|
+
getStakedBeraAPY,
|
|
50
51
|
getStakedBeraSnapshots,
|
|
51
52
|
getStakingPoolBatch,
|
|
52
53
|
getSwapPayload,
|
|
@@ -54,12 +55,13 @@ import {
|
|
|
54
55
|
getTokenInformation,
|
|
55
56
|
getTotalStakedAmount,
|
|
56
57
|
getUserActiveValidators,
|
|
58
|
+
getUserActiveValidatorsApi,
|
|
59
|
+
getUserActiveValidatorsOnChain,
|
|
60
|
+
getUserBoosts,
|
|
57
61
|
getUserBoostsOnValidator,
|
|
58
|
-
getUserClaimableIncentives,
|
|
59
62
|
getUserStakingPositions,
|
|
60
63
|
getUserVaultInfo,
|
|
61
64
|
getUserVaults,
|
|
62
|
-
getValidatorAnalytics,
|
|
63
65
|
getValidatorCommission,
|
|
64
66
|
getValidatorEstimatedBgtPerYear,
|
|
65
67
|
getValidatorOperatorAddress,
|
|
@@ -71,31 +73,34 @@ import {
|
|
|
71
73
|
getVaultValidators,
|
|
72
74
|
isBadCollateralAsset,
|
|
73
75
|
isBasketModeEnabled,
|
|
76
|
+
isDefaultRewardAllocation,
|
|
74
77
|
isImpersonateAccount,
|
|
75
|
-
isSameRewardAllocation
|
|
76
|
-
|
|
78
|
+
isSameRewardAllocation,
|
|
79
|
+
mergeUserActiveValidators
|
|
80
|
+
} from "../chunk-KY7JMIIS.mjs";
|
|
77
81
|
import {
|
|
78
82
|
BeraApolloClient,
|
|
79
83
|
getApolloClient,
|
|
80
84
|
gql
|
|
81
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-5MUCX35C.mjs";
|
|
82
86
|
import {
|
|
83
87
|
fetchBeep
|
|
84
|
-
} from "../chunk-
|
|
88
|
+
} from "../chunk-GDUKRUHE.mjs";
|
|
85
89
|
import "../chunk-GWSTVITN.mjs";
|
|
86
90
|
import {
|
|
87
91
|
getBalanceCall,
|
|
88
92
|
getEnsoClient,
|
|
89
93
|
getWalletBalances
|
|
90
|
-
} from "../chunk-
|
|
94
|
+
} from "../chunk-ZHV3MQ4F.mjs";
|
|
91
95
|
import "../chunk-ZCEFC2TK.mjs";
|
|
92
|
-
import "../chunk-
|
|
93
|
-
import "../chunk-
|
|
96
|
+
import "../chunk-XO2BFPTB.mjs";
|
|
97
|
+
import "../chunk-M3MIGSH3.mjs";
|
|
98
|
+
import "../chunk-FWRYUIJK.mjs";
|
|
94
99
|
import {
|
|
95
100
|
assertAddress,
|
|
96
101
|
assertDefined,
|
|
97
102
|
assertPublicClient
|
|
98
|
-
} from "../chunk-
|
|
103
|
+
} from "../chunk-TXWDUJOY.mjs";
|
|
99
104
|
import {
|
|
100
105
|
bignumber_js_default,
|
|
101
106
|
hoursInSeconds,
|
|
@@ -103,18 +108,18 @@ import {
|
|
|
103
108
|
} from "../chunk-35RACQD4.mjs";
|
|
104
109
|
import {
|
|
105
110
|
beraFetchJson
|
|
106
|
-
} from "../chunk-
|
|
111
|
+
} from "../chunk-4576RF2K.mjs";
|
|
107
112
|
import {
|
|
108
113
|
isToken
|
|
109
|
-
} from "../chunk-
|
|
114
|
+
} from "../chunk-HPRLNT6R.mjs";
|
|
110
115
|
import {
|
|
111
116
|
parseBaseArgs
|
|
112
|
-
} from "../chunk-
|
|
117
|
+
} from "../chunk-SC3BSCTN.mjs";
|
|
113
118
|
import "../chunk-BMNEN4OK.mjs";
|
|
114
|
-
import "../chunk-
|
|
119
|
+
import "../chunk-LL7XR2H5.mjs";
|
|
115
120
|
import {
|
|
116
121
|
BeraError
|
|
117
|
-
} from "../chunk-
|
|
122
|
+
} from "../chunk-MVNQY2D4.mjs";
|
|
118
123
|
|
|
119
124
|
// src/actions/bend/getMaxDeposit.ts
|
|
120
125
|
import { formatEther } from "viem";
|
|
@@ -297,21 +302,9 @@ async function getHoneyTxns({
|
|
|
297
302
|
}
|
|
298
303
|
|
|
299
304
|
// src/actions/pol/getBeraTokenTotalSupply.ts
|
|
300
|
-
import { ChainId } from "@berachain/config";
|
|
301
305
|
async function getBeraTokenTotalSupply(args = {}) {
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
const supplyMonitor = config.pol.supplyMonitor;
|
|
305
|
-
const baseUrl = typeof supplyMonitor === "string" ? supplyMonitor : supplyMonitor.uri;
|
|
306
|
-
const data = await beraFetchJson(
|
|
307
|
-
{
|
|
308
|
-
url: `${baseUrl}/api/stats/bera?network=${network}`,
|
|
309
|
-
name: typeof supplyMonitor === "string" ? "supply-monitor-bera" : supplyMonitor.name,
|
|
310
|
-
type: "rest"
|
|
311
|
-
},
|
|
312
|
-
{ cache: "no-store" }
|
|
313
|
-
);
|
|
314
|
-
return data.totalSupply.toString();
|
|
306
|
+
const res = await fetchBeep("/v0/stats/bera", {}, args);
|
|
307
|
+
return res.totalSupply;
|
|
315
308
|
}
|
|
316
309
|
|
|
317
310
|
// src/actions/pol/getBlockTime.ts
|
|
@@ -364,10 +357,6 @@ async function getLSTStakeConfig({
|
|
|
364
357
|
...args
|
|
365
358
|
}) {
|
|
366
359
|
assertPublicClient(publicClient);
|
|
367
|
-
const { config } = parseBaseArgs({
|
|
368
|
-
...args,
|
|
369
|
-
chainId: publicClient.chain?.id ?? args.chainId
|
|
370
|
-
});
|
|
371
360
|
const lstStakingTokens = tokenList.filter(
|
|
372
361
|
(token) => lstStakingVaults.includes(token.address)
|
|
373
362
|
);
|
|
@@ -687,28 +676,6 @@ async function getActiveBoostAndCommissionChangeDelay({
|
|
|
687
676
|
};
|
|
688
677
|
}
|
|
689
678
|
|
|
690
|
-
// src/actions/validators/getDefaultRewardAllocation.ts
|
|
691
|
-
import { beraChefAbi as beraChefAbi2 } from "@berachain/abis/pol/rewards/beraChef";
|
|
692
|
-
function isDefaultRewardAllocation(rewardAllocation) {
|
|
693
|
-
return rewardAllocation.start.blockNumber === 0;
|
|
694
|
-
}
|
|
695
|
-
async function getDefaultRewardAllocation({
|
|
696
|
-
client,
|
|
697
|
-
...args
|
|
698
|
-
}) {
|
|
699
|
-
const { config } = parseBaseArgs(args);
|
|
700
|
-
const rawDefaultRewardAllocation = await client.readContract({
|
|
701
|
-
address: config.pol.beraChef,
|
|
702
|
-
abi: beraChefAbi2,
|
|
703
|
-
functionName: "getDefaultRewardAllocation",
|
|
704
|
-
args: []
|
|
705
|
-
});
|
|
706
|
-
return formatValidatorRewardAllocation(
|
|
707
|
-
{ ...rawDefaultRewardAllocation, startBlock: 0n },
|
|
708
|
-
0
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
|
|
712
679
|
// src/actions/validators/utils/aggregateValidatorIncentives.ts
|
|
713
680
|
function aggregateValidatorIncentives({
|
|
714
681
|
rewardAllocationWeights,
|
|
@@ -782,8 +749,10 @@ export {
|
|
|
782
749
|
BeraApolloClient,
|
|
783
750
|
HoneyPreviewMethod,
|
|
784
751
|
RewardVaultDistributionMode,
|
|
752
|
+
StakeSnapshotRange,
|
|
785
753
|
aggregateValidatorIncentives,
|
|
786
754
|
beraWriteContract,
|
|
755
|
+
ensoErc4626,
|
|
787
756
|
formatValidatorRewardAllocation,
|
|
788
757
|
getActiveBoostAndCommissionChangeDelay,
|
|
789
758
|
getAllPools,
|
|
@@ -798,7 +767,6 @@ export {
|
|
|
798
767
|
getBalanceCall,
|
|
799
768
|
getBeraTokenTotalSupply,
|
|
800
769
|
getBgtAprSimulation,
|
|
801
|
-
getBgtIncentiveDistributorPaused,
|
|
802
770
|
getBlockTime,
|
|
803
771
|
getBlockTimestamp,
|
|
804
772
|
getChartData,
|
|
@@ -832,7 +800,6 @@ export {
|
|
|
832
800
|
getPythLatestPrices,
|
|
833
801
|
getPythUpdateFee,
|
|
834
802
|
getRelativeCapLimit,
|
|
835
|
-
getRewardProofsByValidator,
|
|
836
803
|
getRewardTokenToBeraRate,
|
|
837
804
|
getRewardVault,
|
|
838
805
|
getRewardVaultDurationConstants,
|
|
@@ -845,7 +812,7 @@ export {
|
|
|
845
812
|
getSWBeraVaultMetadata,
|
|
846
813
|
getSWBeraWithdrawal,
|
|
847
814
|
getStakeWithdrawalCooldown,
|
|
848
|
-
|
|
815
|
+
getStakedBeraAPY,
|
|
849
816
|
getStakedBeraSnapshots,
|
|
850
817
|
getStakingPoolBatch,
|
|
851
818
|
getSwapPayload,
|
|
@@ -854,12 +821,13 @@ export {
|
|
|
854
821
|
getTokens,
|
|
855
822
|
getTotalStakedAmount,
|
|
856
823
|
getUserActiveValidators,
|
|
824
|
+
getUserActiveValidatorsApi,
|
|
825
|
+
getUserActiveValidatorsOnChain,
|
|
826
|
+
getUserBoosts,
|
|
857
827
|
getUserBoostsOnValidator,
|
|
858
|
-
getUserClaimableIncentives,
|
|
859
828
|
getUserStakingPositions,
|
|
860
829
|
getUserVaultInfo,
|
|
861
830
|
getUserVaults,
|
|
862
|
-
getValidatorAnalytics,
|
|
863
831
|
getValidatorBoostApy,
|
|
864
832
|
getValidatorCommission,
|
|
865
833
|
getValidatorEstimatedBgtPerYear,
|
|
@@ -878,6 +846,7 @@ export {
|
|
|
878
846
|
isBasketModeEnabled,
|
|
879
847
|
isDefaultRewardAllocation,
|
|
880
848
|
isImpersonateAccount,
|
|
881
|
-
isSameRewardAllocation
|
|
849
|
+
isSameRewardAllocation,
|
|
850
|
+
mergeUserActiveValidators
|
|
882
851
|
};
|
|
883
852
|
//# sourceMappingURL=exports.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/actions/bend/getMaxDeposit.ts","../../src/actions/dex/getPoolWithState.ts","../../src/actions/dex/getVaultPausedState.ts","../../src/actions/honey/getHoneyFees.ts","../../src/actions/honey/getHoneyPausedState.ts","../../src/actions/honey/getHoneyPythPriceOracle.ts","../../src/actions/honey/getHoneyRootPriceOracle.ts","../../src/actions/honey/getHoneyTxns.ts","../../src/actions/pol/getBeraTokenTotalSupply.ts","../../src/actions/pol/getBlockTime.ts","../../src/actions/pol/getHeroEarnVaults.ts","../../src/actions/pol/getLSTStakeConfig.ts","../../src/actions/pol/getRewardVaultDurationConstants.ts","../../src/actions/pol/getRewardVaultBeaconImplementation.ts","../../src/abi/utils/upgradableBeacon.ts","../../src/actions/pol/getRewardVaultFromToken.ts","../../src/actions/pyth/getHoneyPythFeeds.ts","../../src/actions/tokens/getTokens.ts","../../src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts","../../src/actions/validators/getDefaultRewardAllocation.ts","../../src/actions/validators/utils/aggregateValidatorIncentives.ts","../../src/actions/validators/utils/getValidatorBoostApy.ts"],"sourcesContent":["import { type Address, formatEther, type PublicClient } from \"viem\";\n\nimport { metaMorphoV11Abi as metaMorphoAbi } from \"@berachain/abis/bend-metamorpho/metaMorphoV11\";\n\ninterface GetMaxDepositProps {\n vaultAddress: Address;\n publicClient: PublicClient;\n}\n\nexport interface MaxDeposit {\n /** `maxDeposit` formatted as an ether-denominated decimal string. */\n formatted: string;\n /**\n * True when the vault has no real deposit cap. MetaMorpho's `maxDeposit` sums\n * each enabled market's remaining capacity (its supply cap minus current\n * supply); an uncapped market stores `type(uint184).max` as its cap, so the\n * sum lands at ~uint184.max (≈2.45e55) — not uint256.max. `formatted` turns\n * that into an astronomical number, so callers must key off this flag, not\n * the formatted value, to detect \"unlimited\".\n *\n * A genuine cap is many orders of magnitude smaller (e.g. Re7 HONEY's ~92M =\n * ~9.2e25), so the uint184-based threshold cleanly separates the two. The sum\n * can exceed uint184.max when several markets are uncapped, so we compare with\n * `>=` rather than testing for the exact sentinel.\n */\n isUncapped: boolean;\n}\n\nconst UINT_184_MAX = (1n << 184n) - 1n;\n// 1% below uint184.max — any maxDeposit at/above this is effectively unlimited.\nconst UNCAPPED_THRESHOLD = (UINT_184_MAX * 99n) / 100n;\n\nexport async function getMaxDeposit({\n vaultAddress,\n publicClient,\n}: GetMaxDepositProps): Promise<MaxDeposit> {\n const maxDeposit = await publicClient.readContract({\n address: vaultAddress,\n abi: metaMorphoAbi,\n functionName: \"maxDeposit\",\n args: [vaultAddress],\n });\n return {\n formatted: formatEther(maxDeposit),\n isUncapped: maxDeposit >= UNCAPPED_THRESHOLD,\n };\n}\n","import {\n type MinimalToken,\n mapPoolType,\n type PoolState,\n} from \"@berachain-foundation/berancer-sdk\";\nimport type { Address } from \"viem\";\n\nimport type { MinimalPoolFragment } from \"@berachain/graphql/dex/api\";\n\nexport function getPoolState(apiPool: MinimalPoolFragment): PoolState {\n return {\n type: mapPoolType(apiPool.type),\n protocolVersion: apiPool.protocolVersion as 1 | 2 | 3,\n tokens: apiPool.tokens.map<MinimalToken>(\n (pt) =>\n ({\n ...pt,\n address: pt.address as Address,\n }) satisfies MinimalToken,\n ),\n id: apiPool.id as Address,\n address: apiPool.address as Address,\n } satisfies PoolState;\n}\n","import type { PublicClient } from \"viem\";\n\nimport { vaultAbi as balancerVaultAbi } from \"@berachain/abis/bex/vault\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport async function getVaultPausedState({\n publicClient,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n}) {\n const { config } = parseBaseArgs(args);\n\n const vaultPausedState = await publicClient.readContract({\n address: config.bex.vault,\n abi: balancerVaultAbi,\n functionName: \"getPausedState\",\n });\n\n return vaultPausedState[0];\n}\n","import { type Address, formatUnits, type PublicClient } from \"viem\";\n\nimport { honeyFactoryAbi } from \"@berachain/abis/honey/honeyFactory\";\n\nimport type { Token } from \"@berachain/graphql/pol/api\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport interface CollateralRates {\n mintFee: number;\n redeemFee: number;\n}\n\nexport interface HoneyFeeMap {\n single: Record<Address, CollateralRates>;\n basket: CollateralRates;\n}\n\nexport interface CollateralRatesArgs extends BeraJS.BaseFunctionArgs {\n client: PublicClient;\n collateralList: Token[];\n}\n\n/**\n * Fetches the mint and redeem rates for all collateral tokens and calculates the weighted basket rates\n * @param {Object} params - The parameters object\n * @param {PublicClient} params.client - The Viem public client instance\n * @param {Address[]} params.collateralList - Array of collateral token addresses\n * @returns {Promise<HoneyFeeMap | undefined>} Object containing individual collateral rates and weighted basket rates,\n * or undefined if the operation fails\n */\nexport async function getHoneyFees({\n client,\n collateralList,\n ...args\n}: CollateralRatesArgs): Promise<HoneyFeeMap> {\n const { config } = parseBaseArgs(args);\n\n try {\n // create a list for all the promises needed, fetch the mint and redeem rates for each collateral token\n const promiseList: Record<\"mint\" | \"redeem\", Promise<bigint>[]> = {\n mint: [],\n redeem: [],\n };\n for (const coll of collateralList) {\n promiseList.mint.push(\n client.readContract({\n address: config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"mintRates\",\n args: [coll.address as Address],\n }),\n );\n promiseList.redeem.push(\n client.readContract({\n address: config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"redeemRates\",\n args: [coll.address as Address],\n }),\n );\n }\n const [mintRates, redeemRates, collateralWeights] = await Promise.all([\n Promise.all(promiseList.mint),\n Promise.all(promiseList.redeem),\n // fetch the collateral weights, needed to calculate the weighted basket rates\n client.readContract({\n address: config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"getWeights\",\n }),\n ]);\n\n // calculate the weighted basket rates and the single collateral rates\n\n return collateralList.reduce<HoneyFeeMap>(\n (acc, coll) => {\n const collIdx = collateralList.indexOf(coll);\n acc.single[coll.address as Address] = {\n mintFee: 1 - +formatUnits(mintRates[collIdx], 18),\n redeemFee: 1 - +formatUnits(redeemRates[collIdx], 18),\n };\n acc.basket.mintFee +=\n acc.single[coll.address as Address].mintFee *\n +formatUnits(collateralWeights[collIdx], 18);\n\n acc.basket.redeemFee +=\n acc.single[coll.address as Address].redeemFee *\n +formatUnits(collateralWeights[collIdx], 18);\n return acc;\n },\n {\n single: {},\n basket: { mintFee: 0, redeemFee: 0 },\n },\n );\n } catch (e) {\n console.log(e);\n throw e;\n }\n}\n","import type { PublicClient } from \"viem\";\n\nimport { honeyAbi } from \"@berachain/abis/honey/honey\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Gets the pause state of the Honey protocol\n * @returns boolean\n */\nexport async function getHoneyPausedState({\n client,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n client: PublicClient;\n}) {\n const { config } = parseBaseArgs(args);\n const honeyAddress = config.honey.token;\n const honeyPausedState = await client.readContract({\n address: honeyAddress,\n abi: honeyAbi,\n functionName: \"paused\",\n });\n\n return honeyPausedState;\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { rootPriceOracleAbi as honeyRootOracleAbi } from \"@berachain/abis/extras/rootPriceOracle\";\n\n/**\n * Gets the address of the Honey Pyth Oracle, which is called by the Honey Root Price Oracle to get the price of the collaterals\n * @returns\n */\nexport async function getHoneyPythOracle({\n pythOracle,\n publicClient,\n}: {\n publicClient: PublicClient;\n pythOracle: Address;\n}) {\n return publicClient.readContract({\n address: pythOracle,\n abi: honeyRootOracleAbi,\n functionName: \"pythOracle\",\n });\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { honeyFactoryAbi } from \"@berachain/abis/honey/honeyFactory\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Gets the address of the Honey Root Price Oracle, which keeps the logic to price the collaterals\n */\nexport async function getHoneyRootPriceOracle({\n publicClient,\n factory,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n factory?: Address;\n}): Promise<Address> {\n const { config } = parseBaseArgs(args);\n return publicClient.readContract({\n address: factory ?? config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"priceOracle\",\n });\n}\n","import type { HoneyTransactionsLatestResponse } from \"@berachain/graphql/beep\";\n\nimport { BeraError } from \"../../errors/BeraError\";\nimport { fetchBeep } from \"../clients/fetchBeep\";\n\ntype HoneyTxn = HoneyTransactionsLatestResponse[number];\n/** beep's transaction type discriminator (`\"MINT\" | \"REDEEM\"`). */\ntype HoneyTxnType = HoneyTxn[\"type\"];\n\ninterface GetHoneyTxnsArgs {\n /** Zero-based page index (the page size is applied internally). */\n index: number;\n /** Page size. */\n limit: number;\n /** Optional MINT/REDEEM filter; omit for all transactions. */\n txnType?: HoneyTxnType;\n}\n\n/**\n * Browser-only. Returns a page of honey transactions in the `beep` response\n * shape (`HoneyTransactionsLatestResponse`) the transactions table consumes.\n *\n * Reads from the `beep` backend (`fetchBeep`).\n */\nexport async function getHoneyTxns({\n index,\n limit,\n txnType,\n}: GetHoneyTxnsArgs): Promise<HoneyTransactionsLatestResponse> {\n if (typeof window === \"undefined\") {\n throw new BeraError({\n message:\n \"getHoneyTxns is browser-only; call from a Client Component / SWR hook\",\n level: \"error\",\n });\n }\n\n // beep backend (next-gen), typed against `@berachain/graphql/beep`. Queried\n // directly from the browser — no Vercel proxy. beep's `page` is 1-indexed and\n // filters server-side by `type`; `fetchOpenApi` omits `type` when `txnType`\n // is undefined (the \"all\" tab), so each tab paginates its own filtered feed.\n return fetchBeep(\"/v0/honey/transactions/latest\", {\n query: { page: String(index + 1), perPage: String(limit), type: txnType },\n });\n}\n","import { ChainId } from \"@berachain/config\";\n\nimport { beraFetchJson } from \"../../utils/beraFetch\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\ninterface SupplyMonitorBeraStatsResponse {\n /** Total BERA supply, in whole BERA units. */\n totalSupply: number;\n /** Circulating BERA supply, in whole BERA units. */\n circulatingSupply: number;\n}\n\nexport type GetBeraTokenTotalSupplyArgs = BeraJS.BaseFunctionArgs;\n\n/**\n * Fetches the native BERA total supply (in whole BERA units) from the\n * Berachain supply-monitor service.\n */\nexport async function getBeraTokenTotalSupply(\n args: GetBeraTokenTotalSupplyArgs = {},\n): Promise<string> {\n const { config } = parseBaseArgs(args);\n // supply-monitor only exposes BERA stats for mainnet/bepolia; returns 0 on other chains.\n const network = config.chainId === ChainId.MAINNET ? \"mainnet\" : \"bepolia\";\n\n // `supplyMonitor` is typed as `HttpLink` (string | { uri, name, ... }).\n // Both forms are accepted; pick the URL out of whichever shape was used.\n const supplyMonitor = config.pol.supplyMonitor;\n const baseUrl =\n typeof supplyMonitor === \"string\" ? supplyMonitor : supplyMonitor.uri;\n\n const data = await beraFetchJson<SupplyMonitorBeraStatsResponse>(\n {\n url: `${baseUrl}/api/stats/bera?network=${network}`,\n name:\n typeof supplyMonitor === \"string\"\n ? \"supply-monitor-bera\"\n : supplyMonitor.name,\n type: \"rest\",\n },\n { cache: \"no-store\" },\n );\n\n return data.totalSupply.toString();\n}\n","import type { PublicClient } from \"viem\";\n\nimport { assertPublicClient } from \"../../errors/assert\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\nimport { hoursInSeconds, msToSeconds } from \"../../utils/time\";\n\nexport async function getBlockTime({\n defaultBlockTime,\n publicClient,\n blocksSpan,\n ...args\n}: {\n defaultBlockTime?: number;\n blocksSpan?: number;\n publicClient: PublicClient | undefined;\n} & BeraJS.BaseFunctionArgs): Promise<number> {\n assertPublicClient(publicClient);\n\n const { config } = parseBaseArgs(args);\n\n const blockTime = defaultBlockTime ?? config.averageBlockTime;\n const span = blocksSpan ?? Math.floor(hoursInSeconds(1) / blockTime);\n\n const currentBlock = await publicClient?.getBlock({ blockTag: \"latest\" });\n const oldestBlock = await publicClient?.getBlock({\n blockNumber: currentBlock.number - BigInt(span),\n });\n\n return (\n // we need to use current timestamp as the latest block might not have been minted (chain halted)\n (msToSeconds(Date.now()) - Number(oldestBlock?.timestamp)) /\n (Number(currentBlock?.number) - Number(oldestBlock?.number))\n );\n}\n","import {\n type ApiVaultFragment,\n GetHeroEarnVaults,\n type GetHeroEarnVaultsQuery,\n type GetHeroEarnVaultsQueryVariables,\n} from \"@berachain/graphql/pol/api\";\n\nimport { getApolloClient } from \"../clients/getApolloClient\";\n\nexport interface HeroEarnVaults {\n /**\n * Top-APR PoL reward vaults, ordered by APR descending. Callers typically\n * read `[0]` for the \"Earn with PoL\" hero subtitle. `bestAprExcludedAddresses`\n * lets callers filter out non-incentivized earn actions whose APR figures\n * would otherwise dominate the listing and mislead users.\n */\n bestApr: ApiVaultFragment[];\n /**\n * Highest-APR PoL reward vault among vaults whose protocol is \"bend\".\n * Its `stakingToken.address` is a Bend vault share token — match it back\n * against `bendVaults` to combine the PoL reward APR with the underlying\n * Bend native supply APY.\n */\n bendRewardVault: ApiVaultFragment[];\n /**\n * Minimal Bend native vault data (address + `totalApy`) used to look up the\n * underlying Bend supply APY for whichever Bend vault `bendRewardVault`\n * resolves to.\n */\n bendVaults: GetHeroEarnVaultsQuery[\"bendVaults\"];\n}\n\n/**\n * Batched fetch for the hub home page hero cards. Issues a single GraphQL\n * request to the BEX API that returns:\n * - the top-APR PoL reward vaults (for the \"Earn with PoL\" card)\n * - the highest-APR Bend-protocol PoL reward vault (for the \"Lend\" card)\n * - minimal Bend native vault data, so callers can add the Bend supply APY\n * on top of the PoL reward APR when displaying the combined Lend APY\n */\nexport async function getHeroEarnVaults({\n bestAprExcludedAddresses = [],\n ...args\n}: {\n bestAprExcludedAddresses?: string[];\n} & BeraJS.BaseFunctionArgs = {}): Promise<HeroEarnVaults> {\n const bexApiGraphqlClient = getApolloClient(\"api\", args);\n\n const res = await bexApiGraphqlClient.query<\n GetHeroEarnVaultsQuery,\n GetHeroEarnVaultsQueryVariables\n >({\n query: GetHeroEarnVaults,\n variables: { bestAprExcludedAddresses },\n });\n\n return {\n bestApr: res.data.bestApr.vaults,\n bendRewardVault: res.data.bendRewardVault.vaults,\n bendVaults: res.data.bendVaults,\n };\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { lstStakerVaultAbi } from \"@berachain/abis/pol/lst/lstStakerVault\";\n\nimport { assertPublicClient } from \"../../errors/assert\";\nimport type { TokenWithMetadata } from \"../../types/dex\";\nimport type { StakingConfig } from \"../../types/staking\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\nimport { isToken } from \"../../utils/tokens\";\n\nexport type GetLSTStakeConfigArgs = {\n tokenList: TokenWithMetadata[];\n publicClient?: PublicClient;\n lstStakingVaults: Address[];\n} & BeraJS.BaseFunctionArgs;\n\n/**\n * Builds staking configs from on-chain LST vaults and optional native configs.\n */\nexport async function getLSTStakeConfig({\n tokenList,\n publicClient,\n lstStakingVaults,\n ...args\n}: GetLSTStakeConfigArgs): Promise<StakingConfig[]> {\n assertPublicClient(publicClient);\n\n const { config } = parseBaseArgs({\n ...args,\n chainId: publicClient.chain?.id ?? args.chainId,\n });\n\n const lstStakingTokens = tokenList.filter((token) =>\n lstStakingVaults.includes(token.address),\n );\n\n if (lstStakingTokens.length === 0) {\n return [];\n }\n\n const assets = await Promise.all(\n lstStakingTokens.map(async (stakingToken) => {\n // read the asset token address from the lst staking vault\n const assetTokenAddress = await publicClient.readContract({\n address: stakingToken.address,\n abi: lstStakerVaultAbi,\n functionName: \"asset\",\n });\n return { assetTokenAddress, stakingToken };\n }),\n );\n\n return assets.reduce<StakingConfig[]>(\n (acc, { assetTokenAddress, stakingToken }) => {\n const assetToken = tokenList.find((token) =>\n isToken(token, assetTokenAddress),\n );\n if (!assetToken) return acc;\n acc.push({\n id: stakingToken.address,\n receiptToken: stakingToken,\n inputTokens: [assetToken],\n });\n return acc;\n },\n [],\n );\n}\n","import type { PublicClient } from \"viem\";\n\nimport { rewardVaultAbi } from \"@berachain/abis/pol/rewards/rewardVault\";\n\nimport { assertPublicClient } from \"../../errors/assert\";\nimport { getRewardVaultBeaconImplementation } from \"./getRewardVaultBeaconImplementation\";\n\nexport interface RewardVaultDurationConstants {\n minRewardDuration: number;\n maxRewardDuration: number;\n}\n\n/**\n * Returns the minimum and maximum reward duration constants for all reward vaults.\n */\nexport async function getRewardVaultDurationConstants({\n publicClient,\n ...baseArgs\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n}): Promise<RewardVaultDurationConstants> {\n assertPublicClient(publicClient);\n\n const beaconImplementation = await getRewardVaultBeaconImplementation({\n publicClient,\n ...baseArgs,\n });\n\n const [minRewardDuration, maxRewardDuration] = await Promise.all([\n publicClient.readContract({\n address: beaconImplementation,\n abi: rewardVaultAbi,\n functionName: \"MIN_REWARD_DURATION\",\n }),\n publicClient.readContract({\n address: beaconImplementation,\n abi: rewardVaultAbi,\n functionName: \"MAX_REWARD_DURATION\",\n }),\n ]);\n\n return {\n minRewardDuration: Number(minRewardDuration),\n maxRewardDuration: Number(maxRewardDuration),\n };\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { rewardVaultFactoryAbi } from \"@berachain/abis/pol/rewards/rewardVaultFactory\";\n\nimport { upgradableBeaconAbi } from \"../../abi/utils/upgradableBeacon\";\nimport { assertAddress, assertDefined } from \"../../errors/assert\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Returns the beacon implementation address for all reward vaults.\n */\nexport async function getRewardVaultBeaconImplementation({\n publicClient,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n}): Promise<Address> {\n const { config } = parseBaseArgs(args);\n const factoryAddress = config.pol.factory;\n assertDefined(publicClient, \"publicClient\");\n assertAddress(config.pol.factory, \"factoryAddress\");\n\n // from the factory contract, we get the beacon address\n const beacon = await publicClient.readContract({\n address: factoryAddress,\n abi: rewardVaultFactoryAbi,\n functionName: \"beacon\",\n });\n\n // from the beacon contract, we get the current implementation address\n return publicClient.readContract({\n address: beacon,\n abi: upgradableBeaconAbi,\n functionName: \"implementation\",\n });\n}\n","export const upgradableBeaconAbi = [\n {\n inputs: [\n { internalType: \"address\", name: \"initialOwner\", type: \"address\" },\n {\n internalType: \"address\",\n name: \"initialImplementation\",\n type: \"address\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n { inputs: [], name: \"NewImplementationHasNoCode\", type: \"error\" },\n { inputs: [], name: \"NewOwnerIsZeroAddress\", type: \"error\" },\n { inputs: [], name: \"Unauthorized\", type: \"error\" },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [{ internalType: \"address\", name: \"result\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [{ internalType: \"address\", name: \"result\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"newOwner\", type: \"address\" }],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"newImplementation\", type: \"address\" },\n ],\n name: \"upgradeTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n","import { type Address, type PublicClient, zeroAddress } from \"viem\";\n\nimport { rewardVaultFactoryAbi } from \"@berachain/abis/pol/rewards/rewardVaultFactory\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport async function getRewardVaultFromToken({\n tokenAddress,\n publicClient,\n factoryAddress,\n ...args\n}: {\n tokenAddress: Address;\n publicClient: PublicClient;\n factoryAddress?: Address;\n} & BeraJS.BaseFunctionArgs) {\n const { config } = parseBaseArgs(args);\n\n const vaultAddress = await publicClient.readContract({\n address: factoryAddress ?? config.pol.factory,\n abi: rewardVaultFactoryAbi,\n functionName: \"getVault\",\n args: [tokenAddress],\n });\n\n if (vaultAddress === zeroAddress) {\n return null;\n }\n\n return vaultAddress;\n}\n","import type { PublicClient } from \"viem\";\n\nimport type { Address } from \"@berachain/config\";\n\nimport { pythPriceOracleAbi } from \"@berachain/abis/extras/pythPriceOracle\";\n\nimport type { PythPriceFeedMap } from \"../../types/honeySwap\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Given a list of tokens, it will return the price feed ids for each token according to honey priceOracle\n * @returns\n */\nexport async function getHoneyPythFeeds({\n tokenList,\n publicClient,\n ...args\n}: {\n tokenList: readonly Address[];\n publicClient: PublicClient;\n} & BeraJS.BaseFunctionArgs): Promise<PythPriceFeedMap> {\n const { config } = parseBaseArgs(args);\n\n try {\n const priceFeedIds = await Promise.all(\n tokenList.map((token) =>\n publicClient.readContract({\n address: config.honey.pythOracle,\n abi: pythPriceOracleAbi,\n functionName: \"feeds\",\n args: [token],\n }),\n ),\n );\n\n return tokenList.reduce<PythPriceFeedMap>(\n (acc, token, index) => ({\n ...acc,\n [token]: priceFeedIds[index],\n }),\n {},\n );\n } catch (e) {\n console.error(\"getPythPriceFeedId\", e);\n throw e;\n }\n}\n","import type { TokenWithMetadata } from \"../../types/dex\";\nimport { beraFetchJson } from \"../../utils/beraFetch\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport async function getTokens({\n url,\n ...args\n}: BeraJS.BaseFunctionArgs & { url?: string } = {}): Promise<\n TokenWithMetadata[]\n> {\n const { config } = parseBaseArgs(args);\n const tokenList = await beraFetchJson<{ tokens: TokenWithMetadata[] }>({\n url: url ?? config.lists.tokenList,\n type: \"rest\",\n name: \"GitHub\",\n });\n\n return tokenList.tokens ?? [];\n}\n","import type { PublicClient } from \"viem\";\n\nimport type { EdgeConfigSchema } from \"@berachain/config/internal/edge-config\";\n\nimport { bgtAbi } from \"@berachain/abis/pol/bgt\";\nimport { beraChefAbi } from \"@berachain/abis/pol/rewards/beraChef\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport interface ActiveBoostAndCommissionChangeDelay {\n boostDelay: number;\n unboostDelay: number;\n commissionChangeDelay: number;\n rewardAllocationBlockDelay: number;\n maxWeightPerVault: number;\n maxNumWeightsPerRewardAllocation: number;\n /**\n * Percentage of the validator's commission rate that can be changed at once.\n *\n * @example 1 => 100%\n */\n maxCommissionRate: number;\n /**\n * The number of blocks after which a reward allocation is considered stale and will fallback\n * to baseline reward allocation.\n *\n */\n rewardAllocationInactivityBlockSpan: number;\n /**\n * The number of hours in advance to warn the operator that the reward allocation is expiring.\n */\n ui: EdgeConfigSchema[\"pol\"][\"automatedRewardAllocation\"];\n}\n\nexport async function getActiveBoostAndCommissionChangeDelay({\n publicClient,\n ui,\n ...args\n}: BeraJS.BaseFunctionArgs &\n Pick<ActiveBoostAndCommissionChangeDelay, \"ui\"> & {\n publicClient: PublicClient;\n }): Promise<ActiveBoostAndCommissionChangeDelay> {\n const { config } = parseBaseArgs(args);\n\n const [\n maxCommissionRate,\n commissionChangeDelay,\n rewardAllocationBlockDelay,\n maxWeightPerVault,\n maxNumWeightsPerRewardAllocation,\n dropBoostDelay,\n activateBoostDelay,\n rewardAllocationInactivityBlockSpan,\n ] = await Promise.all([\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"MAX_COMMISSION_RATE\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"commissionChangeDelay\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"rewardAllocationBlockDelay\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"maxWeightPerVault\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"maxNumWeightsPerRewardAllocation\",\n }),\n publicClient.readContract({\n address: config.tokens.bgt,\n abi: bgtAbi,\n functionName: \"dropBoostDelay\",\n }),\n publicClient.readContract({\n address: config.tokens.bgt,\n abi: bgtAbi,\n functionName: \"activateBoostDelay\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"rewardAllocationInactivityBlockSpan\",\n }),\n ]);\n\n return {\n maxCommissionRate: Number(maxCommissionRate) / 1e4,\n boostDelay: Number(activateBoostDelay),\n unboostDelay: Number(dropBoostDelay),\n commissionChangeDelay: Number(commissionChangeDelay),\n rewardAllocationBlockDelay: Number(rewardAllocationBlockDelay),\n maxWeightPerVault: Number(maxWeightPerVault) / 1e4,\n maxNumWeightsPerRewardAllocation: Number(maxNumWeightsPerRewardAllocation),\n rewardAllocationInactivityBlockSpan: Number(\n rewardAllocationInactivityBlockSpan,\n ),\n ui,\n };\n}\n","import type { PublicClient } from \"viem\";\n\nimport { beraChefAbi } from \"@berachain/abis/pol/rewards/beraChef\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\nimport {\n formatValidatorRewardAllocation,\n type ValidatorRewardAllocation,\n} from \"./getValidatorRewardAllocation\";\n\nexport function isDefaultRewardAllocation(\n rewardAllocation: ValidatorRewardAllocation,\n): boolean {\n return rewardAllocation.start.blockNumber === 0;\n}\n\nexport async function getDefaultRewardAllocation({\n client,\n ...args\n}: {\n client: PublicClient;\n}): Promise<ValidatorRewardAllocation> {\n const { config } = parseBaseArgs(args);\n\n const rawDefaultRewardAllocation = await client.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"getDefaultRewardAllocation\",\n args: [],\n });\n\n // Default reward allocation is active as soon as it's set by governance.\n // Since startBlock is not validated and might be anything set in the payload\n // (but it has no effect), we force it to 0 to avoid any confusion.\n // this might change if smart contract is updated to validate startBlock.\n return formatValidatorRewardAllocation(\n { ...rawDefaultRewardAllocation, startBlock: 0n },\n 0,\n );\n}\n","import type {\n ApiMinimalVaultIncentiveFragment,\n ApiValidatorRewardAllocationWeightFragment,\n} from \"@berachain/graphql/pol/api\";\nimport BigNumber from \"@berachain/utils/pkg/bignumber.js\";\n\nexport function aggregateValidatorIncentives({\n rewardAllocationWeights,\n activeOnly = true,\n}: {\n rewardAllocationWeights: ApiValidatorRewardAllocationWeightFragment[];\n activeOnly?: boolean;\n}): ApiMinimalVaultIncentiveFragment[] {\n const map = rewardAllocationWeights\n .filter((x) => x?.receivingVault)\n\n .reduce((acc, rv) => {\n for (const incentive of rv.receivingVault?.activeIncentives ?? []) {\n if (activeOnly && incentive.remainingAmount === \"0\") {\n continue;\n }\n const incentiveRate = new BigNumber(incentive.incentiveRate).times(\n rv.percentage,\n );\n\n const incentiveRateUsd = new BigNumber(\n incentive.incentiveRateUsd,\n ).times(rv.percentage);\n\n const token = incentive.token.address.toLowerCase();\n\n const existing = acc.get(token);\n if (existing) {\n acc.set(token, {\n ...existing,\n incentiveRate: new BigNumber(existing.incentiveRate)\n .plus(incentiveRate)\n .toString(),\n incentiveRateUsd: new BigNumber(existing.incentiveRateUsd)\n .plus(incentiveRateUsd)\n .toString(),\n remainingAmount: new BigNumber(existing.remainingAmount)\n .plus(incentive.remainingAmount)\n .toString(),\n remainingAmountUsd: new BigNumber(existing.remainingAmountUsd)\n .plus(incentive.remainingAmountUsd)\n .toString(),\n });\n } else {\n acc.set(token, {\n ...incentive,\n tokenAddress: incentive.token.address,\n token: incentive.token,\n incentiveRate: incentiveRate.toString(),\n incentiveRateUsd: incentiveRateUsd.toString(),\n remainingAmount: incentive.remainingAmount,\n });\n }\n }\n return acc;\n }, new Map<string, ApiMinimalVaultIncentiveFragment>());\n\n return Array.from(map.values());\n}\n","import type { ApiValidatorFragment } from \"@berachain/graphql/pol/api\";\n\nexport function getValidatorReturnPerBgt(\n validator: Pick<\n ApiValidatorFragment,\n \"dynamicData\" | \"rewardAllocationWeights\"\n >,\n): number {\n return validator?.rewardAllocationWeights?.reduce((acc, ab) => {\n if (!ab) return acc;\n\n const totalIncentiveValue =\n ab.receivingVault?.activeIncentives\n .filter((inc) => Number(inc.remainingAmount) > 0)\n .reduce((totalIncentiveValue, currIncentive) => {\n const tokenPrice =\n Number(currIncentive.remainingAmountUsd) /\n Number(currIncentive.remainingAmount);\n\n return (\n totalIncentiveValue +\n Number(currIncentive.incentiveRate) * tokenPrice\n );\n }, 0) ?? 0;\n\n return acc + totalIncentiveValue * ab.percentage;\n }, 0);\n}\n\nexport function getValidatorBoostApy({\n validator,\n bgtPrice,\n}: {\n validator: Pick<\n ApiValidatorFragment,\n \"dynamicData\" | \"rewardAllocationWeights\"\n >;\n bgtPrice: number;\n}): number {\n const validatorActiveBoostAmount = Number(\n validator.dynamicData?.activeBoostAmount ?? 0,\n );\n\n const returnPerBgt = getValidatorReturnPerBgt(validator);\n\n if (!returnPerBgt || !validatorActiveBoostAmount) {\n // As of now, a validator cannot send rewards to the vaults if it has no active boost amount\n // If baseRate changes on chain, we should update this function\n return 0;\n }\n\n const boostApy =\n (returnPerBgt *\n Number(validator.dynamicData?.lastDayDistributedRewards ?? 0) *\n 365) /\n (validatorActiveBoostAmount * bgtPrice);\n\n return boostApy;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAuB,mBAAsC;AAE7D,SAAS,oBAAoB,qBAAqB;AA0BlD,IAAM,gBAAgB,MAAM,QAAQ;AAEpC,IAAM,qBAAsB,eAAe,MAAO;AAElD,eAAsB,cAAc;AAAA,EAClC;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,aAAa,MAAM,aAAa,aAAa;AAAA,IACjD,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,YAAY;AAAA,EACrB,CAAC;AACD,SAAO;AAAA,IACL,WAAW,YAAY,UAAU;AAAA,IACjC,YAAY,cAAc;AAAA,EAC5B;AACF;;;AC9CA;AAAA,EAEE;AAAA,OAEK;AAKA,SAAS,aAAa,SAAyC;AACpE,SAAO;AAAA,IACL,MAAM,YAAY,QAAQ,IAAI;AAAA,IAC9B,iBAAiB,QAAQ;AAAA,IACzB,QAAQ,QAAQ,OAAO;AAAA,MACrB,CAAC,QACE;AAAA,QACC,GAAG;AAAA,QACH,SAAS,GAAG;AAAA,MACd;AAAA,IACJ;AAAA,IACA,IAAI,QAAQ;AAAA,IACZ,SAAS,QAAQ;AAAA,EACnB;AACF;;;ACrBA,SAAS,YAAY,wBAAwB;AAI7C,eAAsB,oBAAoB;AAAA,EACxC;AAAA,EACA,GAAG;AACL,GAEG;AACD,QAAM,EAA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,EACT,GAAG,oBAAI,IAA8C,CAAC;AAExD,SAAO,MAAM,KAAK,IAAI,OAAO,CAAC;AAChC;;;AC7DO,SAAS,yBACd,WAIQ;AACR,SAAO,WAAW,yBAAyB,OAAO,CAAC,KAAK,OAAO;AAC7D,QAAI,CAAC,GAAI,QAAO;AAEhB,UAAM,sBACJ,GAAG,gBAAgB,iBAChB,OAAO,CAAC,QAAQ,OAAO,IAAI,eAAe,IAAI,CAAC,EAC/C,OAAO,CAACC,sBAAqB,kBAAkB;AAC9C,YAAM,aACJ,OAAO,cAAc,kBAAkB,IACvC,OAAO,cAAc,eAAe;AAEtC,aACEA,uBACA,OAAO,cAAc,aAAa,IAAI;AAAA,IAE1C,GAAG,CAAC,KAAK;AAEb,WAAO,MAAM,sBAAsB,GAAG;AAAA,EACxC,GAAG,CAAC;AACN;AAEO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AACF,GAMW;AACT,QAAM,6BAA6B;AAAA,IACjC,UAAU,aAAa,qBAAqB;AAAA,EAC9C;AAEA,QAAM,eAAe,yBAAyB,SAAS;AAEvD,MAAI,CAAC,gBAAgB,CAAC,4BAA4B;AAGhD,WAAO;AAAA,EACT;AAEA,QAAM,WACH,eACC,OAAO,UAAU,aAAa,6BAA6B,CAAC,IAC5D,OACD,6BAA6B;AAEhC,SAAO;AACT;","names":["honeyFactoryAbi","honeyFactoryAbi","rewardVaultFactoryAbi","rewardVaultFactoryAbi","beraChefAbi","beraChefAbi","totalIncentiveValue"]}
|
|
1
|
+
{"version":3,"sources":["../../src/actions/bend/getMaxDeposit.ts","../../src/actions/dex/getPoolWithState.ts","../../src/actions/dex/getVaultPausedState.ts","../../src/actions/honey/getHoneyFees.ts","../../src/actions/honey/getHoneyPausedState.ts","../../src/actions/honey/getHoneyPythPriceOracle.ts","../../src/actions/honey/getHoneyRootPriceOracle.ts","../../src/actions/honey/getHoneyTxns.ts","../../src/actions/pol/getBeraTokenTotalSupply.ts","../../src/actions/pol/getBlockTime.ts","../../src/actions/pol/getHeroEarnVaults.ts","../../src/actions/pol/getLSTStakeConfig.ts","../../src/actions/pol/getRewardVaultDurationConstants.ts","../../src/actions/pol/getRewardVaultBeaconImplementation.ts","../../src/abi/utils/upgradableBeacon.ts","../../src/actions/pol/getRewardVaultFromToken.ts","../../src/actions/pyth/getHoneyPythFeeds.ts","../../src/actions/tokens/getTokens.ts","../../src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts","../../src/actions/validators/utils/aggregateValidatorIncentives.ts","../../src/actions/validators/utils/getValidatorBoostApy.ts"],"sourcesContent":["import { type Address, formatEther, type PublicClient } from \"viem\";\n\nimport { metaMorphoV11Abi as metaMorphoAbi } from \"@berachain/abis/bend-metamorpho/metaMorphoV11\";\n\ninterface GetMaxDepositProps {\n vaultAddress: Address;\n publicClient: PublicClient;\n}\n\nexport interface MaxDeposit {\n /** `maxDeposit` formatted as an ether-denominated decimal string. */\n formatted: string;\n /**\n * True when the vault has no real deposit cap. MetaMorpho's `maxDeposit` sums\n * each enabled market's remaining capacity (its supply cap minus current\n * supply); an uncapped market stores `type(uint184).max` as its cap, so the\n * sum lands at ~uint184.max (≈2.45e55) — not uint256.max. `formatted` turns\n * that into an astronomical number, so callers must key off this flag, not\n * the formatted value, to detect \"unlimited\".\n *\n * A genuine cap is many orders of magnitude smaller (e.g. Re7 HONEY's ~92M =\n * ~9.2e25), so the uint184-based threshold cleanly separates the two. The sum\n * can exceed uint184.max when several markets are uncapped, so we compare with\n * `>=` rather than testing for the exact sentinel.\n */\n isUncapped: boolean;\n}\n\nconst UINT_184_MAX = (1n << 184n) - 1n;\n// 1% below uint184.max — any maxDeposit at/above this is effectively unlimited.\nconst UNCAPPED_THRESHOLD = (UINT_184_MAX * 99n) / 100n;\n\nexport async function getMaxDeposit({\n vaultAddress,\n publicClient,\n}: GetMaxDepositProps): Promise<MaxDeposit> {\n const maxDeposit = await publicClient.readContract({\n address: vaultAddress,\n abi: metaMorphoAbi,\n functionName: \"maxDeposit\",\n args: [vaultAddress],\n });\n return {\n formatted: formatEther(maxDeposit),\n isUncapped: maxDeposit >= UNCAPPED_THRESHOLD,\n };\n}\n","import {\n type MinimalToken,\n mapPoolType,\n type PoolState,\n} from \"@berachain-foundation/berancer-sdk\";\nimport type { Address } from \"viem\";\n\nimport type { MinimalPoolFragment } from \"@berachain/graphql/dex/api\";\n\nexport function getPoolState(apiPool: MinimalPoolFragment): PoolState {\n return {\n type: mapPoolType(apiPool.type),\n protocolVersion: apiPool.protocolVersion as 1 | 2 | 3,\n tokens: apiPool.tokens.map<MinimalToken>(\n (pt) =>\n ({\n ...pt,\n address: pt.address as Address,\n }) satisfies MinimalToken,\n ),\n id: apiPool.id as Address,\n address: apiPool.address as Address,\n } satisfies PoolState;\n}\n","import type { PublicClient } from \"viem\";\n\nimport { vaultAbi as balancerVaultAbi } from \"@berachain/abis/bex/vault\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport async function getVaultPausedState({\n publicClient,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n}) {\n const { config } = parseBaseArgs(args);\n\n const vaultPausedState = await publicClient.readContract({\n address: config.bex.vault,\n abi: balancerVaultAbi,\n functionName: \"getPausedState\",\n });\n\n return vaultPausedState[0];\n}\n","import { type Address, formatUnits, type PublicClient } from \"viem\";\n\nimport { honeyFactoryAbi } from \"@berachain/abis/honey/honeyFactory\";\n\nimport type { Token } from \"@berachain/graphql/pol/api\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport interface CollateralRates {\n mintFee: number;\n redeemFee: number;\n}\n\nexport interface HoneyFeeMap {\n single: Record<Address, CollateralRates>;\n basket: CollateralRates;\n}\n\nexport interface CollateralRatesArgs extends BeraJS.BaseFunctionArgs {\n client: PublicClient;\n collateralList: Token[];\n}\n\n/**\n * Fetches the mint and redeem rates for all collateral tokens and calculates the weighted basket rates\n * @param {Object} params - The parameters object\n * @param {PublicClient} params.client - The Viem public client instance\n * @param {Address[]} params.collateralList - Array of collateral token addresses\n * @returns {Promise<HoneyFeeMap | undefined>} Object containing individual collateral rates and weighted basket rates,\n * or undefined if the operation fails\n */\nexport async function getHoneyFees({\n client,\n collateralList,\n ...args\n}: CollateralRatesArgs): Promise<HoneyFeeMap> {\n const { config } = parseBaseArgs(args);\n\n try {\n // create a list for all the promises needed, fetch the mint and redeem rates for each collateral token\n const promiseList: Record<\"mint\" | \"redeem\", Promise<bigint>[]> = {\n mint: [],\n redeem: [],\n };\n for (const coll of collateralList) {\n promiseList.mint.push(\n client.readContract({\n address: config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"mintRates\",\n args: [coll.address as Address],\n }),\n );\n promiseList.redeem.push(\n client.readContract({\n address: config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"redeemRates\",\n args: [coll.address as Address],\n }),\n );\n }\n const [mintRates, redeemRates, collateralWeights] = await Promise.all([\n Promise.all(promiseList.mint),\n Promise.all(promiseList.redeem),\n // fetch the collateral weights, needed to calculate the weighted basket rates\n client.readContract({\n address: config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"getWeights\",\n }),\n ]);\n\n // calculate the weighted basket rates and the single collateral rates\n\n return collateralList.reduce<HoneyFeeMap>(\n (acc, coll) => {\n const collIdx = collateralList.indexOf(coll);\n acc.single[coll.address as Address] = {\n mintFee: 1 - +formatUnits(mintRates[collIdx], 18),\n redeemFee: 1 - +formatUnits(redeemRates[collIdx], 18),\n };\n acc.basket.mintFee +=\n acc.single[coll.address as Address].mintFee *\n +formatUnits(collateralWeights[collIdx], 18);\n\n acc.basket.redeemFee +=\n acc.single[coll.address as Address].redeemFee *\n +formatUnits(collateralWeights[collIdx], 18);\n return acc;\n },\n {\n single: {},\n basket: { mintFee: 0, redeemFee: 0 },\n },\n );\n } catch (e) {\n console.log(e);\n throw e;\n }\n}\n","import type { PublicClient } from \"viem\";\n\nimport { honeyAbi } from \"@berachain/abis/honey/honey\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Gets the pause state of the Honey protocol\n * @returns boolean\n */\nexport async function getHoneyPausedState({\n client,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n client: PublicClient;\n}) {\n const { config } = parseBaseArgs(args);\n const honeyAddress = config.honey.token;\n const honeyPausedState = await client.readContract({\n address: honeyAddress,\n abi: honeyAbi,\n functionName: \"paused\",\n });\n\n return honeyPausedState;\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { rootPriceOracleAbi as honeyRootOracleAbi } from \"@berachain/abis/extras/rootPriceOracle\";\n\n/**\n * Gets the address of the Honey Pyth Oracle, which is called by the Honey Root Price Oracle to get the price of the collaterals\n * @returns\n */\nexport async function getHoneyPythOracle({\n pythOracle,\n publicClient,\n}: {\n publicClient: PublicClient;\n pythOracle: Address;\n}) {\n return publicClient.readContract({\n address: pythOracle,\n abi: honeyRootOracleAbi,\n functionName: \"pythOracle\",\n });\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { honeyFactoryAbi } from \"@berachain/abis/honey/honeyFactory\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Gets the address of the Honey Root Price Oracle, which keeps the logic to price the collaterals\n */\nexport async function getHoneyRootPriceOracle({\n publicClient,\n factory,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n factory?: Address;\n}): Promise<Address> {\n const { config } = parseBaseArgs(args);\n return publicClient.readContract({\n address: factory ?? config.honey.factory,\n abi: honeyFactoryAbi,\n functionName: \"priceOracle\",\n });\n}\n","import { BeraError } from \"../../errors/BeraError\";\nimport type { HoneyTransactionsLatestResponse } from \"../../generated/beep\";\nimport { fetchBeep } from \"../clients/fetchBeep\";\n\ntype HoneyTxn = HoneyTransactionsLatestResponse[number];\n/** beep's transaction type discriminator (`\"MINT\" | \"REDEEM\"`). */\ntype HoneyTxnType = HoneyTxn[\"type\"];\n\ninterface GetHoneyTxnsArgs {\n /** Zero-based page index (the page size is applied internally). */\n index: number;\n /** Page size. */\n limit: number;\n /** Optional MINT/REDEEM filter; omit for all transactions. */\n txnType?: HoneyTxnType;\n}\n\n/**\n * Browser-only. Returns a page of honey transactions in the `beep` response\n * shape (`HoneyTransactionsLatestResponse`) the transactions table consumes.\n *\n * Reads from the `beep` backend (`fetchBeep`).\n */\nexport async function getHoneyTxns({\n index,\n limit,\n txnType,\n}: GetHoneyTxnsArgs): Promise<HoneyTransactionsLatestResponse> {\n if (typeof window === \"undefined\") {\n throw new BeraError({\n message:\n \"getHoneyTxns is browser-only; call from a Client Component / SWR hook\",\n level: \"error\",\n });\n }\n\n // beep backend (next-gen), typed against `src/generated/beep`. Queried\n // directly from the browser — no Vercel proxy. beep's `page` is 1-indexed and\n // filters server-side by `type`; `fetchOpenApi` omits `type` when `txnType`\n // is undefined (the \"all\" tab), so each tab paginates its own filtered feed.\n return fetchBeep(\"/v0/honey/transactions/latest\", {\n query: { page: String(index + 1), perPage: String(limit), type: txnType },\n });\n}\n","import { fetchBeep } from \"../clients/fetchBeep\";\n\nexport type GetBeraTokenTotalSupplyArgs = BeraJS.BaseFunctionArgs;\n\n/**\n * Fetches the native BERA total supply (in whole BERA units) from the\n * Berachain supply-monitor service.\n */\nexport async function getBeraTokenTotalSupply(\n args: GetBeraTokenTotalSupplyArgs = {},\n): Promise<string> {\n const res = await fetchBeep(\"/v0/stats/bera\", {}, args);\n\n return res.totalSupply;\n}\n","import type { PublicClient } from \"viem\";\n\nimport { assertPublicClient } from \"../../errors/assert\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\nimport { hoursInSeconds, msToSeconds } from \"../../utils/time\";\n\nexport async function getBlockTime({\n defaultBlockTime,\n publicClient,\n blocksSpan,\n ...args\n}: {\n defaultBlockTime?: number;\n blocksSpan?: number;\n publicClient: PublicClient | undefined;\n} & BeraJS.BaseFunctionArgs): Promise<number> {\n assertPublicClient(publicClient);\n\n const { config } = parseBaseArgs(args);\n\n const blockTime = defaultBlockTime ?? config.averageBlockTime;\n const span = blocksSpan ?? Math.floor(hoursInSeconds(1) / blockTime);\n\n const currentBlock = await publicClient?.getBlock({ blockTag: \"latest\" });\n const oldestBlock = await publicClient?.getBlock({\n blockNumber: currentBlock.number - BigInt(span),\n });\n\n return (\n // we need to use current timestamp as the latest block might not have been minted (chain halted)\n (msToSeconds(Date.now()) - Number(oldestBlock?.timestamp)) /\n (Number(currentBlock?.number) - Number(oldestBlock?.number))\n );\n}\n","import {\n type ApiVaultFragment,\n GetHeroEarnVaults,\n type GetHeroEarnVaultsQuery,\n type GetHeroEarnVaultsQueryVariables,\n} from \"@berachain/graphql/pol/api\";\n\nimport { getApolloClient } from \"../clients/getApolloClient\";\n\nexport interface HeroEarnVaults {\n /**\n * Top-APR PoL reward vaults, ordered by APR descending. Callers typically\n * read `[0]` for the \"Earn with PoL\" hero subtitle. `bestAprExcludedAddresses`\n * lets callers filter out non-incentivized earn actions whose APR figures\n * would otherwise dominate the listing and mislead users.\n */\n bestApr: ApiVaultFragment[];\n /**\n * Highest-APR PoL reward vault among vaults whose protocol is \"bend\".\n * Its `stakingToken.address` is a Bend vault share token — match it back\n * against `bendVaults` to combine the PoL reward APR with the underlying\n * Bend native supply APY.\n */\n bendRewardVault: ApiVaultFragment[];\n /**\n * Minimal Bend native vault data (address + `totalApy`) used to look up the\n * underlying Bend supply APY for whichever Bend vault `bendRewardVault`\n * resolves to.\n */\n bendVaults: GetHeroEarnVaultsQuery[\"bendVaults\"];\n}\n\n/**\n * Batched fetch for the hub home page hero cards. Issues a single GraphQL\n * request to the BEX API that returns:\n * - the top-APR PoL reward vaults (for the \"Earn with PoL\" card)\n * - the highest-APR Bend-protocol PoL reward vault (for the \"Lend\" card)\n * - minimal Bend native vault data, so callers can add the Bend supply APY\n * on top of the PoL reward APR when displaying the combined Lend APY\n */\nexport async function getHeroEarnVaults({\n bestAprExcludedAddresses = [],\n ...args\n}: {\n bestAprExcludedAddresses?: string[];\n} & BeraJS.BaseFunctionArgs = {}): Promise<HeroEarnVaults> {\n const bexApiGraphqlClient = getApolloClient(\"api\", args);\n\n const res = await bexApiGraphqlClient.query<\n GetHeroEarnVaultsQuery,\n GetHeroEarnVaultsQueryVariables\n >({\n query: GetHeroEarnVaults,\n variables: { bestAprExcludedAddresses },\n });\n\n return {\n bestApr: res.data.bestApr.vaults,\n bendRewardVault: res.data.bendRewardVault.vaults,\n bendVaults: res.data.bendVaults,\n };\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { lstStakerVaultAbi } from \"@berachain/abis/pol/lst/lstStakerVault\";\n\nimport { assertPublicClient } from \"../../errors/assert\";\nimport type { TokenWithMetadata } from \"../../types/dex\";\nimport type { StakingConfig } from \"../../types/staking\";\nimport { isToken } from \"../../utils/tokens\";\n\nexport type GetLSTStakeConfigArgs = {\n tokenList: TokenWithMetadata[];\n publicClient?: PublicClient;\n lstStakingVaults: Address[];\n} & BeraJS.BaseFunctionArgs;\n\n/**\n * Builds staking configs from on-chain LST vaults and optional native configs.\n */\nexport async function getLSTStakeConfig({\n tokenList,\n publicClient,\n lstStakingVaults,\n ...args\n}: GetLSTStakeConfigArgs): Promise<StakingConfig[]> {\n assertPublicClient(publicClient);\n\n const lstStakingTokens = tokenList.filter((token) =>\n lstStakingVaults.includes(token.address),\n );\n\n if (lstStakingTokens.length === 0) {\n return [];\n }\n\n const assets = await Promise.all(\n lstStakingTokens.map(async (stakingToken) => {\n // read the asset token address from the lst staking vault\n const assetTokenAddress = await publicClient.readContract({\n address: stakingToken.address,\n abi: lstStakerVaultAbi,\n functionName: \"asset\",\n });\n return { assetTokenAddress, stakingToken };\n }),\n );\n\n return assets.reduce<StakingConfig[]>(\n (acc, { assetTokenAddress, stakingToken }) => {\n const assetToken = tokenList.find((token) =>\n isToken(token, assetTokenAddress),\n );\n if (!assetToken) return acc;\n acc.push({\n id: stakingToken.address,\n receiptToken: stakingToken,\n inputTokens: [assetToken],\n });\n return acc;\n },\n [],\n );\n}\n","import type { PublicClient } from \"viem\";\n\nimport { rewardVaultAbi } from \"@berachain/abis/pol/rewards/rewardVault\";\n\nimport { assertPublicClient } from \"../../errors/assert\";\nimport { getRewardVaultBeaconImplementation } from \"./getRewardVaultBeaconImplementation\";\n\nexport interface RewardVaultDurationConstants {\n minRewardDuration: number;\n maxRewardDuration: number;\n}\n\n/**\n * Returns the minimum and maximum reward duration constants for all reward vaults.\n */\nexport async function getRewardVaultDurationConstants({\n publicClient,\n ...baseArgs\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n}): Promise<RewardVaultDurationConstants> {\n assertPublicClient(publicClient);\n\n const beaconImplementation = await getRewardVaultBeaconImplementation({\n publicClient,\n ...baseArgs,\n });\n\n const [minRewardDuration, maxRewardDuration] = await Promise.all([\n publicClient.readContract({\n address: beaconImplementation,\n abi: rewardVaultAbi,\n functionName: \"MIN_REWARD_DURATION\",\n }),\n publicClient.readContract({\n address: beaconImplementation,\n abi: rewardVaultAbi,\n functionName: \"MAX_REWARD_DURATION\",\n }),\n ]);\n\n return {\n minRewardDuration: Number(minRewardDuration),\n maxRewardDuration: Number(maxRewardDuration),\n };\n}\n","import type { Address, PublicClient } from \"viem\";\n\nimport { rewardVaultFactoryAbi } from \"@berachain/abis/pol/rewards/rewardVaultFactory\";\n\nimport { upgradableBeaconAbi } from \"../../abi/utils/upgradableBeacon\";\nimport { assertAddress, assertDefined } from \"../../errors/assert\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Returns the beacon implementation address for all reward vaults.\n */\nexport async function getRewardVaultBeaconImplementation({\n publicClient,\n ...args\n}: BeraJS.BaseFunctionArgs & {\n publicClient: PublicClient;\n}): Promise<Address> {\n const { config } = parseBaseArgs(args);\n const factoryAddress = config.pol.factory;\n assertDefined(publicClient, \"publicClient\");\n assertAddress(config.pol.factory, \"factoryAddress\");\n\n // from the factory contract, we get the beacon address\n const beacon = await publicClient.readContract({\n address: factoryAddress,\n abi: rewardVaultFactoryAbi,\n functionName: \"beacon\",\n });\n\n // from the beacon contract, we get the current implementation address\n return publicClient.readContract({\n address: beacon,\n abi: upgradableBeaconAbi,\n functionName: \"implementation\",\n });\n}\n","export const upgradableBeaconAbi = [\n {\n inputs: [\n { internalType: \"address\", name: \"initialOwner\", type: \"address\" },\n {\n internalType: \"address\",\n name: \"initialImplementation\",\n type: \"address\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n { inputs: [], name: \"NewImplementationHasNoCode\", type: \"error\" },\n { inputs: [], name: \"NewOwnerIsZeroAddress\", type: \"error\" },\n { inputs: [], name: \"Unauthorized\", type: \"error\" },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"oldOwner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"newOwner\",\n type: \"address\",\n },\n ],\n name: \"OwnershipTransferred\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"implementation\",\n type: \"address\",\n },\n ],\n name: \"Upgraded\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"implementation\",\n outputs: [{ internalType: \"address\", name: \"result\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"owner\",\n outputs: [{ internalType: \"address\", name: \"result\", type: \"address\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"renounceOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"newOwner\", type: \"address\" }],\n name: \"transferOwnership\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"newImplementation\", type: \"address\" },\n ],\n name: \"upgradeTo\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n","import { type Address, type PublicClient, zeroAddress } from \"viem\";\n\nimport { rewardVaultFactoryAbi } from \"@berachain/abis/pol/rewards/rewardVaultFactory\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport async function getRewardVaultFromToken({\n tokenAddress,\n publicClient,\n factoryAddress,\n ...args\n}: {\n tokenAddress: Address;\n publicClient: PublicClient;\n factoryAddress?: Address;\n} & BeraJS.BaseFunctionArgs) {\n const { config } = parseBaseArgs(args);\n\n const vaultAddress = await publicClient.readContract({\n address: factoryAddress ?? config.pol.factory,\n abi: rewardVaultFactoryAbi,\n functionName: \"getVault\",\n args: [tokenAddress],\n });\n\n if (vaultAddress === zeroAddress) {\n return null;\n }\n\n return vaultAddress;\n}\n","import type { PublicClient } from \"viem\";\n\nimport type { Address } from \"@berachain/config\";\n\nimport { pythPriceOracleAbi } from \"@berachain/abis/extras/pythPriceOracle\";\n\nimport type { PythPriceFeedMap } from \"../../types/honeySwap\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\n/**\n * Given a list of tokens, it will return the price feed ids for each token according to honey priceOracle\n * @returns\n */\nexport async function getHoneyPythFeeds({\n tokenList,\n publicClient,\n ...args\n}: {\n tokenList: readonly Address[];\n publicClient: PublicClient;\n} & BeraJS.BaseFunctionArgs): Promise<PythPriceFeedMap> {\n const { config } = parseBaseArgs(args);\n\n try {\n const priceFeedIds = await Promise.all(\n tokenList.map((token) =>\n publicClient.readContract({\n address: config.honey.pythOracle,\n abi: pythPriceOracleAbi,\n functionName: \"feeds\",\n args: [token],\n }),\n ),\n );\n\n return tokenList.reduce<PythPriceFeedMap>(\n (acc, token, index) => ({\n ...acc,\n [token]: priceFeedIds[index],\n }),\n {},\n );\n } catch (e) {\n console.error(\"getPythPriceFeedId\", e);\n throw e;\n }\n}\n","import type { TokenWithMetadata } from \"../../types/dex\";\nimport { beraFetchJson } from \"../../utils/beraFetch\";\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport async function getTokens({\n url,\n ...args\n}: BeraJS.BaseFunctionArgs & { url?: string } = {}): Promise<\n TokenWithMetadata[]\n> {\n const { config } = parseBaseArgs(args);\n const tokenList = await beraFetchJson<{ tokens: TokenWithMetadata[] }>({\n url: url ?? config.lists.tokenList,\n type: \"rest\",\n name: \"GitHub\",\n });\n\n return tokenList.tokens ?? [];\n}\n","import type { PublicClient } from \"viem\";\n\nimport type { EdgeConfigSchema } from \"@berachain/edge-config\";\n\nimport { bgtAbi } from \"@berachain/abis/pol/bgt\";\nimport { beraChefAbi } from \"@berachain/abis/pol/rewards/beraChef\";\n\nimport { parseBaseArgs } from \"../../utils/parseBaseArgs\";\n\nexport interface ActiveBoostAndCommissionChangeDelay {\n boostDelay: number;\n unboostDelay: number;\n commissionChangeDelay: number;\n rewardAllocationBlockDelay: number;\n maxWeightPerVault: number;\n maxNumWeightsPerRewardAllocation: number;\n /**\n * Percentage of the validator's commission rate that can be changed at once.\n *\n * @example 1 => 100%\n */\n maxCommissionRate: number;\n /**\n * The number of blocks after which a reward allocation is considered stale and will fallback\n * to baseline reward allocation.\n *\n */\n rewardAllocationInactivityBlockSpan: number;\n /**\n * The number of hours in advance to warn the operator that the reward allocation is expiring.\n */\n ui: EdgeConfigSchema[\"pol\"][\"automatedRewardAllocation\"];\n}\n\nexport async function getActiveBoostAndCommissionChangeDelay({\n publicClient,\n ui,\n ...args\n}: BeraJS.BaseFunctionArgs &\n Pick<ActiveBoostAndCommissionChangeDelay, \"ui\"> & {\n publicClient: PublicClient;\n }): Promise<ActiveBoostAndCommissionChangeDelay> {\n const { config } = parseBaseArgs(args);\n\n const [\n maxCommissionRate,\n commissionChangeDelay,\n rewardAllocationBlockDelay,\n maxWeightPerVault,\n maxNumWeightsPerRewardAllocation,\n dropBoostDelay,\n activateBoostDelay,\n rewardAllocationInactivityBlockSpan,\n ] = await Promise.all([\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"MAX_COMMISSION_RATE\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"commissionChangeDelay\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"rewardAllocationBlockDelay\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"maxWeightPerVault\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"maxNumWeightsPerRewardAllocation\",\n }),\n publicClient.readContract({\n address: config.tokens.bgt,\n abi: bgtAbi,\n functionName: \"dropBoostDelay\",\n }),\n publicClient.readContract({\n address: config.tokens.bgt,\n abi: bgtAbi,\n functionName: \"activateBoostDelay\",\n }),\n publicClient.readContract({\n address: config.pol.beraChef,\n abi: beraChefAbi,\n functionName: \"rewardAllocationInactivityBlockSpan\",\n }),\n ]);\n\n return {\n maxCommissionRate: Number(maxCommissionRate) / 1e4,\n boostDelay: Number(activateBoostDelay),\n unboostDelay: Number(dropBoostDelay),\n commissionChangeDelay: Number(commissionChangeDelay),\n rewardAllocationBlockDelay: Number(rewardAllocationBlockDelay),\n maxWeightPerVault: Number(maxWeightPerVault) / 1e4,\n maxNumWeightsPerRewardAllocation: Number(maxNumWeightsPerRewardAllocation),\n rewardAllocationInactivityBlockSpan: Number(\n rewardAllocationInactivityBlockSpan,\n ),\n ui,\n };\n}\n","import type {\n ApiMinimalVaultIncentiveFragment,\n ApiValidatorRewardAllocationWeightFragment,\n} from \"@berachain/graphql/pol/api\";\nimport BigNumber from \"@berachain/utils/pkg/bignumber.js\";\n\nexport function aggregateValidatorIncentives({\n rewardAllocationWeights,\n activeOnly = true,\n}: {\n rewardAllocationWeights: ApiValidatorRewardAllocationWeightFragment[];\n activeOnly?: boolean;\n}): ApiMinimalVaultIncentiveFragment[] {\n const map = rewardAllocationWeights\n .filter((x) => x?.receivingVault)\n\n .reduce((acc, rv) => {\n for (const incentive of rv.receivingVault?.activeIncentives ?? []) {\n if (activeOnly && incentive.remainingAmount === \"0\") {\n continue;\n }\n const incentiveRate = new BigNumber(incentive.incentiveRate).times(\n rv.percentage,\n );\n\n const incentiveRateUsd = new BigNumber(\n incentive.incentiveRateUsd,\n ).times(rv.percentage);\n\n const token = incentive.token.address.toLowerCase();\n\n const existing = acc.get(token);\n if (existing) {\n acc.set(token, {\n ...existing,\n incentiveRate: new BigNumber(existing.incentiveRate)\n .plus(incentiveRate)\n .toString(),\n incentiveRateUsd: new BigNumber(existing.incentiveRateUsd)\n .plus(incentiveRateUsd)\n .toString(),\n remainingAmount: new BigNumber(existing.remainingAmount)\n .plus(incentive.remainingAmount)\n .toString(),\n remainingAmountUsd: new BigNumber(existing.remainingAmountUsd)\n .plus(incentive.remainingAmountUsd)\n .toString(),\n });\n } else {\n acc.set(token, {\n ...incentive,\n tokenAddress: incentive.token.address,\n token: incentive.token,\n incentiveRate: incentiveRate.toString(),\n incentiveRateUsd: incentiveRateUsd.toString(),\n remainingAmount: incentive.remainingAmount,\n });\n }\n }\n return acc;\n }, new Map<string, ApiMinimalVaultIncentiveFragment>());\n\n return Array.from(map.values());\n}\n","import type { ApiValidatorFragment } from \"@berachain/graphql/pol/api\";\n\nexport function getValidatorReturnPerBgt(\n validator: Pick<\n ApiValidatorFragment,\n \"dynamicData\" | \"rewardAllocationWeights\"\n >,\n): number {\n return validator?.rewardAllocationWeights?.reduce((acc, ab) => {\n if (!ab) return acc;\n\n const totalIncentiveValue =\n ab.receivingVault?.activeIncentives\n .filter((inc) => Number(inc.remainingAmount) > 0)\n .reduce((totalIncentiveValue, currIncentive) => {\n const tokenPrice =\n Number(currIncentive.remainingAmountUsd) /\n Number(currIncentive.remainingAmount);\n\n return (\n totalIncentiveValue +\n Number(currIncentive.incentiveRate) * tokenPrice\n );\n }, 0) ?? 0;\n\n return acc + totalIncentiveValue * ab.percentage;\n }, 0);\n}\n\nexport function getValidatorBoostApy({\n validator,\n bgtPrice,\n}: {\n validator: Pick<\n ApiValidatorFragment,\n \"dynamicData\" | \"rewardAllocationWeights\"\n >;\n bgtPrice: number;\n}): number {\n const validatorActiveBoostAmount = Number(\n validator.dynamicData?.activeBoostAmount ?? 0,\n );\n\n const returnPerBgt = getValidatorReturnPerBgt(validator);\n\n if (!returnPerBgt || !validatorActiveBoostAmount) {\n // As of now, a validator cannot send rewards to the vaults if it has no active boost amount\n // If baseRate changes on chain, we should update this function\n return 0;\n }\n\n const boostApy =\n (returnPerBgt *\n Number(validator.dynamicData?.lastDayDistributedRewards ?? 0) *\n 365) /\n (validatorActiveBoostAmount * bgtPrice);\n\n return boostApy;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAuB,mBAAsC;AAE7D,SAAS,oBAAoB,qBAAqB;AA0BlD,IAAM,gBAAgB,MAAM,QAAQ;AAEpC,IAAM,qBAAsB,eAAe,MAAO;AAElD,eAAsB,cAAc;AAAA,EAClC;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,aAAa,MAAM,aAAa,aAAa;AAAA,IACjD,SAAS;AAAA,IACT,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,YAAY;AAAA,EACrB,CAAC;AACD,SAAO;AAAA,IACL,WAAW,YAAY,UAAU;AAAA,IACjC,YAAY,cAAc;AAAA,EAC5B;AACF;;;AC9CA;AAAA,EAEE;AAAA,OAEK;AAKA,SAAS,aAAa,SAAyC;AACpE,SAAO;AAAA,IACL,MAAM,YAAY,QAAQ,IAAI;AAAA,IAC9B,iBAAiB,QAAQ;AAAA,IACzB,QAAQ,QAAQ,OAAO;AAAA,MACrB,CAAC,QACE;AAAA,QACC,GAAG;AAAA,QACH,SAAS,GAAG;AAAA,MACd;AAAA,IACJ;AAAA,IACA,IAAI,QAAQ;AAAA,IACZ,SAAS,QAAQ;AAAA,EACnB;AACF;;;ACrBA,SAAS,YAAY,wBAAwB;AAI7C,eAAsB,oBAAoB;AAAA,EACxC;AAAA,EACA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actoryAbi","rewardVaultFactoryAbi","totalIncentiveValue"]}
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
getProposalFromTx,
|
|
7
7
|
getProposalVotes,
|
|
8
8
|
parseProposalBody
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-UWJQ6UKG.mjs";
|
|
10
10
|
import "../../chunk-KL6YZ5VR.mjs";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-TXWDUJOY.mjs";
|
|
12
|
+
import "../../chunk-MVNQY2D4.mjs";
|
|
13
13
|
|
|
14
14
|
// src/actions/governance/computeActualStatus.ts
|
|
15
15
|
import {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChartData.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getChartData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getChartData.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getChartData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAGlE;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,EACjC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAejC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import BigNumber from "@berachain/utils/pkg/bignumber.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Sums the last 24 hourly honey snapshots into a 24h volume.
|
|
4
4
|
*
|
|
5
5
|
* Reads from the `beep` backend (`fetchBeep`), which exposes `totalVolume` per
|
|
6
|
-
* snapshot.
|
|
6
|
+
* snapshot. Safe to call from either the browser or the server.
|
|
7
7
|
*/
|
|
8
8
|
export declare function getHoney24hVolume(): Promise<BigNumber | undefined>;
|
|
9
9
|
//# sourceMappingURL=getHoney24hVolume.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHoney24hVolume.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getHoney24hVolume.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"getHoney24hVolume.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getHoney24hVolume.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAI1D;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CASxE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PublicClient } from "viem";
|
|
2
|
-
import type { EdgeConfigSchema } from "@berachain/
|
|
2
|
+
import type { EdgeConfigSchema } from "@berachain/edge-config";
|
|
3
3
|
import type { TokenWithOrder } from "../../contexts/HoneyConfigProvider";
|
|
4
4
|
import type { TokenWithMetadata } from "../../types/dex";
|
|
5
5
|
interface GetHoneyCollateralsArgs extends BeraJS.BaseFunctionArgs {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHoneyCollaterals.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getHoneyCollaterals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getHoneyCollaterals.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getHoneyCollaterals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKzD,UAAU,uBAAwB,SAAQ,MAAM,CAAC,gBAAgB;IAC/D;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC;;OAEG;IACH,wBAAwB,CAAC,EAAE,WAAW,CACpC,WAAW,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CACnE,CAAC,SAAS,CAAC,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EACN,SAAS,EACT,wBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,uBAAuB,GAAG,OAAO,CAAC;IACnC,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,mBAAmB,EAAE,cAAc,CAAC;CACrC,CAAC,CA6FD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HoneyTransactionsLatestResponse } from "
|
|
1
|
+
import type { HoneyTransactionsLatestResponse } from "../../generated/beep";
|
|
2
2
|
type HoneyTxn = HoneyTransactionsLatestResponse[number];
|
|
3
3
|
/** beep's transaction type discriminator (`"MINT" | "REDEEM"`). */
|
|
4
4
|
type HoneyTxnType = HoneyTxn["type"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getHoneyTxns.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getHoneyTxns.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getHoneyTxns.d.ts","sourceRoot":"","sources":["../../../src/actions/honey/getHoneyTxns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAG5E,KAAK,QAAQ,GAAG,+BAA+B,CAAC,MAAM,CAAC,CAAC;AACxD,mEAAmE;AACnE,KAAK,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;AAErC,UAAU,gBAAgB;IACxB,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,EACjC,KAAK,EACL,KAAK,EACL,OAAO,GACR,EAAE,gBAAgB,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAgB7D"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type GlobalDataQuery } from "@berachain/graphql/pol/api";
|
|
2
2
|
type ReturnedFromQuery = GlobalDataQuery["polGetGlobalInfo"] & {
|
|
3
|
-
top3EmittingValidators: GlobalDataQuery["top3EmittingValidators"]["validators"];
|
|
4
3
|
allValidatorsCount: number;
|
|
5
4
|
};
|
|
6
5
|
export interface GlobalInfo extends Partial<ReturnedFromQuery> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBGTGlobalInfo.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getBGTGlobalInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,4BAA4B,CAAC;AAKpC,KAAK,iBAAiB,GAAG,eAAe,CAAC,kBAAkB,CAAC,GAAG;IAC7D,
|
|
1
|
+
{"version":3,"file":"getBGTGlobalInfo.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getBGTGlobalInfo.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,4BAA4B,CAAC;AAKpC,KAAK,iBAAiB,GAAG,eAAe,CAAC,kBAAkB,CAAC,GAAG;IAC7D,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,iBAAiB,CAAC;CAAG;AAEjE,wBAAsB,gBAAgB,CACpC,IAAI,GAAE,MAAM,CAAC,gBAAqB,GACjC,OAAO,CAAC,UAAU,CAAC,CAsBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBeraTokenTotalSupply.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getBeraTokenTotalSupply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBeraTokenTotalSupply.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getBeraTokenTotalSupply.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAElE;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,GAAE,2BAAgC,GACrC,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -10,33 +10,10 @@ type GetEarnedStakedBeraVaultArgs = {
|
|
|
10
10
|
account: Address;
|
|
11
11
|
};
|
|
12
12
|
export declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<{
|
|
13
|
-
currentDepositRate: import("
|
|
14
|
-
earningsTotal: import("
|
|
15
|
-
earningsRealized: import("
|
|
16
|
-
earningsUnrealized: import("
|
|
17
|
-
shareLots: {
|
|
18
|
-
shares: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
19
|
-
depositRate: import("@berachain/graphql/beep").components["schemas"]["DecimalStr"];
|
|
20
|
-
}[];
|
|
21
|
-
sortedEvents: ({
|
|
22
|
-
_height: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
23
|
-
_log_index: number;
|
|
24
|
-
assets: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
25
|
-
shares: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
26
|
-
_type: "deposit" | "withdrawal";
|
|
27
|
-
sender: import("@berachain/graphql/beep").components["schemas"]["EvmAddress"];
|
|
28
|
-
owner: import("@berachain/graphql/beep").components["schemas"]["EvmAddress"];
|
|
29
|
-
total_assets: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
30
|
-
} | {
|
|
31
|
-
_height: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
32
|
-
_log_index: number;
|
|
33
|
-
assets: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
34
|
-
shares: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
35
|
-
_type: "transfer";
|
|
36
|
-
from: import("@berachain/graphql/beep").components["schemas"]["EvmAddress"];
|
|
37
|
-
to: import("@berachain/graphql/beep").components["schemas"]["EvmAddress"];
|
|
38
|
-
value: import("@berachain/graphql/beep").components["schemas"]["BigIntStr"];
|
|
39
|
-
})[];
|
|
13
|
+
currentDepositRate: import("../../generated/beep").components["schemas"]["BigIntStr"];
|
|
14
|
+
earningsTotal: import("../../generated/beep").components["schemas"]["BigIntStr"];
|
|
15
|
+
earningsRealized: import("../../generated/beep").components["schemas"]["BigIntStr"];
|
|
16
|
+
earningsUnrealized: import("../../generated/beep").components["schemas"]["BigIntStr"];
|
|
40
17
|
}>;
|
|
41
18
|
export {};
|
|
42
19
|
//# sourceMappingURL=getEarnedStakedBeraVault.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEarnedStakedBeraVault.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getEarnedStakedBeraVault.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,KAAK,4BAA4B,GAAG;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AACF,wBAAsB,wBAAwB,CAAC,EAC7C,OAAO,EACP,OAAO,EACP,GAAG,IAAI,EACR,EAAE,MAAM,CAAC,gBAAgB,GAAG,4BAA4B;
|
|
1
|
+
{"version":3,"file":"getEarnedStakedBeraVault.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getEarnedStakedBeraVault.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,KAAK,4BAA4B,GAAG;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AACF,wBAAsB,wBAAwB,CAAC,EAC7C,OAAO,EACP,OAAO,EACP,GAAG,IAAI,EACR,EAAE,MAAM,CAAC,gBAAgB,GAAG,4BAA4B;wBAQsirB,oDAAsB;mBAAqD,oDAAsB;sBAAwD,oDAAsB;wBAA0D,oDAAsB;GAD71rB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLSTStakeConfig.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getLSTStakeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAKlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"getLSTStakeConfig.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getLSTStakeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAKlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,EAAE,OAAO,EAAE,CAAC;CAC7B,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAE5B;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,GAAG,IAAI,EACR,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAsClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRewardVaults.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getRewardVaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAIpE,OAAO,EACL,KAAK,gBAAgB,EAGrB,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AAIpC,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,gBAAgB,EAAE,CAAC;IACpC,UAAU,EAAE;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,wBAAsB,eAAe,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,GAAG,IAAI,EACR,GAAE;IACD,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACzC,GAAG,MAAM,CAAC,gBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"getRewardVaults.d.ts","sourceRoot":"","sources":["../../../src/actions/pol/getRewardVaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAIpE,OAAO,EACL,KAAK,gBAAgB,EAGrB,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AAIpC,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,gBAAgB,EAAE,CAAC;IACpC,UAAU,EAAE;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,wBAAsB,eAAe,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,GAAG,IAAI,EACR,GAAE;IACD,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACzC,GAAG,MAAM,CAAC,gBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4E7D"}
|