@berachain/berajs 0.1.2 → 0.2.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 (453) hide show
  1. package/dist/{BeraError-D1HS_rbb.d.cts → BeraError-_mQdkanr.d.cts} +35 -10
  2. package/dist/{BeraError-D1HS_rbb.d.ts → BeraError-_mQdkanr.d.ts} +35 -10
  3. package/dist/HoneyConfigProvider-CK6mOKFH.d.ts +390 -0
  4. package/dist/HoneyConfigProvider-Ca3ouozs.d.cts +390 -0
  5. package/dist/{RequestError-D8AE6xnI.d.cts → RequestError-A8XJ6QR9.d.cts} +1 -1
  6. package/dist/{RequestError-m4jxyM7D.d.ts → RequestError-Dk97z8rm.d.ts} +1 -1
  7. package/dist/abi/exports.cjs +2 -0
  8. package/dist/abi/exports.cjs.map +1 -0
  9. package/dist/abi/{index.d.cts → exports.d.cts} +12369 -9122
  10. package/dist/abi/{index.d.ts → exports.d.ts} +12369 -9122
  11. package/dist/abi/exports.mjs +2 -0
  12. package/dist/abi/exports.mjs.map +1 -0
  13. package/dist/actions/exports.cjs +2 -0
  14. package/dist/actions/exports.cjs.map +1 -0
  15. package/dist/actions/{index.d.cts → exports.d.cts} +80 -107
  16. package/dist/actions/{index.d.ts → exports.d.ts} +80 -107
  17. package/dist/actions/exports.mjs +2 -0
  18. package/dist/actions/exports.mjs.map +1 -0
  19. package/dist/chunk-575OK77P.mjs +2 -0
  20. package/dist/chunk-575OK77P.mjs.map +1 -0
  21. package/dist/chunk-7GWTHOLO.mjs +2 -0
  22. package/dist/chunk-7GWTHOLO.mjs.map +1 -0
  23. package/dist/chunk-7SC4VD3U.cjs +2 -0
  24. package/dist/chunk-7SC4VD3U.cjs.map +1 -0
  25. package/dist/chunk-BHNQX4XC.mjs +2 -0
  26. package/dist/chunk-BHNQX4XC.mjs.map +1 -0
  27. package/dist/chunk-BOYZVULX.cjs +2 -0
  28. package/dist/chunk-BOYZVULX.cjs.map +1 -0
  29. package/dist/chunk-C3FHGFLK.mjs +2 -0
  30. package/dist/chunk-C3FHGFLK.mjs.map +1 -0
  31. package/dist/chunk-C3G5KXCH.mjs +2 -0
  32. package/dist/chunk-C3G5KXCH.mjs.map +1 -0
  33. package/dist/chunk-CYKCYPFR.cjs +2 -0
  34. package/dist/chunk-CYKCYPFR.cjs.map +1 -0
  35. package/dist/chunk-F4BKSBEM.mjs +2 -0
  36. package/dist/chunk-F4BKSBEM.mjs.map +1 -0
  37. package/dist/chunk-FL2N3XHK.cjs +2 -0
  38. package/dist/chunk-FL2N3XHK.cjs.map +1 -0
  39. package/dist/chunk-G6NA6NSM.mjs +4 -0
  40. package/dist/chunk-G6NA6NSM.mjs.map +1 -0
  41. package/dist/chunk-H2QSRMVS.mjs +2 -0
  42. package/dist/chunk-H2QSRMVS.mjs.map +1 -0
  43. package/dist/chunk-IJM76AWK.cjs +4 -0
  44. package/dist/chunk-IJM76AWK.cjs.map +1 -0
  45. package/dist/chunk-MTS5SZLA.mjs +2 -0
  46. package/dist/chunk-MTS5SZLA.mjs.map +1 -0
  47. package/dist/chunk-MUNAP5TM.cjs +2 -0
  48. package/dist/chunk-MUNAP5TM.cjs.map +1 -0
  49. package/dist/chunk-NAXAZJJY.mjs +2 -0
  50. package/dist/chunk-NAXAZJJY.mjs.map +1 -0
  51. package/dist/chunk-OGJMSGB2.mjs +2 -0
  52. package/dist/chunk-OGJMSGB2.mjs.map +1 -0
  53. package/dist/chunk-OIYXOKTT.cjs +2 -0
  54. package/dist/chunk-OIYXOKTT.cjs.map +1 -0
  55. package/dist/chunk-OS5AJMYJ.cjs +2 -0
  56. package/dist/chunk-OS5AJMYJ.cjs.map +1 -0
  57. package/dist/chunk-Q3SCM6WL.mjs +2 -0
  58. package/dist/chunk-Q3SCM6WL.mjs.map +1 -0
  59. package/dist/chunk-SWMJQOH6.cjs +2 -0
  60. package/dist/chunk-SWMJQOH6.cjs.map +1 -0
  61. package/dist/chunk-TEBJWAVU.mjs +2 -0
  62. package/dist/chunk-TEBJWAVU.mjs.map +1 -0
  63. package/dist/chunk-TJWKS54T.mjs +2 -0
  64. package/dist/chunk-TJWKS54T.mjs.map +1 -0
  65. package/dist/chunk-UQUWMHVF.cjs +2 -0
  66. package/dist/chunk-UQUWMHVF.cjs.map +1 -0
  67. package/dist/chunk-UXUWSRVV.cjs +2 -0
  68. package/dist/chunk-UXUWSRVV.cjs.map +1 -0
  69. package/dist/chunk-VP7XUOSI.cjs +2 -0
  70. package/dist/chunk-VP7XUOSI.cjs.map +1 -0
  71. package/dist/chunk-VXL2ZZ4X.cjs +2 -0
  72. package/dist/chunk-VXL2ZZ4X.cjs.map +1 -0
  73. package/dist/chunk-WRFDB3QJ.cjs +2 -0
  74. package/dist/chunk-WRFDB3QJ.cjs.map +1 -0
  75. package/dist/chunk-WTCBORPB.cjs +2 -0
  76. package/dist/chunk-WTCBORPB.cjs.map +1 -0
  77. package/dist/chunk-XNJLSA6P.cjs +2 -0
  78. package/dist/chunk-XNJLSA6P.cjs.map +1 -0
  79. package/dist/chunk-YQGZMWDT.mjs +2 -0
  80. package/dist/chunk-YQGZMWDT.mjs.map +1 -0
  81. package/dist/chunk-YXLFOEZN.mjs +2 -0
  82. package/dist/chunk-YXLFOEZN.mjs.map +1 -0
  83. package/dist/chunk-ZAKA4TGK.cjs +2 -0
  84. package/dist/chunk-ZAKA4TGK.cjs.map +1 -0
  85. package/dist/chunk-ZQRACIGR.mjs +2 -0
  86. package/dist/chunk-ZQRACIGR.mjs.map +1 -0
  87. package/dist/contexts/exports.cjs +2 -0
  88. package/dist/contexts/exports.cjs.map +1 -0
  89. package/dist/contexts/{index.d.ts → exports.d.cts} +19 -28
  90. package/dist/contexts/{index.d.cts → exports.d.ts} +19 -28
  91. package/dist/contexts/exports.mjs +2 -0
  92. package/dist/contexts/exports.mjs.map +1 -0
  93. package/dist/contracts-CQIPk0Jc.d.cts +74 -0
  94. package/dist/contracts-CQIPk0Jc.d.ts +74 -0
  95. package/dist/{defaultFlags-V-tJs2K8.d.cts → defaultFlags-d0kPbT0i.d.cts} +1 -1
  96. package/dist/{defaultFlags-V-tJs2K8.d.ts → defaultFlags-d0kPbT0i.d.ts} +1 -1
  97. package/dist/dex-C_BB0b0O.d.cts +37 -0
  98. package/dist/dex-C_BB0b0O.d.ts +37 -0
  99. package/dist/enum/exports.cjs +2 -0
  100. package/dist/enum/exports.cjs.map +1 -0
  101. package/dist/enum/exports.d.cts +24 -0
  102. package/dist/enum/exports.d.ts +24 -0
  103. package/dist/enum/exports.mjs +2 -0
  104. package/dist/enum/exports.mjs.map +1 -0
  105. package/dist/errors/exports.cjs +2 -0
  106. package/dist/errors/exports.cjs.map +1 -0
  107. package/dist/errors/exports.d.cts +385 -0
  108. package/dist/errors/exports.d.ts +385 -0
  109. package/dist/errors/exports.mjs +2 -0
  110. package/dist/{getValidatorQueuedOperatorAddress-9xY2RUGe.d.cts → getValidatorQueuedOperatorAddress-BX35p2Lv.d.ts} +125 -15
  111. package/dist/{getValidatorQueuedOperatorAddress-Ne2zoiiV.d.ts → getValidatorQueuedOperatorAddress-It0GsdvQ.d.cts} +125 -15
  112. package/dist/global.d-Ba-NIojH.d.cts +474 -0
  113. package/dist/global.d-By70bEv2.d.ts +474 -0
  114. package/dist/honey-CYm0RWf4.d.cts +14 -0
  115. package/dist/honey-CYm0RWf4.d.ts +14 -0
  116. package/dist/hooks/exports.cjs +4 -0
  117. package/dist/hooks/exports.cjs.map +1 -0
  118. package/dist/hooks/{index.d.cts → exports.d.cts} +223 -173
  119. package/dist/hooks/{index.d.ts → exports.d.ts} +223 -173
  120. package/dist/hooks/exports.mjs +4 -0
  121. package/dist/hooks/exports.mjs.map +1 -0
  122. package/dist/{BexStatusProvider-nS3NcdxI.d.cts → transactionStore-BvStaXf3.d.ts} +41 -1
  123. package/dist/{BexStatusProvider-nS3NcdxI.d.ts → transactionStore-CQrGYSY2.d.cts} +41 -1
  124. package/dist/{txnEnum-BQKDfaeH.d.cts → txnEnum-BYNbCxla.d.cts} +1 -0
  125. package/dist/{txnEnum-BQKDfaeH.d.ts → txnEnum-BYNbCxla.d.ts} +1 -0
  126. package/dist/types/exports.cjs +1 -0
  127. package/dist/types/exports.cjs.map +1 -0
  128. package/dist/types/exports.d.cts +58 -0
  129. package/dist/types/exports.d.ts +58 -0
  130. package/dist/types/exports.mjs +1 -0
  131. package/dist/{useHoneySwapState-C-9BV4VB.d.cts → useHoneySwapState-B-vmIP1b.d.cts} +1 -1
  132. package/dist/{useHoneySwapState-CUY5Sm1b.d.ts → useHoneySwapState-D1DKG_Of.d.ts} +1 -1
  133. package/dist/utils/exports.cjs +2 -0
  134. package/dist/utils/exports.cjs.map +1 -0
  135. package/dist/utils/{index.d.cts → exports.d.cts} +83 -20
  136. package/dist/utils/{index.d.ts → exports.d.ts} +83 -20
  137. package/dist/utils/exports.mjs +2 -0
  138. package/dist/utils/exports.mjs.map +1 -0
  139. package/package.json +16 -17
  140. package/src/abi/{index.ts → exports.ts} +3 -0
  141. package/src/abi/pol/LSTStakerVault.ts +2032 -0
  142. package/src/abi/utils/openChainErrors.ts +71 -30
  143. package/src/abi/utils/thirdwebMinimalAccount.ts +616 -0
  144. package/src/actions/clients/BeraApolloClient.ts +8 -6
  145. package/src/actions/dex/__tests__/aggregators.unit.test.ts +2 -5
  146. package/src/actions/dex/aggregators/base.ts +74 -16
  147. package/src/actions/dex/aggregators/bex.ts +54 -74
  148. package/src/actions/dex/aggregators/bgt.ts +31 -8
  149. package/src/actions/dex/aggregators/{enso.ts → enso/enso.ts} +18 -14
  150. package/src/actions/dex/aggregators/enso/ensoErc4626.debug.test.ts +37 -0
  151. package/src/actions/dex/aggregators/enso/ensoErc4626.ts +176 -0
  152. package/src/actions/dex/aggregators/erc4626.ts +122 -0
  153. package/src/actions/dex/aggregators/fly.ts +59 -53
  154. package/src/actions/dex/aggregators/haiku.ts +52 -54
  155. package/src/actions/dex/aggregators/honey.ts +54 -45
  156. package/src/actions/dex/aggregators/kyberswap.ts +41 -39
  157. package/src/actions/dex/aggregators/oogabooga.ts +47 -46
  158. package/src/actions/dex/aggregators/openOcean.ts +51 -46
  159. package/src/actions/dex/aggregators/wbera.ts +54 -42
  160. package/src/actions/dex/b-sdk.ts +5 -2
  161. package/src/actions/dex/getIsTokenExploited.ts +2 -2
  162. package/src/actions/enso/{zap.ts → getEnsoSwapBundle.ts} +4 -5
  163. package/src/actions/enso/getEnsoUserTokensWithBalances.debug.test.ts +73 -0
  164. package/src/actions/enso/{getEnsoUserToken.ts → getEnsoUserTokensWithBalances.ts} +42 -30
  165. package/src/actions/enso/util.ts +1 -1
  166. package/src/actions/{index.ts → exports.ts} +5 -0
  167. package/src/actions/governance/__tests__/checkProposalField.unit.test.ts +1 -1
  168. package/src/actions/governance/__tests__/getQuorum.integration.test.ts +1 -1
  169. package/src/actions/governance/checkProposalField.ts +1 -1
  170. package/src/actions/governance/computeActualStatus.ts +1 -1
  171. package/src/actions/governance/getBodyErrors.ts +1 -1
  172. package/src/actions/governance/getDecodedFunctionData.ts +1 -4
  173. package/src/actions/governance/getProposalDetails.ts +2 -2
  174. package/src/actions/governance/getProposalFromTx.ts +1 -2
  175. package/src/actions/governance/getProposalParams.ts +7 -8
  176. package/src/actions/governance/getQuorum.ts +1 -2
  177. package/src/actions/honey/getCollateralWeights.ts +1 -1
  178. package/src/actions/honey/getHoneyCollaterals.ts +1 -0
  179. package/src/actions/honey/getHoneyVaultsBalance.ts +51 -55
  180. package/src/actions/honey/getSwapPayload.ts +37 -35
  181. package/src/actions/honey/tests/pyth.integration.test.ts +0 -1
  182. package/src/actions/pol/__tests__/getAllValidators.integration.test.ts +1 -1
  183. package/src/actions/pol/getEarnedStakedBeraVault.ts +31 -0
  184. package/src/actions/pol/getGlobalData.ts +14 -13
  185. package/src/actions/pol/getLSTStakeConfig.ts +67 -0
  186. package/src/actions/pol/getMarkets.ts +1 -1
  187. package/src/actions/pol/getRewardProofsByValidator.ts +1 -1
  188. package/src/actions/pol/getRewardVaultIncentives.ts +3 -5
  189. package/src/actions/pol/getRewardVaults.ts +2 -3
  190. package/src/actions/pol/getSWBeraVaultMetadata.ts +7 -5
  191. package/src/actions/pol/getSWBeraWithdrawal.ts +41 -27
  192. package/src/actions/pol/getStakeWithdrawalCooldown.ts +5 -7
  193. package/src/actions/pol/getStakingDailyAssets.ts +21 -0
  194. package/src/actions/pol/getStakingTokenInformation.ts +3 -4
  195. package/src/actions/pol/getTotalStakedAmount.ts +47 -0
  196. package/src/actions/pol/getUserClaimableIncentives.ts +1 -1
  197. package/src/actions/pol/getUserVaults.ts +8 -6
  198. package/src/actions/pol/getUserVaultsBalance.ts +4 -16
  199. package/src/actions/prices/getTokenCurrentPrices.ts +8 -3
  200. package/src/actions/tokens/getAllowances.ts +68 -41
  201. package/src/actions/tokens/getTokenInformation.ts +4 -1
  202. package/src/actions/tokens/getTokens.ts +1 -1
  203. package/src/actions/tokens/getUnderlyingToken.ts +53 -0
  204. package/src/actions/tokens/getWalletBalances.integration.test.ts +53 -14
  205. package/src/actions/tokens/getWalletBalances.ts +69 -43
  206. package/src/actions/transactions/beraWriteContract.integration.test.ts +18 -6
  207. package/src/actions/transactions/beraWriteContract.ts +3 -3
  208. package/src/actions/validators/getUserActiveValidators.ts +2 -3
  209. package/src/actions/validators/getUserBoostsOnValidator.ts +2 -3
  210. package/src/contexts/BeraFlags/defaultFlags.ts +4 -0
  211. package/src/contexts/SwrFallback.tsx +13 -3
  212. package/src/contexts/TokensProvider.tsx +35 -8
  213. package/src/{hooks/transactions → contexts}/TransactionStoreContext.tsx +32 -4
  214. package/src/contexts/block-time-provider.tsx +1 -1
  215. package/src/contexts/{index.ts → exports.ts} +1 -1
  216. package/src/data/contracts.ts +16 -1
  217. package/src/enum/contracts.ts +13 -0
  218. package/src/enum/dex.ts +29 -0
  219. package/src/enum/{index.ts → exports.ts} +3 -0
  220. package/src/enum/governance.ts +61 -0
  221. package/src/enum/honey.ts +12 -0
  222. package/src/enum/txnEnum.ts +1 -0
  223. package/src/errors/BeraError.ts +50 -11
  224. package/src/errors/BeraMonitoring.ts +66 -0
  225. package/src/errors/BeraTracing.ts +79 -0
  226. package/src/errors/BeraTracing.unit.test.ts +198 -0
  227. package/src/errors/RequestError.ts +2 -2
  228. package/src/errors/assert.ts +4 -2
  229. package/src/errors/assert.unit.test.ts +6 -2
  230. package/src/errors/errorMap.ts +16 -6
  231. package/src/errors/{index.ts → exports.ts} +7 -0
  232. package/src/errors/getErrorMessage.ts +22 -3
  233. package/src/errors/getRevertReason.integration.test.ts +17 -5
  234. package/src/errors/getRevertReason.ts +41 -2
  235. package/src/errors/initBeraError.ts +52 -7
  236. package/src/errors/parseViemError.ts +114 -27
  237. package/src/errors/severity.ts +12 -0
  238. package/src/hooks/bend/useGetConvertToAssets.ts +3 -2
  239. package/src/hooks/dex/useAggregatorsQuotes.ts +126 -365
  240. package/src/hooks/dex/useAllUserPools.ts +1 -1
  241. package/src/hooks/dex/useApiPool.ts +1 -1
  242. package/src/hooks/dex/useCreatePool.ts +6 -5
  243. package/src/hooks/dex/useExploitedTokens.ts +1 -1
  244. package/src/hooks/dex/useLiquidityMismatch.ts +2 -5
  245. package/src/hooks/dex/useLpPosition.ts +21 -20
  246. package/src/hooks/dex/useMultipleTokenApprovalsWithSlippage.ts +40 -29
  247. package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +1 -1
  248. package/src/hooks/dex/usePoolEvents.ts +1 -1
  249. package/src/hooks/dex/usePools.ts +1 -1
  250. package/src/hooks/dex/usePriceImpact.ts +40 -0
  251. package/src/hooks/dex/useSingleAggregatorQuote.ts +350 -0
  252. package/src/hooks/enso/useBendZapSupply.ts +216 -0
  253. package/src/hooks/enso/useEnsoSwapBundle.ts +107 -0
  254. package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +43 -0
  255. package/src/hooks/enso/useZapStakeBera.ts +113 -0
  256. package/src/hooks/{index.ts → exports.ts} +18 -7
  257. package/src/hooks/governance/useCreateProposal.ts +8 -8
  258. package/src/hooks/governance/usePollAllProposals.ts +1 -1
  259. package/src/hooks/governance/usePollProposal.ts +1 -1
  260. package/src/hooks/governance/usePollProposalThreshold.ts +1 -1
  261. package/src/hooks/governance/usePollUserDelegates.ts +1 -1
  262. package/src/hooks/governance/useProposalState.ts +2 -2
  263. package/src/hooks/honey/useCappedGlobally.ts +2 -1
  264. package/src/hooks/honey/useCappedRelatively.ts +1 -1
  265. package/src/hooks/honey/useCollateralWeights.ts +2 -1
  266. package/src/hooks/honey/useHoneyAlerts.ts +11 -11
  267. package/src/hooks/honey/useHoneyBalances.ts +7 -3
  268. package/src/hooks/honey/useHoneyGlobalData.ts +2 -1
  269. package/src/hooks/honey/useHoneySwapState.ts +2 -1
  270. package/src/hooks/honey/useHoneyVaultsBalance.ts +1 -1
  271. package/src/hooks/honey/useIsBadCollateralAsset.ts +2 -1
  272. package/src/hooks/honey/useIsBasketModeEnabled.ts +1 -1
  273. package/src/hooks/honey/usePythLatestPrices.ts +1 -1
  274. package/src/hooks/pol/useOnChainRewardVault.ts +3 -2
  275. package/src/hooks/pol/usePollGlobalData.ts +1 -1
  276. package/src/hooks/pol/usePollMarkets.ts +1 -1
  277. package/src/hooks/pol/useQueuedBeraUnlock.ts +17 -15
  278. package/src/hooks/pol/useRewardTokenToBeraRate.ts +6 -3
  279. package/src/hooks/pol/useRewardVault.ts +1 -1
  280. package/src/hooks/pol/useRewardVaults.ts +1 -1
  281. package/src/hooks/pol/useSWBeraVaultMetadata.ts +35 -0
  282. package/src/hooks/pol/useStakedAPR.ts +38 -0
  283. package/src/hooks/pol/useStakedData.ts +117 -0
  284. package/src/hooks/pol/useStakedSnapshots.ts +52 -0
  285. package/src/hooks/pol/useTotalStakedAmount.ts +30 -0
  286. package/src/hooks/pol/useUserVaultInfo.ts +1 -1
  287. package/src/hooks/pol/useVaultValidators.ts +1 -1
  288. package/src/hooks/tokens/useMultipleTokenInformation.ts +15 -6
  289. package/src/hooks/tokens/usePollAllowances.ts +15 -19
  290. package/src/hooks/tokens/usePollBalance.ts +8 -4
  291. package/src/hooks/tokens/usePollWalletBalances.ts +14 -11
  292. package/src/hooks/tokens/useStakingTokenInformation.ts +2 -1
  293. package/src/hooks/tokens/useTokenCurrentPrice.ts +4 -2
  294. package/src/hooks/tokens/useTokenCurrentPrices.ts +92 -13
  295. package/src/hooks/tokens/useTokenInformation.ts +11 -6
  296. package/src/hooks/tokens/useTokenPrice.ts +21 -0
  297. package/src/hooks/tokens/useTokenPrices.ts +133 -0
  298. package/src/hooks/tokens/useTokens.ts +1 -0
  299. package/src/hooks/tokens/useUnderlyingAsset.ts +23 -0
  300. package/src/hooks/transactions/transactionStore.ts +86 -65
  301. package/src/hooks/transactions/transactionStore.unit.test.ts +54 -1
  302. package/src/hooks/transactions/useAddRecentTransaction.ts +1 -1
  303. package/src/hooks/transactions/useRecentTransactions.ts +1 -1
  304. package/src/hooks/transactions/useSetTransactionStatus.ts +31 -0
  305. package/src/hooks/useContractWrite/useBeraContractWrite.ts +2 -1
  306. package/src/hooks/validators/useAllValidators.ts +1 -1
  307. package/src/hooks/validators/useApiValidator.ts +1 -1
  308. package/src/hooks/validators/useDailyValidatorBlockStats.ts +1 -1
  309. package/src/hooks/validators/useManagedValidatorByAccount.ts +1 -1
  310. package/src/hooks/validators/useManagedValidatorRole.ts +1 -1
  311. package/src/hooks/validators/useOnChainValidator.ts +1 -1
  312. package/src/hooks/validators/useStakingPoolBatch.ts +1 -1
  313. package/src/hooks/validators/useUserActiveValidators.ts +1 -1
  314. package/src/hooks/validators/useUserBoostsOnValidator.ts +1 -1
  315. package/src/hooks/validators/useUserClaimableIncentives.ts +8 -8
  316. package/src/hooks/validators/useValidator.ts +1 -1
  317. package/src/hooks/validators/useValidatorAnalytics.ts +1 -1
  318. package/src/hooks/validators/useValidatorCommission.ts +1 -1
  319. package/src/hooks/validators/useValidatorQueuedCommission.ts +1 -1
  320. package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +1 -1
  321. package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +1 -1
  322. package/src/hooks/validators/useValidatorRewardAllocation.ts +1 -1
  323. package/src/types/{dex.ts → dex.d.ts} +96 -67
  324. package/src/types/{enso.ts → enso.d.ts} +1 -1
  325. package/src/types/exports.ts +8 -0
  326. package/src/types/{global.ts → global.d.ts} +1 -30
  327. package/src/types/{governance.ts → governance.d.ts} +2 -64
  328. package/src/types/{honeySwap.ts → honeySwap.d.ts} +1 -13
  329. package/src/types/{pol.ts → pol.d.ts} +12 -1
  330. package/src/types/staking.d.ts +22 -0
  331. package/src/utils/createEmitter.ts +122 -0
  332. package/src/utils/createEmitter.unit.test.ts +149 -0
  333. package/src/utils/{index.ts → exports.ts} +3 -2
  334. package/src/utils/filter.ts +34 -0
  335. package/src/utils/formatNumber.ts +1 -1
  336. package/src/utils/formatNumber.unit.test.ts +2 -1
  337. package/src/utils/formatTokenList.ts +4 -10
  338. package/src/utils/getHoneySwapMessage.test.ts +1 -2
  339. package/src/utils/getServerSideClient.ts +4 -5
  340. package/src/utils/isDifferenceExceedingThreshold.ts +1 -1
  341. package/src/utils/layerZeroScan.ts +122 -0
  342. package/src/utils/math.ts +1 -1
  343. package/src/utils/parseWhiskToken.ts +15 -0
  344. package/src/utils/poolNamings.ts +1 -1
  345. package/src/utils/tokens.ts +23 -7
  346. package/dist/HoneyConfigProvider-6PXZJMSU.d.cts +0 -562
  347. package/dist/HoneyConfigProvider-CwDFrt02.d.ts +0 -562
  348. package/dist/abi/index.cjs +0 -2
  349. package/dist/abi/index.cjs.map +0 -1
  350. package/dist/abi/index.mjs +0 -2
  351. package/dist/actions/index.cjs +0 -2
  352. package/dist/actions/index.cjs.map +0 -1
  353. package/dist/actions/index.mjs +0 -2
  354. package/dist/aggregatorsRouter-Cny4B_MB.d.cts +0 -593
  355. package/dist/aggregatorsRouter-Cny4B_MB.d.ts +0 -593
  356. package/dist/chunk-22MQVFHP.cjs +0 -2
  357. package/dist/chunk-22MQVFHP.cjs.map +0 -1
  358. package/dist/chunk-3TKSVFZ3.mjs +0 -2
  359. package/dist/chunk-3TKSVFZ3.mjs.map +0 -1
  360. package/dist/chunk-6VF3RF53.cjs +0 -3
  361. package/dist/chunk-6VF3RF53.cjs.map +0 -1
  362. package/dist/chunk-6W22TFYA.mjs +0 -2
  363. package/dist/chunk-6W22TFYA.mjs.map +0 -1
  364. package/dist/chunk-AMRJ4B36.mjs +0 -2
  365. package/dist/chunk-AMRJ4B36.mjs.map +0 -1
  366. package/dist/chunk-DS2ZDVKU.mjs +0 -2
  367. package/dist/chunk-DS2ZDVKU.mjs.map +0 -1
  368. package/dist/chunk-ED43NYSE.cjs +0 -2
  369. package/dist/chunk-ED43NYSE.cjs.map +0 -1
  370. package/dist/chunk-EU4WFADK.cjs +0 -2
  371. package/dist/chunk-EU4WFADK.cjs.map +0 -1
  372. package/dist/chunk-HCTFDGXL.mjs +0 -2
  373. package/dist/chunk-HCTFDGXL.mjs.map +0 -1
  374. package/dist/chunk-IOSYBHKU.mjs +0 -2
  375. package/dist/chunk-IOSYBHKU.mjs.map +0 -1
  376. package/dist/chunk-JMKLDDKY.cjs +0 -2
  377. package/dist/chunk-JMKLDDKY.cjs.map +0 -1
  378. package/dist/chunk-KMKUXP2S.mjs +0 -3
  379. package/dist/chunk-KMKUXP2S.mjs.map +0 -1
  380. package/dist/chunk-OJXJ6CZ4.mjs +0 -4
  381. package/dist/chunk-OJXJ6CZ4.mjs.map +0 -1
  382. package/dist/chunk-PHIOKO3A.mjs +0 -2
  383. package/dist/chunk-PHIOKO3A.mjs.map +0 -1
  384. package/dist/chunk-QCK474XD.cjs +0 -2
  385. package/dist/chunk-QCK474XD.cjs.map +0 -1
  386. package/dist/chunk-REDXXUK7.cjs +0 -2
  387. package/dist/chunk-REDXXUK7.cjs.map +0 -1
  388. package/dist/chunk-S74ZMG2G.cjs +0 -2
  389. package/dist/chunk-S74ZMG2G.cjs.map +0 -1
  390. package/dist/chunk-TOAXF4YW.cjs +0 -2
  391. package/dist/chunk-TOAXF4YW.cjs.map +0 -1
  392. package/dist/chunk-UZ5CB33M.cjs +0 -2
  393. package/dist/chunk-UZ5CB33M.cjs.map +0 -1
  394. package/dist/chunk-VYWYJR63.mjs +0 -2
  395. package/dist/chunk-VYWYJR63.mjs.map +0 -1
  396. package/dist/chunk-XFPTQMAK.cjs +0 -4
  397. package/dist/chunk-XFPTQMAK.cjs.map +0 -1
  398. package/dist/chunk-YK4NINF5.mjs +0 -2
  399. package/dist/chunk-YK4NINF5.mjs.map +0 -1
  400. package/dist/contexts/index.cjs +0 -2
  401. package/dist/contexts/index.cjs.map +0 -1
  402. package/dist/contexts/index.mjs +0 -2
  403. package/dist/contexts/index.mjs.map +0 -1
  404. package/dist/enum/index.cjs +0 -2
  405. package/dist/enum/index.cjs.map +0 -1
  406. package/dist/enum/index.d.cts +0 -31
  407. package/dist/enum/index.d.ts +0 -31
  408. package/dist/enum/index.mjs +0 -2
  409. package/dist/enum/index.mjs.map +0 -1
  410. package/dist/errors/index.cjs +0 -2
  411. package/dist/errors/index.cjs.map +0 -1
  412. package/dist/errors/index.d.cts +0 -204
  413. package/dist/errors/index.d.ts +0 -204
  414. package/dist/errors/index.mjs +0 -2
  415. package/dist/errors/index.mjs.map +0 -1
  416. package/dist/hooks/index.cjs +0 -4
  417. package/dist/hooks/index.cjs.map +0 -1
  418. package/dist/hooks/index.mjs +0 -4
  419. package/dist/hooks/index.mjs.map +0 -1
  420. package/dist/staking-F9Nx9TKD.d.ts +0 -246
  421. package/dist/staking-f4BpYH7l.d.cts +0 -246
  422. package/dist/types/index.cjs +0 -2
  423. package/dist/types/index.cjs.map +0 -1
  424. package/dist/types/index.d.cts +0 -56
  425. package/dist/types/index.d.ts +0 -56
  426. package/dist/types/index.mjs +0 -2
  427. package/dist/types/index.mjs.map +0 -1
  428. package/dist/utils/index.cjs +0 -2
  429. package/dist/utils/index.cjs.map +0 -1
  430. package/dist/utils/index.mjs +0 -2
  431. package/dist/utils/index.mjs.map +0 -1
  432. package/src/actions/dex/getTransactionCount.ts +0 -29
  433. package/src/actions/enso/bend.ts +0 -143
  434. package/src/actions/enso/getEnsoUserToken.debug.test.ts +0 -57
  435. package/src/contexts/berajsProvider/context.tsx +0 -49
  436. package/src/contexts/berajsProvider/index.ts +0 -2
  437. package/src/contexts/berajsProvider/useBeraJs.ts +0 -18
  438. package/src/hooks/dex/usePollVaultIsPaused.ts +0 -30
  439. package/src/hooks/enso/useBendTransactionRequests.ts +0 -247
  440. package/src/hooks/enso/useEnsoZap.ts +0 -166
  441. package/src/hooks/enso/useZapTransactionRequests.ts +0 -81
  442. package/src/hooks/pol/useEarnedStakedBeraVault.ts +0 -59
  443. package/src/hooks/pol/useStakedBeraSnapshots.ts +0 -27
  444. package/src/hooks/validators/validatorRoleManager.ts +0 -0
  445. package/src/types/index.ts +0 -8
  446. package/src/types/staking.ts +0 -7
  447. package/src/utils/formatAggregatorsQuotes.ts +0 -57
  448. package/src/utils/formatAggregatorsQuotes.unit.test.ts +0 -191
  449. package/src/utils/sentryBeforeSend.ts +0 -52
  450. /package/dist/{abi/index.mjs.map → errors/exports.mjs.map} +0 -0
  451. /package/dist/{actions/index.mjs.map → types/exports.mjs.map} +0 -0
  452. /package/src/actions/dex/{__tests__ → aggregators}/haiku.integration.test.ts +0 -0
  453. /package/src/types/{bribe-boost.ts → bribe-boost.d.ts} +0 -0
