@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.
- 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-DBOIV65x.d.ts +144 -0
- package/dist/abi/exports.mjs +3 -4
- package/dist/actions/clients/exports.d.ts +2 -0
- package/dist/actions/clients/exports.mjs +12 -0
- package/dist/actions/exports.d.ts +108 -187
- package/dist/actions/exports.mjs +97 -158
- 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-VA3BQ34H.mjs → chunk-3EARVV7K.mjs} +20 -9
- package/dist/chunk-4Z4AK6SH.mjs +211 -0
- package/dist/chunk-75M6TF7M.mjs +25 -0
- package/dist/chunk-AFN4CVD3.mjs +326 -0
- package/dist/{chunk-7TFV6UKF.mjs → chunk-BGMRHTBQ.mjs} +0 -1
- package/dist/{chunk-3M47ZRXT.mjs → chunk-CDFWPU2R.mjs} +73 -17
- package/dist/{chunk-GWSTVITN.mjs → chunk-CDK4YV3D.mjs} +0 -1
- package/dist/{chunk-KL6YZ5VR.mjs → chunk-DKMAIU74.mjs} +0 -1
- package/dist/chunk-EXIUPSFN.mjs +86 -0
- package/dist/{chunk-VA5L5FDG.mjs → chunk-FFB5LFDW.mjs} +2 -3
- package/dist/{chunk-ZCEFC2TK.mjs → chunk-HQCOU6GY.mjs} +0 -1
- package/dist/{chunk-SGZP4O6R.mjs → chunk-HSSJKHZ4.mjs} +11 -11
- package/dist/{chunk-7QKRRIHI.mjs → chunk-J5I45WGQ.mjs} +77 -152
- package/dist/chunk-KQUMKB66.mjs +89 -0
- package/dist/{chunk-JA4DHMTG.mjs → chunk-NBYLMO2L.mjs} +0 -1
- package/dist/{chunk-4GFN4LEP.mjs → chunk-NPBQLVL3.mjs} +4 -21
- package/dist/{chunk-I3FTWD6I.mjs → chunk-O2NQFKJK.mjs} +1 -1
- package/dist/{chunk-2R73G2PO.mjs → chunk-QJIXTYTZ.mjs} +121 -765
- package/dist/{chunk-GLWPRM33.mjs → chunk-SGIJVHZO.mjs} +0 -1
- package/dist/chunk-SZ5C44L5.mjs +35 -0
- package/dist/{chunk-5NMATIH4.mjs → chunk-WXXOISTU.mjs} +1 -35
- package/dist/chunk-XIYN6AL6.mjs +160 -0
- package/dist/contexts/exports.d.ts +2 -2
- package/dist/contexts/exports.mjs +11 -9
- package/dist/enum/exports.d.ts +1 -1
- package/dist/enum/exports.mjs +3 -16
- package/dist/enum/governance/exports.d.ts +60 -0
- package/dist/enum/governance/exports.mjs +14 -0
- package/dist/errors/exports.d.ts +5 -90
- package/dist/errors/exports.mjs +19 -10
- package/dist/exports-BcUTGFUb.d.ts +40 -0
- package/dist/{getValidatorQueuedOperatorAddress-BcyxE9uw.d.ts → getValidatorQueuedOperatorAddress-Dw5KN5sh.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 +80 -236
- package/dist/hooks/exports.mjs +609 -1508
- package/dist/hooks/governance/exports.d.ts +181 -0
- package/dist/hooks/governance/exports.mjs +888 -0
- package/dist/pol.d-CqPA9K6m.d.ts +142 -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 +24 -7
- package/dist/utils/exports.mjs +49 -11
- package/package.json +60 -13
- package/src/actions/__test/transports.ts +61 -0
- package/src/actions/clients/BeraApolloClient.ts +9 -0
- package/src/actions/clients/exports.ts +4 -0
- package/src/actions/clients/getApolloClient.ts +70 -25
- package/src/actions/clients/getEnsoClient.ts +20 -9
- package/src/actions/dex/aggregators/base.ts +1 -1
- 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/exports.ts +5 -10
- 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 +27 -0
- package/src/actions/pol/getAutoclaimedIncentives.ts +30 -0
- package/src/actions/pol/getBeraTokenTotalSupply.ts +45 -0
- package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +35 -0
- package/src/actions/pol/getEarnedStakedBeraVault.ts +15 -9
- 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/getSWBeraVaultMetadata.ts +1 -1
- package/src/actions/pol/getStakingDailyAssets.ts +11 -8
- 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/data/contracts.ts +5 -0
- 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 +15 -2
- 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 -16
- package/src/hooks/governance/exports.ts +14 -0
- package/src/hooks/honey/useHoney24hVolume.ts +16 -0
- package/src/hooks/pol/useAutoclaimedIncentives.ts +49 -0
- package/src/hooks/pol/useStakedAPR.ts +2 -2
- package/src/hooks/pol/useStakedSnapshots.ts +5 -9
- package/src/hooks/validators/useValidator.ts +2 -0
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +39 -0
- package/src/types/bribe-boost.d.ts +8 -0
- package/src/types/exports.ts +0 -1
- package/src/types/governance/exports.ts +1 -0
- package/src/utils/beraFetch.ts +76 -15
- package/src/utils/exports.ts +1 -0
- package/src/utils/getServerSideClient.ts +4 -2
- 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-A8XJ6QR9.d.cts +0 -57
- package/dist/RequestError-Dk97z8rm.d.ts +0 -57
- package/dist/abi/exports.cjs +0 -4453
- 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 -914
- package/dist/actions/exports.cjs.map +0 -1
- package/dist/actions/exports.d.cts +0 -1644
- package/dist/actions/exports.mjs.map +0 -1
- package/dist/chunk-2R73G2PO.mjs.map +0 -1
- package/dist/chunk-3M47ZRXT.mjs.map +0 -1
- package/dist/chunk-4GFN4LEP.mjs.map +0 -1
- package/dist/chunk-5N7QQS55.cjs +0 -130
- package/dist/chunk-5N7QQS55.cjs.map +0 -1
- package/dist/chunk-5NMATIH4.mjs.map +0 -1
- package/dist/chunk-7QKRRIHI.mjs.map +0 -1
- package/dist/chunk-7TFV6UKF.mjs.map +0 -1
- package/dist/chunk-A4FPM7U3.cjs +0 -63
- package/dist/chunk-A4FPM7U3.cjs.map +0 -1
- package/dist/chunk-BDHINMWQ.cjs +0 -417
- package/dist/chunk-BDHINMWQ.cjs.map +0 -1
- package/dist/chunk-BEHP54S3.cjs +0 -24
- package/dist/chunk-BEHP54S3.cjs.map +0 -1
- package/dist/chunk-EGDXV2PT.cjs +0 -36
- package/dist/chunk-EGDXV2PT.cjs.map +0 -1
- package/dist/chunk-EWBKSMPG.cjs +0 -13
- package/dist/chunk-EWBKSMPG.cjs.map +0 -1
- package/dist/chunk-F6ZW7ZDD.cjs +0 -403
- package/dist/chunk-F6ZW7ZDD.cjs.map +0 -1
- package/dist/chunk-FTXTRUYT.cjs +0 -170
- package/dist/chunk-FTXTRUYT.cjs.map +0 -1
- package/dist/chunk-GLWPRM33.mjs.map +0 -1
- package/dist/chunk-GWSTVITN.mjs.map +0 -1
- package/dist/chunk-H3Z37RYU.cjs +0 -15
- package/dist/chunk-H3Z37RYU.cjs.map +0 -1
- package/dist/chunk-I3FTWD6I.mjs.map +0 -1
- package/dist/chunk-JA4DHMTG.mjs.map +0 -1
- package/dist/chunk-KL6YZ5VR.mjs.map +0 -1
- package/dist/chunk-MXWPP6MS.cjs +0 -572
- package/dist/chunk-MXWPP6MS.cjs.map +0 -1
- package/dist/chunk-SGZP4O6R.mjs.map +0 -1
- package/dist/chunk-TDW5SPXR.cjs +0 -244
- package/dist/chunk-TDW5SPXR.cjs.map +0 -1
- package/dist/chunk-TGK3IXDN.cjs +0 -169
- package/dist/chunk-TGK3IXDN.cjs.map +0 -1
- package/dist/chunk-TJEW6YCJ.cjs +0 -97
- package/dist/chunk-TJEW6YCJ.cjs.map +0 -1
- package/dist/chunk-VA3BQ34H.mjs.map +0 -1
- package/dist/chunk-VA5L5FDG.mjs.map +0 -1
- package/dist/chunk-XSGCRLSD.cjs +0 -1844
- package/dist/chunk-XSGCRLSD.cjs.map +0 -1
- package/dist/chunk-XV3GG3HC.cjs +0 -135
- package/dist/chunk-XV3GG3HC.cjs.map +0 -1
- package/dist/chunk-Y5B224UX.cjs +0 -4698
- package/dist/chunk-Y5B224UX.cjs.map +0 -1
- package/dist/chunk-ZBTRKBSI.mjs +0 -169
- package/dist/chunk-ZBTRKBSI.mjs.map +0 -1
- package/dist/chunk-ZCEFC2TK.mjs.map +0 -1
- package/dist/contexts/exports.cjs +0 -83
- 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 -59
- 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 -39
- package/dist/errors/exports.cjs.map +0 -1
- package/dist/errors/exports.d.cts +0 -413
- 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 -8333
- package/dist/hooks/exports.cjs.map +0 -1
- package/dist/hooks/exports.d.cts +0 -1748
- 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 -787
- package/dist/utils/exports.cjs.map +0 -1
- package/dist/utils/exports.d.cts +0 -412
- package/dist/utils/exports.mjs.map +0 -1
- package/src/actions/dex/getIsTokenExploited.ts +0 -63
- package/src/actions/honey/getHoneyGlobalData.ts +0 -21
- package/src/hooks/dex/useExploitedTokens.ts +0 -57
- package/src/hooks/honey/useHoneyGlobalData.ts +0 -23
|
@@ -7,6 +7,24 @@ import { Abi } from 'viem';
|
|
|
7
7
|
*/
|
|
8
8
|
type SeverityLevel = "fatal" | "error" | "warning" | "log" | "info" | "debug";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Span status codes for tracing.
|
|
12
|
+
* Mirrors Sentry's SpanStatusType for compatibility, but owned by berajs
|
|
13
|
+
* so we don't depend on @sentry/nextjs.
|
|
14
|
+
*
|
|
15
|
+
* @see https://develop.sentry.dev/sdk/foundations/transport/event-payloads/span/
|
|
16
|
+
*/
|
|
17
|
+
type SpanStatusType = "ok" | "cancelled" | "unknown_error" | "invalid_argument" | "deadline_exceeded" | "not_found" | "already_exists" | "permission_denied" | "resource_exhausted" | "failed_precondition" | "aborted" | "out_of_range" | "unimplemented" | "internal_error" | "unavailable" | "data_loss" | "unauthenticated";
|
|
18
|
+
/**
|
|
19
|
+
* Maps an HTTP status code to a span status.
|
|
20
|
+
*/
|
|
21
|
+
declare function httpStatusToSpanStatus(code: number): SpanStatusType;
|
|
22
|
+
/**
|
|
23
|
+
* Maps a BeraError reason code to a span status.
|
|
24
|
+
* Returns undefined if no mapping exists (caller keeps existing spanStatus).
|
|
25
|
+
*/
|
|
26
|
+
declare function reasonToSpanStatus(reason: string | null): SpanStatusType | undefined;
|
|
27
|
+
|
|
10
28
|
interface IBeraErrorArgs {
|
|
11
29
|
message?: string;
|
|
12
30
|
displayMessage?: string;
|
|
@@ -26,6 +44,12 @@ interface IBeraErrorArgs {
|
|
|
26
44
|
* Optional ABI to be used to parse the error.
|
|
27
45
|
*/
|
|
28
46
|
abi?: Abi;
|
|
47
|
+
/**
|
|
48
|
+
* Span status for tracing. When set, the tracing adapter uses this to
|
|
49
|
+
* set the span status instead of a generic "internal_error".
|
|
50
|
+
* Auto-inferred from `reason` when not explicitly provided.
|
|
51
|
+
*/
|
|
52
|
+
spanStatus?: SpanStatusType;
|
|
29
53
|
}
|
|
30
54
|
type Primitive = number | string | boolean | bigint | symbol | null | undefined;
|
|
31
55
|
/**
|
|
@@ -87,8 +111,13 @@ declare class BeraError extends Error {
|
|
|
87
111
|
[key: string | TagsKey]: Primitive;
|
|
88
112
|
};
|
|
89
113
|
level: SeverityLevel;
|
|
114
|
+
/**
|
|
115
|
+
* Span status for tracing providers.
|
|
116
|
+
* Auto-inferred from `reason` when not explicitly provided.
|
|
117
|
+
*/
|
|
118
|
+
spanStatus?: SpanStatusType;
|
|
90
119
|
extra: Record<string, unknown>;
|
|
91
|
-
constructor({ message: m, displayMessage: dm, cause, reason, level, abi, tags, chainId, fingerprint, }: IBeraErrorArgs);
|
|
120
|
+
constructor({ message: m, displayMessage: dm, cause, reason, level, abi, tags, chainId, fingerprint, spanStatus, }: IBeraErrorArgs);
|
|
92
121
|
}
|
|
93
122
|
|
|
94
|
-
export { BeraError as B, type IBeraErrorArgs as I, type SeverityLevel as S };
|
|
123
|
+
export { BeraError as B, type IBeraErrorArgs as I, type SeverityLevel as S, type SpanStatusType as a, httpStatusToSpanStatus as h, reasonToSpanStatus as r };
|
|
@@ -387,4 +387,4 @@ interface HoneyConfigProviderProps extends HoneyConfigContextReturn {
|
|
|
387
387
|
declare function HoneyConfigProvider({ children, ...props }: HoneyConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
388
388
|
declare function useHoneyConfig(): HoneyConfigContextReturn;
|
|
389
389
|
|
|
390
|
-
export { type AllowanceQueryItem as A, type BalanceToken as B, type CollateralRates as C, type TokenWithPrice as D, type HoneySwapActions as H, type IAggregatorArgs as I, type MinimalERC20 as M, type PythLatestUpdates as P, type SwapRequest as S, type TokenWithOrder as T, type TokenWithMetadata as a, type Token as b, HoneyConfigContext as c, type HoneyConfigContextReturn as d, HoneyConfigProvider as e, type HoneyConfigProviderProps as f, type IRawAggregatorQuote as g, type PythPriceFeedMap as h, type TokenCurrentPriceMap as i, type AllowanceToken as j, type CollateralRatesArgs as k, type HoneyFeeMap as l, type HoneyPreviewArgs as m, HoneyPreviewMethod as n, type HoneyPreviewReadResult as o, type HoneyPreviewResult as p, getHoneyFees as q, getHoneyPreview as r, getPythLatestPrices as s, type TokenWithAmount as t, useHoneyConfig as u, type IUserPosition as v, type
|
|
390
|
+
export { type AllowanceQueryItem as A, type BalanceToken as B, type CollateralRates as C, type TokenWithPrice as D, type HoneySwapActions as H, type IAggregatorArgs as I, type MinimalERC20 as M, type PythLatestUpdates as P, type SwapRequest as S, type TokenWithOrder as T, type TokenWithMetadata as a, type Token as b, HoneyConfigContext as c, type HoneyConfigContextReturn as d, HoneyConfigProvider as e, type HoneyConfigProviderProps as f, type IRawAggregatorQuote as g, type PythPriceFeedMap as h, type TokenCurrentPriceMap as i, type AllowanceToken as j, type CollateralRatesArgs as k, type HoneyFeeMap as l, type HoneyPreviewArgs as m, HoneyPreviewMethod as n, type HoneyPreviewReadResult as o, type HoneyPreviewResult as p, getHoneyFees as q, getHoneyPreview as r, getPythLatestPrices as s, type TokenWithAmount as t, useHoneyConfig as u, type IUserPosition as v, type TokenPriceInfo as w, type Calldata as x, type BexStatus as y, type IAggregatorQuote as z };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ErrorLike } from '@apollo/client';
|
|
2
|
+
import { B as BeraError, I as IBeraErrorArgs } from './BeraError-7-A5JYy_.js';
|
|
3
|
+
|
|
4
|
+
interface EventsMap {
|
|
5
|
+
[event: string]: any;
|
|
6
|
+
}
|
|
7
|
+
interface DefaultEvents extends EventsMap {
|
|
8
|
+
[event: string]: (...args: any) => void;
|
|
9
|
+
}
|
|
10
|
+
type Unsubscribe = () => void;
|
|
11
|
+
/**
|
|
12
|
+
* An interface for mixins that expose the `on` function (without the emitter
|
|
13
|
+
* bound to `this`)
|
|
14
|
+
*
|
|
15
|
+
* ```js
|
|
16
|
+
* import { createEmitter } from '~utils/createEmitter'
|
|
17
|
+
*
|
|
18
|
+
* class Ticker implements EmitterMixin<Events> {
|
|
19
|
+
* constructor() {
|
|
20
|
+
* this.emitter = createEmitter()
|
|
21
|
+
* }
|
|
22
|
+
* on(...args) {
|
|
23
|
+
* return this.emitter.on(...args)
|
|
24
|
+
* }
|
|
25
|
+
* tick() {
|
|
26
|
+
* this.emitter.emit('tick')
|
|
27
|
+
* }
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
interface EmitterMixin<Events extends EventsMap = DefaultEvents> {
|
|
32
|
+
on<K extends keyof Events>(event: K, cb: Events[K]): Unsubscribe;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Span context passed to tracing handlers.
|
|
37
|
+
* Compatible with Sentry's StartSpanOptions (name, op, attributes).
|
|
38
|
+
*/
|
|
39
|
+
type SpanContext = {
|
|
40
|
+
name: string;
|
|
41
|
+
op: string;
|
|
42
|
+
attributes: Record<string, string | number | boolean | undefined>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A function that wraps a callback in a tracing span.
|
|
46
|
+
* Compatible with Sentry.startSpan's signature.
|
|
47
|
+
*/
|
|
48
|
+
type StartSpanFn = <T>(context: SpanContext, callback: () => Promise<T>) => Promise<T>;
|
|
49
|
+
/**
|
|
50
|
+
* A generic span-tracing module for berajs.
|
|
51
|
+
*
|
|
52
|
+
* Instead of calling Sentry.startSpan directly, berajs calls
|
|
53
|
+
* `BeraTracing.startSpan()`. Consumer apps subscribe via `.on("span", handler)`
|
|
54
|
+
* and forward spans to their tracing provider (Sentry, Datadog, etc.).
|
|
55
|
+
*
|
|
56
|
+
* Multiple handlers are supported and chain in registration order:
|
|
57
|
+
* the first registered handler is the outermost wrapper.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* // In berajs code:
|
|
62
|
+
* import { BeraTracing } from "./BeraTracing";
|
|
63
|
+
* const result = await BeraTracing.startSpan(
|
|
64
|
+
* { name: "GraphQL query", op: "graphql.query", attributes: {} },
|
|
65
|
+
* () => executeQuery(),
|
|
66
|
+
* );
|
|
67
|
+
*
|
|
68
|
+
* // In app instrumentation:
|
|
69
|
+
* import { BeraTracing } from "@berachain/berajs/errors";
|
|
70
|
+
* BeraTracing.addSpanHandler(Sentry.startSpan);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare const BeraTracing: {
|
|
74
|
+
/**
|
|
75
|
+
* Execute a callback, wrapping it in all registered span handlers.
|
|
76
|
+
*
|
|
77
|
+
* Handlers chain so each wraps the next. First registered = outermost wrapper.
|
|
78
|
+
* If no handlers are registered, the callback is executed directly.
|
|
79
|
+
*/
|
|
80
|
+
startSpan<T>(context: SpanContext, callback: () => Promise<T>): Promise<T>;
|
|
81
|
+
/**
|
|
82
|
+
* Register a span tracing handler.
|
|
83
|
+
*
|
|
84
|
+
* @param _event - Must be "span". Exists for API consistency with BeraMonitoring.
|
|
85
|
+
* @param handler - A StartSpanFn, e.g. Sentry.startSpan.
|
|
86
|
+
* @returns An unsubscribe function to remove the handler.
|
|
87
|
+
*/
|
|
88
|
+
addSpanHandler(handler: StartSpanFn): Unsubscribe;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* This is an error class that should be used to handle errors from fetch requests.
|
|
93
|
+
*/
|
|
94
|
+
declare class RequestError extends BeraError {
|
|
95
|
+
/**
|
|
96
|
+
* The error response from the request.
|
|
97
|
+
*/
|
|
98
|
+
response: Response | ErrorLike | undefined;
|
|
99
|
+
static isCorsError(error: Error): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The endpoint that was requested.
|
|
102
|
+
*/
|
|
103
|
+
endpoint: {
|
|
104
|
+
name?: string;
|
|
105
|
+
url: string;
|
|
106
|
+
type?: "rest" | "graphql" | "rpc";
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* A list of domains that should have their query params removed.
|
|
110
|
+
*/
|
|
111
|
+
private queryRichfulDomains;
|
|
112
|
+
statusCode: number | undefined;
|
|
113
|
+
payload?: object;
|
|
114
|
+
static readonly REASON_MAP: {
|
|
115
|
+
readonly 429: "RATE_LIMITED_429";
|
|
116
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
117
|
+
readonly CORS_ERROR: "CORS";
|
|
118
|
+
};
|
|
119
|
+
constructor(args: IBeraErrorArgs & {
|
|
120
|
+
response: Response | ErrorLike | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* The payload sent to the request.
|
|
123
|
+
*/
|
|
124
|
+
payload?: object;
|
|
125
|
+
endpoint: string | URL | {
|
|
126
|
+
name?: string;
|
|
127
|
+
url: string | URL;
|
|
128
|
+
type: "rest" | "graphql" | "rpc";
|
|
129
|
+
};
|
|
130
|
+
statusCode?: number;
|
|
131
|
+
});
|
|
132
|
+
setEndpoint(endpoint: string | URL | {
|
|
133
|
+
name?: string;
|
|
134
|
+
url: string | URL;
|
|
135
|
+
type?: "rest" | "graphql" | "rpc";
|
|
136
|
+
}): {
|
|
137
|
+
name?: string;
|
|
138
|
+
url: string;
|
|
139
|
+
type?: "rest" | "graphql" | "rpc";
|
|
140
|
+
};
|
|
141
|
+
private tryMatchNetworkError;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export { BeraTracing as B, type EmitterMixin as E, RequestError as R, type SpanContext as S };
|
package/dist/abi/exports.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensoWalletV2FactoryAbi
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NBYLMO2L.mjs";
|
|
4
4
|
import {
|
|
5
5
|
pythAbi
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-CDK4YV3D.mjs";
|
|
7
7
|
import {
|
|
8
8
|
multicall3Abi
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-HQCOU6GY.mjs";
|
|
10
10
|
|
|
11
11
|
// src/abi/bend/bundler.ts
|
|
12
12
|
var bundlerAbi = [
|
|
@@ -4450,4 +4450,3 @@ export {
|
|
|
4450
4450
|
pythErrorsAbi,
|
|
4451
4451
|
thirdwebMinimalAccount
|
|
4452
4452
|
};
|
|
4453
|
-
//# sourceMappingURL=exports.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getApolloClient,
|
|
3
|
+
gql
|
|
4
|
+
} from "../../chunk-4Z4AK6SH.mjs";
|
|
5
|
+
import "../../chunk-75M6TF7M.mjs";
|
|
6
|
+
import "../../chunk-SZ5C44L5.mjs";
|
|
7
|
+
import "../../chunk-XIYN6AL6.mjs";
|
|
8
|
+
import "../../chunk-J5I45WGQ.mjs";
|
|
9
|
+
export {
|
|
10
|
+
getApolloClient,
|
|
11
|
+
gql
|
|
12
|
+
};
|
|
@@ -1,35 +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-Dw5KN5sh.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-Dw5KN5sh.js';
|
|
3
|
+
import { Address, PublicClient, Abi, ContractFunctionArgs, ContractFunctionName, TransactionReceipt, WalletCallReceipt } from 'viem';
|
|
4
|
+
export { B as BeraApolloClient, g as getApolloClient } from '../exports-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 {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import
|
|
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-DVP_9KZn.js';
|
|
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';
|
|
13
|
+
import { GetSnapshotsQuery } from '@berachain/graphql/honey';
|
|
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';
|
|
16
|
+
import BigNumber from '@berachain/utils/pkg/bignumber.js';
|
|
19
17
|
import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
|
|
20
18
|
import { honeyFactoryAbi } from '@berachain/abis/honey/honeyFactory';
|
|
21
19
|
import { honeyFactoryPythWrapperAbi } from '@berachain/abis/honey/honeyFactoryPythWrapper';
|
|
22
|
-
import { I as IHoneySwapState } from '../useHoneySwapState-
|
|
20
|
+
import { I as IHoneySwapState } from '../useHoneySwapState-vFmuFF0g.js';
|
|
21
|
+
import { A as AutoclaimedIncentivesResponse, S as StakingConfig, B as BribeBoostRewardProof, a as BribeBoostRewardItem, U as UserVaultInfo } from '../pol.d-CqPA9K6m.js';
|
|
22
|
+
import { VaultEarningResponse } from '@berachain/graphql/api';
|
|
23
23
|
import { Address as Address$1, ChainId } from '@berachain/config';
|
|
24
24
|
import { Config } from '@wagmi/core';
|
|
25
|
+
import { I as IContractWrite } from '../global.d-BuGDKh4k.js';
|
|
25
26
|
import { GetValidatorBlockStatsQuery, GetValidatorAnalyticsQuery } from '@berachain/graphql/pol/subgraph';
|
|
26
27
|
import '@berachain/config/internal';
|
|
27
28
|
import '../dex-C_BB0b0O.js';
|
|
28
|
-
import 'swr';
|
|
29
|
-
import '../BeraError-_mQdkanr.js';
|
|
30
29
|
import 'react/jsx-runtime';
|
|
31
30
|
import 'react';
|
|
32
31
|
import '../honey-CYm0RWf4.js';
|
|
32
|
+
import 'swr';
|
|
33
|
+
import '../txnEnum-ByI5dtDi.js';
|
|
34
|
+
import '../BeraError-7-A5JYy_.js';
|
|
33
35
|
|
|
34
36
|
interface GetMaxDepositProps {
|
|
35
37
|
vaultAddress: Address;
|
|
@@ -37,33 +39,14 @@ interface GetMaxDepositProps {
|
|
|
37
39
|
}
|
|
38
40
|
declare function getMaxDeposit({ vaultAddress, publicClient, }: GetMaxDepositProps): Promise<string>;
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
* This is a wrapper around the ApolloClient that throws a BeraError if the query returns an error or no data.
|
|
42
|
-
*
|
|
43
|
-
* It's mostly a typescript helper that keeps data always defined since we use errorPolicy: "none" by default.
|
|
44
|
-
* Such setting will throw an error if the query returns an error, rather than returning an object with undefined data and an error property.
|
|
45
|
-
*/
|
|
46
|
-
declare class BeraApolloClient extends ApolloClient {
|
|
42
|
+
declare function getEnsoClient({ baseURL, ...args }?: BeraJS.BaseFunctionArgs & {
|
|
47
43
|
/**
|
|
48
|
-
*
|
|
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
|
|
49
48
|
*/
|
|
50
|
-
|
|
51
|
-
constructor(options: ApolloClient.Options & {
|
|
52
|
-
/**
|
|
53
|
-
* The URL of the endpoint. Used for error reporting only.
|
|
54
|
-
*/
|
|
55
|
-
url: string;
|
|
56
|
-
});
|
|
57
|
-
query<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: Omit<ApolloClient.QueryOptions<TData, TVariables>, "errorPolicy">): Promise<{
|
|
58
|
-
data: TData;
|
|
59
|
-
}>;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
type GraphqlClient = "honey.subgraph" | "pol.subgraph" | "pol.fees" | "governance.subgraph" | "bex.subgraph" | "api" | "bend.whisk";
|
|
63
|
-
declare function getApolloClient(clientName: GraphqlClient, { ...args }: BeraJS.BaseFunctionArgs): BeraApolloClient;
|
|
64
|
-
|
|
65
|
-
declare function getEnsoClient({ useProxy, ...args }?: BeraJS.BaseFunctionArgs & {
|
|
66
|
-
useProxy?: boolean;
|
|
49
|
+
baseURL?: string;
|
|
67
50
|
}): EnsoClient;
|
|
68
51
|
|
|
69
52
|
declare function getAllPools({ textSearch, chain, first, orderBy, orderDirection, skip, fetchPolicy, userAddress, blacklistedPoolIds, ...args }?: Partial<GetPoolsQueryVariables & {
|
|
@@ -546,142 +529,14 @@ declare function getVaultPausedState({ publicClient, ...args }: BeraJS.BaseFunct
|
|
|
546
529
|
publicClient: PublicClient;
|
|
547
530
|
}): Promise<boolean>;
|
|
548
531
|
|
|
549
|
-
type CheckProposalFieldResultMinimal = ProposalErrorCodes | null;
|
|
550
|
-
type CheckProposalFieldResult = ProposalErrorCodes | null | CheckProposalFieldResultMinimal[] | Record<string, CheckProposalFieldResultMinimal>;
|
|
551
|
-
/**
|
|
552
|
-
* Validates a single proposal field or ABI-typed value.
|
|
553
|
-
* Returns `null` if valid, or a `ProposalErrorCodes` value describing the problem.
|
|
554
|
-
*/
|
|
555
|
-
declare function checkProposalField(arg: {
|
|
556
|
-
fieldOrType: "address" | "hex" | "abi" | "string" | "bool" | `uint${string}` | `int${string}` | "action" | "title" | "forumLink" | "description" | "logoURI" | "url";
|
|
557
|
-
value: unknown;
|
|
558
|
-
required?: boolean;
|
|
559
|
-
baseUrl?: string;
|
|
560
|
-
components?: readonly (AbiParameter | readonly AbiParameter[])[];
|
|
561
|
-
}): CheckProposalFieldResultMinimal;
|
|
562
|
-
/**
|
|
563
|
-
* For tuple/tuple[] types, may return nested error structures.
|
|
564
|
-
*/
|
|
565
|
-
declare function checkProposalField(arg: {
|
|
566
|
-
fieldOrType: "tuple[]" | "tuple";
|
|
567
|
-
value: unknown;
|
|
568
|
-
required?: boolean;
|
|
569
|
-
baseUrl?: string;
|
|
570
|
-
components?: readonly (AbiParameter | readonly AbiParameter[])[];
|
|
571
|
-
}): CheckProposalFieldResult;
|
|
572
|
-
|
|
573
|
-
declare const MOCKED_PROPOSAL_STATUSES: readonly ProposalStatus[];
|
|
574
|
-
/**
|
|
575
|
-
* Derives the effective `ProposalStatus` by reconciling subgraph data with the
|
|
576
|
-
* on-chain contract state. Falls back to subgraph timestamps when the on-chain
|
|
577
|
-
* state is unavailable.
|
|
578
|
-
*/
|
|
579
|
-
declare function computeActualStatus(
|
|
580
|
-
/** Subgraph proposal data */
|
|
581
|
-
proposal: ProposalSelectionFragment,
|
|
582
|
-
/** Value returned by the `state` function of the governance contract */
|
|
583
|
-
proposalOnChainState?: ProposalState): ProposalStatus;
|
|
584
|
-
|
|
585
|
-
type GetAllProposalsArgs = BeraJS.BaseFunctionArgs & {
|
|
586
|
-
/** Subgraph filter applied to the proposals query */
|
|
587
|
-
where: Proposal_Filter;
|
|
588
|
-
/** Number of proposals to skip (for pagination) */
|
|
589
|
-
offset?: number;
|
|
590
|
-
/** Maximum proposals per page; must be ≤ 1000 */
|
|
591
|
-
perPage?: number;
|
|
592
|
-
orderBy?: Proposal_OrderBy;
|
|
593
|
-
orderDirection?: OrderDirection;
|
|
594
|
-
/** Full-text search query; switches to the search endpoint when provided */
|
|
595
|
-
text?: string;
|
|
596
|
-
};
|
|
597
|
-
/** Fetches a paginated list of governance proposals from the subgraph */
|
|
598
|
-
declare function getAllProposals({ where, orderBy, orderDirection, offset, perPage, text, ...args }: GetAllProposalsArgs): Promise<ProposalSelectionFragment[] | undefined>;
|
|
599
|
-
|
|
600
|
-
interface GetBodyErrorsArgs {
|
|
601
|
-
/** The proposal to validate */
|
|
602
|
-
proposal: CustomProposal;
|
|
603
|
-
/** The current governance topic, used for forum link base URL validation */
|
|
604
|
-
currentTopic: GovernanceTopic;
|
|
605
|
-
}
|
|
606
|
-
/** Validates the body fields (title, description, forum link) of a proposal */
|
|
607
|
-
declare function getBodyErrors({ proposal, currentTopic, }: GetBodyErrorsArgs): CustomProposalErrors;
|
|
608
|
-
|
|
609
|
-
interface GetDecodedFunctionDataArgs {
|
|
610
|
-
/** Contract address that emitted the calldata */
|
|
611
|
-
address: Address;
|
|
612
|
-
/** Raw calldata to decode */
|
|
613
|
-
callData: `0x${string}`;
|
|
614
|
-
/** @default defaultChainId */
|
|
615
|
-
chainId?: number;
|
|
616
|
-
publicClient: PublicClient;
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* Decodes the function data from a given contract address and calldata.
|
|
620
|
-
*
|
|
621
|
-
* Attempts to decode using a known set of ABIs first, then falls back to
|
|
622
|
-
* fetching the ABI from the block-explorer API.
|
|
623
|
-
*
|
|
624
|
-
* @returns An object with the decoded ABI item, function signature, function name, and arguments.
|
|
625
|
-
*/
|
|
626
|
-
declare function getDecodedFunctionData({ address, callData, chainId, publicClient, }: GetDecodedFunctionDataArgs): Promise<{
|
|
627
|
-
args: never[];
|
|
628
|
-
abiItem?: undefined;
|
|
629
|
-
functionSignature?: undefined;
|
|
630
|
-
functionName?: undefined;
|
|
631
|
-
} | {
|
|
632
|
-
abiItem: AbiFunction | undefined;
|
|
633
|
-
functionSignature: string | undefined;
|
|
634
|
-
functionName: string;
|
|
635
|
-
args: unknown[];
|
|
636
|
-
}>;
|
|
637
|
-
|
|
638
|
-
type GetProposalDetailsArgs = BeraJS.BaseFunctionArgs & {
|
|
639
|
-
/** On-chain proposal ID */
|
|
640
|
-
proposalId: string;
|
|
641
|
-
client?: PublicClient;
|
|
642
|
-
};
|
|
643
|
-
/** Fetches a single proposal with its vote data from the subgraph */
|
|
644
|
-
declare function getProposalDetails({ proposalId, ...args }: GetProposalDetailsArgs): Promise<ProposalWithVotesFragment | undefined>;
|
|
645
|
-
|
|
646
|
-
type GetProposalFromTxArgs = {
|
|
647
|
-
/** Viem public client used to fetch block and receipt data */
|
|
648
|
-
publicClient: PublicClient | undefined;
|
|
649
|
-
} & ({
|
|
650
|
-
/** Pre-fetched transaction receipt */
|
|
651
|
-
tx: TransactionReceipt;
|
|
652
|
-
} | {
|
|
653
|
-
/** Transaction hash to look up */
|
|
654
|
-
txHash: Address;
|
|
655
|
-
});
|
|
656
|
-
/**
|
|
657
|
-
* Reconstructs a `ProposalWithVotesFragment` from the `ProposalCreated` event
|
|
658
|
-
* emitted in a given transaction. Returns `null` if the event is not found.
|
|
659
|
-
*/
|
|
660
|
-
declare function getProposalFromTx(args: GetProposalFromTxArgs): Promise<ProposalWithVotesFragment | null>;
|
|
661
|
-
|
|
662
|
-
type GetProposalVotesArgs = BeraJS.BaseFunctionArgs & {
|
|
663
|
-
/** GraphQL variables forwarded to the GetProposalVotes query */
|
|
664
|
-
variables: GetProposalVotesQueryVariables;
|
|
665
|
-
};
|
|
666
|
-
/** Fetches the votes for a proposal from the subgraph */
|
|
667
|
-
declare function getProposalVotes({ variables, ...args }: GetProposalVotesArgs): Promise<{
|
|
668
|
-
data: GetProposalVotesQuery;
|
|
669
|
-
}>;
|
|
670
|
-
|
|
671
|
-
type ParseProposalBodyResult = graymatter.GrayMatterFile<string> & {
|
|
672
|
-
/** Whether the body uses YAML front-matter (true) or legacy heading format (false) */
|
|
673
|
-
isFrontMatter: boolean;
|
|
674
|
-
};
|
|
675
532
|
/**
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
533
|
+
* Browser-only. Hits the typed `/api/honey/snapshots` endpoint.
|
|
534
|
+
* Server callers must compose the upstream query directly (this action is
|
|
535
|
+
* not server-safe — `fetch` against a relative URL has no origin off-browser).
|
|
679
536
|
*/
|
|
680
|
-
declare function
|
|
681
|
-
|
|
682
|
-
declare function getChartData({ days, ...args }: BeraJS.BaseFunctionArgs & {
|
|
537
|
+
declare function getChartData({ days, }: {
|
|
683
538
|
days: number;
|
|
684
|
-
}): Promise<
|
|
539
|
+
}): Promise<GetSnapshotsQuery>;
|
|
685
540
|
|
|
686
541
|
/**
|
|
687
542
|
* Arguments for the getCollateralWeights function.
|
|
@@ -719,6 +574,9 @@ interface GetGlobalCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
|
719
574
|
*/
|
|
720
575
|
declare function getGlobalCapLimit({ client, asset, amount, isMint, isPythWrapperEnabled, latestPrices, ...args }: GetGlobalCapLimitArgs): Promise<boolean | undefined>;
|
|
721
576
|
|
|
577
|
+
/** Browser-only. Hits `/api/honey/snapshots?interval=hour&first=24` and reduces. */
|
|
578
|
+
declare function getHoney24hVolume(): Promise<BigNumber | undefined>;
|
|
579
|
+
|
|
722
580
|
interface GetHoneyCollateralsArgs extends BeraJS.BaseFunctionArgs {
|
|
723
581
|
/**
|
|
724
582
|
* The public client for blockchain interactions
|
|
@@ -747,8 +605,6 @@ declare function getHoneyCollaterals({ client, tokenData, preferredCollateralOrd
|
|
|
747
605
|
referenceCollateral: TokenWithOrder;
|
|
748
606
|
}>;
|
|
749
607
|
|
|
750
|
-
declare function getHoneyGlobalData({ ...args }?: BeraJS.BaseFunctionArgs): Promise<GetGlobalDataQuery>;
|
|
751
|
-
|
|
752
608
|
/**
|
|
753
609
|
* Gets the pause state of the Honey protocol
|
|
754
610
|
* @returns boolean
|
|
@@ -832,17 +688,39 @@ declare function getBlockTimestamp({ block, currentBlock, blockTime, publicClien
|
|
|
832
688
|
timestamp: number;
|
|
833
689
|
}>;
|
|
834
690
|
|
|
691
|
+
/**
|
|
692
|
+
* Server-side function to fetch the incentives the bot autoclaimed on behalf
|
|
693
|
+
* of a wallet during the BGT → BERA cutover. Only valid to call once the
|
|
694
|
+
* bgtIncentiveDistributor contract is paused.
|
|
695
|
+
*/
|
|
696
|
+
declare function getAutoclaimedIncentives({ account, ...args }: {
|
|
697
|
+
account: Address;
|
|
698
|
+
} & BeraJS.BaseFunctionArgs): Promise<AutoclaimedIncentivesResponse | null>;
|
|
699
|
+
|
|
700
|
+
type GetBeraTokenTotalSupplyArgs = BeraJS.BaseFunctionArgs;
|
|
701
|
+
/**
|
|
702
|
+
* Fetches the native BERA total supply (in whole BERA units) from the
|
|
703
|
+
* Berachain supply-monitor service.
|
|
704
|
+
*/
|
|
705
|
+
declare function getBeraTokenTotalSupply(args?: GetBeraTokenTotalSupplyArgs): Promise<string>;
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Reads `paused()` on the BGT incentive distributor. Used to gate the
|
|
709
|
+
* autoclaim banner — when `true`, users can no longer self-claim and the
|
|
710
|
+
* bot is responsible for distributing incentives on their behalf.
|
|
711
|
+
*
|
|
712
|
+
* Fails closed: any read error returns `false` so the banner stays hidden.
|
|
713
|
+
*/
|
|
714
|
+
declare function getBgtIncentiveDistributorPaused({ publicClient, ...args }: {
|
|
715
|
+
publicClient: PublicClient | undefined;
|
|
716
|
+
} & BeraJS.BaseFunctionArgs): Promise<boolean>;
|
|
717
|
+
|
|
835
718
|
declare function getBlockTime({ defaultBlockTime, publicClient, blocksSpan, ...args }: {
|
|
836
719
|
defaultBlockTime?: number;
|
|
837
720
|
blocksSpan?: number;
|
|
838
721
|
publicClient: PublicClient | undefined;
|
|
839
722
|
} & BeraJS.BaseFunctionArgs): Promise<number>;
|
|
840
723
|
|
|
841
|
-
type StakingHistoryData = {
|
|
842
|
-
currentDepositRate: string;
|
|
843
|
-
earningsRealized: string;
|
|
844
|
-
earningsTotal: string;
|
|
845
|
-
};
|
|
846
724
|
type GetEarnedStakedBeraVaultArgs = {
|
|
847
725
|
/**
|
|
848
726
|
* The token that the user has staked
|
|
@@ -853,12 +731,48 @@ type GetEarnedStakedBeraVaultArgs = {
|
|
|
853
731
|
*/
|
|
854
732
|
account: Address;
|
|
855
733
|
};
|
|
856
|
-
declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<
|
|
734
|
+
declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<VaultEarningResponse>;
|
|
735
|
+
|
|
736
|
+
interface HeroEarnVaults {
|
|
737
|
+
/**
|
|
738
|
+
* Top-APR PoL reward vaults, ordered by APR descending. Callers typically
|
|
739
|
+
* read `[0]` for the "Earn with PoL" hero subtitle. `bestAprExcludedAddresses`
|
|
740
|
+
* lets callers filter out non-incentivized earn actions whose APR figures
|
|
741
|
+
* would otherwise dominate the listing and mislead users.
|
|
742
|
+
*/
|
|
743
|
+
bestApr: ApiVaultFragment[];
|
|
744
|
+
/**
|
|
745
|
+
* Highest-APR PoL reward vault among vaults whose protocol is "bend".
|
|
746
|
+
* Its `stakingToken.address` is a Bend vault share token — match it back
|
|
747
|
+
* against `bendVaults` to combine the PoL reward APR with the underlying
|
|
748
|
+
* Bend native supply APY.
|
|
749
|
+
*/
|
|
750
|
+
bendRewardVault: ApiVaultFragment[];
|
|
751
|
+
/**
|
|
752
|
+
* Minimal Bend native vault data (address + `totalApy`) used to look up the
|
|
753
|
+
* underlying Bend supply APY for whichever Bend vault `bendRewardVault`
|
|
754
|
+
* resolves to.
|
|
755
|
+
*/
|
|
756
|
+
bendVaults: GetHeroEarnVaultsQuery["bendVaults"];
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Batched fetch for the hub home page hero cards. Issues a single GraphQL
|
|
760
|
+
* request to the BEX API that returns:
|
|
761
|
+
* - the top-APR PoL reward vaults (for the "Earn with PoL" card)
|
|
762
|
+
* - the highest-APR Bend-protocol PoL reward vault (for the "Lend" card)
|
|
763
|
+
* - minimal Bend native vault data, so callers can add the Bend supply APY
|
|
764
|
+
* on top of the PoL reward APR when displaying the combined Lend APY
|
|
765
|
+
*/
|
|
766
|
+
declare function getHeroEarnVaults({ bestAprExcludedAddresses, ...args }?: {
|
|
767
|
+
bestAprExcludedAddresses?: string[];
|
|
768
|
+
} & BeraJS.BaseFunctionArgs): Promise<HeroEarnVaults>;
|
|
857
769
|
|
|
858
|
-
|
|
770
|
+
type IncentiveFeeClaimStats = {
|
|
859
771
|
sumAllClaims: number;
|
|
860
772
|
sumClaimsInLast24Hours: number;
|
|
861
|
-
}
|
|
773
|
+
};
|
|
774
|
+
/** Browser-only. Hits `/api/pol/incentive-fee-claims` (server computes totals). */
|
|
775
|
+
declare function getIncentiveFeeClaimStats(): Promise<IncentiveFeeClaimStats>;
|
|
862
776
|
|
|
863
777
|
type GetLSTStakeConfigArgs = {
|
|
864
778
|
tokenList: TokenWithMetadata[];
|
|
@@ -1586,7 +1500,13 @@ declare function getApiValidator({ id, ...args }: {
|
|
|
1586
1500
|
id: Address;
|
|
1587
1501
|
} & BeraJS.BaseFunctionArgs): Promise<GetValidatorQuery>;
|
|
1588
1502
|
|
|
1589
|
-
|
|
1503
|
+
/**
|
|
1504
|
+
* Browser-only. Hits `/api/pol/validator-block-stats`. Server callers (RSC)
|
|
1505
|
+
* should import from `@berachain/berajs/actions/server` instead — that path
|
|
1506
|
+
* has the static Apollo + GraphQL imports and does not pass through the
|
|
1507
|
+
* browser endpoint.
|
|
1508
|
+
*/
|
|
1509
|
+
declare function getDailyValidatorBlockStats({ pubKey, first, }: {
|
|
1590
1510
|
pubKey: Address;
|
|
1591
1511
|
first?: number;
|
|
1592
1512
|
}): Promise<GetValidatorBlockStatsQuery | undefined>;
|
|
@@ -1608,7 +1528,8 @@ declare function getStakingPoolBatch({ client, valPubKey, }: {
|
|
|
1608
1528
|
valPubKey: `0x${string}`;
|
|
1609
1529
|
}): Promise<number>;
|
|
1610
1530
|
|
|
1611
|
-
|
|
1531
|
+
/** Browser-only. Hits `/api/pol/validator-analytics`. */
|
|
1532
|
+
declare function getValidatorAnalytics({ pubkey, dayRange, }: {
|
|
1612
1533
|
pubkey: Address;
|
|
1613
1534
|
dayRange: number;
|
|
1614
1535
|
}): Promise<GetValidatorAnalyticsQuery | undefined>;
|
|
@@ -1641,4 +1562,4 @@ declare function getValidatorBoostApy({ validator, bgtPrice, }: {
|
|
|
1641
1562
|
bgtPrice: number;
|
|
1642
1563
|
}): number;
|
|
1643
1564
|
|
|
1644
|
-
export { type ActiveBoostAndCommissionChangeDelay,
|
|
1565
|
+
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, 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 };
|