@berachain/berajs 0.2.13 → 0.3.0

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.
Files changed (413) hide show
  1. package/dist/actions/clients/BeraApolloClient.d.ts.map +1 -1
  2. package/dist/actions/clients/clientName.d.ts +10 -0
  3. package/dist/actions/clients/clientName.d.ts.map +1 -0
  4. package/dist/actions/clients/exports.d.ts +2 -0
  5. package/dist/actions/clients/exports.d.ts.map +1 -1
  6. package/dist/actions/clients/exports.mjs +26 -7
  7. package/dist/actions/clients/exports.mjs.map +1 -1
  8. package/dist/actions/clients/fetchBeep.d.ts.map +1 -1
  9. package/dist/actions/clients/fetchEnso.d.ts +17 -0
  10. package/dist/actions/clients/fetchEnso.d.ts.map +1 -0
  11. package/dist/actions/clients/fetchLayerzero.d.ts +12 -0
  12. package/dist/actions/clients/fetchLayerzero.d.ts.map +1 -0
  13. package/dist/actions/clients/fetchOpenApi.d.ts +4 -1
  14. package/dist/actions/clients/fetchOpenApi.d.ts.map +1 -1
  15. package/dist/actions/clients/getApolloClient.d.ts.map +1 -1
  16. package/dist/actions/dex/aggregators/base.d.ts +30 -5
  17. package/dist/actions/dex/aggregators/base.d.ts.map +1 -1
  18. package/dist/actions/dex/aggregators/bex.d.ts +11 -1
  19. package/dist/actions/dex/aggregators/bex.d.ts.map +1 -1
  20. package/dist/actions/dex/aggregators/bgt.d.ts +2 -2
  21. package/dist/actions/dex/aggregators/bgt.d.ts.map +1 -1
  22. package/dist/actions/dex/aggregators/enso/enso.d.ts.map +1 -1
  23. package/dist/actions/dex/aggregators/enso/ensoErc4626.d.ts +1 -0
  24. package/dist/actions/dex/aggregators/enso/ensoErc4626.d.ts.map +1 -1
  25. package/dist/actions/dex/aggregators/erc4626.d.ts +2 -2
  26. package/dist/actions/dex/aggregators/erc4626.d.ts.map +1 -1
  27. package/dist/actions/dex/aggregators/fly.d.ts.map +1 -1
  28. package/dist/actions/dex/aggregators/haiku.d.ts +7 -1
  29. package/dist/actions/dex/aggregators/haiku.d.ts.map +1 -1
  30. package/dist/actions/dex/aggregators/honey.d.ts +2 -2
  31. package/dist/actions/dex/aggregators/honey.d.ts.map +1 -1
  32. package/dist/actions/dex/aggregators/kyberswap.d.ts.map +1 -1
  33. package/dist/actions/dex/aggregators/oogabooga.d.ts.map +1 -1
  34. package/dist/actions/dex/aggregators/openOcean.d.ts.map +1 -1
  35. package/dist/actions/dex/aggregators/wbera.d.ts +3 -2
  36. package/dist/actions/dex/aggregators/wbera.d.ts.map +1 -1
  37. package/dist/actions/dex/getAllPools.d.ts.map +1 -1
  38. package/dist/actions/dex/getApiPool.d.ts.map +1 -1
  39. package/dist/actions/enso/getEnsoUserTokensWithBalances.d.ts.map +1 -1
  40. package/dist/actions/enso/util.d.ts +1 -6
  41. package/dist/actions/enso/util.d.ts.map +1 -1
  42. package/dist/actions/exports.d.ts +3 -5
  43. package/dist/actions/exports.d.ts.map +1 -1
  44. package/dist/actions/exports.mjs +31 -50
  45. package/dist/actions/exports.mjs.map +1 -1
  46. package/dist/actions/governance/exports.mjs +3 -3
  47. package/dist/actions/honey/getHoney24hVolume.d.ts +2 -2
  48. package/dist/actions/honey/getHoney24hVolume.d.ts.map +1 -1
  49. package/dist/actions/honey/getHoneyCollaterals.d.ts +1 -1
  50. package/dist/actions/honey/getHoneyCollaterals.d.ts.map +1 -1
  51. package/dist/actions/pol/getEarnedStakedBeraVault.d.ts +0 -23
  52. package/dist/actions/pol/getEarnedStakedBeraVault.d.ts.map +1 -1
  53. package/dist/actions/pol/getLSTStakeConfig.d.ts.map +1 -1
  54. package/dist/actions/pol/getSWBeraVaultMetadata.d.ts +1 -14
  55. package/dist/actions/pol/getSWBeraVaultMetadata.d.ts.map +1 -1
  56. package/dist/actions/pol/getStakedBeraAPY.d.ts +14 -0
  57. package/dist/actions/pol/getStakedBeraAPY.d.ts.map +1 -0
  58. package/dist/actions/pol/getStakedBeraSnapshots.d.ts +14 -4
  59. package/dist/actions/pol/getStakedBeraSnapshots.d.ts.map +1 -1
  60. package/dist/actions/pol/getStakingDailyAssets.d.ts +2 -2
  61. package/dist/actions/pol/getStakingDailyAssets.d.ts.map +1 -1
  62. package/dist/actions/server/exports.mjs +5 -5
  63. package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.d.ts +1 -1
  64. package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.d.ts.map +1 -1
  65. package/dist/actions/validators/getUserActiveValidators.d.ts +37 -1
  66. package/dist/actions/validators/getUserActiveValidators.d.ts.map +1 -1
  67. package/dist/actions/validators/getValidatorRewardAllocation.d.ts +4 -0
  68. package/dist/actions/validators/getValidatorRewardAllocation.d.ts.map +1 -1
  69. package/dist/{chunk-ZWTGVIPJ.mjs → chunk-4576RF2K.mjs} +29 -4
  70. package/dist/chunk-4576RF2K.mjs.map +1 -0
  71. package/dist/{chunk-UA3Z47LT.mjs → chunk-5PBYMJRG.mjs} +95 -24
  72. package/dist/chunk-5PBYMJRG.mjs.map +1 -0
  73. package/dist/{chunk-AEN6IJFU.mjs → chunk-7KN7TDUC.mjs} +2 -2
  74. package/dist/chunk-7OESHTBN.mjs +29 -0
  75. package/dist/chunk-7OESHTBN.mjs.map +1 -0
  76. package/dist/{chunk-IFNIPVTZ.mjs → chunk-BSLXKPX4.mjs} +4 -48
  77. package/dist/chunk-BSLXKPX4.mjs.map +1 -0
  78. package/dist/{chunk-PHYZRH4I.mjs → chunk-BZKA6DBM.mjs} +9 -13
  79. package/dist/chunk-BZKA6DBM.mjs.map +1 -0
  80. package/dist/{chunk-LE4CYW7S.mjs → chunk-FWRYUIJK.mjs} +3 -3
  81. package/dist/{chunk-PJRLHTGC.mjs → chunk-HPRLNT6R.mjs} +3 -3
  82. package/dist/chunk-J6GM7HWX.mjs +19 -0
  83. package/dist/chunk-J6GM7HWX.mjs.map +1 -0
  84. package/dist/{chunk-P3YZ7F22.mjs → chunk-LL7XR2H5.mjs} +34 -3
  85. package/dist/chunk-LL7XR2H5.mjs.map +1 -0
  86. package/dist/{chunk-EJIGERYM.mjs → chunk-M3MIGSH3.mjs} +2 -2
  87. package/dist/{chunk-NZAH3SGT.mjs → chunk-MVNQY2D4.mjs} +9 -4
  88. package/dist/chunk-MVNQY2D4.mjs.map +1 -0
  89. package/dist/{chunk-TGN55GKE.mjs → chunk-SC3BSCTN.mjs} +2 -2
  90. package/dist/{chunk-DOZJB6IJ.mjs → chunk-SMBAW7AG.mjs} +394 -344
  91. package/dist/chunk-SMBAW7AG.mjs.map +1 -0
  92. package/dist/{chunk-QQASX4LJ.mjs → chunk-TXWDUJOY.mjs} +2 -2
  93. package/dist/{chunk-EGAB6NFQ.mjs → chunk-UWJQ6UKG.mjs} +2 -2
  94. package/dist/chunk-XO2BFPTB.mjs +50 -0
  95. package/dist/chunk-XO2BFPTB.mjs.map +1 -0
  96. package/dist/{chunk-7TFV6UKF.mjs → chunk-XXKPXNQD.mjs} +1 -2
  97. package/dist/chunk-XXKPXNQD.mjs.map +1 -0
  98. package/dist/{chunk-J3LTASDE.mjs → chunk-ZHV3MQ4F.mjs} +4 -4
  99. package/dist/contexts/BeraFlags/BeraFlags.d.ts +1 -1
  100. package/dist/contexts/BeraFlags/BeraFlags.d.ts.map +1 -1
  101. package/dist/contexts/BeraFlags/defaultFlags.d.ts +2 -2
  102. package/dist/contexts/BeraFlags/defaultFlags.d.ts.map +1 -1
  103. package/dist/contexts/BexStatusProvider.d.ts +1 -1
  104. package/dist/contexts/BexStatusProvider.d.ts.map +1 -1
  105. package/dist/contexts/TokensProvider.d.ts +1 -1
  106. package/dist/contexts/TokensProvider.d.ts.map +1 -1
  107. package/dist/contexts/exports.mjs +9 -9
  108. package/dist/enum/contracts.d.ts +3 -0
  109. package/dist/enum/contracts.d.ts.map +1 -1
  110. package/dist/enum/exports.mjs +6 -4
  111. package/dist/enum/exports.mjs.map +1 -1
  112. package/dist/errors/RequestError.d.ts +19 -0
  113. package/dist/errors/RequestError.d.ts.map +1 -1
  114. package/dist/errors/errorMap.d.ts +4 -3
  115. package/dist/errors/errorMap.d.ts.map +1 -1
  116. package/dist/errors/exports.mjs +5 -5
  117. package/dist/hooks/dex/useAggregatorsQuotes.d.ts.map +1 -1
  118. package/dist/hooks/dex/useAllUserPools.d.ts.map +1 -1
  119. package/dist/hooks/dex/useCrossChainNativeFee.d.ts +32 -0
  120. package/dist/hooks/dex/useCrossChainNativeFee.d.ts.map +1 -0
  121. package/dist/hooks/dex/useOnChainPoolData.d.ts.map +1 -1
  122. package/dist/hooks/dex/usePools.d.ts.map +1 -1
  123. package/dist/hooks/dex/useSingleAggregatorQuote.d.ts.map +1 -1
  124. package/dist/hooks/enso/useBendZapSupply.d.ts +2 -2
  125. package/dist/hooks/enso/useBendZapSupply.d.ts.map +1 -1
  126. package/dist/hooks/enso/useEnsoUserTokensWithBalances.d.ts.map +1 -1
  127. package/dist/hooks/exports.d.ts +2 -5
  128. package/dist/hooks/exports.d.ts.map +1 -1
  129. package/dist/hooks/exports.mjs +590 -905
  130. package/dist/hooks/exports.mjs.map +1 -1
  131. package/dist/hooks/governance/exports.mjs +4 -4
  132. package/dist/hooks/honey/useHoneyChartData.d.ts.map +1 -1
  133. package/dist/hooks/pol/useRewardTokenToBeraRate.d.ts.map +1 -1
  134. package/dist/hooks/pol/useRewardVaultBalanceFromStakingToken.d.ts.map +1 -1
  135. package/dist/hooks/pol/useRewardVaults.d.ts.map +1 -1
  136. package/dist/hooks/pol/useStakedAPY.d.ts +11 -0
  137. package/dist/hooks/pol/useStakedAPY.d.ts.map +1 -0
  138. package/dist/hooks/pol/useStakedData.d.ts +2 -2
  139. package/dist/hooks/pol/useStakedData.d.ts.map +1 -1
  140. package/dist/hooks/pol/useStakingVaultsMetadata.d.ts +0 -1
  141. package/dist/hooks/pol/useStakingVaultsMetadata.d.ts.map +1 -1
  142. package/dist/hooks/tokens/useMultipleTokenInformation.d.ts +30 -0
  143. package/dist/hooks/tokens/useMultipleTokenInformation.d.ts.map +1 -1
  144. package/dist/hooks/tokens/usePollBalance.d.ts.map +1 -1
  145. package/dist/hooks/validators/useUserActiveValidators.d.ts +5 -0
  146. package/dist/hooks/validators/useUserActiveValidators.d.ts.map +1 -1
  147. package/dist/hooks/validators/useValidator.d.ts.map +1 -1
  148. package/dist/hooks/validators/useValidatorIncentiveDistribution.d.ts +3 -4
  149. package/dist/hooks/validators/useValidatorIncentiveDistribution.d.ts.map +1 -1
  150. package/dist/hooks/validators/useValidatorRewardAllocation.d.ts +1 -0
  151. package/dist/hooks/validators/useValidatorRewardAllocation.d.ts.map +1 -1
  152. package/dist/utils/crossChainBridge.d.ts +74 -0
  153. package/dist/utils/crossChainBridge.d.ts.map +1 -0
  154. package/dist/utils/exports.d.ts +1 -1
  155. package/dist/utils/exports.d.ts.map +1 -1
  156. package/dist/utils/exports.mjs +142 -72
  157. package/dist/utils/exports.mjs.map +1 -1
  158. package/dist/utils/getTestClient.d.ts +5 -3
  159. package/dist/utils/getTestClient.d.ts.map +1 -1
  160. package/dist/utils/parseWhiskToken.d.ts.map +1 -1
  161. package/package.json +8 -6
  162. package/src/actions/clients/BeraApolloClient.ts +4 -2
  163. package/src/actions/clients/clientName.ts +17 -0
  164. package/src/actions/clients/clientName.unit.test.ts +39 -0
  165. package/src/actions/clients/exports.ts +2 -0
  166. package/src/actions/clients/fetchBeep.ts +4 -1
  167. package/src/actions/clients/fetchEnso.ts +48 -0
  168. package/src/actions/clients/fetchLayerzero.ts +34 -0
  169. package/src/actions/clients/fetchOpenApi.ts +9 -2
  170. package/src/actions/clients/fetchOpenApi.unit.test.ts +26 -10
  171. package/src/actions/clients/getApolloClient.ts +3 -11
  172. package/src/actions/dex/__tests__/aggregators.unit.test.ts +231 -2
  173. package/src/actions/dex/aggregators/base.ts +75 -17
  174. package/src/actions/dex/aggregators/bex.ts +41 -1
  175. package/src/actions/dex/aggregators/bgt.ts +11 -6
  176. package/src/actions/dex/aggregators/enso/enso.ts +1 -0
  177. package/src/actions/dex/aggregators/enso/ensoErc4626.ts +27 -9
  178. package/src/actions/dex/aggregators/erc4626.ts +19 -5
  179. package/src/actions/dex/aggregators/fly.ts +1 -0
  180. package/src/actions/dex/aggregators/haiku.ts +33 -2
  181. package/src/actions/dex/aggregators/honey.ts +17 -6
  182. package/src/actions/dex/aggregators/kyberswap.ts +1 -0
  183. package/src/actions/dex/aggregators/oogabooga.ts +1 -0
  184. package/src/actions/dex/aggregators/openOcean.ts +1 -0
  185. package/src/actions/dex/aggregators/wbera.ts +17 -11
  186. package/src/actions/enso/getBendMultiplyBundle.ts +1 -1
  187. package/src/actions/enso/getEnsoUserTokensWithBalances.ts +4 -8
  188. package/src/actions/enso/util.ts +0 -59
  189. package/src/actions/exports.ts +3 -5
  190. package/src/actions/honey/getHoney24hVolume.ts +3 -12
  191. package/src/actions/honey/getHoneyCollaterals.ts +1 -1
  192. package/src/actions/pol/getBeraTokenTotalSupply.ts +3 -33
  193. package/src/actions/pol/getLSTStakeConfig.ts +0 -6
  194. package/src/actions/pol/getSWBeraVaultMetadata.ts +2 -106
  195. package/src/actions/pol/getStakedBeraAPY.ts +45 -0
  196. package/src/actions/pol/getStakedBeraSnapshots.ts +18 -34
  197. package/src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts +1 -1
  198. package/src/actions/validators/getUserActiveValidators.ts +116 -54
  199. package/src/actions/validators/getValidatorRewardAllocation.ts +12 -1
  200. package/src/contexts/BeraFlags/BeraFlags.tsx +1 -4
  201. package/src/contexts/BeraFlags/defaultFlags.ts +1 -3
  202. package/src/contexts/BexStatusProvider.tsx +1 -1
  203. package/src/contexts/TokensProvider.tsx +1 -4
  204. package/src/enum/contracts.ts +3 -0
  205. package/src/errors/BeraError.unit.test.ts +23 -0
  206. package/src/errors/RequestError.ts +46 -9
  207. package/src/errors/RequestError.unit.test.ts +54 -0
  208. package/src/errors/errorMap.ts +8 -3
  209. package/src/errors/getErrorMessage.unit.test.ts +32 -0
  210. package/src/hooks/dex/useAggregatorsQuotes.ts +7 -1
  211. package/src/hooks/dex/useCrossChainNativeFee.ts +83 -0
  212. package/src/hooks/dex/useCrossChainNativeFee.unit.test.ts +63 -0
  213. package/src/hooks/dex/useOnChainPoolData.ts +30 -13
  214. package/src/hooks/dex/useSingleAggregatorQuote.ts +4 -2
  215. package/src/hooks/enso/useBendZapSupply.ts +9 -38
  216. package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +10 -2
  217. package/src/hooks/enso/useZapStakeBera.ts +1 -1
  218. package/src/hooks/exports.ts +2 -5
  219. package/src/hooks/pol/useAutoclaimedIncentives.ts +6 -3
  220. package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +5 -2
  221. package/src/hooks/pol/useRewardTokenToBeraRate.ts +5 -4
  222. package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +0 -1
  223. package/src/hooks/pol/{useStakedAPR.ts → useStakedAPY.ts} +11 -9
  224. package/src/hooks/pol/useStakedData.ts +13 -14
  225. package/src/hooks/pol/useStakingVaultsMetadata.ts +3 -8
  226. package/src/hooks/tokens/useMultipleTokenInformation.ts +64 -21
  227. package/src/hooks/tokens/useMultipleTokenInformation.unit.test.ts +91 -0
  228. package/src/hooks/tokens/usePollBalance.ts +4 -2
  229. package/src/hooks/validators/useUserActiveValidators.ts +54 -9
  230. package/src/hooks/validators/useValidatorIncentiveDistribution.ts +3 -4
  231. package/src/types/bribeBoost.d.ts +0 -49
  232. package/src/types/dex.d.ts +17 -0
  233. package/src/types/enso.d.ts +1 -27
  234. package/src/types/global.d.ts +7 -0
  235. package/src/types/pol.d.ts +3 -48
  236. package/src/utils/crossChainBridge.ts +290 -0
  237. package/src/utils/crossChainBridge.unit.test.ts +177 -0
  238. package/src/utils/exports.ts +1 -1
  239. package/dist/BeraError-7-A5JYy_.d.ts +0 -123
  240. package/dist/BexStatusProvider-DRymVlQf.d.ts +0 -70
  241. package/dist/HoneyConfigProvider-COOuDNra.d.ts +0 -390
  242. package/dist/RequestError-DkUbo3ro.d.ts +0 -145
  243. package/dist/actions/clients/fetchOpenApi.unit.test.d.ts +0 -2
  244. package/dist/actions/clients/fetchOpenApi.unit.test.d.ts.map +0 -1
  245. package/dist/actions/dex/__tests__/aggregators.unit.test.d.ts +0 -2
  246. package/dist/actions/dex/__tests__/aggregators.unit.test.d.ts.map +0 -1
  247. package/dist/actions/dex/__tests__/allPools.integration.test.d.ts +0 -2
  248. package/dist/actions/dex/__tests__/allPools.integration.test.d.ts.map +0 -1
  249. package/dist/actions/dex/__tests__/getOnChainPool.unit.test.d.ts +0 -2
  250. package/dist/actions/dex/__tests__/getOnChainPool.unit.test.d.ts.map +0 -1
  251. package/dist/actions/dex/aggregators/enso/ensoErc4626.debug.test.d.ts +0 -2
  252. package/dist/actions/dex/aggregators/enso/ensoErc4626.debug.test.d.ts.map +0 -1
  253. package/dist/actions/dex/aggregators/haiku.integration.test.d.ts +0 -2
  254. package/dist/actions/dex/aggregators/haiku.integration.test.d.ts.map +0 -1
  255. package/dist/actions/dex/b-sdk.d.ts +0 -3
  256. package/dist/actions/enso/__tests__/getBendDemultiplyBundle.action.unit.test.d.ts +0 -2
  257. package/dist/actions/enso/__tests__/getBendDemultiplyBundle.action.unit.test.d.ts.map +0 -1
  258. package/dist/actions/enso/__tests__/getBendDemultiplyBundle.unit.test.d.ts +0 -2
  259. package/dist/actions/enso/__tests__/getBendDemultiplyBundle.unit.test.d.ts.map +0 -1
  260. package/dist/actions/enso/__tests__/getBendMultiplyBundle.action.unit.test.d.ts +0 -2
  261. package/dist/actions/enso/__tests__/getBendMultiplyBundle.action.unit.test.d.ts.map +0 -1
  262. package/dist/actions/enso/__tests__/getBendMultiplyBundle.unit.test.d.ts +0 -2
  263. package/dist/actions/enso/__tests__/getBendMultiplyBundle.unit.test.d.ts.map +0 -1
  264. package/dist/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.d.ts +0 -2
  265. package/dist/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.d.ts.map +0 -1
  266. package/dist/actions/enso/__tests__/util.unit.test.d.ts +0 -2
  267. package/dist/actions/enso/__tests__/util.unit.test.d.ts.map +0 -1
  268. package/dist/actions/enso/getEnsoSwapBundle.d.ts +0 -3
  269. package/dist/actions/enso/getEnsoSwapBundle.d.ts.map +0 -1
  270. package/dist/actions/governance/__tests__/checkProposalField.unit.test.d.ts +0 -2
  271. package/dist/actions/governance/__tests__/checkProposalField.unit.test.d.ts.map +0 -1
  272. package/dist/actions/governance/__tests__/getDecodedFunctionData.integration.test.d.ts +0 -2
  273. package/dist/actions/governance/__tests__/getDecodedFunctionData.integration.test.d.ts.map +0 -1
  274. package/dist/actions/governance/__tests__/getQuorum.integration.test.d.ts +0 -2
  275. package/dist/actions/governance/__tests__/getQuorum.integration.test.d.ts.map +0 -1
  276. package/dist/actions/honey/tests/pyth.integration.test.d.ts +0 -2
  277. package/dist/actions/honey/tests/pyth.integration.test.d.ts.map +0 -1
  278. package/dist/actions/pol/__tests__/getAllValidators.integration.test.d.ts +0 -2
  279. package/dist/actions/pol/__tests__/getAllValidators.integration.test.d.ts.map +0 -1
  280. package/dist/actions/pol/__tests__/getValidator.integration.test.d.ts +0 -2
  281. package/dist/actions/pol/__tests__/getValidator.integration.test.d.ts.map +0 -1
  282. package/dist/actions/pol/__tests__/rewardVaults.integration.test.d.ts +0 -2
  283. package/dist/actions/pol/__tests__/rewardVaults.integration.test.d.ts.map +0 -1
  284. package/dist/actions/pol/getBgtAprSimultaion.unit.test.d.ts +0 -2
  285. package/dist/actions/pol/getBgtAprSimultaion.unit.test.d.ts.map +0 -1
  286. package/dist/actions/pol/getBgtIncentiveDistributorPaused.d.ts +0 -10
  287. package/dist/actions/pol/getBgtIncentiveDistributorPaused.d.ts.map +0 -1
  288. package/dist/actions/pol/getBlockTime.debug.test.d.ts +0 -2
  289. package/dist/actions/pol/getBlockTime.debug.test.d.ts.map +0 -1
  290. package/dist/actions/pol/getRewardProofsByValidator.d.ts +0 -9
  291. package/dist/actions/pol/getRewardProofsByValidator.d.ts.map +0 -1
  292. package/dist/actions/pol/getRewardVaultBeaconImplementation.integration.test.d.ts +0 -2
  293. package/dist/actions/pol/getRewardVaultBeaconImplementation.integration.test.d.ts.map +0 -1
  294. package/dist/actions/pol/getRewardVaultDurationConstants.integration.test.d.ts +0 -2
  295. package/dist/actions/pol/getRewardVaultDurationConstants.integration.test.d.ts.map +0 -1
  296. package/dist/actions/pol/getStakedBeraAPR.d.ts +0 -12
  297. package/dist/actions/pol/getStakedBeraAPR.d.ts.map +0 -1
  298. package/dist/actions/pol/getUserClaimableIncentives.d.ts +0 -9
  299. package/dist/actions/pol/getUserClaimableIncentives.d.ts.map +0 -1
  300. package/dist/actions/prices/__tests__/prices.integration.test.d.ts +0 -2
  301. package/dist/actions/prices/__tests__/prices.integration.test.d.ts.map +0 -1
  302. package/dist/actions/tokens/getWalletBalances.integration.test.d.ts +0 -2
  303. package/dist/actions/tokens/getWalletBalances.integration.test.d.ts.map +0 -1
  304. package/dist/actions/transactions/beraWriteContract.integration.test.d.ts +0 -2
  305. package/dist/actions/transactions/beraWriteContract.integration.test.d.ts.map +0 -1
  306. package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.integration.test.d.ts +0 -2
  307. package/dist/actions/validators/getActiveBoostAndCommissionChangeDelay.integration.test.d.ts.map +0 -1
  308. package/dist/actions/validators/getValidatorAnalytics.d.ts +0 -12
  309. package/dist/actions/validators/getValidatorAnalytics.d.ts.map +0 -1
  310. package/dist/actions/validators/utils/__tests__/validatorUtils.integration.test.d.ts +0 -2
  311. package/dist/actions/validators/utils/__tests__/validatorUtils.integration.test.d.ts.map +0 -1
  312. package/dist/actions/validators/utils/aggregateValidatorIncentives.unit.test.d.ts +0 -2
  313. package/dist/actions/validators/utils/aggregateValidatorIncentives.unit.test.d.ts.map +0 -1
  314. package/dist/chunk-7TFV6UKF.mjs.map +0 -1
  315. package/dist/chunk-BSOWLS3W.mjs +0 -40
  316. package/dist/chunk-BSOWLS3W.mjs.map +0 -1
  317. package/dist/chunk-DOZJB6IJ.mjs.map +0 -1
  318. package/dist/chunk-IFNIPVTZ.mjs.map +0 -1
  319. package/dist/chunk-NZAH3SGT.mjs.map +0 -1
  320. package/dist/chunk-P3YZ7F22.mjs.map +0 -1
  321. package/dist/chunk-PHYZRH4I.mjs.map +0 -1
  322. package/dist/chunk-UA3Z47LT.mjs.map +0 -1
  323. package/dist/chunk-ZWTGVIPJ.mjs.map +0 -1
  324. package/dist/contexts/block-time-provider.d.ts +0 -10
  325. package/dist/defaultFlags-D6KfkTZx.d.ts +0 -10
  326. package/dist/dex-C_BB0b0O.d.ts +0 -37
  327. package/dist/errors/BeraError.unit.test.d.ts +0 -2
  328. package/dist/errors/BeraError.unit.test.d.ts.map +0 -1
  329. package/dist/errors/BeraTracing.unit.test.d.ts +0 -2
  330. package/dist/errors/BeraTracing.unit.test.d.ts.map +0 -1
  331. package/dist/errors/RequestError.unit.test.d.ts +0 -2
  332. package/dist/errors/RequestError.unit.test.d.ts.map +0 -1
  333. package/dist/errors/assert.unit.test.d.ts +0 -2
  334. package/dist/errors/assert.unit.test.d.ts.map +0 -1
  335. package/dist/errors/getRevertReason.integration.test.d.ts +0 -2
  336. package/dist/errors/getRevertReason.integration.test.d.ts.map +0 -1
  337. package/dist/errors/spanStatus.unit.test.d.ts +0 -2
  338. package/dist/errors/spanStatus.unit.test.d.ts.map +0 -1
  339. package/dist/getApolloClient-MWm_iq4u.d.ts +0 -39
  340. package/dist/getProposalVotes-DAUrdX2n.d.ts +0 -12
  341. package/dist/getValidatorQueuedOperatorAddress-N2I7wHd6.d.ts +0 -511
  342. package/dist/global.d-CR3zicga.d.ts +0 -231
  343. package/dist/global.d-CiZJ2eHz.d.ts +0 -231
  344. package/dist/honey-CYm0RWf4.d.ts +0 -14
  345. package/dist/hooks/enso/useEnsoSwapBundle.d.ts +0 -26
  346. package/dist/hooks/enso/useEnsoSwapBundle.d.ts.map +0 -1
  347. package/dist/hooks/pol/useBgtIncentiveDistributorPaused.d.ts +0 -8
  348. package/dist/hooks/pol/useBgtIncentiveDistributorPaused.d.ts.map +0 -1
  349. package/dist/hooks/pol/useStakedAPR.d.ts +0 -11
  350. package/dist/hooks/pol/useStakedAPR.d.ts.map +0 -1
  351. package/dist/hooks/validators/useUserClaimableIncentives.d.ts +0 -8
  352. package/dist/hooks/validators/useUserClaimableIncentives.d.ts.map +0 -1
  353. package/dist/hooks/validators/useValidatorAnalytics.d.ts +0 -11
  354. package/dist/hooks/validators/useValidatorAnalytics.d.ts.map +0 -1
  355. package/dist/pol.d-CeRgXBL8.d.ts +0 -167
  356. package/dist/txnEnum-ByI5dtDi.d.ts +0 -106
  357. package/dist/types/bribe-boost.d.ts +0 -69
  358. package/dist/types/bribeBoost.d.ts +0 -69
  359. package/dist/types/dex.d.ts +0 -225
  360. package/dist/types/enso.d.ts +0 -76
  361. package/dist/types/global.d.ts +0 -198
  362. package/dist/types/governance.d.ts +0 -112
  363. package/dist/types/honeySwap.d.ts +0 -23
  364. package/dist/types/pol.d.ts +0 -78
  365. package/dist/types/staking.d.ts +0 -22
  366. package/dist/useHoneySwapState-CXVWAThr.d.ts +0 -32
  367. package/dist/useHoneySwapState-twi7NTaO.d.ts +0 -32
  368. package/dist/utils/createEmitter.unit.test.d.ts +0 -2
  369. package/dist/utils/createEmitter.unit.test.d.ts.map +0 -1
  370. package/dist/utils/formatIncentivesTokenMap.d.ts +0 -3
  371. package/dist/utils/formatIncentivesTokenMap.d.ts.map +0 -1
  372. package/dist/utils/formatNumber.unit.test.d.ts +0 -2
  373. package/dist/utils/formatNumber.unit.test.d.ts.map +0 -1
  374. package/dist/utils/formatTimestamps.unit.test.d.ts +0 -2
  375. package/dist/utils/formatTimestamps.unit.test.d.ts.map +0 -1
  376. package/dist/utils/getContractName.unit.test.d.ts +0 -2
  377. package/dist/utils/getContractName.unit.test.d.ts.map +0 -1
  378. package/dist/utils/getHoneySwapMessage.test.d.ts +0 -2
  379. package/dist/utils/getHoneySwapMessage.test.d.ts.map +0 -1
  380. package/dist/utils/layerZeroScan.d.ts +0 -39
  381. package/dist/utils/layerZeroScan.d.ts.map +0 -1
  382. package/dist/utils/math.unit.test.d.ts +0 -2
  383. package/dist/utils/math.unit.test.d.ts.map +0 -1
  384. package/dist/utils/parseBaseArgs.unit.test.d.ts +0 -2
  385. package/dist/utils/parseBaseArgs.unit.test.d.ts.map +0 -1
  386. package/dist/utils/polyfillAbortSignalAny.unit.test.d.ts +0 -2
  387. package/dist/utils/polyfillAbortSignalAny.unit.test.d.ts.map +0 -1
  388. package/dist/utils/time.unit.test.d.ts +0 -2
  389. package/dist/utils/time.unit.test.d.ts.map +0 -1
  390. package/dist/utils/tokens.unit.test.d.ts +0 -2
  391. package/dist/utils/tokens.unit.test.d.ts.map +0 -1
  392. package/dist/utils/truncateHash.unit.test.d.ts +0 -2
  393. package/dist/utils/truncateHash.unit.test.d.ts.map +0 -1
  394. package/src/actions/enso/getEnsoSwapBundle.ts +0 -72
  395. package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +0 -28
  396. package/src/actions/pol/getRewardProofsByValidator.ts +0 -49
  397. package/src/actions/pol/getStakedBeraAPR.ts +0 -56
  398. package/src/actions/pol/getUserClaimableIncentives.ts +0 -40
  399. package/src/actions/validators/getValidatorAnalytics.ts +0 -37
  400. package/src/hooks/enso/useEnsoSwapBundle.ts +0 -121
  401. package/src/hooks/pol/useBgtIncentiveDistributorPaused.ts +0 -34
  402. package/src/hooks/validators/useUserClaimableIncentives.ts +0 -148
  403. package/src/hooks/validators/useValidatorAnalytics.ts +0 -37
  404. package/src/utils/formatIncentivesTokenMap.ts +0 -19
  405. package/src/utils/layerZeroScan.ts +0 -124
  406. /package/dist/{chunk-AEN6IJFU.mjs.map → chunk-7KN7TDUC.mjs.map} +0 -0
  407. /package/dist/{chunk-LE4CYW7S.mjs.map → chunk-FWRYUIJK.mjs.map} +0 -0
  408. /package/dist/{chunk-PJRLHTGC.mjs.map → chunk-HPRLNT6R.mjs.map} +0 -0
  409. /package/dist/{chunk-EJIGERYM.mjs.map → chunk-M3MIGSH3.mjs.map} +0 -0
  410. /package/dist/{chunk-TGN55GKE.mjs.map → chunk-SC3BSCTN.mjs.map} +0 -0
  411. /package/dist/{chunk-QQASX4LJ.mjs.map → chunk-TXWDUJOY.mjs.map} +0 -0
  412. /package/dist/{chunk-EGAB6NFQ.mjs.map → chunk-UWJQ6UKG.mjs.map} +0 -0
  413. /package/dist/{chunk-J3LTASDE.mjs.map → chunk-ZHV3MQ4F.mjs.map} +0 -0
