@berachain/berajs 0.2.8-beta.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BeraError-_mQdkanr.d.cts → BeraError-7-A5JYy_.d.ts} +31 -2
- package/dist/{HoneyConfigProvider-DVP_9KZn.d.ts → HoneyConfigProvider-Dkj-_a5x.d.ts} +1 -1
- package/dist/{RequestError-BRIiJgHk.d.ts → RequestError-DBOIV65x.d.ts} +1 -1
- package/dist/abi/exports.mjs +4452 -2
- package/dist/actions/clients/exports.d.ts +78 -0
- package/dist/actions/clients/exports.mjs +21 -0
- package/dist/actions/exports.d.ts +154 -207
- package/dist/actions/exports.mjs +853 -2
- package/dist/actions/governance/exports.d.ts +140 -0
- package/dist/actions/governance/exports.mjs +226 -0
- package/dist/actions/server/exports.d.ts +13 -0
- package/dist/actions/server/exports.mjs +27 -0
- package/dist/chunk-3JJLQ2JX.mjs +211 -0
- package/dist/chunk-7YVNSDXG.mjs +86 -0
- package/dist/chunk-AUOPN6NK.mjs +96 -0
- package/dist/chunk-BGMRHTBQ.mjs +23 -0
- package/dist/chunk-CDK4YV3D.mjs +571 -0
- package/dist/chunk-DKMAIU74.mjs +62 -0
- package/dist/chunk-DQRH5VE3.mjs +25 -0
- package/dist/chunk-E7YFXBBQ.mjs +349 -0
- package/dist/chunk-GUURQAME.mjs +326 -0
- package/dist/chunk-GY6B3PD5.mjs +89 -0
- package/dist/chunk-HQCOU6GY.mjs +243 -0
- package/dist/chunk-HYDP32P6.mjs +135 -0
- package/dist/chunk-IXIBY5FP.mjs +80 -0
- package/dist/chunk-KHXJDYA4.mjs +1776 -0
- package/dist/chunk-NBYLMO2L.mjs +14 -0
- package/dist/chunk-O2NQFKJK.mjs +170 -0
- package/dist/chunk-P5WXXULM.mjs +54 -0
- package/dist/chunk-QBBOWFMH.mjs +4129 -0
- package/dist/chunk-QVHEM4BG.mjs +35 -0
- package/dist/chunk-SGIJVHZO.mjs +12 -0
- package/dist/chunk-SZ5C44L5.mjs +35 -0
- package/dist/chunk-WNBWX23Q.mjs +426 -0
- package/dist/chunk-Y6THHG77.mjs +126 -0
- package/dist/chunk-ZLTMIFCZ.mjs +165 -0
- package/dist/contexts/exports.d.ts +2 -2
- package/dist/contexts/exports.mjs +85 -2
- package/dist/enum/exports.d.ts +1 -1
- package/dist/enum/exports.mjs +46 -2
- package/dist/enum/governance/exports.d.ts +60 -0
- package/dist/enum/governance/exports.mjs +14 -0
- package/dist/errors/exports.d.ts +4 -3
- package/dist/errors/exports.mjs +48 -2
- package/dist/getApolloClient-BcUTGFUb.d.ts +40 -0
- package/dist/{getValidatorQueuedOperatorAddress-BcyxE9uw.d.ts → getValidatorQueuedOperatorAddress-DphU3qhE.d.ts} +2 -2
- package/dist/{global.d-5w_lvl2J.d.ts → global.d-BuGDKh4k.d.ts} +4 -240
- package/dist/hooks/exports.d.ts +83 -226
- package/dist/hooks/exports.mjs +7463 -4
- package/dist/hooks/governance/exports.d.ts +181 -0
- package/dist/hooks/governance/exports.mjs +888 -0
- package/dist/pol.d-Dw5SQcRX.d.ts +153 -0
- package/dist/{txnEnum-7_o92X3N.d.cts → txnEnum-ByI5dtDi.d.ts} +2 -60
- package/dist/types/exports.d.ts +9 -9
- package/dist/types/exports.mjs +0 -1
- package/dist/types/governance/exports.d.ts +109 -0
- package/dist/types/governance/exports.mjs +0 -0
- package/dist/{useHoneySwapState-B494PQDl.d.ts → useHoneySwapState-vFmuFF0g.d.ts} +1 -1
- package/dist/utils/exports.d.ts +15 -6
- package/dist/utils/exports.mjs +827 -2
- package/package.json +49 -13
- package/src/actions/__test/transports.ts +61 -0
- package/src/actions/clients/exports.ts +7 -0
- package/src/actions/clients/fetchBeep.ts +34 -0
- package/src/actions/clients/fetchOpenApi.ts +93 -0
- package/src/actions/clients/fetchOpenApi.unit.test.ts +223 -0
- package/src/actions/clients/fetchRailwayBackend.ts +34 -0
- package/src/actions/clients/getApolloClient.ts +58 -23
- package/src/actions/clients/getEnsoClient.ts +20 -9
- package/src/actions/dex/aggregators/enso/enso.ts +27 -17
- package/src/actions/dex/aggregators/enso/ensoErc4626.ts +2 -2
- package/src/actions/dex/aggregators/kyberswap.ts +18 -23
- package/src/actions/enso/__tests__/getEnsoUserTokensWithBalances.debug.test.ts +3 -6
- package/src/actions/enso/getEnsoUserTokensWithBalances.ts +18 -0
- package/src/actions/exports.ts +5 -9
- package/src/actions/governance/exports.ts +9 -0
- package/src/actions/governance/getAllProposals.ts +10 -65
- package/src/actions/governance/getProposalDetails.ts +6 -33
- package/src/actions/governance/getProposalVotes.ts +8 -15
- package/src/actions/honey/getChartData.ts +27 -21
- package/src/actions/honey/getHoney24hVolume.ts +19 -22
- package/src/actions/honey/getPythLatestPrices.ts +7 -0
- package/src/actions/pol/__tests__/rewardVaults.integration.test.ts +1 -1
- package/src/actions/pol/getAutoclaimedIncentives.ts +41 -0
- package/src/actions/pol/getAutoclaimedIncentivesTxHash.ts +41 -0
- package/src/actions/pol/getBeraTokenTotalSupply.ts +45 -0
- package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +28 -0
- package/src/actions/pol/getEarnedStakedBeraVault.ts +20 -20
- package/src/actions/pol/getGlobalData.ts +1 -0
- package/src/actions/pol/getHeroEarnVaults.ts +62 -0
- package/src/actions/pol/getIncentiveFeeClaimStats.ts +19 -38
- package/src/actions/pol/getRewardVaults.ts +4 -4
- package/src/actions/pol/getSWBeraVaultMetadata.ts +1 -1
- package/src/actions/pol/getStakingDailyAssets.ts +18 -17
- package/src/actions/server/exports.ts +1 -0
- package/src/actions/server/getDailyValidatorBlockStats.ts +33 -0
- package/src/actions/tokens/getWalletBalances.integration.test.ts +3 -6
- package/src/actions/transactions/beraWriteContract.integration.test.ts +3 -6
- package/src/actions/validators/getDailyValidatorBlockStats.ts +25 -24
- package/src/actions/validators/getValidatorAnalytics.ts +20 -21
- package/src/actions/validators/getValidatorIncentiveDistribution.ts +33 -0
- package/src/actions/validators/utils/getValidatorBoostApy.ts +1 -1
- package/src/enum/contracts.ts +1 -0
- package/src/enum/exports.ts +0 -1
- package/src/enum/governance/exports.ts +1 -0
- package/src/errors/BeraError.ts +47 -7
- package/src/errors/BeraTracing.unit.test.ts +65 -0
- package/src/errors/RequestError.ts +25 -4
- package/src/errors/RequestError.unit.test.ts +55 -0
- package/src/errors/errorMap.ts +8 -0
- package/src/errors/exports.ts +5 -0
- package/src/errors/getRevertReason.integration.test.ts +3 -3
- package/src/errors/spanStatus.ts +78 -0
- package/src/errors/spanStatus.unit.test.ts +62 -0
- package/src/hooks/dex/useCreatePool.ts +1 -88
- package/src/hooks/dex/useOnChainPoolData.ts +27 -2
- package/src/hooks/dex/usePriceImpact.ts +12 -5
- package/src/hooks/enso/useBendDemultiply.ts +9 -1
- package/src/hooks/enso/useBendMultiply.ts +9 -1
- package/src/hooks/enso/useBendZapSupply.ts +26 -7
- package/src/hooks/enso/useEnsoSwapBundle.ts +17 -3
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +13 -2
- package/src/hooks/exports.ts +3 -15
- package/src/hooks/governance/exports.ts +14 -0
- package/src/hooks/pol/useAutoclaimedIncentives.ts +40 -0
- package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +45 -0
- package/src/hooks/pol/useStakedAPR.ts +2 -2
- package/src/hooks/pol/useStakedSnapshots.ts +5 -9
- package/src/hooks/validators/useValidator.ts +6 -8
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +39 -0
- package/src/types/bribe-boost.d.ts +19 -0
- package/src/types/exports.ts +0 -1
- package/src/types/governance/exports.ts +1 -0
- package/src/utils/beraFetch.ts +9 -3
- package/src/utils/exports.ts +1 -0
- package/src/utils/getServerSideClient.ts +4 -2
- package/src/utils/polyfillAbortSignalAny.ts +53 -0
- package/src/utils/polyfillAbortSignalAny.unit.test.ts +81 -0
- package/src/utils/sanitizeRpcUrl.ts +22 -0
- package/src/utils/tracedTransport.ts +35 -0
- package/dist/BeraError-_mQdkanr.d.ts +0 -94
- package/dist/BexStatusProvider-DRymVlQf.d.cts +0 -70
- package/dist/HoneyConfigProvider-DfkjmzEf.d.cts +0 -390
- package/dist/RequestError-DSUzJ1Iy.d.cts +0 -144
- package/dist/abi/exports.cjs +0 -2
- package/dist/abi/exports.cjs.map +0 -1
- package/dist/abi/exports.d.cts +0 -6574
- package/dist/abi/exports.mjs.map +0 -1
- package/dist/actions/exports.cjs +0 -2
- package/dist/actions/exports.cjs.map +0 -1
- package/dist/actions/exports.d.cts +0 -1650
- package/dist/actions/exports.mjs.map +0 -1
- package/dist/chunk-45HIEVNI.cjs +0 -4
- package/dist/chunk-45HIEVNI.cjs.map +0 -1
- package/dist/chunk-47ILYVHC.mjs +0 -2
- package/dist/chunk-47ILYVHC.mjs.map +0 -1
- package/dist/chunk-575OK77P.mjs +0 -2
- package/dist/chunk-575OK77P.mjs.map +0 -1
- package/dist/chunk-5NVZG5N6.mjs +0 -2
- package/dist/chunk-5NVZG5N6.mjs.map +0 -1
- package/dist/chunk-6DIA6PXV.cjs +0 -2
- package/dist/chunk-6DIA6PXV.cjs.map +0 -1
- package/dist/chunk-6JJIZCVY.cjs +0 -2
- package/dist/chunk-6JJIZCVY.cjs.map +0 -1
- package/dist/chunk-7F72ZH4Q.mjs +0 -2
- package/dist/chunk-7F72ZH4Q.mjs.map +0 -1
- package/dist/chunk-AUA42YIG.mjs +0 -4
- package/dist/chunk-AUA42YIG.mjs.map +0 -1
- package/dist/chunk-BC2WX6O6.cjs +0 -2
- package/dist/chunk-BC2WX6O6.cjs.map +0 -1
- package/dist/chunk-CJOZC5Z2.cjs +0 -2
- package/dist/chunk-CJOZC5Z2.cjs.map +0 -1
- package/dist/chunk-D6L7LTA2.cjs +0 -2
- package/dist/chunk-D6L7LTA2.cjs.map +0 -1
- package/dist/chunk-DDEQFR3M.cjs +0 -2
- package/dist/chunk-DDEQFR3M.cjs.map +0 -1
- package/dist/chunk-GXV2JA36.mjs +0 -2
- package/dist/chunk-GXV2JA36.mjs.map +0 -1
- package/dist/chunk-ISYNEDET.mjs +0 -2
- package/dist/chunk-ISYNEDET.mjs.map +0 -1
- package/dist/chunk-JDDRTHFG.mjs +0 -2
- package/dist/chunk-JDDRTHFG.mjs.map +0 -1
- package/dist/chunk-JDZGYU5T.mjs +0 -2
- package/dist/chunk-JDZGYU5T.mjs.map +0 -1
- package/dist/chunk-LVOXBZMA.cjs +0 -2
- package/dist/chunk-LVOXBZMA.cjs.map +0 -1
- package/dist/chunk-MK5NS5B5.mjs +0 -2
- package/dist/chunk-MK5NS5B5.mjs.map +0 -1
- package/dist/chunk-NAXAZJJY.mjs +0 -2
- package/dist/chunk-NAXAZJJY.mjs.map +0 -1
- package/dist/chunk-NLVWRMGD.mjs +0 -2
- package/dist/chunk-NLVWRMGD.mjs.map +0 -1
- package/dist/chunk-OGBD5YOG.mjs +0 -2
- package/dist/chunk-OGBD5YOG.mjs.map +0 -1
- package/dist/chunk-OGJMSGB2.mjs +0 -2
- package/dist/chunk-OGJMSGB2.mjs.map +0 -1
- package/dist/chunk-OIYXOKTT.cjs +0 -2
- package/dist/chunk-OIYXOKTT.cjs.map +0 -1
- package/dist/chunk-OUD27MU7.cjs +0 -2
- package/dist/chunk-OUD27MU7.cjs.map +0 -1
- package/dist/chunk-PRLVZIKD.mjs +0 -2
- package/dist/chunk-PRLVZIKD.mjs.map +0 -1
- package/dist/chunk-Q2SNRLW3.cjs +0 -2
- package/dist/chunk-Q2SNRLW3.cjs.map +0 -1
- package/dist/chunk-REWME3FY.cjs +0 -2
- package/dist/chunk-REWME3FY.cjs.map +0 -1
- package/dist/chunk-RJN36GBU.mjs +0 -2
- package/dist/chunk-RJN36GBU.mjs.map +0 -1
- package/dist/chunk-RWOICHRW.cjs +0 -2
- package/dist/chunk-RWOICHRW.cjs.map +0 -1
- package/dist/chunk-S4CDSVLK.cjs +0 -2
- package/dist/chunk-S4CDSVLK.cjs.map +0 -1
- package/dist/chunk-SFEULGSX.cjs +0 -2
- package/dist/chunk-SFEULGSX.cjs.map +0 -1
- package/dist/chunk-WBTS6KFG.mjs +0 -2
- package/dist/chunk-WBTS6KFG.mjs.map +0 -1
- package/dist/chunk-WRFDB3QJ.cjs +0 -2
- package/dist/chunk-WRFDB3QJ.cjs.map +0 -1
- package/dist/chunk-XNJLSA6P.cjs +0 -2
- package/dist/chunk-XNJLSA6P.cjs.map +0 -1
- package/dist/contexts/exports.cjs +0 -2
- package/dist/contexts/exports.cjs.map +0 -1
- package/dist/contexts/exports.d.cts +0 -66
- package/dist/contexts/exports.mjs.map +0 -1
- package/dist/defaultFlags-D6KfkTZx.d.cts +0 -10
- package/dist/dex-C_BB0b0O.d.cts +0 -37
- package/dist/enum/exports.cjs +0 -2
- package/dist/enum/exports.cjs.map +0 -1
- package/dist/enum/exports.d.cts +0 -23
- package/dist/enum/exports.mjs.map +0 -1
- package/dist/errors/exports.cjs +0 -2
- package/dist/errors/exports.cjs.map +0 -1
- package/dist/errors/exports.d.cts +0 -327
- package/dist/errors/exports.mjs.map +0 -1
- package/dist/getValidatorQueuedOperatorAddress-Cql_D50j.d.cts +0 -562
- package/dist/global.d-B7IeayVX.d.cts +0 -474
- package/dist/honey-CYm0RWf4.d.cts +0 -14
- package/dist/hooks/exports.cjs +0 -4
- package/dist/hooks/exports.cjs.map +0 -1
- package/dist/hooks/exports.d.cts +0 -1734
- package/dist/hooks/exports.mjs.map +0 -1
- package/dist/polling-BKnyavLI.d.cts +0 -8
- package/dist/txnEnum-7_o92X3N.d.ts +0 -164
- package/dist/types/exports.cjs +0 -1
- package/dist/types/exports.cjs.map +0 -1
- package/dist/types/exports.d.cts +0 -90
- package/dist/types/exports.mjs.map +0 -1
- package/dist/useHoneySwapState-D6vpv19r.d.cts +0 -32
- package/dist/utils/exports.cjs +0 -2
- package/dist/utils/exports.cjs.map +0 -1
- package/dist/utils/exports.d.cts +0 -420
- package/dist/utils/exports.mjs.map +0 -1
- package/src/actions/dex/getIsTokenExploited.ts +0 -63
- package/src/hooks/dex/useExploitedTokens.ts +0 -57
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { paths } from '@berachain/graphql/beep';
|
|
2
|
+
import { HttpLink } from '@berachain/config';
|
|
3
|
+
import { paths as paths$1 } from '@berachain/graphql/api';
|
|
4
|
+
export { g as getApolloClient } from '../../getApolloClient-BcUTGFUb.js';
|
|
5
|
+
export { gql } from '@apollo/client';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A minimal, fully-typed GET helper for our `openapi-typescript`-generated
|
|
9
|
+
* backends. Both backends serve only GETs, so rather than a full OpenAPI client
|
|
10
|
+
* we type a single `fetchOpenApi` against a schema's `paths` and wrap it per
|
|
11
|
+
* backend (`fetchBeep`, `fetchRailwayBackend`).
|
|
12
|
+
*
|
|
13
|
+
* The `path`, its path/query params and the response body are all type-checked
|
|
14
|
+
* against the schema, so route shapes can never drift out of sync with the
|
|
15
|
+
* backend. Requests go through {@link beraFetchJson} so they keep the same
|
|
16
|
+
* Sentry tracing, `RequestError` handling and URL sanitization as the rest of
|
|
17
|
+
* the codebase.
|
|
18
|
+
*/
|
|
19
|
+
/** Any `openapi-typescript` `paths` object. */
|
|
20
|
+
type AnyPaths = Record<string, any>;
|
|
21
|
+
/** Paths in a schema that expose a JSON GET response. */
|
|
22
|
+
type GetPath<Paths extends AnyPaths> = {
|
|
23
|
+
[P in keyof Paths]: Paths[P] extends {
|
|
24
|
+
get: {
|
|
25
|
+
responses: {
|
|
26
|
+
200: {
|
|
27
|
+
content: {
|
|
28
|
+
"application/json": unknown;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} ? P : never;
|
|
34
|
+
}[keyof Paths];
|
|
35
|
+
type GetParams<Paths extends AnyPaths, P extends GetPath<Paths>> = Paths[P]["get"] extends {
|
|
36
|
+
parameters: infer Params;
|
|
37
|
+
} ? Params : never;
|
|
38
|
+
type GetResponse<Paths extends AnyPaths, P extends GetPath<Paths>> = Paths[P]["get"]["responses"][200]["content"]["application/json"];
|
|
39
|
+
type DefinedParams<Paths extends AnyPaths, P extends GetPath<Paths>> = {
|
|
40
|
+
[K in keyof GetParams<Paths, P> as GetParams<Paths, P>[K] extends never ? never : K]: GetParams<Paths, P>[K];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Perform a typed GET against an OpenAPI backend.
|
|
44
|
+
*
|
|
45
|
+
* @param link The backend `HttpLink`. The base URL and monitoring name are
|
|
46
|
+
* read from it.
|
|
47
|
+
* @param path An OpenAPI path template, e.g. `/v0/stake/{vault}/stats-by-day`.
|
|
48
|
+
* @param params Path and query params, typed from the schema for `path`.
|
|
49
|
+
* @param fallbackName Monitoring name to use when `link` is a bare string.
|
|
50
|
+
*/
|
|
51
|
+
declare function fetchOpenApi<Paths extends AnyPaths, P extends GetPath<Paths>>(link: HttpLink, path: P, params: DefinedParams<Paths, P>, fallbackName: string): Promise<GetResponse<Paths, P>>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Typed GET against the next-gen "beep" backend.
|
|
55
|
+
*
|
|
56
|
+
* The `path`, its path/query params and the response are all type-checked
|
|
57
|
+
* against the beep schema (`@berachain/graphql/beep`), so route shapes (e.g.
|
|
58
|
+
* the `/v0/stake/*` namespace) can never drift out of sync with the backend.
|
|
59
|
+
* The base URL is resolved from `config.beep`.
|
|
60
|
+
*
|
|
61
|
+
* @throws if `config.beep` is not set for the active chain. Callers should only
|
|
62
|
+
* reach for beep when `config.beep` is non-null.
|
|
63
|
+
*/
|
|
64
|
+
declare function fetchBeep<P extends GetPath<paths>>(path: P, params: DefinedParams<paths, P>, args?: BeraJS.BaseFunctionArgs): Promise<GetResponse<paths, P>>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Typed GET against the legacy Railway backend.
|
|
68
|
+
*
|
|
69
|
+
* The `path`, its path/query params and the response are all type-checked
|
|
70
|
+
* against the Railway schema (`@berachain/graphql/api`). The base URL is
|
|
71
|
+
* resolved from `config.backend`.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated The Railway backend is being replaced by beep; prefer
|
|
74
|
+
* {@link fetchBeep} where `config.beep` is available.
|
|
75
|
+
*/
|
|
76
|
+
declare function fetchRailwayBackend<P extends GetPath<paths$1>>(path: P, params: DefinedParams<paths$1, P>, args?: BeraJS.BaseFunctionArgs): Promise<GetResponse<paths$1, P>>;
|
|
77
|
+
|
|
78
|
+
export { fetchBeep, fetchOpenApi, fetchRailwayBackend };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fetchBeep,
|
|
3
|
+
fetchOpenApi,
|
|
4
|
+
fetchRailwayBackend
|
|
5
|
+
} from "../../chunk-P5WXXULM.mjs";
|
|
6
|
+
import {
|
|
7
|
+
getApolloClient,
|
|
8
|
+
gql
|
|
9
|
+
} from "../../chunk-3JJLQ2JX.mjs";
|
|
10
|
+
import "../../chunk-Y6THHG77.mjs";
|
|
11
|
+
import "../../chunk-DQRH5VE3.mjs";
|
|
12
|
+
import "../../chunk-SZ5C44L5.mjs";
|
|
13
|
+
import "../../chunk-ZLTMIFCZ.mjs";
|
|
14
|
+
import "../../chunk-KHXJDYA4.mjs";
|
|
15
|
+
export {
|
|
16
|
+
fetchBeep,
|
|
17
|
+
fetchOpenApi,
|
|
18
|
+
fetchRailwayBackend,
|
|
19
|
+
getApolloClient,
|
|
20
|
+
gql
|
|
21
|
+
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { V as ValidatorRewardAllocation } from '../getValidatorQueuedOperatorAddress-
|
|
2
|
-
export { B as BaseAggregator, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, b as GetConvertToAssetsProps, c as GetGaugeData, d as GetHoneyVaultsBalanceResponse, e as GetMarkets, f as GetRewardVaultRewardsReturn, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, i as GlobalData, I as IsBadCollateralArgs, j as IsBadCollateralResponse, O as OnChainPool, P as PoolStatus, R as RewardVaultDistributionMode, k as RewardVaultIncentive, S as StakedBeraWithdrawal, U as UserBoostsOnValidator, l as UserStakingPoolPosition, m as UserVault, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress, p as ValidatorRewardAllocationRaw, q as ValidatorRewardAllocationUpdate, r as ValidatorRewardAllocationUpdateWithExpiration, s as ValidatorWithUserBoost, t as VaultMetadata, u as formatValidatorRewardAllocation, v as getBgtAprSimulation, w as getConvertToAssets, x as getGlobalData, y as getHoneyVaultsBalance, z as getMarkets, A as getOnChainPool, C as getPoolPausedState, D as getRewardVaultIncentives, E as getRewardVaultRewards, F as getRewardVaults, H as getSWBeraVaultMetadata, J as getSWBeraWithdrawal, K as getUserActiveValidators, L as getUserBoostsOnValidator, M as getUserStakingPositions, N as getUserVaults, Q as getValidatorQueuedCommission, T as getValidatorQueuedOperatorAddress, W as getValidatorRewardAllocation, X as getVaultHistory, Y as isBadCollateralAsset, Z as isSameRewardAllocation } from '../getValidatorQueuedOperatorAddress-
|
|
3
|
-
import { Address, PublicClient,
|
|
4
|
-
|
|
5
|
-
export { gql } from '@apollo/client';
|
|
1
|
+
import { V as ValidatorRewardAllocation } from '../getValidatorQueuedOperatorAddress-DphU3qhE.js';
|
|
2
|
+
export { B as BaseAggregator, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, b as GetConvertToAssetsProps, c as GetGaugeData, d as GetHoneyVaultsBalanceResponse, e as GetMarkets, f as GetRewardVaultRewardsReturn, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, i as GlobalData, I as IsBadCollateralArgs, j as IsBadCollateralResponse, O as OnChainPool, P as PoolStatus, R as RewardVaultDistributionMode, k as RewardVaultIncentive, S as StakedBeraWithdrawal, U as UserBoostsOnValidator, l as UserStakingPoolPosition, m as UserVault, n as ValidatorQueuedCommission, o as ValidatorQueuedOperatorAddress, p as ValidatorRewardAllocationRaw, q as ValidatorRewardAllocationUpdate, r as ValidatorRewardAllocationUpdateWithExpiration, s as ValidatorWithUserBoost, t as VaultMetadata, u as formatValidatorRewardAllocation, v as getBgtAprSimulation, w as getConvertToAssets, x as getGlobalData, y as getHoneyVaultsBalance, z as getMarkets, A as getOnChainPool, C as getPoolPausedState, D as getRewardVaultIncentives, E as getRewardVaultRewards, F as getRewardVaults, H as getSWBeraVaultMetadata, J as getSWBeraWithdrawal, K as getUserActiveValidators, L as getUserBoostsOnValidator, M as getUserStakingPositions, N as getUserVaults, Q as getValidatorQueuedCommission, T as getValidatorQueuedOperatorAddress, W as getValidatorRewardAllocation, X as getVaultHistory, Y as isBadCollateralAsset, Z as isSameRewardAllocation } from '../getValidatorQueuedOperatorAddress-DphU3qhE.js';
|
|
3
|
+
import { Address, PublicClient, Abi, ContractFunctionArgs, ContractFunctionName, TransactionReceipt, WalletCallReceipt } from 'viem';
|
|
4
|
+
export { B as BeraApolloClient, g as getApolloClient } from '../getApolloClient-BcUTGFUb.js';
|
|
6
5
|
import { EnsoClient } from '@ensofinance/sdk';
|
|
7
6
|
import { PoolState } from '@berachain-foundation/berancer-sdk';
|
|
8
7
|
export { BalancerApi } from '@berachain-foundation/berancer-sdk';
|
|
9
8
|
import * as _berachain_graphql_dex_api from '@berachain/graphql/dex/api';
|
|
10
9
|
import { GetPoolsQueryVariables, GetGlobalLiquidityAndSwapVolumeQuery, GetPoolEventsQuery, GqlChain, PoolHistoricalDataFragment, MinimalPoolFragment } from '@berachain/graphql/dex/api';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
import { C as CustomProposal, G as GovernanceTopic, a as CustomProposalErrors, S as StakingConfig, B as BribeBoostRewardProof, b as BribeBoostRewardItem, U as UserVaultInfo, I as IContractWrite } from '../global.d-5w_lvl2J.js';
|
|
15
|
-
import graymatter from 'gray-matter';
|
|
10
|
+
import { FetchPolicy } from '@apollo/client';
|
|
11
|
+
export { gql } from '@apollo/client';
|
|
12
|
+
import { GqlPoolEventType, ApiVaultFragment, GetHeroEarnVaultsQuery, GqlChain as GqlChain$1, GqlVaultSnapshotDataRange, GetSWberaVaultSnapshotsQuery, ApiValidatorFragment, GetValidatorsQueryVariables, GetValidatorsQuery, ApiRewardAllocationWeightFragment, GetValidatorQuery, ApiValidatorMinimalFragment, ApiValidatorRewardAllocationWeightFragment, ApiMinimalVaultIncentiveFragment } from '@berachain/graphql/pol/api';
|
|
16
13
|
import { GetSnapshotsQuery } from '@berachain/graphql/honey';
|
|
17
|
-
import { b as Token, P as PythLatestUpdates, a as TokenWithMetadata, T as TokenWithOrder, h as PythPriceFeedMap, i as TokenCurrentPriceMap, A as AllowanceQueryItem, j as AllowanceToken, M as MinimalERC20, B as BalanceToken } from '../HoneyConfigProvider-
|
|
18
|
-
export { C as CollateralRates, k as CollateralRatesArgs, l as HoneyFeeMap, m as HoneyPreviewArgs, n as HoneyPreviewMethod, o as HoneyPreviewReadResult, p as HoneyPreviewResult, q as getHoneyFees, r as getHoneyPreview, s as getPythLatestPrices } from '../HoneyConfigProvider-
|
|
14
|
+
import { b as Token, P as PythLatestUpdates, a as TokenWithMetadata, T as TokenWithOrder, h as PythPriceFeedMap, i as TokenCurrentPriceMap, A as AllowanceQueryItem, j as AllowanceToken, M as MinimalERC20, B as BalanceToken } from '../HoneyConfigProvider-Dkj-_a5x.js';
|
|
15
|
+
export { C as CollateralRates, k as CollateralRatesArgs, l as HoneyFeeMap, m as HoneyPreviewArgs, n as HoneyPreviewMethod, o as HoneyPreviewReadResult, p as HoneyPreviewResult, q as getHoneyFees, r as getHoneyPreview, s as getPythLatestPrices } from '../HoneyConfigProvider-Dkj-_a5x.js';
|
|
19
16
|
import BigNumber from '@berachain/utils/pkg/bignumber.js';
|
|
20
17
|
import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
|
|
21
18
|
import { honeyFactoryAbi } from '@berachain/abis/honey/honeyFactory';
|
|
22
19
|
import { honeyFactoryPythWrapperAbi } from '@berachain/abis/honey/honeyFactoryPythWrapper';
|
|
23
|
-
import { I as IHoneySwapState } from '../useHoneySwapState-
|
|
20
|
+
import { I as IHoneySwapState } from '../useHoneySwapState-vFmuFF0g.js';
|
|
21
|
+
import { A as AutoclaimedIncentivesResponse, a as AutoclaimedIncentivesTxHashResponse, S as StakingConfig, B as BribeBoostRewardProof, b as BribeBoostRewardItem, U as UserVaultInfo } from '../pol.d-Dw5SQcRX.js';
|
|
22
|
+
import * as _berachain_graphql_beep from '@berachain/graphql/beep';
|
|
24
23
|
import { Address as Address$1, ChainId } from '@berachain/config';
|
|
25
24
|
import { Config } from '@wagmi/core';
|
|
25
|
+
import { I as IContractWrite } from '../global.d-BuGDKh4k.js';
|
|
26
26
|
import { GetValidatorBlockStatsQuery, GetValidatorAnalyticsQuery } from '@berachain/graphql/pol/subgraph';
|
|
27
27
|
import '@berachain/config/internal';
|
|
28
28
|
import '../dex-C_BB0b0O.js';
|
|
29
|
-
import 'swr';
|
|
30
|
-
import '../BeraError-_mQdkanr.js';
|
|
31
29
|
import 'react/jsx-runtime';
|
|
32
30
|
import 'react';
|
|
33
31
|
import '../honey-CYm0RWf4.js';
|
|
32
|
+
import 'swr';
|
|
33
|
+
import '../txnEnum-ByI5dtDi.js';
|
|
34
|
+
import '../BeraError-7-A5JYy_.js';
|
|
34
35
|
|
|
35
36
|
interface GetMaxDepositProps {
|
|
36
37
|
vaultAddress: Address;
|
|
@@ -38,38 +39,14 @@ interface GetMaxDepositProps {
|
|
|
38
39
|
}
|
|
39
40
|
declare function getMaxDeposit({ vaultAddress, publicClient, }: GetMaxDepositProps): Promise<string>;
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
* This is a wrapper around the ApolloClient that throws a BeraError if the query returns an error or no data.
|
|
43
|
-
*
|
|
44
|
-
* It's mostly a typescript helper that keeps data always defined since we use errorPolicy: "none" by default.
|
|
45
|
-
* Such setting will throw an error if the query returns an error, rather than returning an object with undefined data and an error property.
|
|
46
|
-
*/
|
|
47
|
-
declare class BeraApolloClient extends ApolloClient {
|
|
42
|
+
declare function getEnsoClient({ baseURL, ...args }?: BeraJS.BaseFunctionArgs & {
|
|
48
43
|
/**
|
|
49
|
-
*
|
|
44
|
+
* Override the Enso API base URL.
|
|
45
|
+
*
|
|
46
|
+
* - Omit (or pass `undefined`) → external proxy in production, direct in dev/test
|
|
47
|
+
* - Pass a URL string (e.g. `"/api/enso"`) → route through that proxy
|
|
50
48
|
*/
|
|
51
|
-
|
|
52
|
-
protected serviceName: string;
|
|
53
|
-
constructor(options: ApolloClient.Options & {
|
|
54
|
-
/**
|
|
55
|
-
* The URL of the endpoint. Used for error reporting only.
|
|
56
|
-
*/
|
|
57
|
-
url: string;
|
|
58
|
-
/**
|
|
59
|
-
* The name of the graphql service. Used for error reporting only.
|
|
60
|
-
*/
|
|
61
|
-
name: string;
|
|
62
|
-
});
|
|
63
|
-
query<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: Omit<ApolloClient.QueryOptions<TData, TVariables>, "errorPolicy">): Promise<{
|
|
64
|
-
data: TData;
|
|
65
|
-
}>;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
type GraphqlClient = "honey.subgraph" | "pol.subgraph" | "pol.fees" | "governance.subgraph" | "bex.subgraph" | "api" | "bend.whisk";
|
|
69
|
-
declare function getApolloClient(clientName: GraphqlClient, { ...args }: BeraJS.BaseFunctionArgs): BeraApolloClient;
|
|
70
|
-
|
|
71
|
-
declare function getEnsoClient({ useProxy, ...args }?: BeraJS.BaseFunctionArgs & {
|
|
72
|
-
useProxy?: boolean;
|
|
49
|
+
baseURL?: string;
|
|
73
50
|
}): EnsoClient;
|
|
74
51
|
|
|
75
52
|
declare function getAllPools({ textSearch, chain, first, orderBy, orderDirection, skip, fetchPolicy, userAddress, blacklistedPoolIds, ...args }?: Partial<GetPoolsQueryVariables & {
|
|
@@ -121,8 +98,7 @@ declare function getAllPools({ textSearch, chain, first, orderBy, orderDirection
|
|
|
121
98
|
__typename?: "GqlRewardVaultDynamicData";
|
|
122
99
|
activeIncentivesValueUsd: string;
|
|
123
100
|
apr?: number | null;
|
|
124
|
-
|
|
125
|
-
allTimeReceivedBGTAmount: string;
|
|
101
|
+
rewardCapturePercentage: number;
|
|
126
102
|
} | null;
|
|
127
103
|
} | null;
|
|
128
104
|
}[];
|
|
@@ -177,8 +153,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
177
153
|
__typename?: "GqlRewardVaultDynamicData";
|
|
178
154
|
activeIncentivesValueUsd: string;
|
|
179
155
|
apr?: number | null;
|
|
180
|
-
|
|
181
|
-
allTimeReceivedBGTAmount: string;
|
|
156
|
+
rewardCapturePercentage: number;
|
|
182
157
|
} | null;
|
|
183
158
|
} | null;
|
|
184
159
|
} | {
|
|
@@ -226,8 +201,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
226
201
|
__typename?: "GqlRewardVaultDynamicData";
|
|
227
202
|
activeIncentivesValueUsd: string;
|
|
228
203
|
apr?: number | null;
|
|
229
|
-
|
|
230
|
-
allTimeReceivedBGTAmount: string;
|
|
204
|
+
rewardCapturePercentage: number;
|
|
231
205
|
} | null;
|
|
232
206
|
} | null;
|
|
233
207
|
} | {
|
|
@@ -275,8 +249,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
275
249
|
__typename?: "GqlRewardVaultDynamicData";
|
|
276
250
|
activeIncentivesValueUsd: string;
|
|
277
251
|
apr?: number | null;
|
|
278
|
-
|
|
279
|
-
allTimeReceivedBGTAmount: string;
|
|
252
|
+
rewardCapturePercentage: number;
|
|
280
253
|
} | null;
|
|
281
254
|
} | null;
|
|
282
255
|
} | {
|
|
@@ -324,8 +297,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
324
297
|
__typename?: "GqlRewardVaultDynamicData";
|
|
325
298
|
activeIncentivesValueUsd: string;
|
|
326
299
|
apr?: number | null;
|
|
327
|
-
|
|
328
|
-
allTimeReceivedBGTAmount: string;
|
|
300
|
+
rewardCapturePercentage: number;
|
|
329
301
|
} | null;
|
|
330
302
|
} | null;
|
|
331
303
|
} | {
|
|
@@ -373,8 +345,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
373
345
|
__typename?: "GqlRewardVaultDynamicData";
|
|
374
346
|
activeIncentivesValueUsd: string;
|
|
375
347
|
apr?: number | null;
|
|
376
|
-
|
|
377
|
-
allTimeReceivedBGTAmount: string;
|
|
348
|
+
rewardCapturePercentage: number;
|
|
378
349
|
} | null;
|
|
379
350
|
} | null;
|
|
380
351
|
} | {
|
|
@@ -422,8 +393,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
422
393
|
__typename?: "GqlRewardVaultDynamicData";
|
|
423
394
|
activeIncentivesValueUsd: string;
|
|
424
395
|
apr?: number | null;
|
|
425
|
-
|
|
426
|
-
allTimeReceivedBGTAmount: string;
|
|
396
|
+
rewardCapturePercentage: number;
|
|
427
397
|
} | null;
|
|
428
398
|
} | null;
|
|
429
399
|
} | {
|
|
@@ -471,8 +441,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
471
441
|
__typename?: "GqlRewardVaultDynamicData";
|
|
472
442
|
activeIncentivesValueUsd: string;
|
|
473
443
|
apr?: number | null;
|
|
474
|
-
|
|
475
|
-
allTimeReceivedBGTAmount: string;
|
|
444
|
+
rewardCapturePercentage: number;
|
|
476
445
|
} | null;
|
|
477
446
|
} | null;
|
|
478
447
|
} | {
|
|
@@ -520,8 +489,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
520
489
|
__typename?: "GqlRewardVaultDynamicData";
|
|
521
490
|
activeIncentivesValueUsd: string;
|
|
522
491
|
apr?: number | null;
|
|
523
|
-
|
|
524
|
-
allTimeReceivedBGTAmount: string;
|
|
492
|
+
rewardCapturePercentage: number;
|
|
525
493
|
} | null;
|
|
526
494
|
} | null;
|
|
527
495
|
}>;
|
|
@@ -552,140 +520,12 @@ declare function getVaultPausedState({ publicClient, ...args }: BeraJS.BaseFunct
|
|
|
552
520
|
publicClient: PublicClient;
|
|
553
521
|
}): Promise<boolean>;
|
|
554
522
|
|
|
555
|
-
type CheckProposalFieldResultMinimal = ProposalErrorCodes | null;
|
|
556
|
-
type CheckProposalFieldResult = ProposalErrorCodes | null | CheckProposalFieldResultMinimal[] | Record<string, CheckProposalFieldResultMinimal>;
|
|
557
|
-
/**
|
|
558
|
-
* Validates a single proposal field or ABI-typed value.
|
|
559
|
-
* Returns `null` if valid, or a `ProposalErrorCodes` value describing the problem.
|
|
560
|
-
*/
|
|
561
|
-
declare function checkProposalField(arg: {
|
|
562
|
-
fieldOrType: "address" | "hex" | "abi" | "string" | "bool" | `uint${string}` | `int${string}` | "action" | "title" | "forumLink" | "description" | "logoURI" | "url";
|
|
563
|
-
value: unknown;
|
|
564
|
-
required?: boolean;
|
|
565
|
-
baseUrl?: string;
|
|
566
|
-
components?: readonly (AbiParameter | readonly AbiParameter[])[];
|
|
567
|
-
}): CheckProposalFieldResultMinimal;
|
|
568
|
-
/**
|
|
569
|
-
* For tuple/tuple[] types, may return nested error structures.
|
|
570
|
-
*/
|
|
571
|
-
declare function checkProposalField(arg: {
|
|
572
|
-
fieldOrType: "tuple[]" | "tuple";
|
|
573
|
-
value: unknown;
|
|
574
|
-
required?: boolean;
|
|
575
|
-
baseUrl?: string;
|
|
576
|
-
components?: readonly (AbiParameter | readonly AbiParameter[])[];
|
|
577
|
-
}): CheckProposalFieldResult;
|
|
578
|
-
|
|
579
|
-
declare const MOCKED_PROPOSAL_STATUSES: readonly ProposalStatus[];
|
|
580
|
-
/**
|
|
581
|
-
* Derives the effective `ProposalStatus` by reconciling subgraph data with the
|
|
582
|
-
* on-chain contract state. Falls back to subgraph timestamps when the on-chain
|
|
583
|
-
* state is unavailable.
|
|
584
|
-
*/
|
|
585
|
-
declare function computeActualStatus(
|
|
586
|
-
/** Subgraph proposal data */
|
|
587
|
-
proposal: ProposalSelectionFragment,
|
|
588
|
-
/** Value returned by the `state` function of the governance contract */
|
|
589
|
-
proposalOnChainState?: ProposalState): ProposalStatus;
|
|
590
|
-
|
|
591
|
-
type GetAllProposalsArgs = BeraJS.BaseFunctionArgs & {
|
|
592
|
-
/** Subgraph filter applied to the proposals query */
|
|
593
|
-
where: Proposal_Filter;
|
|
594
|
-
/** Number of proposals to skip (for pagination) */
|
|
595
|
-
offset?: number;
|
|
596
|
-
/** Maximum proposals per page; must be ≤ 1000 */
|
|
597
|
-
perPage?: number;
|
|
598
|
-
orderBy?: Proposal_OrderBy;
|
|
599
|
-
orderDirection?: OrderDirection;
|
|
600
|
-
/** Full-text search query; switches to the search endpoint when provided */
|
|
601
|
-
text?: string;
|
|
602
|
-
};
|
|
603
|
-
/** Fetches a paginated list of governance proposals from the subgraph */
|
|
604
|
-
declare function getAllProposals({ where, orderBy, orderDirection, offset, perPage, text, ...args }: GetAllProposalsArgs): Promise<ProposalSelectionFragment[] | undefined>;
|
|
605
|
-
|
|
606
|
-
interface GetBodyErrorsArgs {
|
|
607
|
-
/** The proposal to validate */
|
|
608
|
-
proposal: CustomProposal;
|
|
609
|
-
/** The current governance topic, used for forum link base URL validation */
|
|
610
|
-
currentTopic: GovernanceTopic;
|
|
611
|
-
}
|
|
612
|
-
/** Validates the body fields (title, description, forum link) of a proposal */
|
|
613
|
-
declare function getBodyErrors({ proposal, currentTopic, }: GetBodyErrorsArgs): CustomProposalErrors;
|
|
614
|
-
|
|
615
|
-
interface GetDecodedFunctionDataArgs {
|
|
616
|
-
/** Contract address that emitted the calldata */
|
|
617
|
-
address: Address;
|
|
618
|
-
/** Raw calldata to decode */
|
|
619
|
-
callData: `0x${string}`;
|
|
620
|
-
/** @default defaultChainId */
|
|
621
|
-
chainId?: number;
|
|
622
|
-
publicClient: PublicClient;
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Decodes the function data from a given contract address and calldata.
|
|
626
|
-
*
|
|
627
|
-
* Attempts to decode using a known set of ABIs first, then falls back to
|
|
628
|
-
* fetching the ABI from the block-explorer API.
|
|
629
|
-
*
|
|
630
|
-
* @returns An object with the decoded ABI item, function signature, function name, and arguments.
|
|
631
|
-
*/
|
|
632
|
-
declare function getDecodedFunctionData({ address, callData, chainId, publicClient, }: GetDecodedFunctionDataArgs): Promise<{
|
|
633
|
-
args: never[];
|
|
634
|
-
abiItem?: undefined;
|
|
635
|
-
functionSignature?: undefined;
|
|
636
|
-
functionName?: undefined;
|
|
637
|
-
} | {
|
|
638
|
-
abiItem: AbiFunction | undefined;
|
|
639
|
-
functionSignature: string | undefined;
|
|
640
|
-
functionName: string;
|
|
641
|
-
args: unknown[];
|
|
642
|
-
}>;
|
|
643
|
-
|
|
644
|
-
type GetProposalDetailsArgs = BeraJS.BaseFunctionArgs & {
|
|
645
|
-
/** On-chain proposal ID */
|
|
646
|
-
proposalId: string;
|
|
647
|
-
client?: PublicClient;
|
|
648
|
-
};
|
|
649
|
-
/** Fetches a single proposal with its vote data from the subgraph */
|
|
650
|
-
declare function getProposalDetails({ proposalId, ...args }: GetProposalDetailsArgs): Promise<ProposalWithVotesFragment | undefined>;
|
|
651
|
-
|
|
652
|
-
type GetProposalFromTxArgs = {
|
|
653
|
-
/** Viem public client used to fetch block and receipt data */
|
|
654
|
-
publicClient: PublicClient | undefined;
|
|
655
|
-
} & ({
|
|
656
|
-
/** Pre-fetched transaction receipt */
|
|
657
|
-
tx: TransactionReceipt;
|
|
658
|
-
} | {
|
|
659
|
-
/** Transaction hash to look up */
|
|
660
|
-
txHash: Address;
|
|
661
|
-
});
|
|
662
|
-
/**
|
|
663
|
-
* Reconstructs a `ProposalWithVotesFragment` from the `ProposalCreated` event
|
|
664
|
-
* emitted in a given transaction. Returns `null` if the event is not found.
|
|
665
|
-
*/
|
|
666
|
-
declare function getProposalFromTx(args: GetProposalFromTxArgs): Promise<ProposalWithVotesFragment | null>;
|
|
667
|
-
|
|
668
|
-
type GetProposalVotesArgs = BeraJS.BaseFunctionArgs & {
|
|
669
|
-
/** GraphQL variables forwarded to the GetProposalVotes query */
|
|
670
|
-
variables: GetProposalVotesQueryVariables;
|
|
671
|
-
};
|
|
672
|
-
/** Fetches the votes for a proposal from the subgraph */
|
|
673
|
-
declare function getProposalVotes({ variables, ...args }: GetProposalVotesArgs): Promise<{
|
|
674
|
-
data: GetProposalVotesQuery;
|
|
675
|
-
}>;
|
|
676
|
-
|
|
677
|
-
type ParseProposalBodyResult = graymatter.GrayMatterFile<string> & {
|
|
678
|
-
/** Whether the body uses YAML front-matter (true) or legacy heading format (false) */
|
|
679
|
-
isFrontMatter: boolean;
|
|
680
|
-
};
|
|
681
523
|
/**
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
*
|
|
524
|
+
* Browser-only. Hits the typed `/api/honey/snapshots` endpoint.
|
|
525
|
+
* Server callers must compose the upstream query directly (this action is
|
|
526
|
+
* not server-safe — `fetch` against a relative URL has no origin off-browser).
|
|
685
527
|
*/
|
|
686
|
-
declare function
|
|
687
|
-
|
|
688
|
-
declare function getChartData({ days, ...args }: BeraJS.BaseFunctionArgs & {
|
|
528
|
+
declare function getChartData({ days, }: {
|
|
689
529
|
days: number;
|
|
690
530
|
}): Promise<GetSnapshotsQuery>;
|
|
691
531
|
|
|
@@ -725,7 +565,8 @@ interface GetGlobalCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
|
725
565
|
*/
|
|
726
566
|
declare function getGlobalCapLimit({ client, asset, amount, isMint, isPythWrapperEnabled, latestPrices, ...args }: GetGlobalCapLimitArgs): Promise<boolean | undefined>;
|
|
727
567
|
|
|
728
|
-
|
|
568
|
+
/** Browser-only. Hits `/api/honey/snapshots?interval=hour&first=24` and reduces. */
|
|
569
|
+
declare function getHoney24hVolume(): Promise<BigNumber | undefined>;
|
|
729
570
|
|
|
730
571
|
interface GetHoneyCollateralsArgs extends BeraJS.BaseFunctionArgs {
|
|
731
572
|
/**
|
|
@@ -838,17 +679,52 @@ declare function getBlockTimestamp({ block, currentBlock, blockTime, publicClien
|
|
|
838
679
|
timestamp: number;
|
|
839
680
|
}>;
|
|
840
681
|
|
|
682
|
+
/**
|
|
683
|
+
* Server-side function to fetch the incentives the bot autoclaimed on behalf
|
|
684
|
+
* of a wallet during the BGT → BERA cutover. Only valid to call once the
|
|
685
|
+
* bgtIncentiveDistributor contract is paused.
|
|
686
|
+
*
|
|
687
|
+
* Returns `null` on 404 — the endpoint 404s when the bot has not yet processed
|
|
688
|
+
* the wallet, which is a normal "no data yet" state rather than an error.
|
|
689
|
+
*/
|
|
690
|
+
declare function getAutoclaimedIncentives({ account, ...args }: {
|
|
691
|
+
account: Address;
|
|
692
|
+
} & BeraJS.BaseFunctionArgs): Promise<AutoclaimedIncentivesResponse | null>;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Companion to `getAutoclaimedIncentives` that fetches the on-chain tx hash
|
|
696
|
+
* for each autoclaimed token. Same nested shape as `/autoclaimed`, but each
|
|
697
|
+
* token leaf is `{ txhash }` where the hash may be absent or empty while the
|
|
698
|
+
* bot is still in flight.
|
|
699
|
+
*
|
|
700
|
+
* Returns `null` on 404 (bot has not run yet for this wallet).
|
|
701
|
+
*/
|
|
702
|
+
declare function getAutoclaimedIncentivesTxHash({ account, ...args }: {
|
|
703
|
+
account: Address;
|
|
704
|
+
} & BeraJS.BaseFunctionArgs): Promise<AutoclaimedIncentivesTxHashResponse | null>;
|
|
705
|
+
|
|
706
|
+
type GetBeraTokenTotalSupplyArgs = BeraJS.BaseFunctionArgs;
|
|
707
|
+
/**
|
|
708
|
+
* Fetches the native BERA total supply (in whole BERA units) from the
|
|
709
|
+
* Berachain supply-monitor service.
|
|
710
|
+
*/
|
|
711
|
+
declare function getBeraTokenTotalSupply(args?: GetBeraTokenTotalSupplyArgs): Promise<string>;
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Reads `paused()` on the BGT incentive distributor. Used to gate the
|
|
715
|
+
* autoclaim banner — when `true`, users can no longer self-claim and the
|
|
716
|
+
* bot is responsible for distributing incentives on their behalf.
|
|
717
|
+
*/
|
|
718
|
+
declare function getBgtIncentiveDistributorPaused({ publicClient, ...args }: {
|
|
719
|
+
publicClient: PublicClient | undefined;
|
|
720
|
+
} & BeraJS.BaseFunctionArgs): Promise<boolean>;
|
|
721
|
+
|
|
841
722
|
declare function getBlockTime({ defaultBlockTime, publicClient, blocksSpan, ...args }: {
|
|
842
723
|
defaultBlockTime?: number;
|
|
843
724
|
blocksSpan?: number;
|
|
844
725
|
publicClient: PublicClient | undefined;
|
|
845
726
|
} & BeraJS.BaseFunctionArgs): Promise<number>;
|
|
846
727
|
|
|
847
|
-
type StakingHistoryData = {
|
|
848
|
-
currentDepositRate: string;
|
|
849
|
-
earningsRealized: string;
|
|
850
|
-
earningsTotal: string;
|
|
851
|
-
};
|
|
852
728
|
type GetEarnedStakedBeraVaultArgs = {
|
|
853
729
|
/**
|
|
854
730
|
* The token that the user has staked
|
|
@@ -859,12 +735,76 @@ type GetEarnedStakedBeraVaultArgs = {
|
|
|
859
735
|
*/
|
|
860
736
|
account: Address;
|
|
861
737
|
};
|
|
862
|
-
declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<
|
|
738
|
+
declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<{
|
|
739
|
+
currentDepositRate: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
740
|
+
earningsTotal: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
741
|
+
earningsRealized: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
742
|
+
earningsUnrealized: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
743
|
+
shareLots: {
|
|
744
|
+
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
745
|
+
depositRate: _berachain_graphql_beep.components["schemas"]["DecimalStr"];
|
|
746
|
+
}[];
|
|
747
|
+
sortedEvents: ({
|
|
748
|
+
_height: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
749
|
+
_log_index: number;
|
|
750
|
+
assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
751
|
+
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
752
|
+
_type: "deposit" | "withdrawal";
|
|
753
|
+
sender: string;
|
|
754
|
+
owner: string;
|
|
755
|
+
total_assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
756
|
+
} | {
|
|
757
|
+
_height: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
758
|
+
_log_index: number;
|
|
759
|
+
assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
760
|
+
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
761
|
+
_type: "transfer";
|
|
762
|
+
from: string;
|
|
763
|
+
to: string;
|
|
764
|
+
value: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
765
|
+
})[];
|
|
766
|
+
}>;
|
|
767
|
+
|
|
768
|
+
interface HeroEarnVaults {
|
|
769
|
+
/**
|
|
770
|
+
* Top-APR PoL reward vaults, ordered by APR descending. Callers typically
|
|
771
|
+
* read `[0]` for the "Earn with PoL" hero subtitle. `bestAprExcludedAddresses`
|
|
772
|
+
* lets callers filter out non-incentivized earn actions whose APR figures
|
|
773
|
+
* would otherwise dominate the listing and mislead users.
|
|
774
|
+
*/
|
|
775
|
+
bestApr: ApiVaultFragment[];
|
|
776
|
+
/**
|
|
777
|
+
* Highest-APR PoL reward vault among vaults whose protocol is "bend".
|
|
778
|
+
* Its `stakingToken.address` is a Bend vault share token — match it back
|
|
779
|
+
* against `bendVaults` to combine the PoL reward APR with the underlying
|
|
780
|
+
* Bend native supply APY.
|
|
781
|
+
*/
|
|
782
|
+
bendRewardVault: ApiVaultFragment[];
|
|
783
|
+
/**
|
|
784
|
+
* Minimal Bend native vault data (address + `totalApy`) used to look up the
|
|
785
|
+
* underlying Bend supply APY for whichever Bend vault `bendRewardVault`
|
|
786
|
+
* resolves to.
|
|
787
|
+
*/
|
|
788
|
+
bendVaults: GetHeroEarnVaultsQuery["bendVaults"];
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Batched fetch for the hub home page hero cards. Issues a single GraphQL
|
|
792
|
+
* request to the BEX API that returns:
|
|
793
|
+
* - the top-APR PoL reward vaults (for the "Earn with PoL" card)
|
|
794
|
+
* - the highest-APR Bend-protocol PoL reward vault (for the "Lend" card)
|
|
795
|
+
* - minimal Bend native vault data, so callers can add the Bend supply APY
|
|
796
|
+
* on top of the PoL reward APR when displaying the combined Lend APY
|
|
797
|
+
*/
|
|
798
|
+
declare function getHeroEarnVaults({ bestAprExcludedAddresses, ...args }?: {
|
|
799
|
+
bestAprExcludedAddresses?: string[];
|
|
800
|
+
} & BeraJS.BaseFunctionArgs): Promise<HeroEarnVaults>;
|
|
863
801
|
|
|
864
|
-
|
|
802
|
+
type IncentiveFeeClaimStats = {
|
|
865
803
|
sumAllClaims: number;
|
|
866
804
|
sumClaimsInLast24Hours: number;
|
|
867
|
-
}
|
|
805
|
+
};
|
|
806
|
+
/** Browser-only. Hits `/api/pol/incentive-fee-claims` (server computes totals). */
|
|
807
|
+
declare function getIncentiveFeeClaimStats(): Promise<IncentiveFeeClaimStats>;
|
|
868
808
|
|
|
869
809
|
type GetLSTStakeConfigArgs = {
|
|
870
810
|
tokenList: TokenWithMetadata[];
|
|
@@ -1592,7 +1532,13 @@ declare function getApiValidator({ id, ...args }: {
|
|
|
1592
1532
|
id: Address;
|
|
1593
1533
|
} & BeraJS.BaseFunctionArgs): Promise<GetValidatorQuery>;
|
|
1594
1534
|
|
|
1595
|
-
|
|
1535
|
+
/**
|
|
1536
|
+
* Browser-only. Hits `/api/pol/validator-block-stats`. Server callers (RSC)
|
|
1537
|
+
* should import from `@berachain/berajs/actions/server` instead — that path
|
|
1538
|
+
* has the static Apollo + GraphQL imports and does not pass through the
|
|
1539
|
+
* browser endpoint.
|
|
1540
|
+
*/
|
|
1541
|
+
declare function getDailyValidatorBlockStats({ pubKey, first, }: {
|
|
1596
1542
|
pubKey: Address;
|
|
1597
1543
|
first?: number;
|
|
1598
1544
|
}): Promise<GetValidatorBlockStatsQuery | undefined>;
|
|
@@ -1614,7 +1560,8 @@ declare function getStakingPoolBatch({ client, valPubKey, }: {
|
|
|
1614
1560
|
valPubKey: `0x${string}`;
|
|
1615
1561
|
}): Promise<number>;
|
|
1616
1562
|
|
|
1617
|
-
|
|
1563
|
+
/** Browser-only. Hits `/api/pol/validator-analytics`. */
|
|
1564
|
+
declare function getValidatorAnalytics({ pubkey, dayRange, }: {
|
|
1618
1565
|
pubkey: Address;
|
|
1619
1566
|
dayRange: number;
|
|
1620
1567
|
}): Promise<GetValidatorAnalyticsQuery | undefined>;
|
|
@@ -1647,4 +1594,4 @@ declare function getValidatorBoostApy({ validator, bgtPrice, }: {
|
|
|
1647
1594
|
bgtPrice: number;
|
|
1648
1595
|
}): number;
|
|
1649
1596
|
|
|
1650
|
-
export { type ActiveBoostAndCommissionChangeDelay,
|
|
1597
|
+
export { type ActiveBoostAndCommissionChangeDelay, type GetAllowances, type GetAllowancesResponse, type GetBeraTokenTotalSupplyArgs, type GetLSTStakeConfigArgs, type GetStakedBeraSnapshotsArgs, type GetTokenInformation, type GetTokenInformationResponse, type GetUserVaultInfoParams, type GetUserVaultsInfo, type GetWalletBalances, type HeroEarnVaults, type IncentiveFeeClaimStats, type PoolDayData, PythLatestUpdates, type RewardVaultDurationConstants, ValidatorRewardAllocation, aggregateValidatorIncentives, beraWriteContract, getActiveBoostAndCommissionChangeDelay, getAllPools, getAllValidators, getAllowances, getApiEnrichedAllocation, getApiPool, getApiValidator, getAutoclaimedIncentives, getAutoclaimedIncentivesTxHash, getBalanceCall, getBeraTokenTotalSupply, getBgtIncentiveDistributorPaused, getBlockTime, getBlockTimestamp, getChartData, getCollateralWeights, getDailyValidatorBlockStats, getDefaultRewardAllocation, getEarnedStakedBeraVault, getEnsoClient, getGlobalCapLimit, getGlobalLiquidityAndSwapVolume, getHeroEarnVaults, getHoney24hVolume, getHoneyCollaterals, getHoneyPausedState, getHoneyPythFeeds, getHoneyPythOracle, getHoneyRootPriceOracle, getIncentiveFeeClaimStats, getLSTStakeConfig, getMaxDeposit, getPoolEvents, getPoolHistoricalData, getPoolState, getPythUpdateFee, getRelativeCapLimit, getRewardProofsByValidator, getRewardTokenToBeraRate, getRewardVault, getRewardVaultDurationConstants, getRewardVaultFromToken, getRewardVaultStakingToken, getStakeWithdrawalCooldown, getStakedBeraAPR, getStakedBeraSnapshots, getStakingPoolBatch, getSwapPayload, getTokenCurrentPrices, getTokenInformation, getTokens, getTotalStakedAmount, getUserClaimableIncentives, getUserVaultInfo, getUserVaultsReward, getValidatorAnalytics, getValidatorBoostApy, getValidatorCommission, getValidatorEstimatedBgtPerYear, getValidatorOperatorAddress, getValidatorQueuedRewardAllocation, getValidatorReturnPerBgt, getVaultPausedState, getVaultValidators, getWalletBalances, isBasketModeEnabled, isDefaultRewardAllocation, isImpersonateAccount };
|