@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,12 +1,13 @@
1
- import { isAddress } from "viem";
1
+ import type { PublicClient } from "viem";
2
2
 
3
+ import type { ChainId } from "@berachain/config";
3
4
  import { defaultChainId } from "@berachain/config/internal";
4
5
 
5
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
6
7
  import { useSWRImmutable } from "@berachain/utils/pkg/swr";
7
8
 
8
9
  import { getTokenInformation } from "../../actions/tokens/getTokenInformation";
9
- import { assertPublicClient } from "../../errors/assert";
10
+ import { assertAddress, assertPublicClient } from "../../errors/assert";
10
11
  import type { Token } from "../../types/dex";
11
12
  import type {
12
13
  DefaultHookOptions,
@@ -17,10 +18,66 @@ export type UseMultipleTokenInformationResponse = DefaultHookReturnType<
17
18
  Token[]
18
19
  >;
19
20
 
21
+ /**
22
+ * Resolve ERC20 metadata for a batch of addresses, best-effort. An address whose
23
+ * metadata can't be read — a non-ERC20 / codeless contract (e.g. a single-asset
24
+ * staking vault whose `decimals()` reverts), an invalid address, or a missing
25
+ * token — is simply omitted from the result rather than failing the whole batch.
26
+ * Consumers key results by address and treat a missing entry as absent.
27
+ */
28
+ export async function fetchMultipleTokenInformation({
29
+ addresses,
30
+ publicClient,
31
+ chainId,
32
+ }: {
33
+ addresses: readonly string[];
34
+ publicClient: PublicClient;
35
+ chainId: ChainId;
36
+ }): Promise<Token[]> {
37
+ const settled = await Promise.allSettled(
38
+ addresses.map(async (address) => {
39
+ assertAddress(address, "address");
40
+
41
+ const tk = await getTokenInformation({
42
+ address,
43
+ publicClient,
44
+ chainId,
45
+ });
46
+
47
+ if (!tk) {
48
+ throw new Error(`Token ${address} not found`);
49
+ }
50
+
51
+ return tk;
52
+ }),
53
+ );
54
+
55
+ return settled
56
+ .filter((r): r is PromiseFulfilledResult<Token> => r.status === "fulfilled")
57
+ .map((r) => r.value);
58
+ }
59
+
20
60
  export type useMultipleTokenInformationArgs = {
61
+ /** Addresses to resolve metadata for. `undefined` disables the query. */
21
62
  addresses: string[] | readonly string[] | undefined;
63
+ /** Chain to read from. Defaults to the app's `defaultChainId`. */
22
64
  chainId?: number;
23
65
  };
66
+
67
+ /**
68
+ * Batch-resolves ERC20 metadata for `addresses`, best-effort.
69
+ *
70
+ * Metadata resolution is best-effort:
71
+ * any address that can't be resolved — a non-ERC20 / codeless contract (e.g. a
72
+ * single-asset staking vault whose `decimals()` reverts), an invalid address, or
73
+ * a missing token — is OMITTED rather than failing the whole batch. So the result
74
+ * length and order do not necessarily match the input `addresses`.
75
+ *
76
+ * ⚠️ The returned array is NOT positional.
77
+ * Do NOT index the result positionally (`data[i]` for `addresses[i]`). Always
78
+ * look tokens up by address, e.g. `data?.find(t => t.address === addr)` or build
79
+ * an address-keyed map.
80
+ */
24
81
  export function useMultipleTokenInformation(
25
82
  args: useMultipleTokenInformationArgs,
26
83
  options?: DefaultHookOptions,
@@ -44,25 +101,11 @@ export function useMultipleTokenInformation(
44
101
  // but we need this for correct type inference
45
102
  assertPublicClient(publicClient);
46
103
 
47
- return Promise.all(
48
- addresses.map(async (address) => {
49
- if (!address || !isAddress(address, { strict: false })) {
50
- throw new Error("Invalid address");
51
- }
52
-
53
- const tk = await getTokenInformation({
54
- address: address,
55
- publicClient,
56
- chainId,
57
- });
58
-
59
- if (!tk) {
60
- throw new Error(`Token ${address} not found`);
61
- }
62
-
63
- return tk;
64
- }),
65
- );
104
+ return fetchMultipleTokenInformation({
105
+ addresses,
106
+ publicClient,
107
+ chainId,
108
+ });
66
109
  },
67
110
  { ...options },
68
111
  );
@@ -0,0 +1,91 @@
1
+ import type { Address, PublicClient } from "viem";
2
+ import { beforeEach, describe, expect, it, vi } from "vitest";
3
+
4
+ import { ChainId } from "@berachain/config/internal";
5
+
6
+ import { getTokenInformation } from "../../actions/tokens/getTokenInformation";
7
+ import type { Token } from "../../types/dex";
8
+ import { fetchMultipleTokenInformation } from "./useMultipleTokenInformation";
9
+
10
+ vi.mock("../../actions/tokens/getTokenInformation", () => ({
11
+ getTokenInformation: vi.fn(),
12
+ }));
13
+
14
+ const mockGetTokenInformation = vi.mocked(getTokenInformation);
15
+
16
+ // publicClient is only forwarded to (the mocked) getTokenInformation, so a stub
17
+ // is enough here.
18
+ const publicClient = {} as unknown as PublicClient;
19
+ const chainId = ChainId.MAINNET;
20
+
21
+ const ADDR_A = "0xac03caba51e17c86c921e1f6cbfbdc91f8bb2e6b" as Address;
22
+ const ADDR_B = "0xbaadcc2962417c01af99fb2b7c75706b9bd6babe" as Address;
23
+ const STAKING_CONTRACT =
24
+ "0x75f3be06b02e235f6d0e7ef2d462b29739168301" as Address;
25
+
26
+ function makeToken(address: Address, symbol: string): Token {
27
+ return {
28
+ address,
29
+ decimals: 18,
30
+ symbol,
31
+ name: symbol,
32
+ chainId,
33
+ };
34
+ }
35
+
36
+ beforeEach(() => {
37
+ vi.clearAllMocks();
38
+ });
39
+
40
+ describe("fetchMultipleTokenInformation", () => {
41
+ it("omits an address whose metadata read reverts instead of rejecting the batch", async () => {
42
+ // Simulates a non-ERC20 single-asset staking contract: `decimals()` reverts,
43
+ // so getTokenInformation rethrows.
44
+ mockGetTokenInformation.mockImplementation(async ({ address }) => {
45
+ if (address === STAKING_CONTRACT) {
46
+ throw new Error('The contract function "decimals" reverted.');
47
+ }
48
+ return makeToken(address, address === ADDR_A ? "iBGT" : "LBGT");
49
+ });
50
+
51
+ const result = await fetchMultipleTokenInformation({
52
+ addresses: [ADDR_A, STAKING_CONTRACT, ADDR_B],
53
+ publicClient,
54
+ chainId,
55
+ });
56
+
57
+ expect(result).toHaveLength(2);
58
+ expect(result.map((t) => t.address)).toEqual([ADDR_A, ADDR_B]);
59
+ expect(result.some((t) => t.address === STAKING_CONTRACT)).toBe(false);
60
+ });
61
+
62
+ it("drops invalid addresses without reading them", async () => {
63
+ mockGetTokenInformation.mockImplementation(async ({ address }) =>
64
+ makeToken(address, "iBGT"),
65
+ );
66
+
67
+ const result = await fetchMultipleTokenInformation({
68
+ addresses: ["not-an-address", ADDR_A],
69
+ publicClient,
70
+ chainId,
71
+ });
72
+
73
+ expect(result.map((t) => t.address)).toEqual([ADDR_A]);
74
+ // The invalid address never reaches getTokenInformation.
75
+ expect(mockGetTokenInformation).toHaveBeenCalledTimes(1);
76
+ });
77
+
78
+ it("returns all tokens for an all-valid batch, preserving order", async () => {
79
+ mockGetTokenInformation.mockImplementation(async ({ address }) =>
80
+ makeToken(address, address === ADDR_A ? "iBGT" : "LBGT"),
81
+ );
82
+
83
+ const result = await fetchMultipleTokenInformation({
84
+ addresses: [ADDR_A, ADDR_B],
85
+ publicClient,
86
+ chainId,
87
+ });
88
+
89
+ expect(result.map((t) => t.address)).toEqual([ADDR_A, ADDR_B]);
90
+ });
91
+ });
@@ -110,8 +110,10 @@ export function usePollBalance(
110
110
 
111
111
  return {
112
112
  ...rest,
113
- isLoading: isLoading || isNativeToken ? isLoadingTokenInformation : false,
114
- error: error || !isNativeToken ? error : undefined,
113
+ isLoading: isNativeToken
114
+ ? isLoading
115
+ : isLoading || isLoadingTokenInformation,
116
+ error,
115
117
  data: tokenBalance,
116
118
  };
117
119
  }
@@ -1,8 +1,12 @@
1
+ import { useMemo } from "react";
2
+
1
3
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
2
4
  import { useSWR } from "@berachain/utils/pkg/swr";
3
5
 
4
6
  import {
5
- getUserActiveValidators,
7
+ getUserActiveValidatorsApi,
8
+ getUserActiveValidatorsOnChain,
9
+ mergeUserActiveValidators,
6
10
  type ValidatorWithUserBoost,
7
11
  } from "../../actions/validators/getUserActiveValidators";
8
12
  import { POLLING } from "../../enum/polling";
@@ -12,23 +16,42 @@ import type {
12
16
  } from "../../types/global";
13
17
 
14
18
  interface UseUserActiveValidatorsResponse
15
- extends DefaultHookReturnType<ValidatorWithUserBoost[] | undefined> {}
19
+ extends DefaultHookReturnType<ValidatorWithUserBoost[] | undefined> {
20
+ /**
21
+ * Re-reads the on-chain boost amounts without re-fetching the API validator
22
+ * list. Use after a boost/drop tx to reflect new amounts immediately.
23
+ */
24
+ refreshOnChain: () => void;
25
+ }
16
26
 
17
27
  export function useUserActiveValidators(
18
28
  options?: DefaultHookOptions,
19
29
  ): UseUserActiveValidatorsResponse {
20
30
  const { address: account } = useBeraWallet();
21
31
  const publicClient = usePublicClient();
22
- const QUERY_KEY =
23
- publicClient && account
24
- ? (["useUserActiveValidators", account] as const)
25
- : null;
26
32
 
27
- return useSWR(
28
- QUERY_KEY,
33
+ const apiSwr = useSWR(
34
+ account ? (["useUserActiveValidatorsApi", account] as const) : null,
29
35
  async ([, account]) => {
30
- return await getUserActiveValidators({
36
+ return await getUserActiveValidatorsApi({ account });
37
+ },
38
+ {
39
+ ...options,
40
+ refreshInterval: options?.refreshInterval ?? POLLING.SLOW,
41
+ keepPreviousData: true,
42
+ },
43
+ );
44
+
45
+ const validators = apiSwr.data;
46
+
47
+ const onChainSwr = useSWR(
48
+ publicClient && account && validators
49
+ ? (["useUserActiveValidatorsOnChain", account, validators] as const)
50
+ : null,
51
+ async ([, account, validators]) => {
52
+ return await getUserActiveValidatorsOnChain({
31
53
  account,
54
+ validators,
32
55
  publicClient,
33
56
  });
34
57
  },
@@ -38,4 +61,26 @@ export function useUserActiveValidators(
38
61
  keepPreviousData: true,
39
62
  },
40
63
  );
64
+
65
+ const onChainBoosts = onChainSwr.data;
66
+
67
+ const data = useMemo(() => {
68
+ if (!validators || !onChainBoosts) return undefined;
69
+ return mergeUserActiveValidators({ validators, onChainBoosts });
70
+ }, [validators, onChainBoosts]);
71
+
72
+ return {
73
+ ...apiSwr,
74
+ data,
75
+ isLoading: apiSwr.isLoading || onChainSwr.isLoading,
76
+ isValidating: apiSwr.isValidating || onChainSwr.isValidating,
77
+ error: apiSwr.error ?? onChainSwr.error,
78
+ refresh: () => {
79
+ apiSwr.refresh();
80
+ onChainSwr.refresh();
81
+ },
82
+ refreshOnChain: () => {
83
+ onChainSwr.refresh();
84
+ },
85
+ };
41
86
  }
@@ -8,10 +8,9 @@ import { POLLING } from "../../enum/polling";
8
8
  import type { DefaultHookReturnType } from "../../types/global";
9
9
 
10
10
  /**
11
- * Historical per-validator incentive distribution. Split from
12
- * `useValidatorAnalytics` so the IncentivesEarned chart can switch data
13
- * sources independently of the other charts that still consume the umbrella
14
- * `GetValidatorAnalytics` query.
11
+ * Historical per-validator incentive distribution, powering the
12
+ * IncentivesEarned chart. Owns its own data source so it can be swapped
13
+ * independently.
15
14
  */
16
15
  export function useValidatorIncentiveDistribution({
17
16
  pubkey,
@@ -1,37 +1,5 @@
1
1
  import type { Address } from "viem";
2
2
 
3
- export interface BribeBoostReward {
4
- token: string;
5
- total_unclaimed: string;
6
- }
7
-
8
- export interface BribeBoostRewardItem {
9
- rewards: BribeBoostReward[];
10
- validator: string;
11
- }
12
-
13
- export interface BribeBoostRewardProof {
14
- validator?: string;
15
- pagination: {
16
- next: number;
17
- previous: number;
18
- record_per_page: number;
19
- current_page: number;
20
- total_page: number;
21
- };
22
- rewards:
23
- | {
24
- id: string;
25
- dist_id: string;
26
- token: Address;
27
- recipient: string;
28
- amount: string;
29
- merkle_proof: string[];
30
- available_at: number;
31
- }[]
32
- | null;
33
- }
34
-
35
3
  // Response shape of GET /api/v1/wallets/:wallet/autoclaimed:
36
4
  // { [wallet]: { [validatorPubkey]: { [tokenAddress]: { amount } } } }
37
5
  // `amount` is a stringified bigint in token base units. The backend now
@@ -50,20 +18,3 @@ export type AutoclaimedIncentivesTxHashResponse = Record<
50
18
  Address,
51
19
  Record<Address, Record<Address, { txhash: string }>>
52
20
  >;
53
-
54
- export interface BribeBoostValidatorApr {
55
- id: string;
56
- boost_total_bgt: string;
57
- rewards_total_usd: string;
58
- daily_rate: string;
59
- apr: string;
60
- apy: string;
61
- tokens: Address[]; // Confirm this type with backend real data
62
- validator: string;
63
- start_block: number;
64
- end_block: number;
65
- start_timestamp: number;
66
- end_timestamp: number;
67
- created_at: string;
68
- updated_at: string;
69
- }
@@ -195,6 +195,13 @@ export type Calldata = {
195
195
  data?: Hex;
196
196
  value: bigint;
197
197
  gasLimit?: bigint;
198
+ /**
199
+ * Extra Sentry tags to attach when this calldata is submitted via `useTxn`.
200
+ * Aggregators set `{ aggregator: this.name }` so failures like
201
+ * AggregatorNotWhitelisted can be attributed to a source without decoding
202
+ * calldata.
203
+ */
204
+ extraTags?: Record<string, string>;
198
205
  };
199
206
 
200
207
  export type IRawAggregatorQuote = {
@@ -208,6 +215,16 @@ export type IRawAggregatorQuote = {
208
215
  isNativeSwap?: boolean;
209
216
  priceImpactPercentage?: number | null;
210
217
  swapFeeBps: number;
218
+ /** True when the route bridges chains; set by the aggregator (source of truth). */
219
+ isCrossChain?: boolean;
220
+ /** Chain the input token (and therefore the tx) lives on. */
221
+ srcChainId?: number;
222
+ /**
223
+ * Bridge the cross-chain route uses, from Enso's chosen bridge hop
224
+ * (`relay` | `stargate` | `ccip`). Drives which explorer/status API the
225
+ * tracker uses; undefined for same-chain routes.
226
+ */
227
+ bridgeProtocol?: string;
211
228
  getCalldata?: ({ account }: { account: Address }) => Calldata;
212
229
  };
213
230
 
@@ -1,26 +1,9 @@
1
- import type { BundleData, EnsoClient } from "@ensofinance/sdk";
1
+ import type { BundleData } from "@ensofinance/sdk";
2
2
  import type { Address, Hex, PublicClient, TransactionRequest } from "viem";
3
3
 
4
4
  import type { MinimalERC20 } from "./dex";
5
5
 
6
6
  export type Quantity = string | number;
7
- export type ActionOutputReference<T> = T | StrictOutputReference<T>;
8
- type StrictOutputReference<T> = {
9
- useOutputOfCallAt: number;
10
- index?: number;
11
- };
12
-
13
- export interface GetEnsoSwapBundleArgs {
14
- fromAddress: Address;
15
- amountIn: Quantity;
16
- tokenIn: Address;
17
- tokenOut: Address;
18
- chainId: number;
19
- ensoClient: EnsoClient;
20
- slippage: number;
21
- destinationChainId?: number;
22
- publicClient: PublicClient;
23
- }
24
7
 
25
8
  export type GetZapTransaction = TransactionRequest & {
26
9
  to: Address;
@@ -29,15 +12,6 @@ export type GetZapTransaction = TransactionRequest & {
29
12
  gasLimit?: bigint;
30
13
  };
31
14
  export type GetZapTransactions = GetZapTransaction[];
32
- export interface GetZapTransactionsArgs {
33
- fromAddress: Address;
34
- amountIn: Quantity;
35
- tokenIn: Address;
36
- chainId: number;
37
- ensoClient: EnsoClient;
38
- bundle: BundleData;
39
- publicClient: PublicClient;
40
- }
41
15
 
42
16
  export interface GetEnsoWalletTransactionsWithApprovalArgs {
43
17
  fromAddress: Address;
@@ -94,6 +94,13 @@ export type IContractWrite<
94
94
  */
95
95
  actionType: TransactionActionType;
96
96
  txnName?: string;
97
+ /**
98
+ * Extra Sentry tags to attach to this transaction's scope, merged under the
99
+ * `operation.txn.*` namespace (e.g. `{ aggregator: "oogabooga" }` becomes the
100
+ * `operation.txn.aggregator` tag). Use for context that helps triage failures
101
+ * without decoding calldata.
102
+ */
103
+ extraTags?: Record<string, string>;
97
104
  gasLimit?: bigint;
98
105
  account?: Account | Address;
99
106
  /**
@@ -1,49 +1,4 @@
1
- import type { Address } from "viem";
2
-
3
- import type { ApiValidatorFragment } from "@berachain/graphql/pol/api";
4
-
5
- import type { Token, TokenWithMetadata } from "./dex";
6
-
7
- export type IncentiveReward = {
8
- tokenMetadata: Token | undefined;
9
- tokenPrice: number;
10
- tokenValue: number;
11
- id: string;
12
- dist_id: string;
13
- token: string;
14
- recipient: string;
15
- formattedAmount: string;
16
- amount: string;
17
- merkle_proof: string[];
18
- available_at: number;
19
- };
20
- export interface IncentiveRewardChunksWithValidatorData {
21
- validator: ApiValidatorInListFragment | ApiValidatorFragment | undefined;
22
- maxTimestamp: number | undefined;
23
- minTimestamp: number | undefined;
24
- totalValue: number;
25
- tokenTotals: {
26
- chainId: number;
27
- address: Address;
28
- amount: number;
29
- value: number;
30
- metadata: Token | undefined;
31
- }[];
32
- rewards: IncentiveReward[];
33
- isCurrent: boolean;
34
- }
35
-
36
- export interface AggregatedTokenTotals {
37
- address: Address;
38
- amount: number;
39
- value: number;
40
- metadata: Token | undefined;
41
- chainId: number;
42
- }
43
-
44
- export type ClaimedIncentives = Record<string, string>;
45
-
46
- export type ClaimedIncentivesLocalState = Record<string, ClaimedIncentives>;
1
+ import type { TokenWithMetadata } from "./dex";
47
2
 
48
3
  export interface UserVaultInfo {
49
4
  balance: bigint;
@@ -56,11 +11,11 @@ export interface UserVaultInfo {
56
11
  export type StakedBeraAsset = {
57
12
  token: TokenWithMetadata;
58
13
  /**
59
- * Staking APR, or `undefined` when unavailable (e.g. the APR backend is
14
+ * Staking APY, or `undefined` when unavailable (e.g. the APY backend is
60
15
  * down). `undefined` lets the UI render a "—" placeholder instead of a
61
16
  * misleading "0%".
62
17
  */
63
- apr: number | undefined;
18
+ apy: number | undefined;
64
19
  stakedAmount: number;
65
20
  /**
66
21
  * USD value of the staked amount, or `undefined` when the token price is