@@ -1,25 +1,28 @@
1
1
  import {
2
2
  getApolloClient
3
- } from "./chunk-PHYZRH4I.mjs";
3
+ } from "./chunk-BZKA6DBM.mjs";
4
4
  import {
5
5
  fetchBeep
6
- } from "./chunk-BSOWLS3W.mjs";
6
+ } from "./chunk-7OESHTBN.mjs";
7
7
  import {
8
8
  pythAbi
9
9
  } from "./chunk-GWSTVITN.mjs";
10
+ import {
11
+ getEnsoClient
12
+ } from "./chunk-ZHV3MQ4F.mjs";
10
13
  import {
11
14
  NotFoundError,
12
15
  TransactionFailedError
13
- } from "./chunk-EJIGERYM.mjs";
16
+ } from "./chunk-M3MIGSH3.mjs";
14
17
  import {
15
18
  BeraMonitoring,
16
19
  initBeraError
17
- } from "./chunk-LE4CYW7S.mjs";
20
+ } from "./chunk-FWRYUIJK.mjs";
18
21
  import {
19
22
  assertAddress,
20
23
  assertDefined,
21
24
  assertPublicClient
22
- } from "./chunk-QQASX4LJ.mjs";
25
+ } from "./chunk-TXWDUJOY.mjs";
23
26
  import {
24
27
  CAP_LIMIT_BUFFER,
25
28
  DEFAULT_METAMASK_GAS_LIMIT,
@@ -34,27 +37,26 @@ import {
34
37
  } from "./chunk-35RACQD4.mjs";
35
38
  import {
36
39
  beraFetch,
37
- beraFetchJson,
38
- getErrorResponse
39
- } from "./chunk-ZWTGVIPJ.mjs";
40
+ beraFetchJson
41
+ } from "./chunk-4576RF2K.mjs";
40
42
  import {
41
43
  beraToken,
42
44
  getHoneyToken,
43
45
  isToken
44
- } from "./chunk-PJRLHTGC.mjs";
46
+ } from "./chunk-HPRLNT6R.mjs";
45
47
  import {
46
48
  parseBaseArgs
47
- } from "./chunk-TGN55GKE.mjs";
49
+ } from "./chunk-SC3BSCTN.mjs";
48
50
  import {
49
51
  RequestError
50
- } from "./chunk-P3YZ7F22.mjs";
52
+ } from "./chunk-LL7XR2H5.mjs";
51
53
  import {
52
54
  BeraError,
53
55
  InvalidArgumentError,
54
56
  commonAbiErrors,
55
57
  parseDecodedError,
56
58
  parseViemError
57
- } from "./chunk-NZAH3SGT.mjs";
59
+ } from "./chunk-MVNQY2D4.mjs";
58
60
 
