@berachain/berajs 0.2.9 → 0.2.11
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/{HoneyConfigProvider-Dkj-_a5x.d.ts → HoneyConfigProvider-COOuDNra.d.ts} +1 -1
- package/dist/actions/clients/exports.d.ts +77 -1
- package/dist/actions/clients/exports.mjs +13 -4
- package/dist/actions/exports.d.ts +121 -39
- package/dist/actions/exports.mjs +75 -34
- package/dist/actions/governance/exports.d.ts +3 -11
- package/dist/actions/governance/exports.mjs +3 -3
- package/dist/actions/server/exports.mjs +4 -4
- package/dist/{chunk-4Z4AK6SH.mjs → chunk-3JJLQ2JX.mjs} +3 -3
- package/dist/{chunk-EXIUPSFN.mjs → chunk-7YVNSDXG.mjs} +2 -2
- package/dist/{chunk-WXXOISTU.mjs → chunk-AUOPN6NK.mjs} +1 -1
- package/dist/{chunk-75M6TF7M.mjs → chunk-DQRH5VE3.mjs} +1 -1
- package/dist/{chunk-CDFWPU2R.mjs → chunk-E7YFXBBQ.mjs} +0 -124
- package/dist/{chunk-AFN4CVD3.mjs → chunk-GUURQAME.mjs} +1 -1
- package/dist/{chunk-KQUMKB66.mjs → chunk-GY6B3PD5.mjs} +1 -1
- package/dist/{chunk-HSSJKHZ4.mjs → chunk-HYDP32P6.mjs} +3 -3
- package/dist/{chunk-NPBQLVL3.mjs → chunk-IXIBY5FP.mjs} +2 -2
- package/dist/{chunk-J5I45WGQ.mjs → chunk-KHXJDYA4.mjs} +7 -0
- package/dist/chunk-MRQGHXAN.mjs +54 -0
- package/dist/{chunk-FFB5LFDW.mjs → chunk-QVHEM4BG.mjs} +2 -2
- package/dist/{chunk-3EARVV7K.mjs → chunk-SXUNCX5E.mjs} +22 -9
- package/dist/chunk-UD5IUNCW.mjs +34 -0
- package/dist/{chunk-QJIXTYTZ.mjs → chunk-VAA2FVPP.mjs} +162 -41
- package/dist/chunk-Y6THHG77.mjs +126 -0
- package/dist/{chunk-XIYN6AL6.mjs → chunk-ZLTMIFCZ.mjs} +10 -5
- package/dist/contexts/exports.d.ts +2 -2
- package/dist/contexts/exports.mjs +11 -9
- package/dist/enum/exports.d.ts +8 -2
- package/dist/errors/exports.mjs +5 -5
- package/dist/getProposalVotes-DAUrdX2n.d.ts +12 -0
- package/dist/{getValidatorQueuedOperatorAddress-Dw5KN5sh.d.ts → getValidatorQueuedOperatorAddress-Cxt-DlL_.d.ts} +2 -2
- package/dist/{global.d-BuGDKh4k.d.ts → global.d-q_LQWQqs.d.ts} +2 -4
- package/dist/hooks/exports.d.ts +114 -164
- package/dist/hooks/exports.mjs +535 -522
- package/dist/hooks/governance/exports.d.ts +20 -15
- package/dist/hooks/governance/exports.mjs +43 -41
- package/dist/{pol.d-CqPA9K6m.d.ts → pol.d-CeRgXBL8.d.ts} +33 -8
- package/dist/types/exports.d.ts +5 -5
- package/dist/{useHoneySwapState-vFmuFF0g.d.ts → useHoneySwapState-twi7NTaO.d.ts} +1 -1
- package/dist/utils/exports.d.ts +2 -2
- package/dist/utils/exports.mjs +15 -9
- package/package.json +9 -8
- package/src/actions/bend/getMaxDeposit.ts +28 -2
- package/src/actions/clients/exports.ts +3 -0
- package/src/actions/clients/fetchBeep.ts +34 -0
- package/src/actions/clients/fetchOpenApi.ts +97 -0
- package/src/actions/clients/fetchOpenApi.unit.test.ts +245 -0
- package/src/actions/clients/fetchRailwayBackend.ts +34 -0
- package/src/actions/enso/getEnsoUserTokensWithBalances.ts +18 -0
- package/src/actions/exports.ts +2 -0
- package/src/actions/honey/getChartData.ts +53 -12
- package/src/actions/honey/getHoney24hVolume.ts +34 -6
- package/src/actions/honey/getHoneyTxns.ts +93 -0
- 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 +21 -10
- package/src/actions/pol/getAutoclaimedIncentivesTxHash.ts +41 -0
- package/src/actions/pol/getBgtIncentiveDistributorPaused.ts +5 -12
- package/src/actions/pol/getEarnedStakedBeraVault.ts +20 -16
- package/src/actions/pol/getRewardVaults.ts +4 -4
- package/src/actions/pol/getStakingDailyAssets.ts +18 -14
- package/src/actions/validators/getValidatorIncentiveDistribution.ts +64 -12
- package/src/actions/validators/utils/getValidatorBoostApy.ts +1 -1
- package/src/contexts/SwrFallback.tsx +2 -1
- package/src/data/contracts.ts +4 -0
- package/src/errors/RequestError.ts +12 -3
- package/src/errors/RequestError.unit.test.ts +55 -0
- package/src/errors/errorMap.ts +8 -0
- package/src/errors/getRevertReason.integration.test.ts +5 -1
- package/src/hooks/bend/useGetConvertToAssets.ts +2 -3
- package/src/hooks/dex/useAggregatorsQuotes.ts +10 -10
- package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +1 -1
- package/src/hooks/dex/useAllUserPools.ts +7 -5
- package/src/hooks/dex/useApiPool.ts +1 -1
- package/src/hooks/dex/useGlobalLiquidityAndSwapVolume.ts +1 -1
- package/src/hooks/dex/useOnChainPoolData.ts +1 -1
- package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +2 -2
- package/src/hooks/dex/usePoolEvents.ts +1 -2
- package/src/hooks/dex/usePoolHistoricalData.ts +2 -3
- package/src/hooks/dex/usePools.ts +4 -2
- package/src/hooks/dex/useSingleAggregatorQuote.ts +6 -18
- package/src/hooks/enso/useBendDemultiply.ts +3 -4
- package/src/hooks/enso/useBendMultiply.ts +3 -4
- package/src/hooks/enso/useBendZapSupply.ts +3 -4
- package/src/hooks/enso/useEnsoSwapBundle.ts +1 -1
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +3 -5
- package/src/hooks/enso/useEnsoWalletV2Address.ts +1 -1
- package/src/hooks/enso/useIsBendAuthorized.ts +1 -1
- package/src/hooks/enso/useZapStakeBera.ts +2 -2
- package/src/hooks/exports.ts +2 -0
- package/src/hooks/governance/useGetPastVotes.ts +1 -1
- package/src/hooks/governance/useHasVoted.ts +1 -1
- package/src/hooks/governance/useIsCanceller.ts +1 -1
- package/src/hooks/governance/usePollAllProposals.ts +13 -12
- package/src/hooks/governance/usePollProposal.ts +3 -3
- package/src/hooks/governance/usePollProposalThreshold.ts +1 -1
- package/src/hooks/governance/usePollProposalVotes.ts +23 -5
- package/src/hooks/governance/usePollUserDelegates.ts +3 -3
- package/src/hooks/governance/useProposalFromTx.ts +2 -1
- package/src/hooks/governance/useProposalSnapshot.ts +2 -3
- package/src/hooks/governance/useProposalState.ts +2 -2
- package/src/hooks/governance/useProposalTimelockState.ts +2 -1
- package/src/hooks/governance/useQuorum.ts +1 -2
- package/src/hooks/honey/useCappedGlobally.ts +3 -6
- package/src/hooks/honey/useCappedRelatively.ts +2 -2
- package/src/hooks/honey/useCollateralWeights.ts +3 -3
- package/src/hooks/honey/useHoney24hVolume.ts +1 -1
- package/src/hooks/honey/useHoneyBalances.ts +1 -1
- package/src/hooks/honey/useHoneyChartData.ts +1 -1
- package/src/hooks/honey/useHoneyVaultsBalance.ts +2 -3
- package/src/hooks/honey/useIsBadCollateralAsset.ts +4 -7
- package/src/hooks/honey/useIsBasketModeEnabled.ts +4 -7
- package/src/hooks/honey/usePythLatestPrices.ts +13 -9
- package/src/hooks/perps/usePythUpdateFee.ts +13 -11
- package/src/hooks/pol/useAutoclaimedIncentives.ts +2 -12
- package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +44 -0
- package/src/hooks/pol/useBgtIncentiveDistributorPaused.ts +39 -0
- package/src/hooks/pol/useBgtUnstakedBalance.ts +2 -2
- package/src/hooks/pol/useClaimableFees.ts +1 -1
- package/src/hooks/pol/useHighestVaultsAPR.ts +4 -6
- package/src/hooks/pol/useOnChainRewardVault.ts +77 -72
- package/src/hooks/pol/usePollGlobalData.ts +2 -3
- package/src/hooks/pol/usePollMarkets.ts +2 -2
- package/src/hooks/pol/useQueuedBeraUnlock.ts +2 -2
- package/src/hooks/pol/useRewardTokenToBeraRate.ts +2 -2
- package/src/hooks/pol/useRewardVault.ts +7 -6
- package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +4 -4
- package/src/hooks/pol/useRewardVaultFromToken.ts +1 -1
- package/src/hooks/pol/useRewardVaultIncentives.ts +1 -1
- package/src/hooks/pol/useRewardVaultRewards.ts +2 -2
- package/src/hooks/pol/useRewardVaults.ts +3 -6
- package/src/hooks/pol/useStakedAPR.ts +1 -2
- package/src/hooks/pol/useStakedData.ts +90 -41
- package/src/hooks/pol/useStakedSnapshots.ts +1 -1
- package/src/hooks/pol/useStakingVaultsMetadata.ts +1 -1
- package/src/hooks/pol/useTotalStakedAmount.ts +1 -2
- package/src/hooks/pol/useUserVaultInfo.ts +2 -2
- package/src/hooks/pol/useUserVaults.ts +2 -3
- package/src/hooks/pol/useVaultAddress.ts +1 -1
- package/src/hooks/pol/useVaultHistory.ts +1 -2
- package/src/hooks/pol/useVaultValidators.ts +2 -2
- package/src/hooks/tokens/useMultipleTokenInformation.ts +2 -2
- package/src/hooks/tokens/usePollAllowances.ts +3 -4
- package/src/hooks/tokens/usePollBalance.ts +2 -2
- package/src/hooks/tokens/usePollWalletBalances.ts +2 -2
- package/src/hooks/tokens/useStakingTokenInformation.ts +2 -2
- package/src/hooks/tokens/useTokenCurrentPrices.ts +11 -13
- package/src/hooks/tokens/useTokenInformation.ts +2 -2
- package/src/hooks/tokens/useTokenPrice.ts +2 -1
- package/src/hooks/tokens/useTokenPrices.ts +3 -4
- package/src/hooks/tokens/useTotalSupply.ts +1 -1
- package/src/hooks/tokens/useUnderlyingAsset.ts +1 -2
- package/src/hooks/useBlockToTimestamp.ts +1 -2
- package/src/hooks/useGetVerifiedAbi.ts +2 -1
- package/src/hooks/validators/useAllValidators.ts +2 -3
- package/src/hooks/validators/useApiEnrichedAllocation.ts +1 -1
- package/src/hooks/validators/useApiValidator.ts +3 -6
- package/src/hooks/validators/useBaselineRewardAllocation.ts +1 -2
- package/src/hooks/validators/useDailyValidatorBlockStats.ts +1 -1
- package/src/hooks/validators/useDefaultRewardAllocation.ts +2 -3
- package/src/hooks/validators/useManagedValidatorRole.ts +2 -2
- package/src/hooks/validators/useOnChainValidator.ts +3 -3
- package/src/hooks/validators/useStakingPoolBatch.ts +3 -4
- package/src/hooks/validators/useUserActiveValidators.ts +2 -3
- package/src/hooks/validators/useUserBoostsOnValidator.ts +1 -1
- package/src/hooks/validators/useUserClaimableIncentives.ts +1 -1
- package/src/hooks/validators/useUserStakingPositions.ts +2 -1
- package/src/hooks/validators/useValidator.ts +4 -8
- package/src/hooks/validators/useValidatorAnalytics.ts +1 -1
- package/src/hooks/validators/useValidatorCommission.ts +2 -2
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +3 -3
- package/src/hooks/validators/useValidatorQueuedCommission.ts +2 -2
- package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +2 -2
- package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +2 -2
- package/src/hooks/validators/useValidatorRewardAllocation.ts +2 -2
- package/src/types/bribe-boost.d.ts +14 -3
- package/src/types/global.d.ts +3 -4
- package/src/types/pol.d.ts +17 -3
- package/src/utils/polyfillAbortSignalAny.ts +53 -0
- package/src/utils/polyfillAbortSignalAny.unit.test.ts +81 -0
- package/dist/polling-BKnyavLI.d.ts +0 -8
- /package/dist/{exports-BcUTGFUb.d.ts → getApolloClient-BcUTGFUb.d.ts} +0 -0
|
@@ -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 TokenPriceInfo as w, 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 BexStatus as x, type Calldata as y, type IAggregatorQuote as z };
|
|
@@ -1,2 +1,78 @@
|
|
|
1
|
-
|
|
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';
|
|
2
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 };
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fetchBeep,
|
|
3
|
+
fetchOpenApi,
|
|
4
|
+
fetchRailwayBackend
|
|
5
|
+
} from "../../chunk-MRQGHXAN.mjs";
|
|
1
6
|
import {
|
|
2
7
|
getApolloClient,
|
|
3
8
|
gql
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-3JJLQ2JX.mjs";
|
|
10
|
+
import "../../chunk-Y6THHG77.mjs";
|
|
11
|
+
import "../../chunk-DQRH5VE3.mjs";
|
|
6
12
|
import "../../chunk-SZ5C44L5.mjs";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-ZLTMIFCZ.mjs";
|
|
14
|
+
import "../../chunk-KHXJDYA4.mjs";
|
|
9
15
|
export {
|
|
16
|
+
fetchBeep,
|
|
17
|
+
fetchOpenApi,
|
|
18
|
+
fetchRailwayBackend,
|
|
10
19
|
getApolloClient,
|
|
11
20
|
gql
|
|
12
21
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
1
|
+
import { V as ValidatorRewardAllocation } from '../getValidatorQueuedOperatorAddress-Cxt-DlL_.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-Cxt-DlL_.js';
|
|
3
3
|
import { Address, PublicClient, Abi, ContractFunctionArgs, ContractFunctionName, TransactionReceipt, WalletCallReceipt } from 'viem';
|
|
4
|
-
export { B as BeraApolloClient, g as getApolloClient } from '../
|
|
4
|
+
export { B as BeraApolloClient, g as getApolloClient } from '../getApolloClient-BcUTGFUb.js';
|
|
5
5
|
import { EnsoClient } from '@ensofinance/sdk';
|
|
6
6
|
import { PoolState } from '@berachain-foundation/berancer-sdk';
|
|
7
7
|
export { BalancerApi } from '@berachain-foundation/berancer-sdk';
|
|
@@ -10,26 +10,26 @@ import { GetPoolsQueryVariables, GetGlobalLiquidityAndSwapVolumeQuery, GetPoolEv
|
|
|
10
10
|
import { FetchPolicy } from '@apollo/client';
|
|
11
11
|
export { gql } from '@apollo/client';
|
|
12
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
|
|
14
|
-
import {
|
|
15
|
-
|
|
13
|
+
import * as _berachain_graphql_beep from '@berachain/graphql/beep';
|
|
14
|
+
import { HoneySnapshotResponse, HoneyTransactionsLatestResponse } from '@berachain/graphql/beep';
|
|
15
|
+
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-COOuDNra.js';
|
|
16
|
+
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-COOuDNra.js';
|
|
16
17
|
import BigNumber from '@berachain/utils/pkg/bignumber.js';
|
|
17
18
|
import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
|
|
18
19
|
import { honeyFactoryAbi } from '@berachain/abis/honey/honeyFactory';
|
|
19
20
|
import { honeyFactoryPythWrapperAbi } from '@berachain/abis/honey/honeyFactoryPythWrapper';
|
|
20
|
-
import { I as IHoneySwapState } from '../useHoneySwapState-
|
|
21
|
-
import { A as AutoclaimedIncentivesResponse, S as StakingConfig, B as BribeBoostRewardProof,
|
|
22
|
-
import { VaultEarningResponse } from '@berachain/graphql/api';
|
|
21
|
+
import { I as IHoneySwapState } from '../useHoneySwapState-twi7NTaO.js';
|
|
22
|
+
import { A as AutoclaimedIncentivesResponse, a as AutoclaimedIncentivesTxHashResponse, S as StakingConfig, B as BribeBoostRewardProof, b as BribeBoostRewardItem, U as UserVaultInfo } from '../pol.d-CeRgXBL8.js';
|
|
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-
|
|
25
|
+
import { I as IContractWrite } from '../global.d-q_LQWQqs.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
29
|
import 'react/jsx-runtime';
|
|
30
30
|
import 'react';
|
|
31
31
|
import '../honey-CYm0RWf4.js';
|
|
32
|
-
import 'swr';
|
|
32
|
+
import '@berachain/utils/pkg/swr';
|
|
33
33
|
import '../txnEnum-ByI5dtDi.js';
|
|
34
34
|
import '../BeraError-7-A5JYy_.js';
|
|
35
35
|
|
|
@@ -37,7 +37,25 @@ interface GetMaxDepositProps {
|
|
|
37
37
|
vaultAddress: Address;
|
|
38
38
|
publicClient: PublicClient;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
interface MaxDeposit {
|
|
41
|
+
/** `maxDeposit` formatted as an ether-denominated decimal string. */
|
|
42
|
+
formatted: string;
|
|
43
|
+
/**
|
|
44
|
+
* True when the vault has no real deposit cap. MetaMorpho's `maxDeposit` sums
|
|
45
|
+
* each enabled market's remaining capacity (its supply cap minus current
|
|
46
|
+
* supply); an uncapped market stores `type(uint184).max` as its cap, so the
|
|
47
|
+
* sum lands at ~uint184.max (≈2.45e55) — not uint256.max. `formatted` turns
|
|
48
|
+
* that into an astronomical number, so callers must key off this flag, not
|
|
49
|
+
* the formatted value, to detect "unlimited".
|
|
50
|
+
*
|
|
51
|
+
* A genuine cap is many orders of magnitude smaller (e.g. Re7 HONEY's ~92M =
|
|
52
|
+
* ~9.2e25), so the uint184-based threshold cleanly separates the two. The sum
|
|
53
|
+
* can exceed uint184.max when several markets are uncapped, so we compare with
|
|
54
|
+
* `>=` rather than testing for the exact sentinel.
|
|
55
|
+
*/
|
|
56
|
+
isUncapped: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare function getMaxDeposit({ vaultAddress, publicClient, }: GetMaxDepositProps): Promise<MaxDeposit>;
|
|
41
59
|
|
|
42
60
|
declare function getEnsoClient({ baseURL, ...args }?: BeraJS.BaseFunctionArgs & {
|
|
43
61
|
/**
|
|
@@ -98,8 +116,7 @@ declare function getAllPools({ textSearch, chain, first, orderBy, orderDirection
|
|
|
98
116
|
__typename?: "GqlRewardVaultDynamicData";
|
|
99
117
|
activeIncentivesValueUsd: string;
|
|
100
118
|
apr?: number | null;
|
|
101
|
-
|
|
102
|
-
allTimeReceivedBGTAmount: string;
|
|
119
|
+
rewardCapturePercentage: number;
|
|
103
120
|
} | null;
|
|
104
121
|
} | null;
|
|
105
122
|
}[];
|
|
@@ -154,8 +171,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
154
171
|
__typename?: "GqlRewardVaultDynamicData";
|
|
155
172
|
activeIncentivesValueUsd: string;
|
|
156
173
|
apr?: number | null;
|
|
157
|
-
|
|
158
|
-
allTimeReceivedBGTAmount: string;
|
|
174
|
+
rewardCapturePercentage: number;
|
|
159
175
|
} | null;
|
|
160
176
|
} | null;
|
|
161
177
|
} | {
|
|
@@ -203,8 +219,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
203
219
|
__typename?: "GqlRewardVaultDynamicData";
|
|
204
220
|
activeIncentivesValueUsd: string;
|
|
205
221
|
apr?: number | null;
|
|
206
|
-
|
|
207
|
-
allTimeReceivedBGTAmount: string;
|
|
222
|
+
rewardCapturePercentage: number;
|
|
208
223
|
} | null;
|
|
209
224
|
} | null;
|
|
210
225
|
} | {
|
|
@@ -252,8 +267,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
252
267
|
__typename?: "GqlRewardVaultDynamicData";
|
|
253
268
|
activeIncentivesValueUsd: string;
|
|
254
269
|
apr?: number | null;
|
|
255
|
-
|
|
256
|
-
allTimeReceivedBGTAmount: string;
|
|
270
|
+
rewardCapturePercentage: number;
|
|
257
271
|
} | null;
|
|
258
272
|
} | null;
|
|
259
273
|
} | {
|
|
@@ -301,8 +315,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
301
315
|
__typename?: "GqlRewardVaultDynamicData";
|
|
302
316
|
activeIncentivesValueUsd: string;
|
|
303
317
|
apr?: number | null;
|
|
304
|
-
|
|
305
|
-
allTimeReceivedBGTAmount: string;
|
|
318
|
+
rewardCapturePercentage: number;
|
|
306
319
|
} | null;
|
|
307
320
|
} | null;
|
|
308
321
|
} | {
|
|
@@ -350,8 +363,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
350
363
|
__typename?: "GqlRewardVaultDynamicData";
|
|
351
364
|
activeIncentivesValueUsd: string;
|
|
352
365
|
apr?: number | null;
|
|
353
|
-
|
|
354
|
-
allTimeReceivedBGTAmount: string;
|
|
366
|
+
rewardCapturePercentage: number;
|
|
355
367
|
} | null;
|
|
356
368
|
} | null;
|
|
357
369
|
} | {
|
|
@@ -399,8 +411,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
399
411
|
__typename?: "GqlRewardVaultDynamicData";
|
|
400
412
|
activeIncentivesValueUsd: string;
|
|
401
413
|
apr?: number | null;
|
|
402
|
-
|
|
403
|
-
allTimeReceivedBGTAmount: string;
|
|
414
|
+
rewardCapturePercentage: number;
|
|
404
415
|
} | null;
|
|
405
416
|
} | null;
|
|
406
417
|
} | {
|
|
@@ -448,8 +459,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
448
459
|
__typename?: "GqlRewardVaultDynamicData";
|
|
449
460
|
activeIncentivesValueUsd: string;
|
|
450
461
|
apr?: number | null;
|
|
451
|
-
|
|
452
|
-
allTimeReceivedBGTAmount: string;
|
|
462
|
+
rewardCapturePercentage: number;
|
|
453
463
|
} | null;
|
|
454
464
|
} | null;
|
|
455
465
|
} | {
|
|
@@ -497,8 +507,7 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
497
507
|
__typename?: "GqlRewardVaultDynamicData";
|
|
498
508
|
activeIncentivesValueUsd: string;
|
|
499
509
|
apr?: number | null;
|
|
500
|
-
|
|
501
|
-
allTimeReceivedBGTAmount: string;
|
|
510
|
+
rewardCapturePercentage: number;
|
|
502
511
|
} | null;
|
|
503
512
|
} | null;
|
|
504
513
|
}>;
|
|
@@ -530,13 +539,18 @@ declare function getVaultPausedState({ publicClient, ...args }: BeraJS.BaseFunct
|
|
|
530
539
|
}): Promise<boolean>;
|
|
531
540
|
|
|
532
541
|
/**
|
|
533
|
-
* Browser-only.
|
|
534
|
-
*
|
|
535
|
-
*
|
|
542
|
+
* Browser-only. Returns daily honey snapshots in the `beep` response shape
|
|
543
|
+
* (`HoneySnapshotResponse`) the chart consumes.
|
|
544
|
+
*
|
|
545
|
+
* Reads from the `beep` backend (`fetchBeep`) when configured, falling back to
|
|
546
|
+
* the legacy honey subgraph proxied through `/api/honey/snapshots` (whose
|
|
547
|
+
* GraphQL result is adapted into the beep shape) otherwise. Server callers must
|
|
548
|
+
* compose the upstream query directly (this action is not server-safe — `fetch`
|
|
549
|
+
* against a relative URL has no origin off-browser).
|
|
536
550
|
*/
|
|
537
551
|
declare function getChartData({ days, }: {
|
|
538
552
|
days: number;
|
|
539
|
-
}): Promise<
|
|
553
|
+
}): Promise<HoneySnapshotResponse>;
|
|
540
554
|
|
|
541
555
|
/**
|
|
542
556
|
* Arguments for the getCollateralWeights function.
|
|
@@ -574,7 +588,13 @@ interface GetGlobalCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
|
574
588
|
*/
|
|
575
589
|
declare function getGlobalCapLimit({ client, asset, amount, isMint, isPythWrapperEnabled, latestPrices, ...args }: GetGlobalCapLimitArgs): Promise<boolean | undefined>;
|
|
576
590
|
|
|
577
|
-
/**
|
|
591
|
+
/**
|
|
592
|
+
* Browser-only. Sums the last 24 hourly honey snapshots into a 24h volume.
|
|
593
|
+
*
|
|
594
|
+
* Reads from the `beep` backend (`fetchBeep`) when configured, falling back to
|
|
595
|
+
* the legacy honey subgraph proxied through `/api/honey/snapshots` otherwise.
|
|
596
|
+
* Both backends expose `totalVolume` per snapshot, so the sum is shape-agnostic.
|
|
597
|
+
*/
|
|
578
598
|
declare function getHoney24hVolume(): Promise<BigNumber | undefined>;
|
|
579
599
|
|
|
580
600
|
interface GetHoneyCollateralsArgs extends BeraJS.BaseFunctionArgs {
|
|
@@ -630,6 +650,27 @@ declare function getHoneyRootPriceOracle({ publicClient, factory, ...args }: Ber
|
|
|
630
650
|
factory?: Address;
|
|
631
651
|
}): Promise<Address>;
|
|
632
652
|
|
|
653
|
+
type HoneyTxn = HoneyTransactionsLatestResponse[number];
|
|
654
|
+
/** beep's transaction type discriminator (`"MINT" | "REDEEM"`). */
|
|
655
|
+
type HoneyTxnType = HoneyTxn["type"];
|
|
656
|
+
interface GetHoneyTxnsArgs {
|
|
657
|
+
/** Zero-based page index (the page size is applied internally). */
|
|
658
|
+
index: number;
|
|
659
|
+
/** Page size. */
|
|
660
|
+
limit: number;
|
|
661
|
+
/** Optional MINT/REDEEM filter; omit for all transactions. */
|
|
662
|
+
txnType?: HoneyTxnType;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Browser-only. Returns a page of honey transactions in the `beep` response
|
|
666
|
+
* shape (`HoneyTransactionsLatestResponse`) the transactions table consumes.
|
|
667
|
+
*
|
|
668
|
+
* Reads from the `beep` backend (`fetchBeep`) when configured, falling back to
|
|
669
|
+
* the legacy honey subgraph proxied through `/api/honey/txns` (whose GraphQL
|
|
670
|
+
* result is adapted into the beep shape) otherwise.
|
|
671
|
+
*/
|
|
672
|
+
declare function getHoneyTxns({ index, limit, txnType, }: GetHoneyTxnsArgs): Promise<HoneyTransactionsLatestResponse>;
|
|
673
|
+
|
|
633
674
|
interface GetRelativeCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
634
675
|
client: PublicClient;
|
|
635
676
|
asset: Address;
|
|
@@ -692,11 +733,26 @@ declare function getBlockTimestamp({ block, currentBlock, blockTime, publicClien
|
|
|
692
733
|
* Server-side function to fetch the incentives the bot autoclaimed on behalf
|
|
693
734
|
* of a wallet during the BGT → BERA cutover. Only valid to call once the
|
|
694
735
|
* bgtIncentiveDistributor contract is paused.
|
|
736
|
+
*
|
|
737
|
+
* Returns `null` on 404 — the endpoint 404s when the bot has not yet processed
|
|
738
|
+
* the wallet, which is a normal "no data yet" state rather than an error.
|
|
695
739
|
*/
|
|
696
740
|
declare function getAutoclaimedIncentives({ account, ...args }: {
|
|
697
741
|
account: Address;
|
|
698
742
|
} & BeraJS.BaseFunctionArgs): Promise<AutoclaimedIncentivesResponse | null>;
|
|
699
743
|
|
|
744
|
+
/**
|
|
745
|
+
* Companion to `getAutoclaimedIncentives` that fetches the on-chain tx hash
|
|
746
|
+
* for each autoclaimed token. Same nested shape as `/autoclaimed`, but each
|
|
747
|
+
* token leaf is `{ txhash }` where the hash may be absent or empty while the
|
|
748
|
+
* bot is still in flight.
|
|
749
|
+
*
|
|
750
|
+
* Returns `null` on 404 (bot has not run yet for this wallet).
|
|
751
|
+
*/
|
|
752
|
+
declare function getAutoclaimedIncentivesTxHash({ account, ...args }: {
|
|
753
|
+
account: Address;
|
|
754
|
+
} & BeraJS.BaseFunctionArgs): Promise<AutoclaimedIncentivesTxHashResponse | null>;
|
|
755
|
+
|
|
700
756
|
type GetBeraTokenTotalSupplyArgs = BeraJS.BaseFunctionArgs;
|
|
701
757
|
/**
|
|
702
758
|
* Fetches the native BERA total supply (in whole BERA units) from the
|
|
@@ -708,8 +764,6 @@ declare function getBeraTokenTotalSupply(args?: GetBeraTokenTotalSupplyArgs): Pr
|
|
|
708
764
|
* Reads `paused()` on the BGT incentive distributor. Used to gate the
|
|
709
765
|
* autoclaim banner — when `true`, users can no longer self-claim and the
|
|
710
766
|
* bot is responsible for distributing incentives on their behalf.
|
|
711
|
-
*
|
|
712
|
-
* Fails closed: any read error returns `false` so the banner stays hidden.
|
|
713
767
|
*/
|
|
714
768
|
declare function getBgtIncentiveDistributorPaused({ publicClient, ...args }: {
|
|
715
769
|
publicClient: PublicClient | undefined;
|
|
@@ -731,7 +785,35 @@ type GetEarnedStakedBeraVaultArgs = {
|
|
|
731
785
|
*/
|
|
732
786
|
account: Address;
|
|
733
787
|
};
|
|
734
|
-
declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<
|
|
788
|
+
declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.BaseFunctionArgs & GetEarnedStakedBeraVaultArgs): Promise<{
|
|
789
|
+
currentDepositRate: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
790
|
+
earningsTotal: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
791
|
+
earningsRealized: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
792
|
+
earningsUnrealized: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
793
|
+
shareLots: {
|
|
794
|
+
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
795
|
+
depositRate: _berachain_graphql_beep.components["schemas"]["DecimalStr"];
|
|
796
|
+
}[];
|
|
797
|
+
sortedEvents: ({
|
|
798
|
+
_height: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
799
|
+
_log_index: number;
|
|
800
|
+
assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
801
|
+
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
802
|
+
_type: "deposit" | "withdrawal";
|
|
803
|
+
sender: string;
|
|
804
|
+
owner: string;
|
|
805
|
+
total_assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
806
|
+
} | {
|
|
807
|
+
_height: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
808
|
+
_log_index: number;
|
|
809
|
+
assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
810
|
+
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
811
|
+
_type: "transfer";
|
|
812
|
+
from: string;
|
|
813
|
+
to: string;
|
|
814
|
+
value: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
815
|
+
})[];
|
|
816
|
+
}>;
|
|
735
817
|
|
|
736
818
|
interface HeroEarnVaults {
|
|
737
819
|
/**
|
|
@@ -1562,4 +1644,4 @@ declare function getValidatorBoostApy({ validator, bgtPrice, }: {
|
|
|
1562
1644
|
bgtPrice: number;
|
|
1563
1645
|
}): number;
|
|
1564
1646
|
|
|
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 };
|
|
1647
|
+
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 MaxDeposit, 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, getHoneyTxns, 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 };
|
package/dist/actions/exports.mjs
CHANGED
|
@@ -12,7 +12,9 @@ import {
|
|
|
12
12
|
getApiPool,
|
|
13
13
|
getApiValidator,
|
|
14
14
|
getAutoclaimedIncentives,
|
|
15
|
+
getAutoclaimedIncentivesTxHash,
|
|
15
16
|
getBgtAprSimulation,
|
|
17
|
+
getBgtIncentiveDistributorPaused,
|
|
16
18
|
getBlockTimestamp,
|
|
17
19
|
getChartData,
|
|
18
20
|
getCollateralWeights,
|
|
@@ -75,45 +77,54 @@ import {
|
|
|
75
77
|
isDefaultRewardAllocation,
|
|
76
78
|
isImpersonateAccount,
|
|
77
79
|
isSameRewardAllocation
|
|
78
|
-
} from "../chunk-
|
|
80
|
+
} from "../chunk-VAA2FVPP.mjs";
|
|
81
|
+
import {
|
|
82
|
+
fetchBeep
|
|
83
|
+
} from "../chunk-MRQGHXAN.mjs";
|
|
79
84
|
import {
|
|
80
85
|
BeraApolloClient,
|
|
81
86
|
getApolloClient,
|
|
82
87
|
gql
|
|
83
|
-
} from "../chunk-
|
|
88
|
+
} from "../chunk-3JJLQ2JX.mjs";
|
|
84
89
|
import "../chunk-CDK4YV3D.mjs";
|
|
85
90
|
import {
|
|
86
91
|
getBalanceCall,
|
|
87
92
|
getEnsoClient,
|
|
88
93
|
getWalletBalances
|
|
89
|
-
} from "../chunk-
|
|
94
|
+
} from "../chunk-HYDP32P6.mjs";
|
|
90
95
|
import "../chunk-HQCOU6GY.mjs";
|
|
91
|
-
import "../chunk-
|
|
92
|
-
import "../chunk-
|
|
96
|
+
import "../chunk-AUOPN6NK.mjs";
|
|
97
|
+
import "../chunk-7YVNSDXG.mjs";
|
|
93
98
|
import {
|
|
94
99
|
assertAddress,
|
|
95
100
|
assertDefined,
|
|
96
101
|
assertPublicClient
|
|
97
|
-
} from "../chunk-
|
|
102
|
+
} from "../chunk-GY6B3PD5.mjs";
|
|
98
103
|
import {
|
|
99
|
-
beraFetchJson,
|
|
100
104
|
bignumber_js_default,
|
|
101
105
|
hoursInSeconds,
|
|
102
106
|
msToSeconds
|
|
103
|
-
} from "../chunk-
|
|
107
|
+
} from "../chunk-E7YFXBBQ.mjs";
|
|
108
|
+
import {
|
|
109
|
+
beraFetchJson
|
|
110
|
+
} from "../chunk-Y6THHG77.mjs";
|
|
104
111
|
import {
|
|
105
112
|
isToken
|
|
106
|
-
} from "../chunk-
|
|
113
|
+
} from "../chunk-IXIBY5FP.mjs";
|
|
107
114
|
import {
|
|
108
115
|
parseBaseArgs
|
|
109
|
-
} from "../chunk-
|
|
116
|
+
} from "../chunk-DQRH5VE3.mjs";
|
|
110
117
|
import "../chunk-SZ5C44L5.mjs";
|
|
111
|
-
import "../chunk-
|
|
112
|
-
import
|
|
118
|
+
import "../chunk-ZLTMIFCZ.mjs";
|
|
119
|
+
import {
|
|
120
|
+
BeraError
|
|
121
|
+
} from "../chunk-KHXJDYA4.mjs";
|
|
113
122
|
|
|
114
123
|
// src/actions/bend/getMaxDeposit.ts
|
|
115
124
|
import { formatEther } from "viem";
|
|
116
125
|
import { metaMorphoV11Abi as metaMorphoAbi } from "@berachain/abis/bend-metamorpho/metaMorphoV11";
|
|
126
|
+
var UINT_184_MAX = (1n << 184n) - 1n;
|
|
127
|
+
var UNCAPPED_THRESHOLD = UINT_184_MAX * 99n / 100n;
|
|
117
128
|
async function getMaxDeposit({
|
|
118
129
|
vaultAddress,
|
|
119
130
|
publicClient
|
|
@@ -124,7 +135,10 @@ async function getMaxDeposit({
|
|
|
124
135
|
functionName: "maxDeposit",
|
|
125
136
|
args: [vaultAddress]
|
|
126
137
|
});
|
|
127
|
-
return
|
|
138
|
+
return {
|
|
139
|
+
formatted: formatEther(maxDeposit),
|
|
140
|
+
isUncapped: maxDeposit >= UNCAPPED_THRESHOLD
|
|
141
|
+
};
|
|
128
142
|
}
|
|
129
143
|
|
|
130
144
|
// src/actions/dex/getPoolWithState.ts
|
|
@@ -269,6 +283,51 @@ async function getHoneyRootPriceOracle({
|
|
|
269
283
|
});
|
|
270
284
|
}
|
|
271
285
|
|
|
286
|
+
// src/actions/honey/getHoneyTxns.ts
|
|
287
|
+
async function getHoneyTxns({
|
|
288
|
+
index,
|
|
289
|
+
limit,
|
|
290
|
+
txnType
|
|
291
|
+
}) {
|
|
292
|
+
if (typeof window === "undefined") {
|
|
293
|
+
throw new BeraError({
|
|
294
|
+
message: "getHoneyTxns is browser-only; call from a Client Component / SWR hook",
|
|
295
|
+
level: "error"
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
const { config } = parseBaseArgs({});
|
|
299
|
+
if (!config.beep) {
|
|
300
|
+
const params = new URLSearchParams({
|
|
301
|
+
skip: String(index * limit),
|
|
302
|
+
limit: String(limit)
|
|
303
|
+
});
|
|
304
|
+
if (txnType) params.set("type", txnType);
|
|
305
|
+
const txns = await beraFetchJson({
|
|
306
|
+
url: `/api/honey/txns?${params}`,
|
|
307
|
+
name: "honey-txns",
|
|
308
|
+
type: "rest"
|
|
309
|
+
});
|
|
310
|
+
return txns.map(fromHoneyTxn);
|
|
311
|
+
}
|
|
312
|
+
return fetchBeep("/v0/honey/transactions/latest", {
|
|
313
|
+
query: { page: String(index + 1), perPage: String(limit), type: txnType }
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function fromHoneyTxn(txn) {
|
|
317
|
+
return {
|
|
318
|
+
txHash: txn.chainTransaction.txHash,
|
|
319
|
+
type: txn.type ?? "MINT",
|
|
320
|
+
collaterals: txn.collateral.map((collateral) => ({
|
|
321
|
+
address: collateral.collateral,
|
|
322
|
+
amount: collateral.collateralAmount
|
|
323
|
+
})),
|
|
324
|
+
to: txn.to,
|
|
325
|
+
from: txn.from,
|
|
326
|
+
honeyAmount: txn.honeyAmount,
|
|
327
|
+
timestamp: Number(txn.timestamp)
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
272
331
|
// src/actions/pol/getBeraTokenTotalSupply.ts
|
|
273
332
|
import { ChainId } from "@berachain/config";
|
|
274
333
|
async function getBeraTokenTotalSupply(args = {}) {
|
|
@@ -287,26 +346,6 @@ async function getBeraTokenTotalSupply(args = {}) {
|
|
|
287
346
|
return data.totalSupply.toString();
|
|
288
347
|
}
|
|
289
348
|
|
|
290
|
-
// src/actions/pol/getBgtIncentiveDistributorPaused.ts
|
|
291
|
-
import { bgtIncentiveDistributorAbi } from "@berachain/abis/pol/rewards/bgtIncentiveDistributor";
|
|
292
|
-
async function getBgtIncentiveDistributorPaused({
|
|
293
|
-
publicClient,
|
|
294
|
-
...args
|
|
295
|
-
}) {
|
|
296
|
-
assertPublicClient(publicClient);
|
|
297
|
-
const { config } = parseBaseArgs(args);
|
|
298
|
-
try {
|
|
299
|
-
const paused = await publicClient.readContract({
|
|
300
|
-
address: config.pol.bgtIncentiveDistributor,
|
|
301
|
-
abi: bgtIncentiveDistributorAbi,
|
|
302
|
-
functionName: "paused"
|
|
303
|
-
});
|
|
304
|
-
return paused;
|
|
305
|
-
} catch {
|
|
306
|
-
return false;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
349
|
// src/actions/pol/getBlockTime.ts
|
|
311
350
|
async function getBlockTime({
|
|
312
351
|
defaultBlockTime,
|
|
@@ -744,7 +783,7 @@ function getValidatorBoostApy({
|
|
|
744
783
|
if (!returnPerBgt || !validatorActiveBoostAmount) {
|
|
745
784
|
return 0;
|
|
746
785
|
}
|
|
747
|
-
const boostApy = returnPerBgt * Number(validator.dynamicData?.
|
|
786
|
+
const boostApy = returnPerBgt * Number(validator.dynamicData?.lastDayDistributedRewards ?? 0) * 365 / (validatorActiveBoostAmount * bgtPrice);
|
|
748
787
|
return boostApy;
|
|
749
788
|
}
|
|
750
789
|
export {
|
|
@@ -765,6 +804,7 @@ export {
|
|
|
765
804
|
getApiValidator,
|
|
766
805
|
getApolloClient,
|
|
767
806
|
getAutoclaimedIncentives,
|
|
807
|
+
getAutoclaimedIncentivesTxHash,
|
|
768
808
|
getBalanceCall,
|
|
769
809
|
getBeraTokenTotalSupply,
|
|
770
810
|
getBgtAprSimulation,
|
|
@@ -790,6 +830,7 @@ export {
|
|
|
790
830
|
getHoneyPythFeeds,
|
|
791
831
|
getHoneyPythOracle,
|
|
792
832
|
getHoneyRootPriceOracle,
|
|
833
|
+
getHoneyTxns,
|
|
793
834
|
getHoneyVaultsBalance,
|
|
794
835
|
getIncentiveFeeClaimStats,
|
|
795
836
|
getLSTStakeConfig,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AbiParameter, Address, PublicClient, AbiFunction, TransactionReceipt } from 'viem';
|
|
2
2
|
import { ProposalErrorCodes, ProposalState } from '../../enum/governance/exports.js';
|
|
3
|
-
import { ProposalStatus, ProposalSelectionFragment, Proposal_Filter, Proposal_OrderBy, OrderDirection, ProposalWithVotesFragment
|
|
3
|
+
import { ProposalStatus, ProposalSelectionFragment, Proposal_Filter, Proposal_OrderBy, OrderDirection, ProposalWithVotesFragment } from '@berachain/graphql/governance';
|
|
4
4
|
import { CustomProposal, GovernanceTopic, CustomProposalErrors } from '../../types/governance/exports.js';
|
|
5
|
+
export { G as GetProposalVotesArgs, g as getProposalVotes } from '../../getProposalVotes-DAUrdX2n.js';
|
|
5
6
|
import graymatter from 'gray-matter';
|
|
6
7
|
|
|
7
8
|
type CheckProposalFieldResultMinimal = ProposalErrorCodes | null;
|
|
@@ -117,15 +118,6 @@ type GetProposalFromTxArgs = {
|
|
|
117
118
|
*/
|
|
118
119
|
declare function getProposalFromTx(args: GetProposalFromTxArgs): Promise<ProposalWithVotesFragment | null>;
|
|
119
120
|
|
|
120
|
-
type GetProposalVotesArgs = BeraJS.BaseFunctionArgs & {
|
|
121
|
-
/** GraphQL variables forwarded to the GetProposalVotes query */
|
|
122
|
-
variables: GetProposalVotesQueryVariables;
|
|
123
|
-
};
|
|
124
|
-
/** Fetches the votes for a proposal from the subgraph */
|
|
125
|
-
declare function getProposalVotes(_args: GetProposalVotesArgs): Promise<{
|
|
126
|
-
data: GetProposalVotesQuery;
|
|
127
|
-
}>;
|
|
128
|
-
|
|
129
121
|
type ParseProposalBodyResult = graymatter.GrayMatterFile<string> & {
|
|
130
122
|
/** Whether the body uses YAML front-matter (true) or legacy heading format (false) */
|
|
131
123
|
isFrontMatter: boolean;
|
|
@@ -137,4 +129,4 @@ type ParseProposalBodyResult = graymatter.GrayMatterFile<string> & {
|
|
|
137
129
|
*/
|
|
138
130
|
declare function parseProposalBody(proposal?: Pick<ProposalSelectionFragment, "description">): ParseProposalBodyResult;
|
|
139
131
|
|
|
140
|
-
export { type GetAllProposalsArgs, type GetBodyErrorsArgs, type GetDecodedFunctionDataArgs, type GetProposalDetailsArgs, type GetProposalFromTxArgs,
|
|
132
|
+
export { type GetAllProposalsArgs, type GetBodyErrorsArgs, type GetDecodedFunctionDataArgs, type GetProposalDetailsArgs, type GetProposalFromTxArgs, MOCKED_PROPOSAL_STATUSES, type ParseProposalBodyResult, checkProposalField, computeActualStatus, getAllProposals, getBodyErrors, getDecodedFunctionData, getProposalDetails, getProposalFromTx, parseProposalBody };
|