@berachain/berajs 0.2.8-beta.8 → 0.2.9

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 (225) hide show
  1. package/dist/{BeraError-_mQdkanr.d.cts → BeraError-7-A5JYy_.d.ts} +31 -2
  2. package/dist/{HoneyConfigProvider-DVP_9KZn.d.ts → HoneyConfigProvider-Dkj-_a5x.d.ts} +1 -1
  3. package/dist/RequestError-DBOIV65x.d.ts +144 -0
  4. package/dist/abi/exports.mjs +3 -4
  5. package/dist/actions/clients/exports.d.ts +2 -0
  6. package/dist/actions/clients/exports.mjs +12 -0
  7. package/dist/actions/exports.d.ts +108 -187
  8. package/dist/actions/exports.mjs +97 -158
  9. package/dist/actions/governance/exports.d.ts +140 -0
  10. package/dist/actions/governance/exports.mjs +226 -0
  11. package/dist/actions/server/exports.d.ts +13 -0
  12. package/dist/actions/server/exports.mjs +27 -0
  13. package/dist/{chunk-VA3BQ34H.mjs → chunk-3EARVV7K.mjs} +20 -9
  14. package/dist/chunk-4Z4AK6SH.mjs +211 -0
  15. package/dist/chunk-75M6TF7M.mjs +25 -0
  16. package/dist/chunk-AFN4CVD3.mjs +326 -0
  17. package/dist/{chunk-7TFV6UKF.mjs → chunk-BGMRHTBQ.mjs} +0 -1
  18. package/dist/{chunk-3M47ZRXT.mjs → chunk-CDFWPU2R.mjs} +73 -17
  19. package/dist/{chunk-GWSTVITN.mjs → chunk-CDK4YV3D.mjs} +0 -1
  20. package/dist/{chunk-KL6YZ5VR.mjs → chunk-DKMAIU74.mjs} +0 -1
  21. package/dist/chunk-EXIUPSFN.mjs +86 -0
  22. package/dist/{chunk-VA5L5FDG.mjs → chunk-FFB5LFDW.mjs} +2 -3
  23. package/dist/{chunk-ZCEFC2TK.mjs → chunk-HQCOU6GY.mjs} +0 -1
  24. package/dist/{chunk-SGZP4O6R.mjs → chunk-HSSJKHZ4.mjs} +11 -11
  25. package/dist/{chunk-7QKRRIHI.mjs → chunk-J5I45WGQ.mjs} +77 -152
  26. package/dist/chunk-KQUMKB66.mjs +89 -0
  27. package/dist/{chunk-JA4DHMTG.mjs → chunk-NBYLMO2L.mjs} +0 -1
  28. package/dist/{chunk-4GFN4LEP.mjs → chunk-NPBQLVL3.mjs} +4 -21
  29. package/dist/{chunk-I3FTWD6I.mjs → chunk-O2NQFKJK.mjs} +1 -1
  30. package/dist/{chunk-2R73G2PO.mjs → chunk-QJIXTYTZ.mjs} +121 -765
  31. package/dist/{chunk-GLWPRM33.mjs → chunk-SGIJVHZO.mjs} +0 -1
  32. package/dist/chunk-SZ5C44L5.mjs +35 -0
  33. package/dist/{chunk-5NMATIH4.mjs → chunk-WXXOISTU.mjs} +1 -35
  34. package/dist/chunk-XIYN6AL6.mjs +160 -0
  35. package/dist/contexts/exports.d.ts +2 -2
  36. package/dist/contexts/exports.mjs +11 -9
  37. package/dist/enum/exports.d.ts +1 -1
  38. package/dist/enum/exports.mjs +3 -16
  39. package/dist/enum/governance/exports.d.ts +60 -0
  40. package/dist/enum/governance/exports.mjs +14 -0
  41. package/dist/errors/exports.d.ts +5 -90
  42. package/dist/errors/exports.mjs +19 -10
  43. package/dist/exports-BcUTGFUb.d.ts +40 -0
  44. package/dist/{getValidatorQueuedOperatorAddress-BcyxE9uw.d.ts → getValidatorQueuedOperatorAddress-Dw5KN5sh.d.ts} +2 -2
  45. package/dist/{global.d-5w_lvl2J.d.ts → global.d-BuGDKh4k.d.ts} +4 -240
  46. package/dist/hooks/exports.d.ts +80 -236
  47. package/dist/hooks/exports.mjs +609 -1508
  48. package/dist/hooks/governance/exports.d.ts +181 -0
  49. package/dist/hooks/governance/exports.mjs +888 -0
  50. package/dist/pol.d-CqPA9K6m.d.ts +142 -0
  51. package/dist/{txnEnum-7_o92X3N.d.cts → txnEnum-ByI5dtDi.d.ts} +2 -60
  52. package/dist/types/exports.d.ts +9 -9
  53. package/dist/types/exports.mjs +0 -1
  54. package/dist/types/governance/exports.d.ts +109 -0
  55. package/dist/types/governance/exports.mjs +0 -0
  56. package/dist/{useHoneySwapState-B494PQDl.d.ts → useHoneySwapState-vFmuFF0g.d.ts} +1 -1
  57. package/dist/utils/exports.d.ts +24 -7
  58. package/dist/utils/exports.mjs +49 -11
  59. package/package.json +60 -13
  60. package/src/actions/__test/transports.ts +61 -0
  61. package/src/actions/clients/BeraApolloClient.ts +9 -0
  62. package/src/actions/clients/exports.ts +4 -0
  63. package/src/actions/clients/getApolloClient.ts +70 -25
  64. package/src/actions/clients/getEnsoClient.ts +20 -9
  65. package/src/actions/dex/aggregators/base.ts +1 -1
  66. package/src/actions/dex/aggregators/enso/enso.ts +27 -17
  67. package/src/actions/dex/aggregators/enso/ensoErc4626.ts +2 -2
  68. package/src/actions/dex/aggregators/kyberswap.ts +18 -23
  69. package/src/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.ts +3 -6
  70. package/src/actions/exports.ts +5 -10
  71. package/src/actions/governance/exports.ts +9 -0
  72. package/src/actions/governance/getAllProposals.ts +10 -65
  73. package/src/actions/governance/getProposalDetails.ts +6 -33
  74. package/src/actions/governance/getProposalVotes.ts +8 -15
  75. package/src/actions/honey/getChartData.ts +27 -21
  76. package/src/actions/honey/getHoney24hVolume.ts +27 -0
  77. package/src/actions/pol/getAutoclaimedIncentives.ts +30 -0
  78. package/src/actions/pol/getBeraTokenTotalSupply.ts +45 -0
  79. package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +35 -0
  80. package/src/actions/pol/getEarnedStakedBeraVault.ts +15 -9
  81. package/src/actions/pol/getGlobalData.ts +1 -0
  82. package/src/actions/pol/getHeroEarnVaults.ts +62 -0
  83. package/src/actions/pol/getIncentiveFeeClaimStats.ts +19 -38
  84. package/src/actions/pol/getSWBeraVaultMetadata.ts +1 -1
  85. package/src/actions/pol/getStakingDailyAssets.ts +11 -8
  86. package/src/actions/server/exports.ts +1 -0
  87. package/src/actions/server/getDailyValidatorBlockStats.ts +33 -0
  88. package/src/actions/tokens/getWalletBalances.integration.test.ts +3 -6
  89. package/src/actions/transactions/beraWriteContract.integration.test.ts +3 -6
  90. package/src/actions/validators/getDailyValidatorBlockStats.ts +25 -24
  91. package/src/actions/validators/getValidatorAnalytics.ts +20 -21
  92. package/src/actions/validators/getValidatorIncentiveDistribution.ts +33 -0
  93. package/src/data/contracts.ts +5 -0
  94. package/src/enum/contracts.ts +1 -0
  95. package/src/enum/exports.ts +0 -1
  96. package/src/enum/governance/exports.ts +1 -0
  97. package/src/errors/BeraError.ts +47 -7
  98. package/src/errors/BeraTracing.unit.test.ts +65 -0
  99. package/src/errors/RequestError.ts +15 -2
  100. package/src/errors/exports.ts +5 -0
  101. package/src/errors/getRevertReason.integration.test.ts +3 -3
  102. package/src/errors/spanStatus.ts +78 -0
  103. package/src/errors/spanStatus.unit.test.ts +62 -0
  104. package/src/hooks/dex/useCreatePool.ts +1 -88
  105. package/src/hooks/dex/useOnChainPoolData.ts +27 -2
  106. package/src/hooks/dex/usePriceImpact.ts +12 -5
  107. package/src/hooks/enso/useBendDemultiply.ts +9 -1
  108. package/src/hooks/enso/useBendMultiply.ts +9 -1
  109. package/src/hooks/enso/useBendZapSupply.ts +26 -7
  110. package/src/hooks/enso/useEnsoSwapBundle.ts +17 -3
  111. package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +13 -2
  112. package/src/hooks/exports.ts +3 -16
  113. package/src/hooks/governance/exports.ts +14 -0
  114. package/src/hooks/honey/useHoney24hVolume.ts +16 -0
  115. package/src/hooks/pol/useAutoclaimedIncentives.ts +49 -0
  116. package/src/hooks/pol/useStakedAPR.ts +2 -2
  117. package/src/hooks/pol/useStakedSnapshots.ts +5 -9
  118. package/src/hooks/validators/useValidator.ts +2 -0
  119. package/src/hooks/validators/useValidatorIncentiveDistribution.ts +39 -0
  120. package/src/types/bribe-boost.d.ts +8 -0
  121. package/src/types/exports.ts +0 -1
  122. package/src/types/governance/exports.ts +1 -0
  123. package/src/utils/beraFetch.ts +76 -15
  124. package/src/utils/exports.ts +1 -0
  125. package/src/utils/getServerSideClient.ts +4 -2
  126. package/src/utils/sanitizeRpcUrl.ts +22 -0
  127. package/src/utils/tracedTransport.ts +35 -0
  128. package/dist/BeraError-_mQdkanr.d.ts +0 -94
  129. package/dist/BexStatusProvider-DRymVlQf.d.cts +0 -70
  130. package/dist/HoneyConfigProvider-DfkjmzEf.d.cts +0 -390
  131. package/dist/RequestError-A8XJ6QR9.d.cts +0 -57
  132. package/dist/RequestError-Dk97z8rm.d.ts +0 -57
  133. package/dist/abi/exports.cjs +0 -4453
  134. package/dist/abi/exports.cjs.map +0 -1
  135. package/dist/abi/exports.d.cts +0 -6574
  136. package/dist/abi/exports.mjs.map +0 -1
  137. package/dist/actions/exports.cjs +0 -914
  138. package/dist/actions/exports.cjs.map +0 -1
  139. package/dist/actions/exports.d.cts +0 -1644
  140. package/dist/actions/exports.mjs.map +0 -1
  141. package/dist/chunk-2R73G2PO.mjs.map +0 -1
  142. package/dist/chunk-3M47ZRXT.mjs.map +0 -1
  143. package/dist/chunk-4GFN4LEP.mjs.map +0 -1
  144. package/dist/chunk-5N7QQS55.cjs +0 -130
  145. package/dist/chunk-5N7QQS55.cjs.map +0 -1
  146. package/dist/chunk-5NMATIH4.mjs.map +0 -1
  147. package/dist/chunk-7QKRRIHI.mjs.map +0 -1
  148. package/dist/chunk-7TFV6UKF.mjs.map +0 -1
  149. package/dist/chunk-A4FPM7U3.cjs +0 -63
  150. package/dist/chunk-A4FPM7U3.cjs.map +0 -1
  151. package/dist/chunk-BDHINMWQ.cjs +0 -417
  152. package/dist/chunk-BDHINMWQ.cjs.map +0 -1
  153. package/dist/chunk-BEHP54S3.cjs +0 -24
  154. package/dist/chunk-BEHP54S3.cjs.map +0 -1
  155. package/dist/chunk-EGDXV2PT.cjs +0 -36
  156. package/dist/chunk-EGDXV2PT.cjs.map +0 -1
  157. package/dist/chunk-EWBKSMPG.cjs +0 -13
  158. package/dist/chunk-EWBKSMPG.cjs.map +0 -1
  159. package/dist/chunk-F6ZW7ZDD.cjs +0 -403
  160. package/dist/chunk-F6ZW7ZDD.cjs.map +0 -1
  161. package/dist/chunk-FTXTRUYT.cjs +0 -170
  162. package/dist/chunk-FTXTRUYT.cjs.map +0 -1
  163. package/dist/chunk-GLWPRM33.mjs.map +0 -1
  164. package/dist/chunk-GWSTVITN.mjs.map +0 -1
  165. package/dist/chunk-H3Z37RYU.cjs +0 -15
  166. package/dist/chunk-H3Z37RYU.cjs.map +0 -1
  167. package/dist/chunk-I3FTWD6I.mjs.map +0 -1
  168. package/dist/chunk-JA4DHMTG.mjs.map +0 -1
  169. package/dist/chunk-KL6YZ5VR.mjs.map +0 -1
  170. package/dist/chunk-MXWPP6MS.cjs +0 -572
  171. package/dist/chunk-MXWPP6MS.cjs.map +0 -1
  172. package/dist/chunk-SGZP4O6R.mjs.map +0 -1
  173. package/dist/chunk-TDW5SPXR.cjs +0 -244
  174. package/dist/chunk-TDW5SPXR.cjs.map +0 -1
  175. package/dist/chunk-TGK3IXDN.cjs +0 -169
  176. package/dist/chunk-TGK3IXDN.cjs.map +0 -1
  177. package/dist/chunk-TJEW6YCJ.cjs +0 -97
  178. package/dist/chunk-TJEW6YCJ.cjs.map +0 -1
  179. package/dist/chunk-VA3BQ34H.mjs.map +0 -1
  180. package/dist/chunk-VA5L5FDG.mjs.map +0 -1
  181. package/dist/chunk-XSGCRLSD.cjs +0 -1844
  182. package/dist/chunk-XSGCRLSD.cjs.map +0 -1
  183. package/dist/chunk-XV3GG3HC.cjs +0 -135
  184. package/dist/chunk-XV3GG3HC.cjs.map +0 -1
  185. package/dist/chunk-Y5B224UX.cjs +0 -4698
  186. package/dist/chunk-Y5B224UX.cjs.map +0 -1
  187. package/dist/chunk-ZBTRKBSI.mjs +0 -169
  188. package/dist/chunk-ZBTRKBSI.mjs.map +0 -1
  189. package/dist/chunk-ZCEFC2TK.mjs.map +0 -1
  190. package/dist/contexts/exports.cjs +0 -83
  191. package/dist/contexts/exports.cjs.map +0 -1
  192. package/dist/contexts/exports.d.cts +0 -66
  193. package/dist/contexts/exports.mjs.map +0 -1
  194. package/dist/defaultFlags-D6KfkTZx.d.cts +0 -10
  195. package/dist/dex-C_BB0b0O.d.cts +0 -37
  196. package/dist/enum/exports.cjs +0 -59
  197. package/dist/enum/exports.cjs.map +0 -1
  198. package/dist/enum/exports.d.cts +0 -23
  199. package/dist/enum/exports.mjs.map +0 -1
  200. package/dist/errors/exports.cjs +0 -39
  201. package/dist/errors/exports.cjs.map +0 -1
  202. package/dist/errors/exports.d.cts +0 -413
  203. package/dist/errors/exports.mjs.map +0 -1
  204. package/dist/getValidatorQueuedOperatorAddress-Cql_D50j.d.cts +0 -562
  205. package/dist/global.d-B7IeayVX.d.cts +0 -474
  206. package/dist/honey-CYm0RWf4.d.cts +0 -14
  207. package/dist/hooks/exports.cjs +0 -8333
  208. package/dist/hooks/exports.cjs.map +0 -1
  209. package/dist/hooks/exports.d.cts +0 -1748
  210. package/dist/hooks/exports.mjs.map +0 -1
  211. package/dist/polling-BKnyavLI.d.cts +0 -8
  212. package/dist/txnEnum-7_o92X3N.d.ts +0 -164
  213. package/dist/types/exports.cjs +0 -1
  214. package/dist/types/exports.cjs.map +0 -1
  215. package/dist/types/exports.d.cts +0 -90
  216. package/dist/types/exports.mjs.map +0 -1
  217. package/dist/useHoneySwapState-D6vpv19r.d.cts +0 -32
  218. package/dist/utils/exports.cjs +0 -787
  219. package/dist/utils/exports.cjs.map +0 -1
  220. package/dist/utils/exports.d.cts +0 -412
  221. package/dist/utils/exports.mjs.map +0 -1
  222. package/src/actions/dex/getIsTokenExploited.ts +0 -63
  223. package/src/actions/honey/getHoneyGlobalData.ts +0 -21
  224. package/src/hooks/dex/useExploitedTokens.ts +0 -57
  225. package/src/hooks/honey/useHoneyGlobalData.ts +0 -23