@@ -1,246 +0,0 @@
1
- import { Address, Hex, AbiFunction } from 'viem';
2
- import { ProposalWithVotesFragment, ProposalVoteFragment } from '@berachain/graphql/governance';
3
- import { ApiValidatorFragment } from '@berachain/graphql/pol/api';
4
- import { a as Token } from './HoneyConfigProvider-CwDFrt02.js';
5
-
6
- interface BribeBoostReward {
7
- token: string;
8
- total_unclaimed: string;
9
- }
10
- interface BribeBoostRewardItem {
11
- rewards: BribeBoostReward[];
12
- validator: string;
13
- }
14
- interface BribeBoostRewardProof {
15
- validator?: string;
16
- pagination: {
17
- next: number;
18
- previous: number;
19
- record_per_page: number;
20
- current_page: number;
21
- total_page: number;
22
- };
23
- rewards: {
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
- }[] | null;
32
- }
33
- interface BribeBoostValidatorApr {
34
- id: string;
35
- boost_total_bgt: string;
36
- rewards_total_usd: string;
37
- daily_rate: string;
38
- apr: string;
39
- apy: string;
40
- tokens: Address[];
41
- validator: string;
42
- start_block: number;
43
- end_block: number;
44
- start_timestamp: number;
45
- end_timestamp: number;
46
- created_at: string;
47
- updated_at: string;
48
- }
49
-
50
- type Proposal = ProposalWithVotesFragment;
51
- type Vote = ProposalVoteFragment;
52
- type Voter = Address;
53
- /**
54
- * Maps the proposal state from the governor contract to a more human-readable format.
55
- * Don't edit this enum manually, it's synced with the governor contract.
56
- *
57
- * @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/IGovernor.sol
58
- */
59
- declare enum ProposalState {
60
- Pending = 0,
61
- Active = 1,
62
- Canceled = 2,
63
- Defeated = 3,
64
- Succeeded = 4,
65
- Queued = 5,
66
- Expired = 6,
67
- Executed = 7
68
- }
69
- type ProposalVotes = {
70
- yes: number;
71
- no: number;
72
- abstain: number;
73
- };
74
- declare const VoteColorMap: {
75
- yes: string;
76
- 1: string;
77
- no: string;
78
- 2: string;
79
- veto: string;
80
- 4: string;
81
- abstain: string;
82
- 3: string;
83
- yes_secondary: string;
84
- no_secondary: string;
85
- veto_secondary: string;
86
- abstain_secondary: string;
87
- default: string;
88
- };
89
- declare enum VoteEnum {
90
- AGAINST = "no",
91
- FOR = "yes",
92
- ABSTAIN = "abstain"
93
- }
94
- type PROPOSAL_GENRE = "berahub" | "honey" | "bend" | "berps" | "general";
95
- type CustomProposalActionErrors = {
96
- type?: null | ProposalErrorCodes;
97
- target?: null | ProposalErrorCodes;
98
- value?: null | ProposalErrorCodes;
99
- ABI?: null | ProposalErrorCodes;
100
- functionSignature?: null | ProposalErrorCodes;
101
- args?: (null | ProposalErrorCodes)[];
102
- vault?: null | ProposalErrorCodes;
103
- isFriend?: null | ProposalErrorCodes;
104
- to?: null | ProposalErrorCodes;
105
- amount?: null | ProposalErrorCodes;
106
- minIncentiveRate?: null | ProposalErrorCodes;
107
- managerAddress?: null | ProposalErrorCodes;
108
- input?: null | ProposalErrorCodes;
109
- token?: null | ProposalErrorCodes;
110
- rawCalldata?: null | ProposalErrorCodes;
111
- message?: null | ProposalErrorCodes;
112
- } | null;
113
- type CustomProposalErrors = {
114
- title?: null | ProposalErrorCodes;
115
- description?: null | ProposalErrorCodes;
116
- forumLink?: null | ProposalErrorCodes;
117
- actions?: CustomProposalActionErrors[];
118
- };
119
- declare enum ProposalErrorCodes {
120
- REQUIRED = "Required",
121
- INVALID_AMOUNT = "Invalid amount",
122
- NEGATIVE_AMOUNT = "Negative amount",
123
- INVALID_ADDRESS = "Invalid address",
124
- INVALID_ACTION = "Invalid action",
125
- INVALID_ABI = "Invalid ABI",
126
- MUST_BE_HTTPS = "Must be HTTPS",
127
- MUST_BE_HTTPS_OR_IPFS = "Must be HTTPS or IPFS",
128
- INVALID_BASEPATH = "Must be a berachain forum link",
129
- /**
130
- * Mainly used when it's not a reward vault
131
- */
132
- INVALID_CONTRACT = "This is not a valid contract"
133
- }
134
- type GovernanceTopic = {
135
- id: PROPOSAL_GENRE;
136
- color: string;
137
- icon: React.ReactNode;
138
- iconBackground?: string;
139
- name: string;
140
- slug: string;
141
- forumLink: string;
142
- description?: string;
143
- comingSoon?: boolean;
144
- };
145
- declare enum ProposalTypeEnum {
146
- CUSTOM_PROPOSAL = "custom-action",
147
- WHITELIST_REWARD_VAULT = "whitelist-reward-vault",
148
- BLACKLIST_REWARD_VAULT = "blacklist-reward-vault",
149
- ERC20_TRANSFER = "erc20-transfer",
150
- WHITELIST_REWARD_VAULT_INCENTIVE = "whitelist-reward-vault-incentive"
151
- }
152
- type CustomProposal = {
153
- title: string;
154
- description: any;
155
- actions: ProposalAction[];
156
- forumLink: string;
157
- topic: Set<PROPOSAL_GENRE>;
158
- };
159
- type SafeProposalAction = {
160
- value: bigint;
161
- target: "" | Address;
162
- } & ({
163
- type: ProposalTypeEnum.CUSTOM_PROPOSAL;
164
- input: "ABI" | "rawCalldata" | "message";
165
- ABI: string;
166
- _isVerifiedAbi?: boolean;
167
- functionSignature: string;
168
- args: string[];
169
- rawCalldata: Hex;
170
- message: string;
171
- } | {
172
- type: ProposalTypeEnum.WHITELIST_REWARD_VAULT | ProposalTypeEnum.BLACKLIST_REWARD_VAULT;
173
- vault: Address;
174
- } | {
175
- type: ProposalTypeEnum.ERC20_TRANSFER;
176
- to: Address;
177
- amount: string;
178
- } | {
179
- type: ProposalTypeEnum.WHITELIST_REWARD_VAULT_INCENTIVE;
180
- vault: Address;
181
- token: Address;
182
- minIncentiveRate: string;
183
- managerAddress: Address;
184
- });
185
- type ProposalAction = Partial<SafeProposalAction> & {
186
- type: SafeProposalAction["type"];
187
- };
188
- type VerifiedAbi = {
189
- abiItem?: AbiFunction;
190
- functionName?: string;
191
- args: readonly unknown[];
192
- functionSignature?: string;
193
- };
194
-
195
- type IncentiveReward = {
196
- tokenMetadata: Token | undefined;
197
- tokenPrice: number;
198
- tokenValue: number;
199
- id: string;
200
- dist_id: string;
201
- token: string;
202
- recipient: string;
203
- formattedAmount: string;
204
- amount: string;
205
- merkle_proof: string[];
206
- available_at: number;
207
- };
208
- interface IncentiveRewardChunksWithValidatorData {
209
- validator: ApiValidatorFragment | undefined;
210
- maxTimestamp: number | undefined;
211
- minTimestamp: number | undefined;
212
- totalValue: number;
213
- tokenTotals: {
214
- address: Address;
215
- amount: number;
216
- value: number;
217
- metadata: Token | undefined;
218
- }[];
219
- rewards: IncentiveReward[];
220
- isCurrent: boolean;
221
- }
222
- interface AggregatedTokenTotals {
223
- address: Address;
224
- amount: number;
225
- value: number;
226
- metadata: Token | undefined;
227
- }
228
- type ClaimedIncentives = Record<string, string>;
229
- type ClaimedIncentivesLocalState = Record<string, ClaimedIncentives>;
230
- interface UserVaultInfo {
231
- balance: bigint;
232
- delegatedBalance: bigint;
233
- withdrawableBalance: bigint;
234
- rewards: string;
235
- percentage: string;
236
- }
237
-
238
- interface ProtocolMetadata {
239
- name: string;
240
- logoURI: string;
241
- url: string;
242
- description: string;
243
- tags?: string[];
244
- }
245
-
246
- export { type AggregatedTokenTotals as A, type BribeBoostRewardProof as B, type CustomProposal as C, type GovernanceTopic as G, type IncentiveReward as I, type ProtocolMetadata as P, type SafeProposalAction as S, type UserVaultInfo as U, type Vote as V, ProposalErrorCodes as a, ProposalState as b, type CustomProposalErrors as c, type BribeBoostRewardItem as d, type BribeBoostReward as e, type BribeBoostValidatorApr as f, type Proposal as g, type Voter as h, type ProposalVotes as i, VoteColorMap as j, VoteEnum as k, type PROPOSAL_GENRE as l, type CustomProposalActionErrors as m, ProposalTypeEnum as n, type ProposalAction as o, type VerifiedAbi as p, type IncentiveRewardChunksWithValidatorData as q, type ClaimedIncentives as r, type ClaimedIncentivesLocalState as s };
@@ -1,246 +0,0 @@
1
- import { Address, Hex, AbiFunction } from 'viem';
2
- import { ProposalWithVotesFragment, ProposalVoteFragment } from '@berachain/graphql/governance';
3
- import { ApiValidatorFragment } from '@berachain/graphql/pol/api';
4
- import { a as Token } from './HoneyConfigProvider-6PXZJMSU.cjs';
5
-
6
- interface BribeBoostReward {
7
- token: string;
8
- total_unclaimed: string;
9
- }
10
- interface BribeBoostRewardItem {
11
- rewards: BribeBoostReward[];
12
- validator: string;
13
- }
14
- interface BribeBoostRewardProof {
15
- validator?: string;
16
- pagination: {
17
- next: number;
18
- previous: number;
19
- record_per_page: number;
20
- current_page: number;
21
- total_page: number;
22
- };
23
- rewards: {
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
- }[] | null;
32
- }
33
- interface BribeBoostValidatorApr {
34
- id: string;
35
- boost_total_bgt: string;
36
- rewards_total_usd: string;
37
- daily_rate: string;
38
- apr: string;
39
- apy: string;
40
- tokens: Address[];
41
- validator: string;
42
- start_block: number;
43
- end_block: number;
44
- start_timestamp: number;
45
- end_timestamp: number;
46
- created_at: string;
47
- updated_at: string;
48
- }
49
-
50
- type Proposal = ProposalWithVotesFragment;
51
- type Vote = ProposalVoteFragment;
52
- type Voter = Address;
53
- /**
54
- * Maps the proposal state from the governor contract to a more human-readable format.
55
- * Don't edit this enum manually, it's synced with the governor contract.
56
- *
57
- * @see https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/governance/IGovernor.sol
58
- */
59
- declare enum ProposalState {
60
- Pending = 0,
61
- Active = 1,
62
- Canceled = 2,
63
- Defeated = 3,
64
- Succeeded = 4,
65
- Queued = 5,
66
- Expired = 6,
67
- Executed = 7
68
- }
69
- type ProposalVotes = {
70
- yes: number;
71
- no: number;
72
- abstain: number;
73
- };
74
- declare const VoteColorMap: {
75
- yes: string;
76
- 1: string;
77
- no: string;
78
- 2: string;
79
- veto: string;
80
- 4: string;
81
- abstain: string;
82
- 3: string;
83
- yes_secondary: string;
84
- no_secondary: string;
85
- veto_secondary: string;
86
- abstain_secondary: string;
87
- default: string;
88
- };
89
- declare enum VoteEnum {
90
- AGAINST = "no",
91
- FOR = "yes",
92
- ABSTAIN = "abstain"
93
- }
94
- type PROPOSAL_GENRE = "berahub" | "honey" | "bend" | "berps" | "general";
95
- type CustomProposalActionErrors = {
96
- type?: null | ProposalErrorCodes;
97
- target?: null | ProposalErrorCodes;
98
- value?: null | ProposalErrorCodes;
99
- ABI?: null | ProposalErrorCodes;
100
- functionSignature?: null | ProposalErrorCodes;
101
- args?: (null | ProposalErrorCodes)[];
102
- vault?: null | ProposalErrorCodes;
103
- isFriend?: null | ProposalErrorCodes;
104
- to?: null | ProposalErrorCodes;
105
- amount?: null | ProposalErrorCodes;
106
- minIncentiveRate?: null | ProposalErrorCodes;
107
- managerAddress?: null | ProposalErrorCodes;
108
- input?: null | ProposalErrorCodes;
109
- token?: null | ProposalErrorCodes;
110
- rawCalldata?: null | ProposalErrorCodes;
111
- message?: null | ProposalErrorCodes;
112
- } | null;
113
- type CustomProposalErrors = {
114
- title?: null | ProposalErrorCodes;
115
- description?: null | ProposalErrorCodes;
116
- forumLink?: null | ProposalErrorCodes;
117
- actions?: CustomProposalActionErrors[];
118
- };
119
- declare enum ProposalErrorCodes {
120
- REQUIRED = "Required",
121
- INVALID_AMOUNT = "Invalid amount",
122
- NEGATIVE_AMOUNT = "Negative amount",
123
- INVALID_ADDRESS = "Invalid address",
124
- INVALID_ACTION = "Invalid action",
125
- INVALID_ABI = "Invalid ABI",
126
- MUST_BE_HTTPS = "Must be HTTPS",
127
- MUST_BE_HTTPS_OR_IPFS = "Must be HTTPS or IPFS",
128
- INVALID_BASEPATH = "Must be a berachain forum link",
129
- /**
130
- * Mainly used when it's not a reward vault
131
- */
132
- INVALID_CONTRACT = "This is not a valid contract"
133
- }
134
- type GovernanceTopic = {
135
- id: PROPOSAL_GENRE;
136
- color: string;
137
- icon: React.ReactNode;
138
- iconBackground?: string;
139
- name: string;
140
- slug: string;
141
- forumLink: string;
142
- description?: string;
143
- comingSoon?: boolean;
144
- };
145
- declare enum ProposalTypeEnum {
146
- CUSTOM_PROPOSAL = "custom-action",
147
- WHITELIST_REWARD_VAULT = "whitelist-reward-vault",
148
- BLACKLIST_REWARD_VAULT = "blacklist-reward-vault",
149
- ERC20_TRANSFER = "erc20-transfer",
150
- WHITELIST_REWARD_VAULT_INCENTIVE = "whitelist-reward-vault-incentive"
151
- }
152
- type CustomProposal = {
153
- title: string;
154
- description: any;
155
- actions: ProposalAction[];
156
- forumLink: string;
157
- topic: Set<PROPOSAL_GENRE>;
158
- };
159
- type SafeProposalAction = {
160
- value: bigint;
161
- target: "" | Address;
162
- } & ({
163
- type: ProposalTypeEnum.CUSTOM_PROPOSAL;
164
- input: "ABI" | "rawCalldata" | "message";
165
- ABI: string;
166
- _isVerifiedAbi?: boolean;
167
- functionSignature: string;
168
- args: string[];
169
- rawCalldata: Hex;
170
- message: string;
171
- } | {
172
- type: ProposalTypeEnum.WHITELIST_REWARD_VAULT | ProposalTypeEnum.BLACKLIST_REWARD_VAULT;
173
- vault: Address;
174
- } | {
175
- type: ProposalTypeEnum.ERC20_TRANSFER;
176
- to: Address;
177
- amount: string;
178
- } | {
179
- type: ProposalTypeEnum.WHITELIST_REWARD_VAULT_INCENTIVE;
180
- vault: Address;
181
- token: Address;
182
- minIncentiveRate: string;
183
- managerAddress: Address;
184
- });
185
- type ProposalAction = Partial<SafeProposalAction> & {
186
- type: SafeProposalAction["type"];
187
- };
188
- type VerifiedAbi = {
189
- abiItem?: AbiFunction;
190
- functionName?: string;
191
- args: readonly unknown[];
192
- functionSignature?: string;
193
- };
194
-
195
- type IncentiveReward = {
196
- tokenMetadata: Token | undefined;
197
- tokenPrice: number;
198
- tokenValue: number;
199
- id: string;
200
- dist_id: string;
201
- token: string;
202
- recipient: string;
203
- formattedAmount: string;
204
- amount: string;
205
- merkle_proof: string[];
206
- available_at: number;
207
- };
208
- interface IncentiveRewardChunksWithValidatorData {
209
- validator: ApiValidatorFragment | undefined;
210
- maxTimestamp: number | undefined;
211
- minTimestamp: number | undefined;
212
- totalValue: number;
213
- tokenTotals: {
214
- address: Address;
215
- amount: number;
216
- value: number;
217
- metadata: Token | undefined;
218
- }[];
219
- rewards: IncentiveReward[];
220
- isCurrent: boolean;
221
- }
222
- interface AggregatedTokenTotals {
223
- address: Address;
224
- amount: number;
225
- value: number;
226
- metadata: Token | undefined;
227
- }
228
- type ClaimedIncentives = Record<string, string>;
229
- type ClaimedIncentivesLocalState = Record<string, ClaimedIncentives>;
230
- interface UserVaultInfo {
231
- balance: bigint;
232
- delegatedBalance: bigint;
233
- withdrawableBalance: bigint;
234
- rewards: string;
235
- percentage: string;
236
- }
237
-
238
- interface ProtocolMetadata {
239
- name: string;
240
- logoURI: string;
241
- url: string;
242
- description: string;
243
- tags?: string[];
244
- }
245
-
246
- export { type AggregatedTokenTotals as A, type BribeBoostRewardProof as B, type CustomProposal as C, type GovernanceTopic as G, type IncentiveReward as I, type ProtocolMetadata as P, type SafeProposalAction as S, type UserVaultInfo as U, type Vote as V, ProposalErrorCodes as a, ProposalState as b, type CustomProposalErrors as c, type BribeBoostRewardItem as d, type BribeBoostReward as e, type BribeBoostValidatorApr as f, type Proposal as g, type Voter as h, type ProposalVotes as i, VoteColorMap as j, VoteEnum as k, type PROPOSAL_GENRE as l, type CustomProposalActionErrors as m, ProposalTypeEnum as n, type ProposalAction as o, type VerifiedAbi as p, type IncentiveRewardChunksWithValidatorData as q, type ClaimedIncentives as r, type ClaimedIncentivesLocalState as s };
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTOAXF4YWcjs = require('../chunk-TOAXF4YW.cjs');exports.Aggregators = _chunkTOAXF4YWcjs.b; exports.ContractName = _chunkTOAXF4YWcjs.d; exports.HoneySwapAction = _chunkTOAXF4YWcjs.j; exports.PoolCreationStep = _chunkTOAXF4YWcjs.a; exports.ProposalErrorCodes = _chunkTOAXF4YWcjs.h; exports.ProposalState = _chunkTOAXF4YWcjs.e; exports.ProposalTypeEnum = _chunkTOAXF4YWcjs.i; exports.SwapReferrer = _chunkTOAXF4YWcjs.c; exports.VoteColorMap = _chunkTOAXF4YWcjs.f; exports.VoteEnum = _chunkTOAXF4YWcjs.g;
2
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/pong/coding/monobera/packages/berajs/dist/types/index.cjs"],"names":[],"mappings":"AAAA,kIAAsD,ocAAyM","file":"/Users/pong/coding/monobera/packages/berajs/dist/types/index.cjs"}
@@ -1,56 +0,0 @@
1
- export { A as AggregatedTokenTotals, e as BribeBoostReward, d as BribeBoostRewardItem, B as BribeBoostRewardProof, f as BribeBoostValidatorApr, r as ClaimedIncentives, s as ClaimedIncentivesLocalState, C as CustomProposal, m as CustomProposalActionErrors, c as CustomProposalErrors, G as GovernanceTopic, I as IncentiveReward, q as IncentiveRewardChunksWithValidatorData, l as PROPOSAL_GENRE, g as Proposal, o as ProposalAction, a as ProposalErrorCodes, b as ProposalState, n as ProposalTypeEnum, i as ProposalVotes, P as ProtocolMetadata, S as SafeProposalAction, U as UserVaultInfo, p as VerifiedAbi, V as Vote, j as VoteColorMap, k as VoteEnum, h as Voter } from '../staking-f4BpYH7l.cjs';
2
- export { A as Aggregators, l as AllowanceToken, B as BalanceToken, G as BalanceTokenWithMetadata, O as BexStatus, R as ContractName, D as DefaultHookOptions, E as DefaultHookReturnType, V as HoneySwapAction, H as HoneySwapActions, i as IAggregatorArgs, g as IAggregatorQuote, m as IContractWrite, Q as IContractWriteFn, I as IRawAggregatorQuote, F as IUserPosition, M as MinimalERC20, y as PoolCreationStep, j as PythPriceFeedMap, S as SwapReferrer, N as SwapRequest, a as Token, h as TokenBalance, k as TokenCurrentPriceMap, x as TokenInput, J as TokenPriceInfo, z as TokenWithAmount, b as TokenWithMetadata } from '../HoneyConfigProvider-6PXZJMSU.cjs';
3
- import { BundleData, EnsoClient } from '@ensofinance/sdk';
4
- import { TransactionRequest, Address, Hex, PublicClient } from 'viem';
5
- import '@berachain/graphql/governance';
6
- import '@berachain/graphql/pol/api';
7
- import 'react/jsx-runtime';
8
- import 'react';
9
- import '@berachain-foundation/berancer-sdk';
10
- import '../aggregatorsRouter-Cny4B_MB.cjs';
11
- import '@wagmi/core';
12
- import 'swr';
13
- import '@berachain/config';
14
- import '../txnEnum-BQKDfaeH.cjs';
15
- import '../BeraError-D1HS_rbb.cjs';
16
- import '@sentry/nextjs';
17
-
18
- type Quantity = string | number;
19
- type ActionOutputReference<T> = T | StrictOutputReference<T>;
20
- type StrictOutputReference<T> = {
21
- useOutputOfCallAt: number;
22
- index?: number;
23
- };
24
- interface GetZapTransactionRequestsArgs {
25
- fromAddress: Address;
26
- amountIn: Quantity;
27
- tokenIn: Address;
28
- tokenOut: Address;
29
- chainId: number;
30
- ensoClient: EnsoClient;
31
- slippage: number;
32
- destinationChainId?: number;
33
- publicClient: PublicClient;
34
- }
35
- type GetZapTransaction = TransactionRequest & {
36
- to: Address;
37
- data: Hex;
38
- value?: bigint;
39
- gasLimit?: bigint;
40
- };
41
- type GetZapTransactions = GetZapTransaction[];
42
- interface GetZapTransactionsArgs {
43
- fromAddress: Address;
44
- amountIn: Quantity;
45
- tokenIn: Address;
46
- chainId: number;
47
- ensoClient: EnsoClient;
48
- bundle: BundleData;
49
- publicClient: PublicClient;
50
- }
51
- interface GetZapTransactionResponse {
52
- bundle: BundleData;
53
- transactions: GetZapTransactions;
54
- }
55
-
56
- export type { ActionOutputReference, GetZapTransaction, GetZapTransactionRequestsArgs, GetZapTransactionResponse, GetZapTransactions, GetZapTransactionsArgs, Quantity };
@@ -1,56 +0,0 @@
1
- export { A as AggregatedTokenTotals, e as BribeBoostReward, d as BribeBoostRewardItem, B as BribeBoostRewardProof, f as BribeBoostValidatorApr, r as ClaimedIncentives, s as ClaimedIncentivesLocalState, C as CustomProposal, m as CustomProposalActionErrors, c as CustomProposalErrors, G as GovernanceTopic, I as IncentiveReward, q as IncentiveRewardChunksWithValidatorData, l as PROPOSAL_GENRE, g as Proposal, o as ProposalAction, a as ProposalErrorCodes, b as ProposalState, n as ProposalTypeEnum, i as ProposalVotes, P as ProtocolMetadata, S as SafeProposalAction, U as UserVaultInfo, p as VerifiedAbi, V as Vote, j as VoteColorMap, k as VoteEnum, h as Voter } from '../staking-F9Nx9TKD.js';
2
- export { A as Aggregators, l as AllowanceToken, B as BalanceToken, G as BalanceTokenWithMetadata, O as BexStatus, R as ContractName, D as DefaultHookOptions, E as DefaultHookReturnType, V as HoneySwapAction, H as HoneySwapActions, i as IAggregatorArgs, g as IAggregatorQuote, m as IContractWrite, Q as IContractWriteFn, I as IRawAggregatorQuote, F as IUserPosition, M as MinimalERC20, y as PoolCreationStep, j as PythPriceFeedMap, S as SwapReferrer, N as SwapRequest, a as Token, h as TokenBalance, k as TokenCurrentPriceMap, x as TokenInput, J as TokenPriceInfo, z as TokenWithAmount, b as TokenWithMetadata } from '../HoneyConfigProvider-CwDFrt02.js';
3
- import { BundleData, EnsoClient } from '@ensofinance/sdk';
4
- import { TransactionRequest, Address, Hex, PublicClient } from 'viem';
5
- import '@berachain/graphql/governance';
6
- import '@berachain/graphql/pol/api';
7
- import 'react/jsx-runtime';
8
- import 'react';
9
- import '@berachain-foundation/berancer-sdk';
10
- import '../aggregatorsRouter-Cny4B_MB.js';
11
- import '@wagmi/core';
12
- import 'swr';
13
- import '@berachain/config';
14
- import '../txnEnum-BQKDfaeH.js';
15
- import '../BeraError-D1HS_rbb.js';
16
- import '@sentry/nextjs';
17
-
18
- type Quantity = string | number;
19
- type ActionOutputReference<T> = T | StrictOutputReference<T>;
20
- type StrictOutputReference<T> = {
21
- useOutputOfCallAt: number;
22
- index?: number;
23
- };
24
- interface GetZapTransactionRequestsArgs {
25
- fromAddress: Address;
26
- amountIn: Quantity;
27
- tokenIn: Address;
28
- tokenOut: Address;
29
- chainId: number;
30
- ensoClient: EnsoClient;
31
- slippage: number;
32
- destinationChainId?: number;
33
- publicClient: PublicClient;
34
- }
35
- type GetZapTransaction = TransactionRequest & {
36
- to: Address;
37
- data: Hex;
38
- value?: bigint;
39
- gasLimit?: bigint;
40
- };
41
- type GetZapTransactions = GetZapTransaction[];
42
- interface GetZapTransactionsArgs {
43
- fromAddress: Address;
44
- amountIn: Quantity;
45
- tokenIn: Address;
46
- chainId: number;
47
- ensoClient: EnsoClient;
48
- bundle: BundleData;
49
- publicClient: PublicClient;
50
- }
51
- interface GetZapTransactionResponse {
52
- bundle: BundleData;
53
- transactions: GetZapTransactions;
54
- }
55
-
56
- export type { ActionOutputReference, GetZapTransaction, GetZapTransactionRequestsArgs, GetZapTransactionResponse, GetZapTransactions, GetZapTransactionsArgs, Quantity };
@@ -1,2 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"../chunk-IOSYBHKU.mjs";export{b as Aggregators,d as ContractName,j as HoneySwapAction,a as PoolCreationStep,h as ProposalErrorCodes,e as ProposalState,i as ProposalTypeEnum,c as SwapReferrer,f as VoteColorMap,g as VoteEnum};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkREDXXUK7cjs = require('../chunk-REDXXUK7.cjs');var _chunk22MQVFHPcjs = require('../chunk-22MQVFHP.cjs');require('../chunk-ED43NYSE.cjs');require('../chunk-JMKLDDKY.cjs');exports.CAP_LIMIT_BUFFER = _chunkREDXXUK7cjs.r; exports.DEFAULT_METAMASK_GAS_LIMIT = _chunkREDXXUK7cjs.w; exports.MAX_CUSTOM_DEADLINE = _chunkREDXXUK7cjs.s; exports.MAX_CUSTOM_SLIPPAGE = _chunkREDXXUK7cjs.v; exports.MIN_CUSTOM_DEADLINE = _chunkREDXXUK7cjs.t; exports.MIN_CUSTOM_SLIPPAGE = _chunkREDXXUK7cjs.u; exports.beraFetch = _chunkREDXXUK7cjs.b; exports.beraFetchJson = _chunkREDXXUK7cjs.c; exports.calculateTimestampFromDays = _chunkREDXXUK7cjs.E; exports.days = _chunkREDXXUK7cjs.j; exports.daysInSeconds = _chunkREDXXUK7cjs.k; exports.defaultBeraFlags = _chunk22MQVFHPcjs.a; exports.formatAggregatorsQuotes = _chunkREDXXUK7cjs.z; exports.formatInputTokenValue = _chunkREDXXUK7cjs.A; exports.formatNumber = _chunkREDXXUK7cjs.B; exports.formatTimeLeft = _chunkREDXXUK7cjs.G; exports.formatUnixTimestamp = _chunkREDXXUK7cjs.F; exports.formatUsd = _chunkREDXXUK7cjs.H; exports.getContractName = _chunkREDXXUK7cjs.I; exports.getHoneySwapMessage = _chunkREDXXUK7cjs.J; exports.getHoneyToken = _chunk22MQVFHPcjs.e; exports.getPythDefaultUpdateFee = _chunkREDXXUK7cjs.x; exports.getSafeNumber = _chunkREDXXUK7cjs.C; exports.getServerSidePublicClient = _chunkREDXXUK7cjs.K; exports.getTestClient = _chunkREDXXUK7cjs.L; exports.hours = _chunkREDXXUK7cjs.h; exports.hoursInSeconds = _chunkREDXXUK7cjs.i; exports.internal_beraToken = _chunk22MQVFHPcjs.c; exports.internal_wBeraToken = _chunk22MQVFHPcjs.d; exports.isDifferenceExceedingThreshold = _chunkREDXXUK7cjs.M; exports.isSubgraphStale = _chunkREDXXUK7cjs.N; exports.isToken = _chunk22MQVFHPcjs.f; exports.isValidatorProposer = _chunkREDXXUK7cjs.S; exports.isValidatorSigner = _chunkREDXXUK7cjs.T; exports.minutes = _chunkREDXXUK7cjs.f; exports.minutesInSeconds = _chunkREDXXUK7cjs.g; exports.months = _chunkREDXXUK7cjs.n; exports.monthsInSeconds = _chunkREDXXUK7cjs.o; exports.msToSeconds = _chunkREDXXUK7cjs.d; exports.parseBaseArgs = _chunk22MQVFHPcjs.b; exports.seconds = _chunkREDXXUK7cjs.e; exports.sentryBeforeSend = _chunkREDXXUK7cjs.O; exports.truncateDecimal = _chunkREDXXUK7cjs.D; exports.truncateHash = _chunkREDXXUK7cjs.R; exports.weeks = _chunkREDXXUK7cjs.l; exports.weeksInSeconds = _chunkREDXXUK7cjs.m; exports.wrapNativeToken = _chunkREDXXUK7cjs.P; exports.wrapNativeTokens = _chunkREDXXUK7cjs.Q; exports.years = _chunkREDXXUK7cjs.p; exports.yearsInSeconds = _chunkREDXXUK7cjs.q;
2
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/pong/coding/monobera/packages/berajs/dist/utils/index.cjs"],"names":[],"mappings":"AAAA,kIAAsV,yDAA+C,iCAA8B,iCAA8B,4yEAAiiC","file":"/Users/pong/coding/monobera/packages/berajs/dist/utils/index.cjs"}
@@ -1,2 +0,0 @@
1
- import{A as E,B as F,C as G,D as H,E as I,F as J,G as K,H as L,I as M,J as N,K as O,L as P,M as Q,N as R,O as S,P as T,Q as U,R as V,S as W,T as X,b as g,c as h,d as i,e as j,f as k,g as l,h as m,i as n,j as o,k as p,l as q,m as r,n as s,o as t,p as u,q as v,r as w,s as x,t as y,u as z,v as A,w as B,x as C,z as D}from"../chunk-AMRJ4B36.mjs";import{a,b,c,d,e,f}from"../chunk-VYWYJR63.mjs";import"../chunk-PHIOKO3A.mjs";import"../chunk-HCTFDGXL.mjs";export{w as CAP_LIMIT_BUFFER,B as DEFAULT_METAMASK_GAS_LIMIT,x as MAX_CUSTOM_DEADLINE,A as MAX_CUSTOM_SLIPPAGE,y as MIN_CUSTOM_DEADLINE,z as MIN_CUSTOM_SLIPPAGE,g as beraFetch,h as beraFetchJson,I as calculateTimestampFromDays,o as days,p as daysInSeconds,a as defaultBeraFlags,D as formatAggregatorsQuotes,E as formatInputTokenValue,F as formatNumber,K as formatTimeLeft,J as formatUnixTimestamp,L as formatUsd,M as getContractName,N as getHoneySwapMessage,e as getHoneyToken,C as getPythDefaultUpdateFee,G as getSafeNumber,O as getServerSidePublicClient,P as getTestClient,m as hours,n as hoursInSeconds,c as internal_beraToken,d as internal_wBeraToken,Q as isDifferenceExceedingThreshold,R as isSubgraphStale,f as isToken,W as isValidatorProposer,X as isValidatorSigner,k as minutes,l as minutesInSeconds,s as months,t as monthsInSeconds,i as msToSeconds,b as parseBaseArgs,j as seconds,S as sentryBeforeSend,H as truncateDecimal,V as truncateHash,q as weeks,r as weeksInSeconds,T as wrapNativeToken,U as wrapNativeTokens,u as years,v as yearsInSeconds};
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,29 +0,0 @@
1
- import { type Address, isAddress, type PublicClient } from "viem";
2
-
3
- import { assertPublicClient, InvalidArgumentError } from "~/errors";
4
-
5
- export interface GetTransactionCount {
6
- address: Address | undefined;
7
- publicClient: PublicClient;
8
- }
9
-
10
- export type GetTransactionCountResponse = number | undefined;
11
-
12
- export async function getTransactionCount({
13
- address,
14
- publicClient,
15
- }: GetTransactionCount): Promise<GetTransactionCountResponse> {
16
- assertPublicClient(publicClient);
17
-
18
- if (!address || !isAddress(address))
19
- throw new InvalidArgumentError({
20
- property: "address",
21
- value: address,
22
- expected: "Address",
23
- });
24
-
25
- const transactionCount = await publicClient.getTransactionCount({
26
- address,
27
- });
28
- return transactionCount;
29
- }