59
61
  // src/actions/bend/getConvertToAssets.ts
60
62
  import { formatEther } from "viem";
@@ -79,6 +81,26 @@ var BaseAggregator = class _BaseAggregator {
79
81
  static PATH_NOT_FOUND_REASON = RequestError.REASON_MAP.NO_SWAP_PATHS;
80
82
  needsAccountForQuote = false;
81
83
  notFoundMessages = [];
84
+ /**
85
+ * Whether this aggregator can handle a BERA↔WBERA pair.
86
+ *
87
+ * Most aggregators normalize native BERA → WBERA before routing (see
88
+ * `parseAddresses`), so a BERA↔WBERA pair collapses to WBERA↔WBERA and the
89
+ * external router rejects it as "same token" (e.g. Enso 400, HUB-9FQ). For
90
+ * those, `getUnsupportedReason` rejects the pair up-front so no request fires.
91
+ * Only the dedicated wrap/unwrap aggregator sets this `true`.
92
+ */
93
+ supportsBeraWrap = false;
94
+ /**
95
+ * Whether this aggregator can bridge — route a pair whose tokens live on
96
+ * different chains (`tokenIn.chainId !== tokenOut.chainId`).
97
+ *
98
+ * Most aggregators only route within a single chain; handed a cross-chain
99
+ * pair they would 400 or, worse, quote garbage against the wrong chain.
100
+ * `getUnsupportedReason` rejects such pairs up-front unless this is `true`.
101
+ * Only bridging aggregators (Enso via LayerZero) set it.
102
+ */
103
+ supportsBridging = false;
82
104
  config;
83
105
  chainId;
84
106
  constructor(args = {}) {
@@ -174,27 +196,50 @@ var BaseAggregator = class _BaseAggregator {
174
196
  ];
175
197
  }
176
198
  /**
177
- * Check if chain is supported
199
+ * Returns a human-readable reason this aggregator can't route the pair, or
200
+ * `null` if it can. Callers gate on `=== null`; `assertChainSupport` throws
201
+ * the reason so users get an accurate message (not a misleading "does not
202
+ * support chain ID" for what is actually a same-token pair).
178
203
  */
179
- checkChainSupport({
204
+ getUnsupportedReason({
180
205
  tokenIn,
181
206
  tokenOut
182
207
  }) {
183
- if (this.supportedChains === null) {
184
- return true;
208
+ if (isToken(tokenIn, tokenOut)) {
209
+ return `${this.name} cannot route between the same token (${tokenIn.symbol}).`;
185
210
  }
186
- return this.supportedChains.includes(tokenIn.chainId) && this.supportedChains.includes(tokenOut.chainId);
211
+ if (!this.supportsBeraWrap) {
212
+ let normalize2 = function(token) {
213
+ return (isToken(token, "BERA") ? wbera : token.address).toLowerCase();
214
+ };
215
+ var normalize = normalize2;
216
+ const wbera = this.config.tokens.wbera;
217
+ if (normalize2(tokenIn) === normalize2(tokenOut)) {
218
+ return `${this.name} cannot route between BERA and WBERA \u2014 use wrap/unwrap instead.`;
219
+ }
220
+ }
221
+ if (tokenIn.chainId !== tokenOut.chainId && !this.supportsBridging) {
222
+ return `${this.name} cannot route across chains (${tokenIn.chainId} \u2192 ${tokenOut.chainId}).`;
223
+ }
224
+ if (this.supportedChains !== null && (!this.supportedChains.includes(tokenIn.chainId) || !this.supportedChains.includes(tokenOut.chainId))) {
225
+ return `${this.name} does not support tokens chain ID: ${tokenIn.chainId} and ${tokenOut.chainId}`;
226
+ }
227
+ return null;
187
228
  }
188
229
  assertChainSupport({
189
230
  tokenIn,
190
231
  tokenOut,
191
- underlyingToken
232
+ underlyingToken,
233
+ honeyNativeState
192
234
  }) {
193
- if (!this.checkChainSupport({ tokenIn, tokenOut, underlyingToken })) {
194
- throw new BeraError({
195
- message: `${this.name} does not support tokens chain ID: ${tokenIn.chainId} and ${tokenOut.chainId}`,
196
- level: "error"
197
- });
235
+ const reason = this.getUnsupportedReason({
236
+ tokenIn,
237
+ tokenOut,
238
+ underlyingToken,
239
+ honeyNativeState
240
+ });
241
+ if (reason !== null) {
242
+ throw new BeraError({ message: reason, level: "error" });
198
243
  }
199
244
  }
200
245
  async fetch(url, options) {
@@ -220,6 +265,157 @@ var BaseAggregator = class _BaseAggregator {
220
265
  }
221
266
  };
222
267
 
268
+ // src/actions/dex/aggregators/enso/ensoErc4626.ts
269
+ import { ethAddress, zeroAddress as zeroAddress2 } from "viem";
270
+ var EnsoErc4626Aggregator = class extends BaseAggregator {
271
+ name = "Enso (Mint)" /* EnsoErc4626 */;
272
+ supportedChains = null;
273
+ supportsBridging = true;
274
+ type = "rest";
275
+ needsAccountForQuote = true;
276
+ notFoundMessages = [
277
+ "Could not build shortcuts for route",
278
+ "Could not quote shortcuts for route",
279
+ "Swap not found for a required underlying of defi route,",
280
+ "No route found from"
281
+ ];
282
+ async getQuote({
283
+ tokenIn,
284
+ tokenOut,
285
+ amount,
286
+ slippage,
287
+ account = zeroAddress2,
288
+ aggregatorsFeeBps,
289
+ proxyAggregatorsThroughVercel = false,
290
+ rewardVault,
291
+ underlyingToken
292
+ }) {
293
+ this.assertChainSupport({ tokenIn, tokenOut });
294
+ assertAddress(account, "account");
295
+ const ensoClient = getEnsoClient({
296
+ baseURL: proxyAggregatorsThroughVercel ? "/api/enso" : void 0
297
+ });
298
+ if (tokenIn.address === zeroAddress2) tokenIn.address = ethAddress;
299
+ if (tokenOut.address === zeroAddress2) tokenOut.address = ethAddress;
300
+ const zapTokenOut = underlyingToken ?? tokenOut;
301
+ const isCrossChain = tokenIn.chainId !== zapTokenOut.chainId;
302
+ const bundleActions = [
303
+ // this is the base route action, which will swap the token in to the zap token out
304
+ // it handles cross-chain swaps and refunds the user if the swap fails
305
+ // this might even be the only action if no underlying token or reward vault is provided
306
+ {
307
+ protocol: "enso",
308
+ action: "route",
309
+ args: {
310
+ tokenIn: tokenIn.address,
311
+ tokenOut: zapTokenOut.address,
312
+ // must be undefined if the token is the same chain
313
+ destinationChainId: isCrossChain ? zapTokenOut.chainId : void 0,
314
+ refundReceiver: account,
315
+ receiver: account,
316
+ amountIn: amount,
317
+ slippage: slippage * 100,
318
+ // Enso expects slippage in basis points
319
+ // We can't track CCIP delivery status (no poller in crossChainBridge),
320
+ // so keep Enso from routing cross-chain zaps through it.
321
+ ignoreBridges: isCrossChain ? ["ccip"] : void 0
322
+ }
323
+ }
324
+ ];
325
+ if (underlyingToken) {
326
+ bundleActions.push({
327
+ protocol: "erc4626",
328
+ action: "deposit",
329
+ args: {
330
+ amountIn: { useOutputOfCallAt: 0 },
331
+ tokenIn: underlyingToken.address,
332
+ primaryAddress: tokenOut.address,
333
+ tokenOut: tokenOut.address
334
+ }
335
+ });
336
+ }
337
+ if (rewardVault) {
338
+ const offset = bundleActions.length;
339
+ bundleActions.push(
340
+ {
341
+ protocol: "enso",
342
+ action: "balance",
343
+ args: {
344
+ token: tokenOut.address
345
+ }
346
+ },
347
+ {
348
+ protocol: "erc20",
349
+ action: "approve",
350
+ args: {
351
+ amount: { useOutputOfCallAt: offset },
352
+ spender: rewardVault,
353
+ token: tokenOut.address
354
+ }
355
+ },
356
+ {
357
+ protocol: "enso",
358
+ action: "call",
359
+ args: {
360
+ address: rewardVault,
361
+ args: [account, { useOutputOfCallAt: offset }],
362
+ method: "stakeOnBehalf",
363
+ abi: "function stakeOnBehalf(address account, uint256 amount) external"
364
+ }
365
+ },
366
+ {
367
+ protocol: "enso",
368
+ action: "balance",
369
+ args: {
370
+ token: rewardVault
371
+ }
372
+ }
373
+ );
374
+ }
375
+ const bundle = await ensoClient.getBundleData(
376
+ {
377
+ fromAddress: account,
378
+ receiver: account,
379
+ spender: account,
380
+ chainId: tokenIn.chainId,
381
+ routingStrategy: "router"
382
+ },
383
+ bundleActions
384
+ );
385
+ const bridgeProtocol = bundle.route?.find(
386
+ (hop) => hop.action === "bridge"
387
+ )?.protocol;
388
+ const tokenOutAddress = rewardVault?.toLowerCase() ?? tokenOut.address.toLowerCase();
389
+ const amountOut = String(
390
+ bundle.minAmountsOut?.[tokenOutAddress] ?? bundle.amountsOut?.[tokenOutAddress] ?? "0"
391
+ );
392
+ return {
393
+ amountOut,
394
+ amountIn: amount,
395
+ allowanceRequirements: this.parseAllowanceRequirements({
396
+ tokenIn,
397
+ rawAmount: amount,
398
+ spender: bundle.tx.to
399
+ }),
400
+ name: this.name,
401
+ swapFeeBps: 0,
402
+ isCrossChain,
403
+ srcChainId: tokenIn.chainId,
404
+ bridgeProtocol,
405
+ priceImpactPercentage: bundle.priceImpact ? bundle.priceImpact / 100 : null,
406
+ getCalldata: () => ({
407
+ address: bundle.tx.to,
408
+ data: bundle.tx.data,
409
+ value: BigInt(bundle.tx.value ?? 0),
410
+ extraTags: { aggregator: this.name }
411
+ // not returning gas limit because it's usually underestimated by enso.
412
+ // gasLimit: BigInt(bundle.gas),
413
+ })
414
+ };
415
+ }
416
+ };
417
+ var ensoErc4626 = new EnsoErc4626Aggregator();
418
+
223
419
  // src/actions/dex/bSdk.ts
224
420
  import {
225
421
  API_CHAIN_NAMES,
@@ -233,7 +429,7 @@ import {
233
429
  VAULT,
234
430
  WEIGHTED_POOL_FACTORY_BALANCER_V2
235
431
  } from "@berachain-foundation/berancer-sdk";
236
- import { zeroAddress as zeroAddress2 } from "viem";
432
+ import { zeroAddress as zeroAddress3 } from "viem";
237
433
  import { berachain, berachainBepolia } from "viem/chains";
238
434
  import { chainConfigs } from "@berachain/config/internal";
239
435
  for (const chain of Object.keys(chainConfigs)) {
@@ -245,11 +441,11 @@ for (const chain of Object.keys(chainConfigs)) {
245
441
  BALANCER_RELAYER[chainId] = config.bex.relayer;
246
442
  VAULT[chainId] = config.bex.vault;
247
443
  BALANCER_QUERIES[chainId] = config.bex.queries;
248
- WEIGHTED_POOL_FACTORY_BALANCER_V2[chainId] = zeroAddress2;
249
- COMPOSABLE_STABLE_POOL_FACTORY[chainId] = zeroAddress2;
444
+ WEIGHTED_POOL_FACTORY_BALANCER_V2[chainId] = zeroAddress3;
445
+ COMPOSABLE_STABLE_POOL_FACTORY[chainId] = zeroAddress3;
250
446
  const nativeToken = new Token(
251
447
  chainId,
252
- zeroAddress2,
448
+ zeroAddress3,
253
449
  beraToken.decimals,
254
450
  beraToken.name,
255
451
  beraToken.symbol,
@@ -919,12 +1115,6 @@ async function getWeights({
919
1115
 
920
1116
  // src/actions/honey/getHoney24hVolume.ts
921
1117
  async function getHoney24hVolume() {
922
- if (typeof window === "undefined") {
923
- throw new BeraError({
924
- message: "getHoney24hVolume is browser-only; call from a Client Component / SWR hook",
925
- level: "error"
926
- });
927
- }
928
1118
  const snapshots = await fetchBeep("/v0/honey/snapshots/{interval}", {
929
1119
  path: { interval: "hour" },
930
1120
  query: { perPage: "24" }
@@ -1550,21 +1740,6 @@ function getBgtAprSimulation({
1550
1740
  };
1551
1741
  }
1552
1742
 
1553
- // src/actions/pol/getBgtIncentiveDistributorPaused.ts
1554
- import { bgtIncentiveDistributorAbi } from "@berachain/abis/pol/rewards/bgtIncentiveDistributor";
1555
- async function getBgtIncentiveDistributorPaused({
1556
- publicClient,
1557
- ...args
1558
- }) {
1559
- assertPublicClient(publicClient);
1560
- const { config } = parseBaseArgs(args);
1561
- return publicClient.readContract({
1562
- address: config.pol.bgtIncentiveDistributor,
1563
- abi: bgtIncentiveDistributorAbi,
1564
- functionName: "paused"
1565
- });
1566
- }
1567
-
1568
1743
  // src/actions/pol/getEarnedStakedBeraVault.ts
1569
1744
  async function getEarnedStakedBeraVault({
1570
1745
  address,
@@ -1702,38 +1877,6 @@ async function getMarkets(args = {}) {
1702
1877
  }
1703
1878
  }
1704
1879
 
1705
- // src/actions/pol/getRewardProofsByValidator.ts
1706
- async function getRewardProofsByValidator({
1707
- account,
1708
- validator,
1709
- page = 1,
1710
- perPage = 1e3,
1711
- ...args
1712
- }) {
1713
- const { config } = parseBaseArgs(args);
1714
- const result = await fetch(
1715
- `${config.pol.bribeBoostApi}/api/v1/wallets/${account.toLowerCase()}/proofs/validator/${validator.toLowerCase()}?page=${page}&per_page=${perPage}`,
1716
- {
1717
- cache: "no-store"
1718
- }
1719
- );
1720
- if (!result.ok) {
1721
- const error = await getErrorResponse(result);
1722
- throw new BeraError({
1723
- message: "Failed to fetch proofs on server",
1724
- cause: {
1725
- error,
1726
- result,
1727
- account,
1728
- validator
1729
- },
1730
- reason: error?.reason
1731
- });
1732
- }
1733
- const data = await result.json();
1734
- return data;
1735
- }
1736
-
1737
1880
  // src/actions/pol/getRewardTokenToBeraRate.ts
1738
1881
  import { formatUnits as formatUnits6, parseUnits as parseUnits5 } from "viem";
1739
1882
  import { wberaStakerVaultAbi as stakeBeraVaultAbi } from "@berachain/abis/pol/wberaStakerVault";
@@ -1988,64 +2131,44 @@ async function getRewardVaults({
1988
2131
  };
1989
2132
  }
1990
2133
 
1991
- // src/actions/pol/getStakedBeraAPR.ts
1992
- import {
1993
- GetSWberaVaultMetadata,
1994
- GqlSWberaVaultMetadataResolution
1995
- } from "@berachain/graphql/pol/api";
1996
- function getResolution(window2) {
1997
- if (window2 === "DAY") {
1998
- return GqlSWberaVaultMetadataResolution.OneDay;
2134
+ // src/actions/pol/getStakedBeraAPY.ts
2135
+ function getBeepResolutionEnum(window2) {
2136
+ switch (window2) {
2137
+ case "18HOURS":
2138
+ return "EIGHTEEN_HOURS";
2139
+ case "12HOURS":
2140
+ return "TWELVE_HOURS";
2141
+ case "6HOURS":
2142
+ return "SIX_HOURS";
2143
+ case "DAY":
2144
+ return "ONE_DAY";
2145
+ case "WEEK":
2146
+ return "SEVEN_DAYS";
1999
2147
  }
2000
- return GqlSWberaVaultMetadataResolution.SevenDays;
2001
2148
  }
2002
- async function getStakedBeraAPR({
2003
- window: window2,
2004
- ...args
2149
+ async function getStakedBeraAPY({
2150
+ window: window2
2005
2151
  }) {
2006
- const { config } = parseBaseArgs(args);
2007
- const bexApiGraphqlClient = getApolloClient("api", args);
2008
- try {
2009
- const data = await bexApiGraphqlClient.query({
2010
- query: GetSWberaVaultMetadata,
2011
- variables: {
2012
- chain: config.bex.chainName,
2013
- resolution: getResolution(window2 ?? "DAY")
2014
- }
2015
- });
2016
- const { apr } = data.data.polGetSWberaVaultMetadata;
2017
- return Number(apr);
2018
- } catch (error) {
2019
- console.error("Failed to get SW Bera APR", error);
2020
- throw error;
2021
- }
2152
+ const { apy } = await fetchBeep("/v0/stake/apr", {
2153
+ query: {
2154
+ interval: getBeepResolutionEnum(window2)
2155
+ }
2156
+ });
2157
+ return apy === null ? 0 : Number(apy);
2022
2158
  }
2023
2159
 
2024
2160
  // src/actions/pol/getStakedBeraSnapshots.ts
2025
- import {
2026
- GetSWberaVaultSnapshots,
2027
- GqlVaultSnapshotDataRange
2028
- } from "@berachain/graphql/pol/api";
2161
+ var StakeSnapshotRange = /* @__PURE__ */ ((StakeSnapshotRange2) => {
2162
+ StakeSnapshotRange2["SevenDays"] = "7";
2163
+ StakeSnapshotRange2["ThirtyDays"] = "30";
2164
+ StakeSnapshotRange2["SixtyDays"] = "60";
2165
+ StakeSnapshotRange2["NinetyDays"] = "90";
2166
+ return StakeSnapshotRange2;
2167
+ })(StakeSnapshotRange || {});
2029
2168
  async function getStakedBeraSnapshots({
2030
- chain,
2031
- range = GqlVaultSnapshotDataRange.ThirtyDays,
2032
- ...args
2169
+ range = "30" /* ThirtyDays */
2033
2170
  } = {}) {
2034
- const { config } = parseBaseArgs(args);
2035
- const bexApiGraphqlClient = getApolloClient("api", args);
2036
- try {
2037
- const data = await bexApiGraphqlClient.query({
2038
- query: GetSWberaVaultSnapshots,
2039
- variables: {
2040
- chain: chain ?? config.bex.chainName,
2041
- range
2042
- }
2043
- });
2044
- return data.data.polGetSWberaVaultSnapshots;
2045
- } catch (error) {
2046
- console.error("Failed to get SW Bera Snapshots", error);
2047
- throw error;
2048
- }
2171
+ return await fetchBeep("/v0/stake/apr/history", { query: { days: range } });
2049
2172
  }
2050
2173
 
2051
2174
  // src/actions/pol/getStakeWithdrawalCooldown.ts
@@ -2063,109 +2186,29 @@ async function getStakeWithdrawalCooldown({
2063
2186
  }
2064
2187
 
2065
2188
  // src/actions/pol/getSWBeraVaultMetadata.ts
2066
- import { erc20Abi as erc20Abi5, erc4626Abi } from "viem";
2189
+ import { erc4626Abi } from "viem";
2067
2190
  async function getSWBeraVaultMetadata({
2068
2191
  address,
2069
- underlyingAsset,
2070
- publicClient,
2071
- blockTime
2192
+ publicClient
2072
2193
  }) {
2073
2194
  assertPublicClient(publicClient);
2074
- const hoursWindow = 26;
2075
2195
  try {
2076
- const currentBlock = await publicClient.getBlock({ blockTag: "latest" });
2077
- const blocksPerWindow = Math.floor(hoursWindow * 60 * 60 / blockTime);
2078
- const blockWindowAgo = currentBlock.number - BigInt(blocksPerWindow);
2079
- const [
2080
- curretTotalAssets,
2081
- currentTotalSupply,
2082
- currentOneShareWorth,
2083
- currentTVL,
2084
- totalAssets24HoursAgo,
2085
- totalSupply24HoursAgo,
2086
- oneShareWorthWindowAgo,
2087
- tvl24HoursAgo,
2088
- underlyingTotalSupply,
2089
- lockPeriod
2090
- ] = await Promise.all([
2196
+ const [curretTotalAssets, lockPeriod] = await Promise.all([
2091
2197
  publicClient.readContract({
2092
2198
  address,
2093
2199
  abi: erc4626Abi,
2094
2200
  functionName: "totalAssets"
2095
2201
  }),
2096
- publicClient.readContract({
2097
- address,
2098
- abi: erc4626Abi,
2099
- functionName: "totalSupply"
2100
- }),
2101
- publicClient.readContract({
2102
- address,
2103
- abi: erc4626Abi,
2104
- functionName: "previewRedeem",
2105
- args: [10n ** 18n],
2106
- blockNumber: currentBlock.number
2107
- }),
2108
- publicClient.readContract({
2109
- address: underlyingAsset,
2110
- abi: erc20Abi5,
2111
- functionName: "balanceOf",
2112
- args: [address]
2113
- }),
2114
- publicClient.readContract({
2115
- address,
2116
- abi: erc4626Abi,
2117
- functionName: "totalAssets",
2118
- blockNumber: blockWindowAgo
2119
- }),
2120
- publicClient.readContract({
2121
- address,
2122
- abi: erc20Abi5,
2123
- functionName: "totalSupply",
2124
- blockNumber: blockWindowAgo
2125
- }),
2126
- publicClient.readContract({
2127
- address,
2128
- abi: erc4626Abi,
2129
- functionName: "previewRedeem",
2130
- args: [10n ** 18n],
2131
- blockNumber: blockWindowAgo
2132
- }),
2133
- publicClient.readContract({
2134
- address: underlyingAsset,
2135
- abi: erc20Abi5,
2136
- functionName: "balanceOf",
2137
- args: [address],
2138
- blockNumber: blockWindowAgo
2139
- }),
2140
- publicClient.readContract({
2141
- address: underlyingAsset,
2142
- abi: erc20Abi5,
2143
- functionName: "totalSupply"
2144
- }),
2145
2202
  getStakeWithdrawalCooldown({
2146
2203
  publicClient,
2147
2204
  address
2148
2205
  })
2149
2206
  ]);
2150
- const exchangeRateWindowAgo = new bignumber_js_default(
2151
- oneShareWorthWindowAgo.toString()
2152
- );
2153
- const currentExchangeRate = new bignumber_js_default(currentOneShareWorth.toString());
2154
2207
  return {
2155
2208
  address,
2156
2209
  current: {
2157
- exchangeRate: currentExchangeRate.toString(),
2158
- totalSupply: new bignumber_js_default(currentTotalSupply.toString()).dividedBy(1e18).toString(),
2159
- totalAssets: new bignumber_js_default(curretTotalAssets.toString()).dividedBy(1e18).toString(),
2160
- tvl: new bignumber_js_default(currentTVL.toString()).dividedBy(1e18).toString()
2210
+ totalAssets: new bignumber_js_default(curretTotalAssets.toString()).dividedBy(1e18).toString()
2161
2211
  },
2162
- previous: {
2163
- exchangeRate: exchangeRateWindowAgo.toString(),
2164
- totalSupply: new bignumber_js_default(totalSupply24HoursAgo.toString()).dividedBy(1e18).toString(),
2165
- totalAssets: new bignumber_js_default(totalAssets24HoursAgo.toString()).dividedBy(1e18).toString(),
2166
- tvl: new bignumber_js_default(tvl24HoursAgo.toString()).dividedBy(1e18).toString()
2167
- },
2168
- totalWBeraIssued: new bignumber_js_default(underlyingTotalSupply.toString()).dividedBy(1e18).toString(),
2169
2212
  lockPeriod
2170
2213
  };
2171
2214
  } catch (error) {
@@ -2315,29 +2358,6 @@ async function getTotalStakedAmount({
2315
2358
  }
2316
2359
  }
2317
2360
 
2318
- // src/actions/pol/getUserClaimableIncentives.ts
2319
- async function getUserClaimableIncentives({
2320
- account,
2321
- ...args
2322
- }) {
2323
- const { config } = parseBaseArgs(args);
2324
- const result = await fetch(
2325
- `${config.pol.bribeBoostApi}/api/v1/wallets/${account.toLowerCase()}/rewards/aggregation`,
2326
- {
2327
- cache: "no-store"
2328
- }
2329
- );
2330
- if (!result.ok) {
2331
- const error = await getErrorResponse(result);
2332
- throw new BeraError({
2333
- message: "Failed to fetch incentives on server",
2334
- cause: { error, result, account },
2335
- reason: error?.error
2336
- });
2337
- }
2338
- return result.json();
2339
- }
2340
-
2341
2361
  // src/actions/pol/getUserVaultInfo.ts
2342
2362
  import { formatEther as formatEther5 } from "viem";
2343
2363
 
@@ -2592,7 +2612,7 @@ async function getVaultValidators({
2592
2612
  }
2593
2613
 
2594
2614
  // src/actions/prices/getTokenCurrentPrices.ts
2595
- import { getAddress, zeroAddress as zeroAddress3 } from "viem";
2615
+ import { getAddress, zeroAddress as zeroAddress4 } from "viem";
2596
2616
  import {
2597
2617
  GetTokenCurrentPrices
2598
2618
  } from "@berachain/graphql/dex/api";
@@ -2627,7 +2647,7 @@ async function getTokenCurrentPrices({
2627
2647
  chainId
2628
2648
  };
2629
2649
  if (isToken(formattedAddress, "WBERA")) {
2630
- map[zeroAddress3] = {
2650
+ map[zeroAddress4] = {
2631
2651
  price: getSafeNumber(tokenInformation.price.toString()),
2632
2652
  updatedAt: tokenInformation.updatedAt,
2633
2653
  chainId
@@ -2652,7 +2672,7 @@ async function getTokenCurrentPrices({
2652
2672
  // src/actions/tokens/getAllowances.ts
2653
2673
  import { getPublicClient } from "@wagmi/core";
2654
2674
  import {
2655
- erc20Abi as erc20Abi6,
2675
+ erc20Abi as erc20Abi5,
2656
2676
  formatUnits as formatUnits10
2657
2677
  } from "viem";
2658
2678
  async function getAllowances({
@@ -2678,7 +2698,7 @@ async function getAllowances({
2678
2698
  contracts: items.map(
2679
2699
  (item) => ({
2680
2700
  address: item.token.address,
2681
- abi: erc20Abi6,
2701
+ abi: erc20Abi5,
2682
2702
  functionName: "allowance",
2683
2703
  args: [account, item.spender]
2684
2704
  })
@@ -3407,7 +3427,31 @@ async function getApiValidator({
3407
3427
  }
3408
3428
 
3409
3429
  // src/actions/validators/getValidatorRewardAllocation.ts
3430
+ import { beraChefAbi as beraChefAbi2 } from "@berachain/abis/pol/rewards/beraChef";
3431
+
3432
+ // src/actions/validators/getDefaultRewardAllocation.ts
3410
3433
  import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
3434
+ function isDefaultRewardAllocation(rewardAllocation) {
3435
+ return rewardAllocation.start.blockNumber === 0;
3436
+ }
3437
+ async function getDefaultRewardAllocation({
3438
+ client,
3439
+ ...args
3440
+ }) {
3441
+ const { config } = parseBaseArgs(args);
3442
+ const rawDefaultRewardAllocation = await client.readContract({
3443
+ address: config.pol.beraChef,
3444
+ abi: beraChefAbi,
3445
+ functionName: "getDefaultRewardAllocation",
3446
+ args: []
3447
+ });
3448
+ return formatValidatorRewardAllocation(
3449
+ { ...rawDefaultRewardAllocation, startBlock: 0n },
3450
+ 0
3451
+ );
3452
+ }
3453
+
3454
+ // src/actions/validators/getValidatorRewardAllocation.ts
3411
3455
  function formatValidatorRewardAllocation(raw, startTs) {
3412
3456
  return {
3413
3457
  start: {
@@ -3435,13 +3479,13 @@ async function getValidatorRewardAllocation({
3435
3479
  const [rawActiveRewardAllocation, rawSetRewardAllocation] = await Promise.all([
3436
3480
  client.readContract({
3437
3481
  address: config.pol.beraChef,
3438
- abi: beraChefAbi,
3482
+ abi: beraChefAbi2,
3439
3483
  functionName: "getActiveRewardAllocation",
3440
3484
  args: [pubKey]
3441
3485
  }),
3442
3486
  client.readContract({
3443
3487
  address: config.pol.beraChef,
3444
- abi: beraChefAbi,
3488
+ abi: beraChefAbi2,
3445
3489
  functionName: "getSetActiveRewardAllocation",
3446
3490
  args: [pubKey]
3447
3491
  })
@@ -3462,8 +3506,11 @@ async function getValidatorRewardAllocation({
3462
3506
  rawSetRewardAllocation,
3463
3507
  Number(lastRaUpdateSet.timestamp)
3464
3508
  );
3509
+ const isDefault = isDefaultRewardAllocation(activeRewardAllocation);
3465
3510
  let isBaseline = false;
3466
- if (setRewardAllocation.start.blockNumber === 0) {
3511
+ if (isDefault) {
3512
+ isBaseline = false;
3513
+ } else if (setRewardAllocation.start.blockNumber === 0) {
3467
3514
  isBaseline = true;
3468
3515
  } else {
3469
3516
  isBaseline = !isSameRewardAllocation(
@@ -3475,6 +3522,7 @@ async function getValidatorRewardAllocation({
3475
3522
  activeRewardAllocation,
3476
3523
  setRewardAllocation,
3477
3524
  isBaseline,
3525
+ isDefault,
3478
3526
  isNeverSet: setRewardAllocation?.start.blockNumber === 0
3479
3527
  };
3480
3528
  } catch (e) {
@@ -3491,6 +3539,25 @@ async function getStakingPoolBatch({
3491
3539
  return 5614;
3492
3540
  }
3493
3541
 
3542
+ // src/actions/validators/getUserBoosts.ts
3543
+ import {
3544
+ GetUserValidatorInformation
3545
+ } from "@berachain/graphql/pol/api";
3546
+ async function getUserBoosts({
3547
+ account,
3548
+ ...args
3549
+ }) {
3550
+ const { config } = parseBaseArgs(args);
3551
+ const apiClient = getApolloClient("api", args);
3552
+ return apiClient.query({
3553
+ query: GetUserValidatorInformation,
3554
+ variables: {
3555
+ address: account.toLowerCase(),
3556
+ chain: config.bex.chainName
3557
+ }
3558
+ });
3559
+ }
3560
+
3494
3561
  // src/actions/validators/getUserBoostsOnValidator.ts
3495
3562
  import { formatEther as formatEther6 } from "viem";
3496
3563
  import { bgtAbi as bgtAbi2 } from "@berachain/abis/pol/bgt";
@@ -3540,91 +3607,92 @@ async function getUserBoostsOnValidator({
3540
3607
 
3541
3608
  // src/actions/validators/getUserActiveValidators.ts
3542
3609
  import { formatEther as formatEther7, parseEther as parseEther4 } from "viem";
3543
-
3544
- // src/actions/validators/getUserBoosts.ts
3545
- import {
3546
- GetUserValidatorInformation
3547
- } from "@berachain/graphql/pol/api";
3548
- async function getUserBoosts({
3610
+ async function getUserActiveValidatorsApi({
3549
3611
  account,
3612
+ chain,
3550
3613
  ...args
3551
3614
  }) {
3552
3615
  const { config } = parseBaseArgs(args);
3553
- const apiClient = getApolloClient("api", args);
3554
- return apiClient.query({
3555
- query: GetUserValidatorInformation,
3616
+ const resolvedChain = chain ?? config.bex.chainName;
3617
+ const userBoosts = await getUserBoosts({ account });
3618
+ const validatorInfoList = await getAllValidators({
3556
3619
  variables: {
3557
- address: account.toLowerCase(),
3558
- chain: config.bex.chainName
3620
+ chain: resolvedChain,
3621
+ where: {
3622
+ idIn: userBoosts.data.polGetValidatorBoosts.boosts.map(
3623
+ (t) => t.validatorId
3624
+ )
3625
+ }
3559
3626
  }
3560
3627
  });
3628
+ return validatorInfoList?.validators.validators ?? [];
3561
3629
  }
3562
-
3563
- // src/actions/validators/getUserActiveValidators.ts
3564
- async function getUserActiveValidators({
3630
+ async function getUserActiveValidatorsOnChain({
3565
3631
  account,
3566
- publicClient,
3567
- chain,
3568
- ...args
3632
+ validators,
3633
+ publicClient
3569
3634
  }) {
3570
- const { config } = parseBaseArgs(args);
3571
- const resolvedChain = chain ?? config.bex.chainName;
3572
- const userBoosts = await getUserBoosts({ account });
3573
- const [validatorInfoList, onChainBoosts] = await Promise.all([
3574
- getAllValidators({
3575
- variables: {
3576
- chain: resolvedChain,
3577
- where: {
3578
- idIn: userBoosts.data.polGetValidatorBoosts.boosts.map(
3579
- (t) => t.validatorId
3580
- )
3581
- }
3582
- }
3583
- }),
3584
- Promise.all(
3585
- userBoosts.data.polGetValidatorBoosts.boosts.filter(
3586
- (t) => (
3587
- // there's an edge case here where api doesn't return the pubkey
3588
- // because the user might have boosted a pubkey that doesn't exist
3589
- // api doesn't return the pubkey in this case, but we're choosing to filter them out
3590
- !!t.validator
3591
- )
3592
- ).map(
3593
- (t) => getUserBoostsOnValidator({
3594
- account,
3595
- pubkey: t.validator.pubkey,
3596
- publicClient
3597
- })
3598
- )
3635
+ return await Promise.all(
3636
+ validators.map(
3637
+ (validator) => getUserBoostsOnValidator({
3638
+ account,
3639
+ pubkey: validator.pubkey,
3640
+ publicClient
3641
+ })
3599
3642
  )
3600
- ]);
3601
- return validatorInfoList?.validators.validators.map((validator) => {
3643
+ );
3644
+ }
3645
+ function mergeUserActiveValidators({
3646
+ validators,
3647
+ onChainBoosts
3648
+ }) {
3649
+ return validators.flatMap((validator) => {
3602
3650
  const userDeposited = onChainBoosts.find(
3603
3651
  (data) => data.pubkey.toLowerCase() === validator.pubkey.toLowerCase()
3604
3652
  );
3605
3653
  if (!userDeposited) {
3606
- throw new Error("User deposited not found");
3654
+ return [];
3607
3655
  }
3608
- const droppableBoostAmount = parseEther4(userDeposited?.activeBoostAmount ?? "0") - parseEther4(userDeposited?.queuedDropBoostAmount);
3609
- return {
3610
- ...validator,
3611
- userBoosts: {
3612
- pubkey: userDeposited.pubkey,
3613
- activeBoostAmount: userDeposited?.activeBoostAmount,
3614
- queuedBoostAmount: userDeposited?.queuedBoostAmount,
3615
- queuedBoostStartBlock: Number(userDeposited?.queuedBoostStartBlock),
3616
- queuedDropBoostAmount: userDeposited?.queuedDropBoostAmount,
3617
- queuedDropBoostStartBlock: Number(
3618
- userDeposited?.queuedDropBoostStartBlock
3619
- ),
3620
- droppableBoostAmount: formatEther7(droppableBoostAmount),
3621
- hasPendingBoosts: Number(userDeposited?.queuedBoostAmount) > 0 || Number(userDeposited?.queuedDropBoostAmount) > 0,
3622
- hasActiveBoosts: Number(userDeposited?.activeBoostAmount) > 0,
3623
- hasDroppableBoosts: droppableBoostAmount > 0n
3656
+ const droppableBoostAmount = parseEther4(userDeposited.activeBoostAmount ?? "0") - parseEther4(userDeposited.queuedDropBoostAmount);
3657
+ return [
3658
+ {
3659
+ ...validator,
3660
+ userBoosts: {
3661
+ pubkey: userDeposited.pubkey,
3662
+ activeBoostAmount: userDeposited.activeBoostAmount,
3663
+ queuedBoostAmount: userDeposited.queuedBoostAmount,
3664
+ queuedBoostStartBlock: Number(userDeposited.queuedBoostStartBlock),
3665
+ queuedDropBoostAmount: userDeposited.queuedDropBoostAmount,
3666
+ queuedDropBoostStartBlock: Number(
3667
+ userDeposited.queuedDropBoostStartBlock
3668
+ ),
3669
+ droppableBoostAmount: formatEther7(droppableBoostAmount),
3670
+ hasPendingBoosts: Number(userDeposited.queuedBoostAmount) > 0 || Number(userDeposited.queuedDropBoostAmount) > 0,
3671
+ hasActiveBoosts: Number(userDeposited.activeBoostAmount) > 0,
3672
+ hasDroppableBoosts: droppableBoostAmount > 0n
3673
+ }
3624
3674
  }
3625
- };
3675
+ ];
3626
3676
  });
3627
3677
  }
3678
+ async function getUserActiveValidators({
3679
+ account,
3680
+ publicClient,
3681
+ chain,
3682
+ ...args
3683
+ }) {
3684
+ const validators = await getUserActiveValidatorsApi({
3685
+ account,
3686
+ chain,
3687
+ ...args
3688
+ });
3689
+ const onChainBoosts = await getUserActiveValidatorsOnChain({
3690
+ account,
3691
+ validators,
3692
+ publicClient
3693
+ });
3694
+ return mergeUserActiveValidators({ validators, onChainBoosts });
3695
+ }
3628
3696
 
3629
3697
  // src/actions/validators/getUserStakingPositions.ts
3630
3698
  var snowTestWalletPositions = [
@@ -3822,30 +3890,8 @@ async function getUserStakingPositions(account) {
3822
3890
  return [];
3823
3891
  }
3824
3892
 
3825
- // src/actions/validators/getValidatorAnalytics.ts
3826
- async function getValidatorAnalytics({
3827
- pubkey,
3828
- dayRange
3829
- }) {
3830
- if (typeof window === "undefined") {
3831
- throw new BeraError({
3832
- message: "getValidatorAnalytics is browser-only; call from a Client Component / SWR hook",
3833
- level: "error"
3834
- });
3835
- }
3836
- const params = new URLSearchParams({
3837
- pubkey,
3838
- dayRange: String(dayRange)
3839
- });
3840
- return beraFetchJson({
3841
- url: `/api/pol/validator-analytics?${params}`,
3842
- name: "pol-validator-analytics",
3843
- type: "rest"
3844
- });
3845
- }
3846
-
3847
3893
  // src/actions/validators/getValidatorCommission.ts
3848
- import { beraChefAbi as beraChefAbi2 } from "@berachain/abis/pol/rewards/beraChef";
3894
+ import { beraChefAbi as beraChefAbi3 } from "@berachain/abis/pol/rewards/beraChef";
3849
3895
  async function getValidatorCommission({
3850
3896
  client,
3851
3897
  pubKey,
@@ -3854,7 +3900,7 @@ async function getValidatorCommission({
3854
3900
  const { config } = parseBaseArgs(args);
3855
3901
  const result = await client.readContract({
3856
3902
  address: config.pol.beraChef,
3857
- abi: beraChefAbi2,
3903
+ abi: beraChefAbi3,
3858
3904
  functionName: "getValCommissionOnIncentiveTokens",
3859
3905
  args: [pubKey]
3860
3906
  });
@@ -3892,7 +3938,7 @@ async function getValidatorOperatorAddress({
3892
3938
  }
3893
3939
 
3894
3940
  // src/actions/validators/getValidatorQueuedCommission.ts
3895
- import { beraChefAbi as beraChefAbi3 } from "@berachain/abis/pol/rewards/beraChef";
3941
+ import { beraChefAbi as beraChefAbi4 } from "@berachain/abis/pol/rewards/beraChef";
3896
3942
  async function getValidatorQueuedCommission({
3897
3943
  client,
3898
3944
  pubKey,
@@ -3901,7 +3947,7 @@ async function getValidatorQueuedCommission({
3901
3947
  const { config } = parseBaseArgs(args);
3902
3948
  const result = await client.readContract({
3903
3949
  address: config.pol.beraChef,
3904
- abi: beraChefAbi3,
3950
+ abi: beraChefAbi4,
3905
3951
  functionName: "getValQueuedCommissionOnIncentiveTokens",
3906
3952
  args: [pubKey]
3907
3953
  });
@@ -3934,7 +3980,7 @@ async function getValidatorQueuedOperatorAddress({
3934
3980
  }
3935
3981
 
3936
3982
  // src/actions/validators/getValidatorQueuedRewardAllocation.ts
3937
- import { beraChefAbi as beraChefAbi4 } from "@berachain/abis/pol/rewards/beraChef";
3983
+ import { beraChefAbi as beraChefAbi5 } from "@berachain/abis/pol/rewards/beraChef";
3938
3984
  async function getValidatorQueuedRewardAllocation({
3939
3985
  client,
3940
3986
  pubKey,
@@ -3944,7 +3990,7 @@ async function getValidatorQueuedRewardAllocation({
3944
3990
  try {
3945
3991
  const result = await client.readContract({
3946
3992
  address: config.pol.beraChef,
3947
- abi: beraChefAbi4,
3993
+ abi: beraChefAbi5,
3948
3994
  functionName: "getQueuedRewardAllocation",
3949
3995
  args: [pubKey]
3950
3996
  });
@@ -3958,6 +4004,7 @@ async function getValidatorQueuedRewardAllocation({
3958
4004
  export {
3959
4005
  getConvertToAssets,
3960
4006
  BaseAggregator,
4007
+ ensoErc4626,
3961
4008
  BalancerApi,
3962
4009
  getAllPools,
3963
4010
  getApiPool,
@@ -3987,24 +4034,22 @@ export {
3987
4034
  RewardVaultDistributionMode,
3988
4035
  getRewardVaultRewards,
3989
4036
  getBgtAprSimulation,
3990
- getBgtIncentiveDistributorPaused,
3991
4037
  getEarnedStakedBeraVault,
3992
4038
  getGlobalData,
3993
4039
  getMarkets,
3994
- getRewardProofsByValidator,
3995
4040
  getRewardTokenToBeraRate,
3996
4041
  getRewardVault,
3997
4042
  getRewardVaultEarnedRewards,
3998
4043
  getRewardVaultIncentives,
3999
4044
  getRewardVaultStakingToken,
4000
4045
  getRewardVaults,
4001
- getStakedBeraAPR,
4046
+ getStakedBeraAPY,
4047
+ StakeSnapshotRange,
4002
4048
  getStakedBeraSnapshots,
4003
4049
  getStakeWithdrawalCooldown,
4004
4050
  getSWBeraVaultMetadata,
4005
4051
  getSWBeraWithdrawal,
4006
4052
  getTotalStakedAmount,
4007
- getUserClaimableIncentives,
4008
4053
  getUserVaultInfo,
4009
4054
  getUserVaults,
4010
4055
  getVaultHistory,
@@ -4019,11 +4064,16 @@ export {
4019
4064
  formatValidatorRewardAllocation,
4020
4065
  isSameRewardAllocation,
4021
4066
  getValidatorRewardAllocation,
4067
+ isDefaultRewardAllocation,
4068
+ getDefaultRewardAllocation,
4022
4069
  getStakingPoolBatch,
4070
+ getUserBoosts,
4023
4071
  getUserBoostsOnValidator,
4072
+ getUserActiveValidatorsApi,
4073
+ getUserActiveValidatorsOnChain,
4074
+ mergeUserActiveValidators,
4024
4075
  getUserActiveValidators,
4025
4076
  getUserStakingPositions,
4026
- getValidatorAnalytics,
4027
4077
  getValidatorCommission,
4028
4078
  getValidatorEstimatedBgtPerYear,
4029
4079
  getValidatorOperatorAddress,
@@ -4031,4 +4081,4 @@ export {
4031
4081
  getValidatorQueuedOperatorAddress,
4032
4082
  getValidatorQueuedRewardAllocation
4033
4083
  };
4034
- //# sourceMappingURL=chunk-DOZJB6IJ.mjs.map
4084
+ //# sourceMappingURL=chunk-SMBAW7AG.mjs.map