@@ -1,1748 +0,0 @@
1
- import * as swr__internal from 'swr/_internal';
2
- import * as swr from 'swr';
3
- import { SWRResponse } from 'swr';
4
- import { b as GetConvertToAssetsProps, O as OnChainPool, B as BaseAggregator, d as GetHoneyVaultsBalanceResponse, j as IsBadCollateralResponse, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, i as GlobalData, e as GetMarkets, S as StakedBeraWithdrawal, k as RewardVaultIncentive, f as GetRewardVaultRewardsReturn, c as GetGaugeData, t as VaultMetadata, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, V as ValidatorRewardAllocation, s as ValidatorWithUserBoost, U as UserBoostsOnValidator, l as UserStakingPoolPosition, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress } from '../getValidatorQueuedOperatorAddress-Cql_D50j.cjs';
5
- import { D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, a as CustomProposalErrors, C as CustomProposal, S as StakingConfig, d as StakedBeraAsset, U as UserVaultInfo, e as IUseContractWriteArgs, f as UseContractWriteApi, B as BribeBoostRewardProof } from '../global.d-B7IeayVX.cjs';
6
- export { T as TxnEventKeys } from '../global.d-B7IeayVX.cjs';
7
- import { S as SwapReferrer, A as Aggregators, a as PoolCreationStep } from '../dex-C_BB0b0O.cjs';
8
- import * as viem from 'viem';
9
- import { Address, Hex } from 'viem';
10
- import { M as MinimalERC20, d as HoneyConfigContextReturn, g as IRawAggregatorQuote, b as Token, t as TokenWithAmount, i as TokenCurrentPriceMap, v as IUserPosition, A as AllowanceQueryItem, j as AllowanceToken, B as BalanceToken, w as Calldata, h as PythPriceFeedMap, P as PythLatestUpdates, x as TokenPriceInfo, a as TokenWithMetadata } from '../HoneyConfigProvider-DfkjmzEf.cjs';
11
- import * as _berachain_graphql_dex_api from '@berachain/graphql/dex/api';
12
- import { GetPoolsQueryVariables, MinimalPoolFragment, GqlPoolEventType, PoolHistoricalDataFragment, GqlRewardVaultDynamicData, GqlVaultSnapshotDataRange, GqlValidatorDynamicData } from '@berachain/graphql/dex/api';
13
- export { u as useBexStatus } from '../BexStatusProvider-DRymVlQf.cjs';
14
- import { PoolType } from '@berachain-foundation/berancer-sdk';
15
- import { SubgraphPoolFragment } from '@berachain/graphql/dex/subgraph';
16
- import { P as POLLING } from '../polling-BKnyavLI.cjs';
17
- import { BendDemultiplyBundleResponse, BendMultiplyBundleResponse, GetZapTransactionResponse } from '../types/exports.cjs';
18
- import * as react from 'react';
19
- import * as swr_infinite from 'swr/infinite';
20
- import { SWRInfiniteResponse, SWRInfiniteKeyLoader } from 'swr/infinite';
21
- import * as _berachain_graphql_governance from '@berachain/graphql/governance';
22
- import { Proposal_Filter, Proposal_OrderBy, OrderDirection, ProposalStatus, ProposalSelectionFragment, ProposalWithVotesFragment, GetProposalVotesQueryVariables } from '@berachain/graphql/governance';
23
- import { I as IHoneySwapState } from '../useHoneySwapState-D6vpv19r.cjs';
24
- export { r as reducer, u as useHoneySwapState } from '../useHoneySwapState-D6vpv19r.cjs';
25
- import * as _berachain_graphql_honey from '@berachain/graphql/honey';
26
- import BigNumber from '@berachain/utils/pkg/bignumber.js';
27
- import * as _berachain_graphql_pol_api from '@berachain/graphql/pol/api';
28
- import { GqlRewardVaultFilter, ApiVaultFragment, GetVaultsQueryVariables, GetVaultHistoryQuery, ApiValidatorFragment, GetValidatorsQueryVariables, GetValidatorsQuery, GqlChain, GetValidatorQuery, ApiValidatorMinimalFragment } from '@berachain/graphql/pol/api';
29
- import { Address as Address$1 } from '@berachain/config';
30
- import { GetValidatorBlockStatsQuery, GetValidatorAnalyticsQuery } from '@berachain/graphql/pol/subgraph';
31
- import '@berachain/config/internal';
32
- import '../txnEnum-7_o92X3N.cjs';
33
- import '@wagmi/core';
34
- import '../BeraError-_mQdkanr.cjs';
35
- import 'react/jsx-runtime';
36
- import '../honey-CYm0RWf4.cjs';
37
- import '@berachain/config/internal/edge-config';
38
- import '@ensofinance/sdk';
39
-
40
- declare const useGetConvertToAssets: ({ sharesAmount, vaultAddress, vaultChainId, }: Omit<GetConvertToAssetsProps, "publicClient"> & {
41
- vaultChainId?: number;
42
- }, options?: DefaultHookOptions) => {
43
- refresh: () => void;
44
- data: {
45
- raw: bigint;
46
- formatted: string;
47
- } | undefined;
48
- error: any;
49
- mutate: swr.KeyedMutator<{
50
- raw: bigint;
51
- formatted: string;
52
- }>;
53
- isValidating: boolean;
54
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
55
- };
56
-
57
- type IUseAggregatorsQuotesArgs$1 = BeraJS.BaseFunctionArgs & {
58
- tokenIn: MinimalERC20;
59
- tokenOut: MinimalERC20;
60
- amount: string;
61
- slippage: number;
62
- referrer?: SwapReferrer;
63
- rewardVault?: Address;
64
- /**
65
- * Useful cause the collaterals are provided byt he honeyContext and this way we can
66
- * use the Provider only in the swap page where is needed.
67
- *
68
- * The collaterals for the honey mint/redeem aggregator.
69
- */
70
- honeyNativeState?: Pick<HoneyConfigContextReturn, "collateralList" | "protocol">;
71
- };
72
- declare function useAggregatorsQuotes(args: IUseAggregatorsQuotesArgs$1, options?: DefaultHookOptions): {
73
- refresh: () => Promise<IRawAggregatorQuote | undefined>[];
74
- quotes: IRawAggregatorQuote[];
75
- loadingAggregatorsNames: (Aggregators | null)[];
76
- isLoading: boolean;
77
- error: any;
78
- };
79
-
80
- declare const useAggregatorsRouterFeeBps: () => {
81
- refresh: swr.KeyedMutator<number>;
82
- data: number | undefined;
83
- error: any;
84
- mutate: swr.KeyedMutator<number>;
85
- isValidating: boolean;
86
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
87
- };
88
-
89
- declare const useAllUserPoolsQueryKey: ({ query, }?: {
90
- query?: GetPoolsQueryVariables;
91
- }) => (string | _berachain_graphql_dex_api.Exact<{
92
- textSearch?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["String"]["input"]>;
93
- first?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["Int"]["input"]>;
94
- userAddress?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["String"]["input"]>;
95
- chain: Array<_berachain_graphql_dex_api.GqlChain> | _berachain_graphql_dex_api.GqlChain;
96
- orderBy?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.GqlPoolOrderBy>;
97
- skip?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["Int"]["input"]>;
98
- orderDirection?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.GqlPoolOrderDirection>;
99
- blacklistedPoolIds?: _berachain_graphql_dex_api.InputMaybe<Array<_berachain_graphql_dex_api.Scalars["String"]["input"]> | _berachain_graphql_dex_api.Scalars["String"]["input"]>;
100
- }> | undefined)[];
101
- declare const useAllUserPools: (query: GetPoolsQueryVariables, options?: DefaultHookOptions) => {
102
- refresh: () => void;
103
- data: {
104
- pools: {
105
- __typename?: "GqlPoolMinimal";
106
- id: string;
107
- name: string;
108
- address: `0x${string}`;
109
- factory?: `0x${string}` | null;
110
- protocolVersion: number;
111
- type: _berachain_graphql_dex_api.GqlPoolType;
112
- tokens: Array<{
113
- __typename?: "GqlPoolTokenExpanded";
114
- address: `0x${string}`;
115
- symbol: string;
116
- name: string;
117
- decimals: number;
118
- }>;
119
- dynamicData: {
120
- __typename?: "GqlPoolDynamicData";
121
- totalShares: string;
122
- fees24h: string;
123
- volume24h: string;
124
- swapFee: string;
125
- isInRecoveryMode: boolean;
126
- isPaused: boolean;
127
- totalLiquidity: string;
128
- aprItems: Array<{
129
- __typename?: "GqlPoolAprItem";
130
- apr: number;
131
- type: _berachain_graphql_dex_api.GqlPoolAprItemType;
132
- id: string;
133
- }>;
134
- };
135
- userBalance?: {
136
- __typename?: "GqlPoolUserBalance";
137
- totalBalanceUsd: number;
138
- walletBalance: any;
139
- walletBalanceUsd: number;
140
- } | null;
141
- rewardVault?: {
142
- __typename?: "GqlRewardVault";
143
- isVaultWhitelisted: boolean;
144
- vaultAddress: `0x${string}`;
145
- stakingTokenAddress: `0x${string}`;
146
- dynamicData?: {
147
- __typename?: "GqlRewardVaultDynamicData";
148
- activeIncentivesValueUsd: string;
149
- apr?: number | null;
150
- bgtCapturePercentage: string;
151
- allTimeReceivedBGTAmount: string;
152
- } | null;
153
- } | null;
154
- }[];
155
- count: number;
156
- } | undefined;
157
- error: any;
158
- mutate: swr.KeyedMutator<{
159
- pools: {
160
- __typename?: "GqlPoolMinimal";
161
- id: string;
162
- name: string;
163
- address: `0x${string}`;
164
- factory?: `0x${string}` | null;
165
- protocolVersion: number;
166
- type: _berachain_graphql_dex_api.GqlPoolType;
167
- tokens: Array<{
168
- __typename?: "GqlPoolTokenExpanded";
169
- address: `0x${string}`;
170
- symbol: string;
171
- name: string;
172
- decimals: number;
173
- }>;
174
- dynamicData: {
175
- __typename?: "GqlPoolDynamicData";
176
- totalShares: string;
177
- fees24h: string;
178
- volume24h: string;
179
- swapFee: string;
180
- isInRecoveryMode: boolean;
181
- isPaused: boolean;
182
- totalLiquidity: string;
183
- aprItems: Array<{
184
- __typename?: "GqlPoolAprItem";
185
- apr: number;
186
- type: _berachain_graphql_dex_api.GqlPoolAprItemType;
187
- id: string;
188
- }>;
189
- };
190
- userBalance?: {
191
- __typename?: "GqlPoolUserBalance";
192
- totalBalanceUsd: number;
193
- walletBalance: any;
194
- walletBalanceUsd: number;
195
- } | null;
196
- rewardVault?: {
197
- __typename?: "GqlRewardVault";
198
- isVaultWhitelisted: boolean;
199
- vaultAddress: `0x${string}`;
200
- stakingTokenAddress: `0x${string}`;
201
- dynamicData?: {
202
- __typename?: "GqlRewardVaultDynamicData";
203
- activeIncentivesValueUsd: string;
204
- apr?: number | null;
205
- bgtCapturePercentage: string;
206
- allTimeReceivedBGTAmount: string;
207
- } | null;
208
- } | null;
209
- }[];
210
- count: number;
211
- }>;
212
- isValidating: boolean;
213
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
214
- };
215
-
216
- declare const useApiPoolQueryKey: ({ poolId, account, }: {
217
- poolId: Hex;
218
- account?: Address;
219
- }) => readonly ["usePool-api", `0x${string}`, `0x${string}` | undefined] | null;
220
- declare function useApiPool({ poolId, account, }: {
221
- poolId: Hex;
222
- account?: Address;
223
- }): {
224
- refresh: () => void;
225
- data: MinimalPoolFragment | undefined;
226
- error: any;
227
- mutate: swr.KeyedMutator<MinimalPoolFragment>;
228
- isValidating: boolean;
229
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
230
- };
231
-
232
- interface UseCreatePoolProps extends BeraJS.BaseFunctionArgs {
233
- poolCreateTokens: Token[];
234
- initialLiquidityTokens: TokenWithAmount[];
235
- normalizedWeights: bigint[];
236
- poolType: PoolType;
237
- swapFee: number;
238
- owner: string;
239
- poolSymbol: string;
240
- poolName: string;
241
- amplification: number;
242
- weightsDuplicationThreshold?: number;
243
- oracles: Oracle[];
244
- }
245
- interface UseCreatePoolReturn {
246
- generatedPoolName: string;
247
- generatedPoolSymbol: string;
248
- isDupePool: boolean;
249
- dupePool?: SubgraphPoolFragment | null;
250
- createPoolArgs: any;
251
- isLoadingPools: boolean;
252
- errorLoadingPools: boolean;
253
- }
254
- declare enum OracleMode {
255
- None = "None",
256
- Custom = "Custom"
257
- }
258
- interface Oracle {
259
- mode: OracleMode;
260
- address: string;
261
- tokenAddress: string;
262
- cacheDuration: number;
263
- }
264
- declare const useCreatePool: ({ poolCreateTokens, initialLiquidityTokens, normalizedWeights, poolType, poolName, poolSymbol, swapFee, owner, amplification, oracles, weightsDuplicationThreshold, ...baseArgs }: UseCreatePoolProps) => UseCreatePoolReturn;
265
-
266
- declare const useExploitedTokensQueryKey: (tokens: Token[] | undefined) => readonly ["useExploitedTokens", Token[]] | null;
267
- /**
268
- * This hook checks if any of provided tokens might have been exploited by frontrunning its deployment.
269
- *
270
- * @see {@link getIsTokenExploited} for more details
271
- * @returns a record of tokens and whether they might have been exploited
272
- */
273
- declare const useExploitedTokens: ({ tokens, }: {
274
- tokens: Token[] | undefined;
275
- }) => {
276
- refresh: () => Promise<Record<`0x${string}`, boolean> | undefined>;
277
- data: Record<`0x${string}`, boolean> | undefined;
278
- error: any;
279
- mutate: swr.KeyedMutator<Record<`0x${string}`, boolean>>;
280
- isValidating: boolean;
281
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
282
- };
283
-
284
- declare const useGlobalLiquidityAndSwapVolume: () => {
285
- data: {
286
- totalLiquidity: number;
287
- swapVolume24h: number;
288
- };
289
- refresh: () => Promise<_berachain_graphql_dex_api.GetGlobalLiquidityAndSwapVolumeQuery | undefined>;
290
- error: any;
291
- mutate: swr.KeyedMutator<_berachain_graphql_dex_api.GetGlobalLiquidityAndSwapVolumeQuery>;
292
- isValidating: boolean;
293
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
294
- };
295
-
296
- type LiquidityMismatchInfo = {
297
- title: string | null;
298
- message: string | null;
299
- suggestWeighted?: boolean;
300
- };
301
- interface UseLiquidityMismatchParams {
302
- currentStep: PoolCreationStep;
303
- tokenPrices?: TokenCurrentPriceMap;
304
- isLoadingTokenPrices: boolean;
305
- tokens: TokenWithAmount[] | null;
306
- weights: bigint[] | null;
307
- weightsError: string | null;
308
- poolType: PoolType;
309
- liquidityMismatchTolerancePercent?: number;
310
- oracles: Oracle[];
311
- }
312
- /**
313
- * Hook for detecting liquidity mismatches.
314
- *
315
- * @param {PoolCreationStep} currentStep - The current step of the pool creation process.
316
- * @param {Record<string, number>} tokenPrices - The current token prices.
317
- * @param {boolean} isLoadingTokenPrices - Whether the token prices are still loading.
318
- * @param {Array<{ address: string, amount: number }>} tokens - The tokens in the pool, including their addresses and amounts.
319
- * @param {Record<string, number>} weights - The per-token weights in the pool we are creating.
320
- * @param {string | null} weightsError - An error message for the weights indicating that the weights are invalid.
321
- * @param {string} poolType - The type of pool being created.
322
- * @param {number} liquidityMismatchTolerancePercent - The tolerance for liquidity mismatches in percent.
323
- * @returns {Object} The liquidity mismatch info.
324
- */
325
- declare const useLiquidityMismatch: ({ currentStep, tokenPrices, isLoadingTokenPrices, tokens, weights, weightsError, poolType, liquidityMismatchTolerancePercent, oracles, }: UseLiquidityMismatchParams) => LiquidityMismatchInfo;
326
-
327
- type IUseLpPositionArgs = {
328
- pool: MinimalPoolFragment | undefined;
329
- vaultAddress?: Address | undefined;
330
- };
331
- /**
332
- * Given a pool and used within an initialized viem context, returns the user's position
333
- */
334
- declare const useLpPosition: ({ pool, vaultAddress }: IUseLpPositionArgs, options?: DefaultHookOptions) => DefaultHookReturnType<IUserPosition>;
335
-
336
- type NeedsApprovalToken = AllowanceToken & {
337
- maxAmountIn: bigint;
338
- };
339
- declare function useMultipleTokenApprovalsWithSlippage(tokenInput: AllowanceQueryItem[], options?: {
340
- slippage?: number;
341
- }): {
342
- needsApproval: NeedsApprovalToken[];
343
- refresh: () => void;
344
- isLoading: boolean;
345
- };
346
-
347
- declare function useOnChainPoolDataQueryKey(args: {
348
- poolId: string;
349
- } | {
350
- address: Address;
351
- }): readonly ["useOnChainPoolData", `0x${string}`] | null;
352
- interface OnChainPoolFragment extends SubgraphPoolFragment {
353
- amplificationParameter: {
354
- currentFormattedValue: number | undefined;
355
- } | undefined;
356
- }
357
- declare function useOnChainPoolData(poolId: string): {
358
- data: OnChainPoolFragment | undefined;
359
- error: any;
360
- isLoading: boolean;
361
- mutate: swr.KeyedMutator<OnChainPool>;
362
- refresh: () => Promise<OnChainPool | undefined>;
363
- };
364
-
365
- /**
366
- * Hook for fetching relayer approval status with SWR
367
- *
368
- * @returns SWR data spread and refresh function
369
- */
370
- declare const usePollPoolCreationRelayerApproval: (options?: DefaultHookOptions) => {
371
- refreshPoolCreationApproval: () => void;
372
- data: boolean | undefined;
373
- error: any;
374
- mutate: swr.KeyedMutator<boolean>;
375
- isValidating: boolean;
376
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
377
- };
378
-
379
- declare function usePool({ poolId }: {
380
- poolId: Hex;
381
- }): {
382
- data: readonly [undefined, _berachain_graphql_dex_api.MinimalPoolFragment | undefined, OnChainPoolFragment | undefined];
383
- isLoading: boolean;
384
- isError: any;
385
- refresh: () => void;
386
- };
387
-
388
- declare const usePoolEvents: ({ poolId, typeInArray, }: {
389
- poolId: string | undefined;
390
- typeInArray: GqlPoolEventType[];
391
- }) => swr.SWRResponse<_berachain_graphql_dex_api.GetPoolEventsQuery, any, {
392
- refreshInterval: POLLING;
393
- }>;
394
-
395
- type UsePoolHistoricalDataArgs = {
396
- poolId: string | undefined;
397
- };
398
- declare const usePoolHistoricalData: ({ poolId, ...baseArgs }: UsePoolHistoricalDataArgs & BeraJS.BaseFunctionArgs, options?: DefaultHookOptions) => DefaultHookReturnType<PoolHistoricalDataFragment[] | undefined>;
399
-
400
- declare const usePoolsQueryKey: ({ query, }?: {
401
- query?: GetPoolsQueryVariables;
402
- }) => (string | _berachain_graphql_dex_api.Exact<{
403
- textSearch?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["String"]["input"]>;
404
- first?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["Int"]["input"]>;
405
- userAddress?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["String"]["input"]>;
406
- chain: Array<_berachain_graphql_dex_api.GqlChain> | _berachain_graphql_dex_api.GqlChain;
407
- orderBy?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.GqlPoolOrderBy>;
408
- skip?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.Scalars["Int"]["input"]>;
409
- orderDirection?: _berachain_graphql_dex_api.InputMaybe<_berachain_graphql_dex_api.GqlPoolOrderDirection>;
410
- blacklistedPoolIds?: _berachain_graphql_dex_api.InputMaybe<Array<_berachain_graphql_dex_api.Scalars["String"]["input"]> | _berachain_graphql_dex_api.Scalars["String"]["input"]>;
411
- }> | undefined)[];
412
- /**
413
- * Returns all pools from bex api, including user's pools if logged in
414
- * @todo add subgraph fallback
415
- */
416
- declare const usePools: (query: GetPoolsQueryVariables, options?: DefaultHookOptions) => {
417
- pools: {
418
- __typename?: "GqlPoolMinimal";
419
- id: string;
420
- name: string;
421
- address: `0x${string}`;
422
- factory?: `0x${string}` | null;
423
- protocolVersion: number;
424
- type: _berachain_graphql_dex_api.GqlPoolType;
425
- tokens: Array<{
426
- __typename?: "GqlPoolTokenExpanded";
427
- address: `0x${string}`;
428
- symbol: string;
429
- name: string;
430
- decimals: number;
431
- }>;
432
- dynamicData: {
433
- __typename?: "GqlPoolDynamicData";
434
- totalShares: string;
435
- fees24h: string;
436
- volume24h: string;
437
- swapFee: string;
438
- isInRecoveryMode: boolean;
439
- isPaused: boolean;
440
- totalLiquidity: string;
441
- aprItems: Array<{
442
- __typename?: "GqlPoolAprItem";
443
- apr: number;
444
- type: _berachain_graphql_dex_api.GqlPoolAprItemType;
445
- id: string;
446
- }>;
447
- };
448
- userBalance?: {
449
- __typename?: "GqlPoolUserBalance";
450
- totalBalanceUsd: number;
451
- walletBalance: any;
452
- walletBalanceUsd: number;
453
- } | null;
454
- rewardVault?: {
455
- __typename?: "GqlRewardVault";
456
- isVaultWhitelisted: boolean;
457
- vaultAddress: `0x${string}`;
458
- stakingTokenAddress: `0x${string}`;
459
- dynamicData?: {
460
- __typename?: "GqlRewardVaultDynamicData";
461
- activeIncentivesValueUsd: string;
462
- apr?: number | null;
463
- bgtCapturePercentage: string;
464
- allTimeReceivedBGTAmount: string;
465
- } | null;
466
- } | null;
467
- }[];
468
- walletPools: {
469
- __typename?: "GqlPoolMinimal";
470
- id: string;
471
- name: string;
472
- address: `0x${string}`;
473
- factory?: `0x${string}` | null;
474
- protocolVersion: number;
475
- type: _berachain_graphql_dex_api.GqlPoolType;
476
- tokens: Array<{
477
- __typename?: "GqlPoolTokenExpanded";
478
- address: `0x${string}`;
479
- symbol: string;
480
- name: string;
481
- decimals: number;
482
- }>;
483
- dynamicData: {
484
- __typename?: "GqlPoolDynamicData";
485
- totalShares: string;
486
- fees24h: string;
487
- volume24h: string;
488
- swapFee: string;
489
- isInRecoveryMode: boolean;
490
- isPaused: boolean;
491
- totalLiquidity: string;
492
- aprItems: Array<{
493
- __typename?: "GqlPoolAprItem";
494
- apr: number;
495
- type: _berachain_graphql_dex_api.GqlPoolAprItemType;
496
- id: string;
497
- }>;
498
- };
499
- userBalance?: {
500
- __typename?: "GqlPoolUserBalance";
501
- totalBalanceUsd: number;
502
- walletBalance: any;
503
- walletBalanceUsd: number;
504
- } | null;
505
- rewardVault?: {
506
- __typename?: "GqlRewardVault";
507
- isVaultWhitelisted: boolean;
508
- vaultAddress: `0x${string}`;
509
- stakingTokenAddress: `0x${string}`;
510
- dynamicData?: {
511
- __typename?: "GqlRewardVaultDynamicData";
512
- activeIncentivesValueUsd: string;
513
- apr?: number | null;
514
- bgtCapturePercentage: string;
515
- allTimeReceivedBGTAmount: string;
516
- } | null;
517
- } | null;
518
- }[];
519
- isLoading: boolean;
520
- refresh: () => void;
521
- pagination: {
522
- page: number;
523
- pageSize: _berachain_graphql_dex_api.InputMaybe<number> | undefined;
524
- count: number;
525
- };
526
- };
527
-
528
- declare function usePriceImpact({ tokenIn, tokenOut, formattedAmountIn, formattedAmountOut, }: {
529
- tokenIn: Token | undefined;
530
- tokenOut: Token | undefined;
531
- formattedAmountIn: string | undefined;
532
- formattedAmountOut: string | undefined;
533
- }): {
534
- data: number | null | undefined;
535
- isLoading: boolean;
536
- };
537
-
538
- type IUseAggregatorsQuotesArgs = BeraJS.BaseFunctionArgs & {
539
- tokenIn: MinimalERC20;
540
- tokenOut: MinimalERC20;
541
- amount: string;
542
- slippage: number;
543
- referrer?: SwapReferrer;
544
- rewardVault?: Address;
545
- /**
546
- * Useful cause the collaterals are provided byt he honeyContext and this way we can
547
- * use the Provider only in the swap page where is needed.
548
- *
549
- * The collaterals for the honey mint/redeem aggregator.
550
- */
551
- honeyNativeState?: Pick<HoneyConfigContextReturn, "collateralList" | "protocol">;
552
- underlyingToken?: MinimalERC20 | null;
553
- };
554
- declare const USE_AGGREGATORS_QUOTES_QUERY_KEY = "useAggregatorsQuotes";
555
- /**
556
- * Standalone hook for fetching a quote from a single aggregator.
557
- * Resolves wallet, fee, and feature flag context internally — use this
558
- * when you need a quote outside of the `useAggregatorsQuotes` multi-quote flow.
559
- */
560
- declare function useSingleAggregatorQuote(args: IUseAggregatorsQuotesArgs & {
561
- aggregator: BaseAggregator;
562
- }, options?: DefaultHookOptions): swr.SWRResponse<IRawAggregatorQuote | undefined, any, (Partial<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>> & Partial<swr__internal.ProviderConfiguration> & {
563
- provider?: (cache: Readonly<swr.Cache>) => swr.Cache;
564
- } & {
565
- isEnabled?: boolean;
566
- }) | undefined> | null;
567
-
568
- type UseBendDemultiply = {
569
- collateralToken?: Token;
570
- loanToken?: Token;
571
- marketId?: Hex;
572
- primaryAddress?: Address;
573
- repayAmount?: string;
574
- slippage?: number;
575
- chainId?: number;
576
- collateralPriceInLoanAsset?: string;
577
- currentCollateral?: string;
578
- currentDebt?: string;
579
- };
580
- declare function useBendDemultiply({ collateralToken, loanToken, marketId, primaryAddress, repayAmount, slippage, chainId, collateralPriceInLoanAsset, currentCollateral, currentDebt, }: UseBendDemultiply, options?: DefaultHookOptions): swr.SWRResponse<BendDemultiplyBundleResponse, unknown, swr.SWRConfiguration<BendDemultiplyBundleResponse, unknown, (arg: readonly ["useBendDemultiply", `0x${string}`, Token, Token, `0x${string}`, `0x${string}`, number, string, number, string, string, string, `0x${string}`, boolean]) => swr__internal.FetcherResponse<BendDemultiplyBundleResponse>> | undefined>;
581
-
582
- type UseBendMultiply = {
583
- collateralToken?: Token;
584
- loanToken?: Token;
585
- marketId?: Hex;
586
- primaryAddress?: Address;
587
- formattedSupplyCollateralAmount?: string;
588
- formattedCurrentCollateralAmount?: string;
589
- formattedCurrentBorrowAmount?: string;
590
- leverageMultiplier?: number;
591
- slippage?: number;
592
- chainId?: number;
593
- formattedCollateralPriceInLoanAsset?: string;
594
- };
595
- declare function useBendMultiply({ collateralToken, loanToken, marketId, primaryAddress, formattedSupplyCollateralAmount, formattedCurrentCollateralAmount, formattedCurrentBorrowAmount, leverageMultiplier, slippage, chainId, formattedCollateralPriceInLoanAsset, }: UseBendMultiply, options?: DefaultHookOptions): swr.SWRResponse<BendMultiplyBundleResponse, unknown, swr.SWRConfiguration<BendMultiplyBundleResponse, unknown, (arg: readonly ["useBendMultiply", `0x${string}`, Token, Token, `0x${string}`, `0x${string}`, number, string, string, string, number, number, string, `0x${string}`, boolean]) => swr__internal.FetcherResponse<BendMultiplyBundleResponse>> | undefined>;
596
-
597
- type UseBendZapSupplyArgs = {
598
- tokenIn?: BalanceToken;
599
- loanToken: MinimalERC20;
600
- bendVault: MinimalERC20;
601
- rewardVault?: Address;
602
- amount?: string;
603
- slippage?: number;
604
- };
605
- /**
606
- * Get the bend zap supply transaction requests for swapping tokens using Enso.
607
- * @param {UseBendZapSupplyArgs} props - The props for the hook see {@link UseBendZapSupplyArgs}
608
- * @returns {DefaultHookReturnType<GetZapTransactionResponse> & {tokens: BalanceToken[], refresh: () => void}}
609
- *
610
- * The bend transaction response data with polling enabled, see {@link GetZapTransactionResponse} and {@link BalanceToken}
611
- * @remarks The hook is only enabled when all parameters are provided and amount is greater than 0
612
- */
613
- declare function useBendZapSupply({ tokenIn, loanToken, bendVault, rewardVault, amount, slippage, }: UseBendZapSupplyArgs, options?: DefaultHookOptions): {
614
- zapSupplyAmount: {
615
- raw: bigint;
616
- formatted: string;
617
- } | undefined;
618
- priceImpact: number | null | undefined;
619
- hasInsufficientNativeBalance: boolean | 0 | undefined;
620
- isCrossChain: boolean | 0 | undefined;
621
- nativeFee: string | undefined;
622
- refresh: () => void;
623
- data: IRawAggregatorQuote | undefined;
624
- error: any;
625
- mutate: swr.KeyedMutator<IRawAggregatorQuote>;
626
- isValidating: boolean;
627
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
628
- };
629
- declare function useBendZapSupplyHelper({ tokenIn, loanToken, bendVault, rewardVault, amount, slippage, }: UseBendZapSupplyArgs, options?: DefaultHookOptions): swr.SWRResponse<IRawAggregatorQuote, any, {
630
- refreshInterval: POLLING;
631
- errorRetryInterval?: number | undefined;
632
- errorRetryCount?: number;
633
- loadingTimeout?: number | undefined;
634
- focusThrottleInterval?: number | undefined;
635
- dedupingInterval?: number | undefined;
636
- refreshWhenHidden?: boolean;
637
- refreshWhenOffline?: boolean;
638
- revalidateOnFocus?: boolean | undefined;
639
- revalidateOnReconnect?: boolean | undefined;
640
- revalidateOnMount?: boolean;
641
- revalidateIfStale?: boolean | undefined;
642
- shouldRetryOnError?: boolean | ((err: any) => boolean) | undefined;
643
- keepPreviousData?: boolean;
644
- suspense?: boolean;
645
- fallbackData?: any;
646
- strictServerPrefetchWarning?: boolean;
647
- fetcher?: swr.BareFetcher<any> | undefined;
648
- use?: swr.Middleware[];
649
- fallback?: {
650
- [key: string]: any;
651
- } | undefined;
652
- isPaused?: (() => boolean) | undefined;
653
- onLoadingSlow?: ((key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>) => void) | undefined;
654
- onSuccess?: ((data: any, key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>) => void) | undefined;
655
- onError?: ((err: any, key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>) => void) | undefined;
656
- onErrorRetry?: ((err: any, key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>, revalidate: swr.Revalidator, revalidateOpts: Required<swr.RevalidatorOptions>) => void) | undefined;
657
- onDiscarded?: ((key: string) => void) | undefined;
658
- compare?: ((a: any, b: any) => boolean) | undefined;
659
- isOnline?: (() => boolean) | undefined;
660
- isVisible?: (() => boolean) | undefined;
661
- initFocus?: ((callback: () => void) => (() => void) | void) | undefined;
662
- initReconnect?: ((callback: () => void) => (() => void) | void) | undefined;
663
- provider?: (cache: Readonly<swr.Cache>) => swr.Cache;
664
- isEnabled?: boolean;
665
- }>;
666
-
667
- /**
668
- * Get the swap bundle for swapping tokens using Enso.
669
- * @param {Pick<BalanceToken, "address" | "decimals">} tokenIn - The input token to swap from
670
- * @param {Pick<BalanceToken, "address" | "decimals">} tokenOut - The output token to swap to
671
- * @param {string} amount - The amount of input token to swap
672
- * @param {number} slippage - The slippage tolerance to use for the route in percentage
673
- * @returns {DefaultHookReturnType<GetZapTransactionResponse> & {tokens: BalanceToken[], refresh: () => void}}
674
- *
675
- * The zap transaction response data with polling enabled, see {@link GetZapTransactionResponse} and {@link BalanceToken}
676
- * @remarks The hook is only enabled when all parameters are provided and amount is greater than 0
677
- */
678
- declare function useEnsoSwapBundle({ tokenIn, tokenOut, amount, slippage, }: {
679
- tokenIn?: Pick<MinimalERC20, "address" | "decimals" | "chainId">;
680
- tokenOut?: Pick<MinimalERC20, "address" | "decimals">;
681
- amount?: string;
682
- slippage?: number;
683
- }): {
684
- refresh: () => void;
685
- data: GetZapTransactionResponse | undefined;
686
- error: any;
687
- mutate: swr.KeyedMutator<GetZapTransactionResponse>;
688
- isValidating: boolean;
689
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
690
- };
691
-
692
- declare function useEnsoUserTokensWithBalances({ chainId }?: {
693
- chainId?: number;
694
- }, options?: DefaultHookOptions): {
695
- refresh: () => Promise<BalanceToken[] | undefined>;
696
- data: BalanceToken[] | undefined;
697
- error: any;
698
- mutate: swr.KeyedMutator<BalanceToken[]>;
699
- isValidating: boolean;
700
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
701
- };
702
-
703
- type UseZapStakeBeraArgs = {
704
- inputToken: MinimalERC20 | undefined;
705
- amount: string;
706
- underlyingToken: MinimalERC20 | undefined;
707
- slippage?: number;
708
- inputTokenPrice?: number;
709
- tokenOut: MinimalERC20;
710
- };
711
- /**
712
- * hook to get zap stake BERA transaction data from enso.
713
- * supports cross-chain zaps from any chain to berachain staking.
714
- */
715
- declare function useZapStakeBera({ inputToken, amount, underlyingToken, slippage, tokenOut, }: UseZapStakeBeraArgs, options?: DefaultHookOptions): {
716
- data: {
717
- priceImpactPercentage: number | null | undefined;
718
- isCrossChain: boolean | undefined;
719
- amountOut?: string | undefined;
720
- amountIn?: string | undefined;
721
- name?: any;
722
- allowanceRequirements?: AllowanceQueryItem[] | undefined;
723
- isNativeSwap?: boolean;
724
- swapFeeBps?: number | undefined;
725
- getCalldata?: ({ account }: {
726
- account: viem.Address;
727
- }) => Calldata;
728
- };
729
- refresh: () => void;
730
- error: any;
731
- mutate: swr.KeyedMutator<IRawAggregatorQuote>;
732
- isValidating: boolean;
733
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
734
- };
735
-
736
- declare const useCreateProposal: ({ initialData, currentTopic, onError, }: {
737
- initialData?: any;
738
- currentTopic: GovernanceTopic;
739
- onError: (e: CustomProposalErrors) => void;
740
- }) => {
741
- proposal: CustomProposal;
742
- setProposal: react.Dispatch<react.SetStateAction<CustomProposal>>;
743
- addProposalAction: () => void;
744
- removeProposalAction: (idx: number) => void;
745
- computeParamsAndErrors: () => readonly [`0x${string}`[], bigint[], `0x${string}`[], string] | undefined;
746
- };
747
-
748
- /**
749
- * Returns the amount of voting power that a wallet had when the voting period began.
750
- * {@link https://docs.openzeppelin.com/contracts/5.x/api/governance#Votes-getPastVotes-address-uint256-}
751
- */
752
- declare const useGetPastVotes: (args: {
753
- wallet?: Address;
754
- } & ({
755
- proposalId?: bigint;
756
- timepoint: number | bigint;
757
- } | {
758
- proposalId: bigint;
759
- timepoint?: number | bigint;
760
- })) => swr.SWRResponse<string, any, any>;
761
-
762
- declare const useHasVoted: ({ proposalId, wallet, }: {
763
- proposalId: string;
764
- wallet?: Address;
765
- }) => swr.SWRResponse<boolean, any, any>;
766
-
767
- declare const useIsCanceller: ({ account, ...baseArgs }: {
768
- account: Address | undefined;
769
- } & BeraJS.BaseFunctionArgs) => swr.SWRResponse<boolean, any, {
770
- refreshInterval: POLLING;
771
- revalidateOnFocus: false;
772
- }>;
773
-
774
- type UsePollAllProposalsArgs = {
775
- topic: string;
776
- where?: Proposal_Filter;
777
- perPage?: number;
778
- orderBy?: Proposal_OrderBy;
779
- orderDirection?: OrderDirection;
780
- status_in?: ProposalStatus[];
781
- text?: string;
782
- autoRefreshProposals?: boolean;
783
- };
784
- type ProposalResult = {
785
- data: ProposalSelectionFragment[][];
786
- hasMore: boolean;
787
- } & Omit<SWRInfiniteResponse<ProposalSelectionFragment[]>, "data">;
788
- type PollAllProposalsKey = [
789
- "usePollAllProposals",
790
- number,
791
- string,
792
- Proposal_Filter | undefined,
793
- ProposalStatus[] | undefined,
794
- Proposal_OrderBy | undefined,
795
- OrderDirection | undefined,
796
- number,
797
- string | undefined
798
- ] | null;
799
- declare function usePollAllProposalsQueryKey(topic: string, args?: Partial<UsePollAllProposalsArgs>): (pageIndex: number, previousPageData?: ProposalSelectionFragment[]) => PollAllProposalsKey;
800
- /**
801
- * Fetch all proposals for a given topic
802
- */
803
- declare function usePollAllProposals(args: UsePollAllProposalsArgs, options?: DefaultHookOptions & {
804
- autoRefresh?: boolean;
805
- }): ProposalResult;
806
-
807
- interface UsePollProposalResponse extends DefaultHookReturnType<ProposalWithVotesFragment> {
808
- }
809
- /**
810
- * Polls a proposal and returns the proposal details.
811
- * Pulls data from the subgraph and onchain.
812
- *
813
- * @param proposalId - The ID of the proposal to poll
814
- * @param options - Optional configuration options
815
- * @param options.autoRefresh - If true, the data will be refreshed automatically based on the block number and status threshold
816
- * @returns {UsePollProposalResponse} Object containing:
817
- * - data: ProposalWithVotesFragment | undefined - The proposal data if successful
818
- * - error: Error | undefined - Error object if request failed
819
- * - isLoading: boolean - True while data is being fetched
820
- * - isValidating: boolean - True while data is being revalidated
821
- * - mutate: () => Promise<ProposalWithVotesFragment | undefined> - Function to manually refresh the data
822
- * - refresh: () => Promise<void> - Function to manually refresh the data
823
- */
824
- declare const usePollProposal: (proposalId: string, options?: DefaultHookOptions & {
825
- autoRefresh?: boolean;
826
- }) => UsePollProposalResponse;
827
-
828
- declare const usePollProposalThreshold: (governorAddress: Address) => DefaultHookReturnType<{
829
- votesThreshold: string;
830
- }>;
831
-
832
- type UsePollProposalVotesArgs = Omit<GetProposalVotesQueryVariables, "offset" | "limit">;
833
- /**
834
- * Fetches all the votes for a proposal from the Subgraph
835
- * @param args - The arguments to pass to the query
836
- * @param total - The total amount of pages of votes to fetch
837
- */
838
- declare const usePollProposalVotes: (args: UsePollProposalVotesArgs, total: number) => swr_infinite.SWRInfiniteResponse<{
839
- data: _berachain_graphql_governance.GetProposalVotesQuery;
840
- }, any>;
841
- declare const usePollProposalVotesQueryKey: ({ ...args }: UsePollProposalVotesArgs, total: number) => SWRInfiniteKeyLoader;
842
-
843
- declare const usePollUserDelegates: (options?: DefaultHookOptions) => DefaultHookReturnType<{
844
- delegate: Address;
845
- currentVotes: string | undefined;
846
- }>;
847
-
848
- declare const useProposalFromTx: (txHash?: Address) => SWRResponse<ProposalWithVotesFragment | null>;
849
-
850
- /**
851
- * Timepoint used to retrieve user’s votes and quorum. If using block
852
- * number (as per Compound’s Comp), the snapshot is performed at
853
- * the end of this block. Hence, voting for this proposal starts at the beginning of the following block.
854
- *
855
- * {@link https://docs.openzeppelin.com/contracts/5.x/api/governance#IGovernor-proposalSnapshot-uint256-}
856
- */
857
- declare const useProposalSnapshot: ({ proposalId, }: {
858
- proposalId: number | bigint | string | undefined;
859
- }) => SWRResponse<string>;
860
-
861
- declare const useProposalState: ({ proposalId, governorAddress, }: {
862
- proposalId: number | bigint | string | undefined;
863
- governorAddress: Address;
864
- }) => SWRResponse<string>;
865
-
866
- declare const TimelockOperationState: {
867
- readonly 0: "unset";
868
- readonly 1: "waiting";
869
- readonly 2: "ready";
870
- readonly 3: "done";
871
- };
872
- /**
873
- * Fetches the state of a proposal timelock
874
- * @returns state of the proposal timelock (unset, waiting, ready, done)
875
- */
876
- declare function useProposalTimelockState({ proposalTimelockId, timelockAddress, }: {
877
- proposalTimelockId: Address | undefined;
878
- timelockAddress: Address;
879
- }): SWRResponse<(typeof TimelockOperationState)[keyof typeof TimelockOperationState]>;
880
-
881
- /**
882
- * Queries the quorum for a given timestamp.
883
- *
884
- * @returns current quorum if timestamp is in the future.
885
- */
886
- declare function useQuorum({ at }: {
887
- at: number | string;
888
- }, { isEnabled, }: {
889
- isEnabled?: boolean;
890
- }): {
891
- data: number | undefined;
892
- error: any;
893
- mutate: swr.KeyedMutator<string>;
894
- isValidating: boolean;
895
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
896
- };
897
-
898
- interface UseCappedGloballyResponse extends DefaultHookReturnType<boolean | undefined> {
899
- }
900
- declare const useCappedGlobally: ({ asset, amount, isMint, isBasketModeEnabled, }: {
901
- asset: Token | undefined;
902
- amount: string | undefined;
903
- isMint: boolean;
904
- isBasketModeEnabled: boolean | undefined;
905
- }, options?: DefaultHookOptions) => UseCappedGloballyResponse;
906
-
907
- interface UseCappedRelativelyResponse extends DefaultHookReturnType<boolean | undefined> {
908
- }
909
- declare const useCappedRelatively: ({ asset, amount, isMint, isBasketModeEnabled, }: {
910
- asset: Address | undefined;
911
- amount: string | undefined;
912
- isMint: boolean;
913
- isBasketModeEnabled: boolean | undefined;
914
- }, options?: DefaultHookOptions) => UseCappedRelativelyResponse;
915
-
916
- interface UseCollateralWeightsResponse extends DefaultHookReturnType<Record<Address, bigint> | undefined> {
917
- }
918
- declare const useCollateralWeights: ({ collateralList, }: {
919
- collateralList: Token[] | undefined;
920
- }, options?: DefaultHookOptions) => UseCollateralWeightsResponse;
921
-
922
- /**
923
- * Interface defining the state props that we need without the entire IHoneySwapState
924
- */
925
- type HoneyAlertStateProps = Pick<IHoneySwapState, "actionType" | "fromAmount" | "toAmount" | "collaterals" | "isBasketModeEnabled">;
926
- /**
927
- * Interface defining the alert states returned by the useHoneyAlerts hook
928
- */
929
- interface HoneyAlertsReturn {
930
- /** Indicates if the vault's liquidity is completely depleted (balance <= 1) */
931
- isLiquidityDepleted: boolean;
932
- isLiquidityDepletedCollaterals: Token[] | undefined;
933
- /** Indicates if the requested redeem amount exceeds available liquidity in the vault*/
934
- isRedeemMoreThanLiquidity: boolean;
935
- isRedeemMoreThanLiquidityCollaterals: Token[] | undefined;
936
- /** Indicates if the vault's liquidity is low (balance <= 1000) */
937
- isLowLiquidity: boolean;
938
- isLiquidityLowCollaterals: Token[] | undefined;
939
- /** Indicates if the selected collateral is flagged as bad (blacklisted or depegged) */
940
- isDepegged: boolean;
941
- /** Indicates if the selected collateral is blacklisted */
942
- isBlacklisted: boolean;
943
- /** Indicates if the input amount exceeds the global cap limit */
944
- isCappedGlobally: boolean | undefined;
945
- /** Indicates if the input amount exceeds the relative cap limit */
946
- isCappedRelatively: boolean | undefined;
947
- /** Indicates if the input amount exceeds the balance of the user */
948
- isExceedingBalance: boolean;
949
- }
950
- /**
951
- * Hook that monitors various alert conditions for Honey swap operations
952
- *
953
- * This hook tracks multiple states that could affect swap operations:
954
- * - Liquidity levels in vaults (depleted, low)
955
- * - Collateral quality (blacklisted, depegged)
956
- * - Cap limits for transactions (global, relative)
957
- * - Balance checks
958
- *
959
- * @param {Object} params - The parameters object
960
- * @param {HoneyAlertStateProps} params.state - The current state of the Honey swap operation
961
- * @returns {HoneyAlertsReturn} Object containing various alert states
962
-
963
- */
964
- declare const useHoneyAlerts: ({ actionType, collaterals, fromAmount, toAmount, isBasketModeEnabled, }: HoneyAlertStateProps) => HoneyAlertsReturn;
965
-
966
- /**
967
- * Hook that fetches and maintains balances for HONEY token and collateral tokens
968
- *
969
- * This hook:
970
- * - Fetches balances for all collateral tokens and the HONEY token
971
- * - Updates balances at regular intervals (10s)
972
- * - Returns a map of token addresses to their respective balances
973
- * - Provides a refresh function to manually trigger balance updates
974
- *
975
- * The hook requires:
976
- * - A connected wallet account
977
- * - A public client
978
- * - BeraJS configuration
979
- * - A list of collateral tokens
980
- *
981
- * @returns {DefaultHookReturnType<Record<Address, BalanceToken>>} Object containing:
982
- * - data: Map of token addresses to their balances
983
- * - error: Any error that occurred during fetching
984
- * - isLoading: Loading state
985
- * - refresh: Function to manually refresh balances
986
- */
987
- declare const useHoneyBalances: () => DefaultHookReturnType<Record<Address, BalanceToken>>;
988
-
989
- declare function useHoneyChartData({ days }: {
990
- days: number;
991
- }): {
992
- refresh: () => Promise<_berachain_graphql_honey.GetChartDataQuery | undefined>;
993
- data: _berachain_graphql_honey.GetChartDataQuery | undefined;
994
- error: any;
995
- mutate: swr.KeyedMutator<_berachain_graphql_honey.GetChartDataQuery>;
996
- isValidating: boolean;
997
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
998
- };
999
-
1000
- declare function useHoneyGlobalData(): {
1001
- data: {
1002
- dailyVolume: BigNumber | undefined;
1003
- __typename?: "Query";
1004
- honeySnapshots?: {
1005
- __typename?: "HoneySnapshot";
1006
- id: string;
1007
- allTimeVolume: string;
1008
- totalVolume: string;
1009
- timestamp: string;
1010
- totalSupply: string;
1011
- mintVolume: string;
1012
- redeemVolume: string;
1013
- }[] | undefined;
1014
- };
1015
- refresh: () => Promise<_berachain_graphql_honey.GetGlobalDataQuery | undefined>;
1016
- error: any;
1017
- mutate: swr.KeyedMutator<_berachain_graphql_honey.GetGlobalDataQuery>;
1018
- isValidating: boolean;
1019
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1020
- };
1021
-
1022
- declare const useHoneyVaultsBalance: (options?: DefaultHookOptions) => DefaultHookReturnType<GetHoneyVaultsBalanceResponse[]>;
1023
-
1024
- interface UseIsBadCollateralResponse extends DefaultHookReturnType<IsBadCollateralResponse | undefined> {
1025
- }
1026
- declare const useIsBadCollateralAsset: ({ collateral }: {
1027
- collateral: Token | undefined;
1028
- }, options?: DefaultHookOptions) => UseIsBadCollateralResponse;
1029
-
1030
- declare function useIsBasketModeEnabled({ state }: {
1031
- state: IHoneySwapState;
1032
- }, options?: DefaultHookOptions): DefaultHookReturnType<boolean | undefined>;
1033
-
1034
- /**
1035
- * Hook to fetch the latest Pyth price updates for specified pair addresses
1036
- * @param {Object} params - The parameters object
1037
- * @param {Address[] | undefined} params.pairMainAddress - Array of pair addresses to fetch price updates for
1038
- * @returns {SWRResponse<PythLatestUpdates>} SWR response containing the latest Pyth price updates
1039
- * @example
1040
- * ```ts
1041
- * const { data, error } = usePythLatestPrices({
1042
- * pairMainAddress: ["0x123...", "0x456..."]
1043
- * });
1044
- * ```
1045
- */
1046
- declare function usePythLatestPrices({ priceFeedMap, }: {
1047
- priceFeedMap: PythPriceFeedMap | undefined;
1048
- }, options?: DefaultHookOptions): SWRResponse<PythLatestUpdates>;
1049
-
1050
- declare const usePythUpdateFee: ({ pythPriceFeedCalldata, tokenListLength, }: {
1051
- pythPriceFeedCalldata: Address[] | undefined;
1052
- tokenListLength: number;
1053
- }, options?: DefaultHookOptions) => {
1054
- QUERY_KEY: readonly ["usePythUpdateFee", `0x${string}`[]] | null;
1055
- data: bigint;
1056
- isLoading: boolean;
1057
- };
1058
-
1059
- declare function useBgtAprSimulation(args: GetBgtAprSimulationArgs | undefined): GetBgtAprSimulationResult
1060
- /**
1061
- * Returns undefined if still loading
1062
- */
1063
- | undefined;
1064
-
1065
- declare const useBgtUnstakedBalance: (options?: DefaultHookOptions) => DefaultHookReturnType<string | undefined>;
1066
-
1067
- declare const useClaimableFees: () => {
1068
- refresh: () => Promise<string | undefined>;
1069
- data: string | undefined;
1070
- error: any;
1071
- mutate: swr.KeyedMutator<string>;
1072
- isValidating: boolean;
1073
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1074
- };
1075
-
1076
- /**
1077
- * Hook that fetches and returns the highest APR (Annual Percentage Rate) from reward vaults.
1078
- *
1079
- * @param {`0x${string}`[]} [params.filteringVaults=[]] - Optional array of vault addresses to filter by
1080
- *
1081
- * @returns {Object} An object containing:
1082
- * - highestApr: The highest APR value from the reward vaults
1083
- * - refresh: Function to manually refresh the data
1084
- * - ...swrResponse: All properties from the underlying SWR response
1085
- *
1086
- * @example
1087
- * const { highestApr } = useHighestVaultsAPR({
1088
- * filteringVaults: ['0x123...', '0x456...']
1089
- * });
1090
- */
1091
- declare const useHighestVaultsAPR: (where?: GqlRewardVaultFilter, { isEnabled }?: {
1092
- isEnabled?: boolean;
1093
- }) => {
1094
- highestApr: GqlRewardVaultDynamicData["apr"] | undefined;
1095
- isLoading: boolean;
1096
- refresh: () => void;
1097
- };
1098
-
1099
- declare const usePollGlobalData: (options?: DefaultHookOptions) => DefaultHookReturnType<GlobalData>;
1100
-
1101
- interface UsePollMarketsResponse extends DefaultHookReturnType<GetMarkets> {
1102
- }
1103
- declare const usePollMarketsQueryKey: () => string;
1104
- declare const usePollMarkets: (options?: DefaultHookOptions) => UsePollMarketsResponse;
1105
-
1106
- declare function useQueuedBeraUnlock({ receiptTokenAddresses, account, version, }: {
1107
- receiptTokenAddresses: Address[];
1108
- account?: Address | string;
1109
- version: "V1" | "V2";
1110
- }, options?: DefaultHookOptions): {
1111
- refresh: () => Promise<StakedBeraWithdrawal[] | undefined>;
1112
- data: StakedBeraWithdrawal[] | undefined;
1113
- error: any;
1114
- mutate: swr.KeyedMutator<StakedBeraWithdrawal[]>;
1115
- isValidating: boolean;
1116
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1117
- };
1118
-
1119
- declare const useRewardTokenToBeraRate: ({ address, }: {
1120
- address: Address | undefined;
1121
- }, opt?: DefaultHookOptions) => swr.SWRResponse<number, any, {
1122
- errorRetryInterval?: number | undefined;
1123
- errorRetryCount?: number;
1124
- loadingTimeout?: number | undefined;
1125
- focusThrottleInterval?: number | undefined;
1126
- dedupingInterval?: number | undefined;
1127
- refreshInterval?: number | ((latestData: any) => number) | undefined;
1128
- refreshWhenHidden?: boolean;
1129
- refreshWhenOffline?: boolean;
1130
- revalidateOnFocus?: boolean | undefined;
1131
- revalidateOnReconnect?: boolean | undefined;
1132
- revalidateOnMount?: boolean;
1133
- revalidateIfStale?: boolean | undefined;
1134
- shouldRetryOnError?: boolean | ((err: any) => boolean) | undefined;
1135
- keepPreviousData?: boolean;
1136
- suspense?: boolean;
1137
- fallbackData?: any;
1138
- strictServerPrefetchWarning?: boolean;
1139
- fetcher?: swr.BareFetcher<any> | undefined;
1140
- use?: swr.Middleware[];
1141
- fallback?: {
1142
- [key: string]: any;
1143
- } | undefined;
1144
- isPaused?: (() => boolean) | undefined;
1145
- onLoadingSlow?: ((key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>) => void) | undefined;
1146
- onSuccess?: ((data: any, key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>) => void) | undefined;
1147
- onError?: ((err: any, key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>) => void) | undefined;
1148
- onErrorRetry?: ((err: any, key: string, config: Readonly<swr__internal.PublicConfiguration<any, any, swr.BareFetcher<any>>>, revalidate: swr.Revalidator, revalidateOpts: Required<swr.RevalidatorOptions>) => void) | undefined;
1149
- onDiscarded?: ((key: string) => void) | undefined;
1150
- compare?: ((a: any, b: any) => boolean) | undefined;
1151
- isOnline?: (() => boolean) | undefined;
1152
- isVisible?: (() => boolean) | undefined;
1153
- initFocus?: ((callback: () => void) => (() => void) | void) | undefined;
1154
- initReconnect?: ((callback: () => void) => (() => void) | void) | undefined;
1155
- provider?: (cache: Readonly<swr.Cache>) => swr.Cache;
1156
- isEnabled?: boolean;
1157
- }>;
1158
-
1159
- interface UseRewardVaultResponse extends DefaultHookReturnType<ApiVaultFragment> {
1160
- }
1161
- declare const useRewardVaultQueryKey: (address: Address | undefined) => readonly ["useRewardVault", `0x${string}`] | null;
1162
- declare const useRewardVault: (id: Address | undefined, options?: DefaultHookOptions) => UseRewardVaultResponse;
1163
-
1164
- declare const useRewardVaultBalanceFromStakingToken: ({ stakingToken, rewardVaultAddress: _rewardVaultAddress, }: {
1165
- stakingToken: Address | undefined;
1166
- rewardVaultAddress?: Address;
1167
- }, options?: DefaultHookOptions) => {
1168
- refresh: () => void;
1169
- isLoading: boolean;
1170
- data: {
1171
- address: `0x${string}`;
1172
- balance: bigint;
1173
- } | undefined;
1174
- error: any;
1175
- mutate: swr.KeyedMutator<{
1176
- address: `0x${string}`;
1177
- balance: bigint;
1178
- }>;
1179
- isValidating: boolean;
1180
- };
1181
-
1182
- declare const useRewardVaultFromToken: ({ tokenAddress, }: {
1183
- tokenAddress: Address | string | undefined;
1184
- }, { isEnabled, }?: {
1185
- isEnabled?: boolean;
1186
- }) => {
1187
- refresh: () => Promise<`0x${string}` | undefined>;
1188
- data: `0x${string}` | undefined;
1189
- error: any;
1190
- mutate: swr.KeyedMutator<`0x${string}` | undefined>;
1191
- isValidating: boolean;
1192
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1193
- };
1194
-
1195
- declare function useRewardVaultIncentives({ address, stakingToken, }: {
1196
- address: Address | undefined;
1197
- stakingToken: Address | undefined;
1198
- }): {
1199
- refresh: () => Promise<RewardVaultIncentive[] | undefined>;
1200
- data: RewardVaultIncentive[] | undefined;
1201
- error: any;
1202
- mutate: swr.KeyedMutator<RewardVaultIncentive[]>;
1203
- isValidating: boolean;
1204
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1205
- };
1206
-
1207
- declare const useRewardVaultRewards: (address: Address, options?: DefaultHookOptions) => {
1208
- refresh: () => Promise<GetRewardVaultRewardsReturn | undefined>;
1209
- data: GetRewardVaultRewardsReturn | undefined;
1210
- error: any;
1211
- mutate: swr.KeyedMutator<GetRewardVaultRewardsReturn>;
1212
- isValidating: boolean;
1213
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1214
- };
1215
-
1216
- declare const useRewardVaultsQueryKey: (filter?: GetVaultsQueryVariables, onChainIncentives?: boolean) => readonly ["useRewardVaults", _berachain_graphql_pol_api.Exact<{
1217
- where?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.GqlRewardVaultFilter>;
1218
- pageSize?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.Scalars["Int"]["input"]>;
1219
- skip?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.Scalars["Int"]["input"]>;
1220
- orderBy?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.GqlRewardVaultOrderBy>;
1221
- orderDirection?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.GqlRewardVaultOrderDirection>;
1222
- search?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.Scalars["String"]["input"]>;
1223
- }> | undefined, boolean];
1224
- declare const useRewardVaults: (args: {
1225
- filter?: GetVaultsQueryVariables;
1226
- onChainIncentives?: boolean;
1227
- }, options?: DefaultHookOptions) => {
1228
- refresh: swr.KeyedMutator<GetGaugeData>;
1229
- data: GetGaugeData | undefined;
1230
- error: any;
1231
- mutate: swr.KeyedMutator<GetGaugeData>;
1232
- isValidating: boolean;
1233
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1234
- };
1235
-
1236
- type UseStakedAPR = {
1237
- _timestamp: number;
1238
- apr: string;
1239
- }[];
1240
- declare function useStakedAPR({ range, }: {
1241
- range: GqlVaultSnapshotDataRange;
1242
- }): DefaultHookReturnType<UseStakedAPR>;
1243
-
1244
- /**
1245
- * Fetches staked asset data in two phases for progressive loading:
1246
- *
1247
- * 1. APR — independent fetch, resolves quickly, shared by both phases.
1248
- * 2. Balances (fast path) — wallet balances (via usePollWalletBalances),
1249
- * token prices (via useTokenPrices), and exchange rates.
1250
- * Provides staked amounts and USD values immediately (earnings are 0).
1251
- * 3. Positions (slow path) — adds earnings data from the vault.
1252
- * Provides the full picture with earned amounts and USD values.
1253
- *
1254
- * Consumers can show `balances` right away and swap in `data` once positions resolve.
1255
- */
1256
- declare const useStakedData: (stakingConfigs: StakingConfig[]) => {
1257
- /** Fast path: staked amounts + USD values (no earnings) */
1258
- balances: StakedBeraAsset[] | undefined;
1259
- /** Slow path: full enriched positions with earnings */
1260
- data: StakedBeraAsset[] | undefined;
1261
- /** True only when both balances and positions are still loading */
1262
- isLoading: boolean;
1263
- isLoadingBalances: boolean;
1264
- isLoadingPositions: boolean;
1265
- isValidatingPositions: boolean;
1266
- };
1267
-
1268
- type UseStakedBeraSnapshot = Record<Address, {
1269
- _timestamp: number;
1270
- total_assets: string;
1271
- }[]>;
1272
- declare function useStakedSnapshots({ range, addresses, }: {
1273
- addresses: Address[];
1274
- range: 30 | 60 | 90;
1275
- }): DefaultHookReturnType<UseStakedBeraSnapshot>;
1276
-
1277
- type StakingVaultEntry = {
1278
- address: Address;
1279
- underlyingAsset: Address;
1280
- };
1281
- declare const useStakingVaultsMetadata: (vaults?: StakingVaultEntry[]) => swr.SWRResponse<VaultMetadata[], any, {
1282
- refreshInterval: POLLING;
1283
- }>;
1284
-
1285
- declare function useTotalStakedAmount({ vaultAddresses, }: {
1286
- vaultAddresses: Address$1[];
1287
- }): DefaultHookReturnType<Record<Address$1, bigint>>;
1288
-
1289
- declare const useUserVaultInfo: (args: {
1290
- vaultAddress: Address | undefined;
1291
- }, options?: DefaultHookOptions) => DefaultHookReturnType<UserVaultInfo>;
1292
-
1293
- declare const useUserVaults: (options?: DefaultHookOptions) => DefaultHookReturnType<GetUserVaultsResponse>;
1294
-
1295
- interface RewardVault {
1296
- stakeToken: Address;
1297
- address: Address;
1298
- }
1299
- declare const useVaultAddress: (vaultAddress: Address) => swr.SWRResponse<{
1300
- stakeToken: `0x${string}`;
1301
- address: `0x${string}`;
1302
- }, any, any>;
1303
-
1304
- declare const useVaultHistory: ({ vault, range, resolution, }: GetVaultHistoryArgs) => DefaultHookReturnType<GetVaultHistoryQuery["polGetRewardVaultSnapshots"]>;
1305
-
1306
- interface UsePollValidatorInfoResponse$1 extends DefaultHookReturnType<ApiValidatorFragment[] | undefined> {
1307
- }
1308
- declare const useVaultValidators: (id: Address, options?: DefaultHookOptions) => UsePollValidatorInfoResponse$1;
1309
-
1310
- /**
1311
- * Shorthand for `useTokenCurrentPrice` with the Bera token address.
1312
- * @returns
1313
- */
1314
- declare function useBeraCurrentPrice(opts?: DefaultHookOptions): {
1315
- data: TokenPriceInfo | undefined;
1316
- error: any;
1317
- mutate: swr.KeyedMutator<TokenCurrentPriceMap>;
1318
- isValidating: boolean;
1319
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1320
- };
1321
-
1322
- type UseMultipleTokenInformationResponse = DefaultHookReturnType<Token[]>;
1323
- type useMultipleTokenInformationArgs = {
1324
- addresses: string[] | readonly string[] | undefined;
1325
- chainId?: number;
1326
- };
1327
- declare function useMultipleTokenInformation(args: useMultipleTokenInformationArgs, options?: DefaultHookOptions): UseMultipleTokenInformationResponse;
1328
-
1329
- type UsePollAllowancesArgs = {
1330
- items: AllowanceQueryItem[];
1331
- };
1332
- interface UsePollAllowancesResponse extends DefaultHookReturnType<AllowanceToken[] | undefined> {
1333
- }
1334
- /**
1335
- *
1336
- * @brief Allows the user to poll the allowances of a given token array.
1337
- *
1338
- * @param contract the address of the ERC20 token contract
1339
- * @param tokens the list of tokens to poll allowances for
1340
- * @param chainId the chain ID to check allowances on
1341
- */
1342
- declare function usePollAllowances(args: UsePollAllowancesArgs, options?: DefaultHookOptions): UsePollAllowancesResponse;
1343
-
1344
- declare function usePollBalance({ address: addressString, owner, chainId, }: {
1345
- /**
1346
- * Token address to get the balance of
1347
- */
1348
- address: string | undefined;
1349
- owner?: Address | undefined;
1350
- chainId?: number;
1351
- }, options?: DefaultHookOptions): Omit<DefaultHookReturnType<BalanceToken | undefined>, "mutate">;
1352
-
1353
- type UsePollWalletBalancesArgs = {
1354
- /**
1355
- * If provided, the tokens will be used instead of the default token list.
1356
- */
1357
- tokens?: Token[];
1358
- walletAddress?: Address;
1359
- };
1360
- interface UsePollBalancesResponse extends DefaultHookReturnType<BalanceToken[] | undefined> {
1361
- }
1362
- declare function usePollWalletBalances(args?: UsePollWalletBalancesArgs, options?: DefaultHookOptions): UsePollBalancesResponse;
1363
-
1364
- type UseStakingTokenInformationResponse = DefaultHookReturnType<Partial<Token> | undefined>;
1365
- type useStakingTokenInformationArgs = {
1366
- address: string | undefined;
1367
- };
1368
- declare const useStakingTokenInformation: (args: useStakingTokenInformationArgs, options?: DefaultHookOptions) => UseStakingTokenInformationResponse;
1369
-
1370
- /**
1371
- * @deprecated use useTokenPrice instead
1372
- */
1373
- declare function useTokenCurrentPrice({ address }: {
1374
- address: `0x${string}` | undefined;
1375
- }, options?: DefaultHookOptions): {
1376
- data: TokenPriceInfo | undefined;
1377
- error: any;
1378
- mutate: swr.KeyedMutator<TokenCurrentPriceMap>;
1379
- isValidating: boolean;
1380
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1381
- };
1382
-
1383
- /**
1384
- * @deprecated use useTokenPrices instead that supports multichain tokens
1385
- */
1386
- declare function useTokenCurrentPrices({ addressIn, }?: {
1387
- addressIn?: string[] | readonly string[];
1388
- }, options?: DefaultHookOptions): {
1389
- data: {
1390
- [x: string]: TokenPriceInfo | undefined;
1391
- };
1392
- error: any;
1393
- mutate: swr.KeyedMutator<TokenCurrentPriceMap>;
1394
- isValidating: boolean;
1395
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1396
- };
1397
-
1398
- type UseTokenInformationResponse = DefaultHookReturnType<Token | undefined>;
1399
- type UseTokenInformationArgs = {
1400
- address: string | undefined;
1401
- chainId: number;
1402
- };
1403
- declare function useTokenInformation(args: UseTokenInformationArgs, options?: DefaultHookOptions): UseTokenInformationResponse;
1404
-
1405
- type TokenPriceInput = Pick<Token, "address" | "chainId">;
1406
- type TokenPriceOutput = TokenPriceInput & {
1407
- price: number;
1408
- };
1409
- type TokenPriceMap = Record<number, Record<Address, number>>;
1410
- declare function useTokenPrices({ tokens, }?: {
1411
- tokens?: TokenPriceInput[];
1412
- }, options?: DefaultHookOptions): {
1413
- isLoading: boolean;
1414
- data: TokenPriceOutput[];
1415
- priceMap: TokenPriceMap;
1416
- getTokenPrice: (token?: TokenPriceInput) => number | undefined;
1417
- };
1418
-
1419
- declare function useTokenPrice({ token }: {
1420
- token: TokenPriceInput | undefined;
1421
- }, options?: DefaultHookOptions): {
1422
- data: number | undefined;
1423
- isLoading: boolean;
1424
- };
1425
-
1426
- declare function useTokens(): {
1427
- /**
1428
- * @deprecated use useTokens().tokenList instead
1429
- */
1430
- data: {
1431
- tokenList: TokenWithMetadata[];
1432
- customTokenList: Token[];
1433
- featuredTokenList: TokenWithMetadata[];
1434
- };
1435
- tokenList: TokenWithMetadata[];
1436
- userTokens: Token[];
1437
- featuredTokens: TokenWithMetadata[];
1438
- onRemoveToken: (token: Token) => void;
1439
- onAddToken: (token: Token) => void;
1440
- refresh: () => void;
1441
- ensoTokens: BalanceToken[] | undefined;
1442
- };
1443
-
1444
- declare function useTotalSupply({ address }: {
1445
- address: Address | undefined;
1446
- }): swr.SWRResponse<bigint, any, any>;
1447
-
1448
- /**
1449
- *
1450
- * @returns Timestamp in seconds
1451
- */
1452
- declare function useBlockToTimestamp(inputBlock: number | bigint | string): number | undefined;
1453
-
1454
- declare function useBeraContractWrite({ onlyPermissionless, onSuccess, onError, onLoading, onWarning, onSubmission, }?: IUseContractWriteArgs & {
1455
- /**
1456
- * Whether to allow only permissionless transactions.
1457
- *
1458
- * This is useful when UI is reading data for another account compared to the connected account.
1459
- */
1460
- onlyPermissionless?: boolean;
1461
- }): UseContractWriteApi;
1462
-
1463
- declare const useGetVerifiedAbi: (address?: string) => swr.SWRResponse<string, any, swr.SWRConfiguration<string, any, ((arg: readonly [any, ...unknown[]]) => swr__internal.FetcherResponse<string>) | ((arg: readonly [any, ...unknown[]]) => swr__internal.FetcherResponse<string>)> | undefined>;
1464
-
1465
- type UseHistoryStateOptions<T> = {
1466
- key: string;
1467
- defaultValue: T;
1468
- };
1469
- /**
1470
- * useHistoryState is a hook that allows storing state in the browser's history state
1471
- * it is useful for storing state that you want to persist across pages
1472
- * It is indexed by the key parameter to be able to store multiple states on the same page and
1473
- * also to not override nextjs usage of the history state
1474
- * @param {string} key - the key to store the state under
1475
- * @param {T} defaultValue - the default value to use if the state is not found
1476
- * @returns {T} state - the current state
1477
- * @returns {function} setHistoryState - a function to set the state
1478
- */
1479
- declare function useHistoryState<T>({ key, defaultValue, }: UseHistoryStateOptions<T>): readonly [T, (value: T | ((prev: T) => T)) => void];
1480
-
1481
- /**
1482
- * Returns the previous value of a variable before the render
1483
- * @param value - the value to return the previous value for
1484
- */
1485
- declare function usePrevious<T>(value: T): T | undefined;
1486
-
1487
- declare const useAllValidatorsQueryKey: ({ variables, }?: {
1488
- variables?: GetValidatorsQueryVariables;
1489
- }) => (string | _berachain_graphql_pol_api.Exact<{
1490
- where?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.GqlValidatorFilter>;
1491
- sortBy?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.GqlValidatorOrderBy>;
1492
- sortOrder?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.GqlValidatorOrderDirection>;
1493
- pageSize?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.Scalars["Int"]["input"]>;
1494
- skip?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.Scalars["Int"]["input"]>;
1495
- search?: _berachain_graphql_pol_api.InputMaybe<_berachain_graphql_pol_api.Scalars["String"]["input"]>;
1496
- chain?: _berachain_graphql_pol_api.InputMaybe<GqlChain>;
1497
- }> | undefined)[];
1498
- declare const useAllValidators: (variables: GetValidatorsQueryVariables & BeraJS.BaseFunctionArgs, options?: DefaultHookOptions) => DefaultHookReturnType<GetValidatorsQuery | undefined>;
1499
-
1500
- declare function useApiEnrichedAllocation({ allocation, }: {
1501
- allocation: ValidatorRewardAllocation | undefined;
1502
- }): swr.SWRResponse<_berachain_graphql_pol_api.ApiRewardAllocationWeightFragment[], any, any>;
1503
-
1504
- interface UsePollValidatorInfoResponse extends DefaultHookReturnType<GetValidatorQuery> {
1505
- }
1506
- declare const useApiValidatorQueryKey: (id: Address) => readonly ["useApiValidator", `0x${string}`] | null;
1507
- declare const useApiValidator: (id: Address, options?: DefaultHookOptions) => UsePollValidatorInfoResponse;
1508
-
1509
- declare function useBaselineRewardAllocation(): swr.SWRResponse<ValidatorRewardAllocation, any, any>;
1510
-
1511
- declare const useDailyValidatorBlockStats: ({ pubKey, first, }: {
1512
- pubKey: Address | undefined;
1513
- first?: number;
1514
- }) => DefaultHookReturnType<GetValidatorBlockStatsQuery>;
1515
-
1516
- declare function useDefaultRewardAllocation(options?: DefaultHookOptions): {
1517
- refresh: () => Promise<ValidatorRewardAllocation | undefined>;
1518
- data: ValidatorRewardAllocation | undefined;
1519
- error: any;
1520
- mutate: swr.KeyedMutator<ValidatorRewardAllocation | undefined>;
1521
- isValidating: boolean;
1522
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1523
- };
1524
-
1525
- type ManagedValidatorRole = {
1526
- operator: Address | null;
1527
- rewardAllocator: Address | null;
1528
- hasOperatorRole: boolean;
1529
- hasRewardAllocatorRole: boolean;
1530
- };
1531
- declare function useManagedValidatorRole({ pubKey, account: accountAddress, }: {
1532
- pubKey: Address | undefined;
1533
- account?: Address | undefined;
1534
- }, options?: DefaultHookOptions): DefaultHookReturnType<ManagedValidatorRole | undefined>;
1535
-
1536
- declare const useOnChainValidator: ({ pubkey }: {
1537
- pubkey: Address;
1538
- }, options: DefaultHookOptions) => DefaultHookReturnType<Partial<ApiValidatorFragment>>;
1539
-
1540
- declare const useStakingPoolBatch: ({ valPubKey, options, }: {
1541
- valPubKey: Address;
1542
- options?: DefaultHookOptions;
1543
- }) => DefaultHookReturnType<number | undefined>;
1544
-
1545
- interface UseUserActiveValidatorsResponse extends DefaultHookReturnType<ValidatorWithUserBoost[] | undefined> {
1546
- }
1547
- declare const useUserActiveValidators: (options?: DefaultHookOptions) => UseUserActiveValidatorsResponse;
1548
-
1549
- declare const useUserBoostsOnValidator: ({ pubkey, ...args }: {
1550
- pubkey: Address | undefined;
1551
- account?: Address;
1552
- }) => DefaultHookReturnType<UserBoostsOnValidator>;
1553
-
1554
- interface UseUserClaimableIncentivesReturnType extends DefaultHookReturnType<BribeBoostRewardProof[]> {
1555
- tokenMap?: Set<string> | undefined;
1556
- }
1557
- declare const useUserClaimableIncentives: () => UseUserClaimableIncentivesReturnType;
1558
-
1559
- /**
1560
- * Hook to fetch and manage user staking positions for validators
1561
- *
1562
- * This hook retrieves staking positions for a given account and optionally filters
1563
- * by a specific validator address.
1564
- *
1565
- * @param params - Configuration parameters for the hook
1566
- * @param params.account - The user's wallet address to fetch staking positions for
1567
- * @param params.validatorAddress - Optional validator address to filter positions by
1568
- *
1569
- *
1570
- * @example
1571
- * ```tsx
1572
- * // Fetch all staking positions for a user
1573
- * const { data, isLoading, error } = useUserStakingPositions({
1574
- * account: userAddress
1575
- * });
1576
- *
1577
- * // Fetch staking positions for a specific validator
1578
- * const { data, isLoading, error } = useUserStakingPositions({
1579
- * account: userAddress,
1580
- * validatorAddress: "0x1234..."
1581
- * });
1582
- * ```
1583
- */
1584
- declare const useUserStakingPositions: ({ account, validatorAddress, }: {
1585
- account: Address | undefined;
1586
- validatorAddress?: Address;
1587
- }) => {
1588
- refresh: () => void;
1589
- data: UserStakingPoolPosition[] | undefined;
1590
- error: any;
1591
- mutate: swr.KeyedMutator<UserStakingPoolPosition[]>;
1592
- isValidating: boolean;
1593
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1594
- };
1595
-
1596
- declare function useValidator({ pubkey }: {
1597
- pubkey: Address;
1598
- }, options: DefaultHookOptions): {
1599
- data: {
1600
- uptime: {
1601
- __typename?: "GqlValidatorBlockUptime";
1602
- isActive: boolean;
1603
- isProposer: boolean;
1604
- isSigner: boolean;
1605
- status: _berachain_graphql_pol_api.GqlValidatorBlockUptimeStatus;
1606
- blockNumber: number;
1607
- }[] | undefined;
1608
- validator: {
1609
- operator: `0x${string}` | null | undefined;
1610
- dynamicData: {
1611
- activeBoostAmount: string;
1612
- queuedBoostAmount: string;
1613
- usersActiveBoostCount: number;
1614
- usersQueuedBoostCount: number;
1615
- allTimeDistributedBGTAmount: string;
1616
- rewardRate: string;
1617
- stakedBeraAmount: string;
1618
- lastDayDistributedBGTAmount: string;
1619
- activeBoostAmountRank: number;
1620
- boostApr: GqlValidatorDynamicData["boostApr"];
1621
- commissionOnIncentives: number;
1622
- };
1623
- id: Address;
1624
- pubkey: Address;
1625
- metadata: {
1626
- __typename?: "GqlValidatorMetadata";
1627
- name: string;
1628
- logoURI: string;
1629
- website: string;
1630
- description: string;
1631
- } | null | undefined;
1632
- rewardAllocationWeights: {
1633
- __typename?: "GqlValidatorRewardAllocationWeight";
1634
- percentage: number;
1635
- receiver: `0x${string}`;
1636
- startBlock: number;
1637
- receivingVault?: {
1638
- __typename?: "GqlRewardVault";
1639
- vaultAddress: `0x${string}`;
1640
- isVaultWhitelisted: boolean;
1641
- stakingTokenAmount: string;
1642
- id: `0x${string}`;
1643
- address: `0x${string}`;
1644
- dynamicData?: {
1645
- __typename?: "GqlRewardVaultDynamicData";
1646
- allTimeReceivedBGTAmount: string;
1647
- apr?: number | null;
1648
- bgtCapturePercentage: string;
1649
- bgtCapturePerBlock: string;
1650
- activeIncentivesValueUsd: string;
1651
- activeIncentivesRateUsd: string;
1652
- tvl?: number | null;
1653
- } | null;
1654
- stakingToken: {
1655
- __typename?: "GqlToken";
1656
- address: `0x${string}`;
1657
- name: string;
1658
- symbol: string;
1659
- decimals: number;
1660
- };
1661
- metadata?: {
1662
- __typename?: "GqlRewardVaultMetadata";
1663
- name: string;
1664
- logoURI: string;
1665
- url: string;
1666
- protocolName: string;
1667
- protocolIcon: string;
1668
- description: string;
1669
- categories: Array<string>;
1670
- action: string;
1671
- } | null;
1672
- activeIncentives: Array<{
1673
- __typename?: "GqlRewardVaultIncentive";
1674
- active: boolean;
1675
- tokenAddress: `0x${string}`;
1676
- remainingAmount: string;
1677
- remainingAmountUsd: string;
1678
- incentiveRate: string;
1679
- incentiveRateUsd: string;
1680
- token: {
1681
- __typename?: "GqlToken";
1682
- address: `0x${string}`;
1683
- name: string;
1684
- symbol: string;
1685
- decimals: number;
1686
- };
1687
- }>;
1688
- } | null;
1689
- }[];
1690
- __typename?: "GqlValidator";
1691
- rewardAllocator?: `0x${string}` | null;
1692
- lastBlockUptime?: {
1693
- __typename?: "GqlValidatorBlockUptime";
1694
- isActive: boolean;
1695
- isProposer: boolean;
1696
- isSigner: boolean;
1697
- status: _berachain_graphql_pol_api.GqlValidatorBlockUptimeStatus;
1698
- blockNumber: number;
1699
- } | null | undefined;
1700
- } | null;
1701
- };
1702
- isLoading: boolean;
1703
- error: any;
1704
- };
1705
-
1706
- declare function useValidatorAnalytics({ pubkey, dayRange, }: {
1707
- pubkey: Address | undefined;
1708
- dayRange: number;
1709
- }): DefaultHookReturnType<GetValidatorAnalyticsQuery>;
1710
-
1711
- declare const useValidatorCommission: (pubKey: Address, options?: DefaultHookOptions) => DefaultHookReturnType<number | undefined | null>;
1712
-
1713
- declare const useValidatorEstimatedBgtPerYear: (validator: ApiValidatorMinimalFragment) => {
1714
- data: number | undefined;
1715
- isLoading: boolean;
1716
- };
1717
-
1718
- declare function useValidatorQueuedCommission(pubKey: Address, options?: DefaultHookOptions): DefaultHookReturnType<ValidatorQueuedCommission | undefined | null>;
1719
-
1720
- declare const useValidatorQueuedOperatorAddress: (pubKey: Address, options?: DefaultHookOptions) => DefaultHookReturnType<ValidatorQueuedOperatorAddress | undefined>;
1721
-
1722
- declare const useValidatorQueuedRewardAllocation: (pubKey: Address, options?: DefaultHookOptions) => DefaultHookReturnType<ValidatorRewardAllocation | undefined>;
1723
-
1724
- declare function useValidatorRewardAllocation(pubKey: Address, options?: DefaultHookOptions): {
1725
- refresh: () => Promise<{
1726
- activeRewardAllocation: ValidatorRewardAllocation;
1727
- setRewardAllocation: ValidatorRewardAllocation;
1728
- isBaseline: boolean;
1729
- isNeverSet: boolean;
1730
- } | undefined>;
1731
- data: {
1732
- activeRewardAllocation: ValidatorRewardAllocation;
1733
- setRewardAllocation: ValidatorRewardAllocation;
1734
- isBaseline: boolean;
1735
- isNeverSet: boolean;
1736
- } | undefined;
1737
- error: any;
1738
- mutate: swr.KeyedMutator<{
1739
- activeRewardAllocation: ValidatorRewardAllocation;
1740
- setRewardAllocation: ValidatorRewardAllocation;
1741
- isBaseline: boolean;
1742
- isNeverSet: boolean;
1743
- }>;
1744
- isValidating: boolean;
1745
- isLoading: swr__internal.IsLoadingResponse<Data, Config>;
1746
- };
1747
-
1748
- export { IHoneySwapState, IUseContractWriteArgs, type LiquidityMismatchInfo, type ManagedValidatorRole, type OnChainPoolFragment, type Oracle, OracleMode, type RewardVault, type StakingVaultEntry, type TokenPriceInput, type TokenPriceMap, type TokenPriceOutput, USE_AGGREGATORS_QUOTES_QUERY_KEY, type UseBendDemultiply, type UseBendMultiply, type UseCappedGloballyResponse, type UseCappedRelativelyResponse, type UseCollateralWeightsResponse, UseContractWriteApi, type UseIsBadCollateralResponse, type UseMultipleTokenInformationResponse, type UsePollAllowancesArgs, type UsePollAllowancesResponse, type UsePollBalancesResponse, type UsePollMarketsResponse, type UsePollProposalResponse, type UsePollValidatorInfoResponse, type UsePollWalletBalancesArgs, type UseRewardVaultResponse, type UseStakingTokenInformationResponse, type UseTokenInformationArgs, type UseTokenInformationResponse, useAggregatorsQuotes, useAggregatorsRouterFeeBps, useAllUserPools, useAllUserPoolsQueryKey, useAllValidators, useAllValidatorsQueryKey, useApiEnrichedAllocation, useApiPool, useApiPoolQueryKey, useApiValidator, useApiValidatorQueryKey, useBaselineRewardAllocation, useBendDemultiply, useBendMultiply, useBendZapSupply, useBendZapSupplyHelper, useBeraContractWrite, useBeraCurrentPrice, useBgtAprSimulation, useBgtUnstakedBalance, useBlockToTimestamp, useCappedGlobally, useCappedRelatively, useClaimableFees, useCollateralWeights, useCreatePool, useCreateProposal, useDailyValidatorBlockStats, useDefaultRewardAllocation, useEnsoSwapBundle, useEnsoUserTokensWithBalances, useExploitedTokens, useExploitedTokensQueryKey, useGetConvertToAssets, useGetPastVotes, useGetVerifiedAbi, useGlobalLiquidityAndSwapVolume, useHasVoted, useHighestVaultsAPR, useHistoryState, useHoneyAlerts, useHoneyBalances, useHoneyChartData, useHoneyGlobalData, useHoneyVaultsBalance, useIsBadCollateralAsset, useIsBasketModeEnabled, useIsCanceller, useLiquidityMismatch, useLpPosition, useManagedValidatorRole, useMultipleTokenApprovalsWithSlippage, useMultipleTokenInformation, type useMultipleTokenInformationArgs, useOnChainPoolData, useOnChainPoolDataQueryKey, useOnChainValidator, usePollAllProposals, usePollAllProposalsQueryKey, usePollAllowances, usePollBalance, usePollGlobalData, usePollMarkets, usePollMarketsQueryKey, usePollPoolCreationRelayerApproval, usePollProposal, usePollProposalThreshold, usePollProposalVotes, usePollProposalVotesQueryKey, usePollUserDelegates, usePollWalletBalances, usePool, usePoolEvents, usePoolHistoricalData, usePools, usePoolsQueryKey, usePrevious, usePriceImpact, useProposalFromTx, useProposalSnapshot, useProposalState, useProposalTimelockState, usePythLatestPrices, usePythUpdateFee, useQueuedBeraUnlock, useQuorum, useRewardTokenToBeraRate, useRewardVault, useRewardVaultBalanceFromStakingToken, useRewardVaultFromToken, useRewardVaultIncentives, useRewardVaultQueryKey, useRewardVaultRewards, useRewardVaults, useRewardVaultsQueryKey, useSingleAggregatorQuote, useStakedAPR, useStakedData, useStakedSnapshots, useStakingPoolBatch, useStakingTokenInformation, type useStakingTokenInformationArgs, useStakingVaultsMetadata, useTokenCurrentPrice, useTokenCurrentPrices, useTokenInformation, useTokenPrice, useTokenPrices, useTokens, useTotalStakedAmount, useTotalSupply, useUserActiveValidators, useUserBoostsOnValidator, useUserClaimableIncentives, useUserStakingPositions, useUserVaultInfo, useUserVaults, useValidator, useValidatorAnalytics, useValidatorCommission, useValidatorEstimatedBgtPerYear, useValidatorQueuedCommission, useValidatorQueuedOperatorAddress, useValidatorQueuedRewardAllocation, useValidatorRewardAllocation, useVaultAddress, useVaultHistory, useVaultValidators, useZapStakeBera };