@berachain/berajs 0.2.10 → 0.2.12
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 +5 -21
- package/dist/actions/clients/exports.mjs +5 -7
- package/dist/actions/exports.d.ts +117 -31
- package/dist/actions/exports.mjs +36 -25
- package/dist/actions/governance/exports.d.ts +3 -11
- package/dist/actions/server/exports.mjs +2 -2
- package/dist/chunk-4ML4Y6UN.mjs +46 -0
- package/dist/{chunk-7YVNSDXG.mjs → chunk-FGION6F6.mjs} +1 -1
- package/dist/{chunk-3JJLQ2JX.mjs → chunk-MKSFQIKC.mjs} +1 -4
- package/dist/{chunk-ZLTMIFCZ.mjs → chunk-RFJGL4MF.mjs} +3 -3
- package/dist/{chunk-Y6THHG77.mjs → chunk-T43JPYQS.mjs} +1 -1
- package/dist/{chunk-WNBWX23Q.mjs → chunk-W2VODV76.mjs} +7 -10
- package/dist/{chunk-QBBOWFMH.mjs → chunk-XDG26EG6.mjs} +115 -162
- package/dist/{chunk-P5WXXULM.mjs → chunk-YLTWPFCJ.mjs} +3 -18
- package/dist/contexts/exports.d.ts +2 -2
- package/dist/contexts/exports.mjs +6 -4
- package/dist/enum/exports.d.ts +8 -2
- package/dist/errors/exports.mjs +2 -2
- package/dist/{getApolloClient-BcUTGFUb.d.ts → getApolloClient-MWm_iq4u.d.ts} +4 -5
- package/dist/getProposalVotes-DAUrdX2n.d.ts +12 -0
- package/dist/{getValidatorQueuedOperatorAddress-DphU3qhE.d.ts → getValidatorQueuedOperatorAddress-Cc05dlO3.d.ts} +8 -59
- package/dist/{global.d-BuGDKh4k.d.ts → global.d-CR3zicga.d.ts} +3 -10
- package/dist/hooks/exports.d.ts +145 -403
- package/dist/hooks/exports.mjs +496 -755
- package/dist/hooks/governance/exports.d.ts +24 -19
- package/dist/hooks/governance/exports.mjs +43 -53
- package/dist/{pol.d-Dw5SQcRX.d.ts → pol.d-CeRgXBL8.d.ts} +18 -4
- 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 +6 -2
- package/package.json +8 -7
- package/src/actions/bend/getMaxDeposit.ts +28 -2
- package/src/actions/clients/exports.ts +0 -1
- package/src/actions/clients/fetchBeep.ts +0 -7
- package/src/actions/clients/fetchOpenApi.ts +10 -6
- package/src/actions/clients/fetchOpenApi.unit.test.ts +20 -14
- package/src/actions/clients/getApolloClient.ts +4 -9
- package/src/actions/exports.ts +1 -1
- package/src/actions/honey/getChartData.ts +14 -14
- package/src/actions/honey/getHoney24hVolume.ts +17 -8
- package/src/actions/honey/getHoneyTxns.ts +45 -0
- package/src/actions/pol/__tests__/rewardVaults.integration.test.ts +3 -3
- package/src/actions/pol/getEarnedStakedBeraVault.ts +0 -15
- package/src/actions/pol/getGlobalData.ts +10 -29
- package/src/actions/pol/getRewardVaults.ts +4 -4
- package/src/actions/pol/getSWBeraVaultMetadata.ts +0 -7
- package/src/actions/pol/getStakingDailyAssets.ts +0 -14
- package/src/actions/validators/getApiEnrichedAllocation.ts +1 -1
- package/src/actions/validators/getValidatorIncentiveDistribution.ts +43 -13
- package/src/contexts/SwrFallback.tsx +2 -1
- package/src/data/contracts.ts +4 -0
- package/src/errors/RequestError.ts +3 -3
- package/src/errors/getRevertReason.integration.test.ts +5 -1
- package/src/hooks/bend/useGetConvertToAssets.ts +3 -11
- package/src/hooks/dex/useAggregatorsQuotes.ts +13 -11
- package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +2 -7
- package/src/hooks/dex/useAllUserPools.ts +8 -13
- package/src/hooks/dex/useApiPool.ts +2 -9
- package/src/hooks/dex/useGlobalLiquidityAndSwapVolume.ts +1 -2
- package/src/hooks/dex/useOnChainPoolData.ts +3 -4
- package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +3 -9
- package/src/hooks/dex/usePoolEvents.ts +1 -2
- package/src/hooks/dex/usePoolHistoricalData.ts +3 -9
- package/src/hooks/dex/usePools.ts +6 -4
- 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 +4 -5
- package/src/hooks/enso/useEnsoSwapBundle.ts +2 -2
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +4 -10
- package/src/hooks/enso/useEnsoWalletV2Address.ts +1 -1
- package/src/hooks/enso/useIsBendAuthorized.ts +1 -1
- package/src/hooks/enso/useZapStakeBera.ts +2 -5
- package/src/hooks/exports.ts +1 -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 +7 -10
- package/src/hooks/governance/usePollProposalThreshold.ts +2 -7
- package/src/hooks/governance/usePollProposalVotes.ts +23 -5
- package/src/hooks/governance/usePollUserDelegates.ts +4 -9
- package/src/hooks/governance/useProposalFromTx.ts +4 -5
- package/src/hooks/governance/useProposalSnapshot.ts +3 -4
- package/src/hooks/governance/useProposalState.ts +3 -3
- package/src/hooks/governance/useProposalTimelockState.ts +3 -2
- package/src/hooks/governance/useQuorum.ts +1 -2
- package/src/hooks/honey/useCappedGlobally.ts +4 -12
- package/src/hooks/honey/useCappedRelatively.ts +3 -8
- package/src/hooks/honey/useCollateralWeights.ts +4 -9
- package/src/hooks/honey/useHoney24hVolume.ts +2 -6
- package/src/hooks/honey/useHoneyBalances.ts +2 -7
- package/src/hooks/honey/useHoneyChartData.ts +4 -12
- package/src/hooks/honey/useHoneyVaultsBalance.ts +3 -9
- package/src/hooks/honey/useIsBadCollateralAsset.ts +5 -13
- package/src/hooks/honey/useIsBasketModeEnabled.ts +5 -13
- package/src/hooks/honey/usePythLatestPrices.ts +15 -13
- package/src/hooks/perps/usePythUpdateFee.ts +13 -11
- package/src/hooks/pol/useAutoclaimedIncentives.ts +2 -8
- package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +2 -8
- package/src/hooks/pol/useBgtIncentiveDistributorPaused.ts +34 -0
- package/src/hooks/pol/useBgtUnstakedBalance.ts +3 -8
- package/src/hooks/pol/useClaimableFees.ts +2 -6
- package/src/hooks/pol/useHighestVaultsAPR.ts +6 -11
- package/src/hooks/pol/useOnChainRewardVault.ts +77 -72
- package/src/hooks/pol/usePollGlobalData.ts +3 -9
- package/src/hooks/pol/usePollMarkets.ts +3 -8
- package/src/hooks/pol/useQueuedBeraUnlock.ts +3 -12
- package/src/hooks/pol/useRewardTokenToBeraRate.ts +2 -2
- package/src/hooks/pol/useRewardVault.ts +9 -8
- package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +6 -6
- package/src/hooks/pol/useRewardVaultFromToken.ts +24 -30
- package/src/hooks/pol/useRewardVaultIncentives.ts +2 -7
- package/src/hooks/pol/useRewardVaultRewards.ts +3 -8
- package/src/hooks/pol/useRewardVaults.ts +4 -12
- package/src/hooks/pol/useStakedAPR.ts +2 -8
- package/src/hooks/pol/useStakedData.ts +90 -41
- package/src/hooks/pol/useStakedSnapshots.ts +4 -9
- package/src/hooks/pol/useStakingVaultsMetadata.ts +1 -1
- package/src/hooks/pol/useTotalStakedAmount.ts +2 -8
- package/src/hooks/pol/useUserVaultInfo.ts +3 -8
- package/src/hooks/pol/useUserVaults.ts +3 -8
- package/src/hooks/pol/useVaultAddress.ts +1 -1
- package/src/hooks/pol/useVaultHistory.ts +2 -8
- package/src/hooks/pol/useVaultValidators.ts +3 -8
- package/src/hooks/tokens/useMultipleTokenInformation.ts +3 -8
- package/src/hooks/tokens/usePollAllowances.ts +4 -11
- package/src/hooks/tokens/usePollBalance.ts +2 -5
- package/src/hooks/tokens/usePollWalletBalances.ts +3 -3
- package/src/hooks/tokens/useStakingTokenInformation.ts +3 -12
- package/src/hooks/tokens/useTokenCurrentPrices.ts +11 -13
- package/src/hooks/tokens/useTokenInformation.ts +3 -8
- 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 +3 -9
- package/src/hooks/validators/useApiEnrichedAllocation.ts +1 -1
- package/src/hooks/validators/useApiValidator.ts +4 -12
- package/src/hooks/validators/useBaselineRewardAllocation.ts +1 -2
- package/src/hooks/validators/useDailyValidatorBlockStats.ts +2 -4
- package/src/hooks/validators/useDefaultRewardAllocation.ts +3 -9
- package/src/hooks/validators/useManagedValidatorRole.ts +2 -3
- package/src/hooks/validators/useOnChainValidator.ts +4 -11
- package/src/hooks/validators/useStakingPoolBatch.ts +4 -10
- package/src/hooks/validators/useUserActiveValidators.ts +3 -9
- package/src/hooks/validators/useUserBoostsOnValidator.ts +2 -4
- package/src/hooks/validators/useUserClaimableIncentives.ts +3 -3
- package/src/hooks/validators/useUserStakingPositions.ts +3 -9
- package/src/hooks/validators/useValidatorAnalytics.ts +2 -4
- package/src/hooks/validators/useValidatorCommission.ts +3 -8
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +4 -6
- package/src/hooks/validators/useValidatorQueuedCommission.ts +3 -8
- package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +3 -8
- package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +3 -8
- package/src/hooks/validators/useValidatorRewardAllocation.ts +3 -8
- package/src/types/global.d.ts +7 -10
- package/src/types/pol.d.ts +17 -3
- package/dist/polling-BKnyavLI.d.ts +0 -8
- package/src/actions/clients/fetchRailwayBackend.ts +0 -34
- package/src/actions/pol/getGlobalCuttingBoard.ts +0 -25
- package/src/actions/pol/getIncentiveFeeClaimStats.ts +0 -24
|
@@ -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,14 +1,13 @@
|
|
|
1
1
|
import { paths } from '@berachain/graphql/beep';
|
|
2
2
|
import { HttpLink } from '@berachain/config';
|
|
3
|
-
|
|
4
|
-
export { g as getApolloClient } from '../../getApolloClient-BcUTGFUb.js';
|
|
3
|
+
export { g as getApolloClient } from '../../getApolloClient-MWm_iq4u.js';
|
|
5
4
|
export { gql } from '@apollo/client';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* A minimal, fully-typed GET helper for our `openapi-typescript`-generated
|
|
9
|
-
*
|
|
10
|
-
* we type a single `fetchOpenApi` against a schema's `paths` and wrap it
|
|
11
|
-
*
|
|
8
|
+
* `beep` backend. beep serves only GETs, so rather than a full OpenAPI client
|
|
9
|
+
* we type a single `fetchOpenApi` against a schema's `paths` and wrap it
|
|
10
|
+
* (`fetchBeep`).
|
|
12
11
|
*
|
|
13
12
|
* The `path`, its path/query params and the response body are all type-checked
|
|
14
13
|
* against the schema, so route shapes can never drift out of sync with the
|
|
@@ -57,22 +56,7 @@ declare function fetchOpenApi<Paths extends AnyPaths, P extends GetPath<Paths>>(
|
|
|
57
56
|
* against the beep schema (`@berachain/graphql/beep`), so route shapes (e.g.
|
|
58
57
|
* the `/v0/stake/*` namespace) can never drift out of sync with the backend.
|
|
59
58
|
* 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
59
|
*/
|
|
64
60
|
declare function fetchBeep<P extends GetPath<paths>>(path: P, params: DefinedParams<paths, P>, args?: BeraJS.BaseFunctionArgs): Promise<GetResponse<paths, P>>;
|
|
65
61
|
|
|
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 };
|
|
62
|
+
export { fetchBeep, fetchOpenApi };
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchBeep,
|
|
3
|
-
fetchOpenApi
|
|
4
|
-
|
|
5
|
-
} from "../../chunk-P5WXXULM.mjs";
|
|
3
|
+
fetchOpenApi
|
|
4
|
+
} from "../../chunk-YLTWPFCJ.mjs";
|
|
6
5
|
import {
|
|
7
6
|
getApolloClient,
|
|
8
7
|
gql
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-MKSFQIKC.mjs";
|
|
9
|
+
import "../../chunk-T43JPYQS.mjs";
|
|
11
10
|
import "../../chunk-DQRH5VE3.mjs";
|
|
12
11
|
import "../../chunk-SZ5C44L5.mjs";
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-RFJGL4MF.mjs";
|
|
14
13
|
import "../../chunk-KHXJDYA4.mjs";
|
|
15
14
|
export {
|
|
16
15
|
fetchBeep,
|
|
17
16
|
fetchOpenApi,
|
|
18
|
-
fetchRailwayBackend,
|
|
19
17
|
getApolloClient,
|
|
20
18
|
gql
|
|
21
19
|
};
|
|
@@ -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
|
|
3
|
-
import { Address, PublicClient, Abi, ContractFunctionArgs, ContractFunctionName, TransactionReceipt, WalletCallReceipt } from 'viem';
|
|
4
|
-
export { B as BeraApolloClient, g as getApolloClient } from '../getApolloClient-
|
|
1
|
+
import { V as ValidatorRewardAllocation } from '../getValidatorQueuedOperatorAddress-Cc05dlO3.js';
|
|
2
|
+
export { B as BaseAggregator, G as GetBgtAprSimulationArgs, a as GetBgtAprSimulationResult, b as GetConvertToAssetsProps, c as GetHoneyVaultsBalanceResponse, d as GetMarkets, e as GetRewardVaultData, f as GetRewardVaultRewardsReturn, g as GetUserVaultsResponse, h as GetVaultHistoryArgs, i as GlobalData, I as IsBadCollateralArgs, j as IsBadCollateralResponse, 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 getRewardVaultIncentives, C as getRewardVaultRewards, D as getRewardVaults, E as getSWBeraVaultMetadata, F as getSWBeraWithdrawal, H as getUserActiveValidators, J as getUserBoostsOnValidator, K as getUserStakingPositions, L as getUserVaults, M as getValidatorQueuedCommission, N as getValidatorQueuedOperatorAddress, O as getValidatorRewardAllocation, P as getVaultHistory, Q as isBadCollateralAsset, T as isSameRewardAllocation } from '../getValidatorQueuedOperatorAddress-Cc05dlO3.js';
|
|
3
|
+
import { Address, PublicClient, Hex, Abi, ContractFunctionArgs, ContractFunctionName, TransactionReceipt, WalletCallReceipt } from 'viem';
|
|
4
|
+
export { B as BeraApolloClient, g as getApolloClient } from '../getApolloClient-MWm_iq4u.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';
|
|
@@ -9,27 +9,27 @@ import * as _berachain_graphql_dex_api from '@berachain/graphql/dex/api';
|
|
|
9
9
|
import { GetPoolsQueryVariables, GetGlobalLiquidityAndSwapVolumeQuery, GetPoolEventsQuery, GqlChain, PoolHistoricalDataFragment, MinimalPoolFragment } from '@berachain/graphql/dex/api';
|
|
10
10
|
import { FetchPolicy } from '@apollo/client';
|
|
11
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
|
|
14
|
-
import {
|
|
15
|
-
|
|
12
|
+
import { GqlPoolType, GqlPoolEventType, ApiVaultFragment, GetHeroEarnVaultsQuery, GqlChain as GqlChain$1, GqlVaultSnapshotDataRange, GetSWberaVaultSnapshotsQuery, ApiValidatorFragment, GetValidatorsQueryVariables, GetValidatorsQuery, ApiRewardAllocationWeightFragment, GetValidatorQuery, ApiValidatorMinimalFragment, ApiValidatorRewardAllocationWeightFragment, ApiMinimalVaultIncentiveFragment } from '@berachain/graphql/pol/api';
|
|
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, a as AutoclaimedIncentivesTxHashResponse, S as StakingConfig, B as BribeBoostRewardProof, b as BribeBoostRewardItem, U as UserVaultInfo } from '../pol.d-
|
|
22
|
-
import * as _berachain_graphql_beep from '@berachain/graphql/beep';
|
|
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-CR3zicga.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
|
/**
|
|
@@ -496,6 +514,54 @@ declare function getApiPool({ poolId, account, ...args }: {
|
|
|
496
514
|
|
|
497
515
|
declare function getGlobalLiquidityAndSwapVolume(args?: BeraJS.BaseFunctionArgs): Promise<GetGlobalLiquidityAndSwapVolumeQuery>;
|
|
498
516
|
|
|
517
|
+
interface PoolStatus {
|
|
518
|
+
isPoolInRecoveryMode: boolean;
|
|
519
|
+
isPoolPaused: boolean;
|
|
520
|
+
}
|
|
521
|
+
declare function getPoolPausedState({ publicClient, poolAddress, }: {
|
|
522
|
+
publicClient: PublicClient;
|
|
523
|
+
poolAddress: Address;
|
|
524
|
+
}): Promise<PoolStatus>;
|
|
525
|
+
|
|
526
|
+
interface OnChainPool {
|
|
527
|
+
pausedState: PoolStatus;
|
|
528
|
+
address: Address;
|
|
529
|
+
id: Hex;
|
|
530
|
+
name: string;
|
|
531
|
+
poolTokens: [
|
|
532
|
+
/**
|
|
533
|
+
* The addresses of the tokens in the pool
|
|
534
|
+
*/
|
|
535
|
+
readonly Address[],
|
|
536
|
+
/**
|
|
537
|
+
* The balances of the tokens in the pool
|
|
538
|
+
*/
|
|
539
|
+
string[],
|
|
540
|
+
/**
|
|
541
|
+
* The last change block of the pool
|
|
542
|
+
*/
|
|
543
|
+
number
|
|
544
|
+
];
|
|
545
|
+
totalSupply: string;
|
|
546
|
+
swapFee: string;
|
|
547
|
+
decimals: number;
|
|
548
|
+
weights: readonly string[] | undefined;
|
|
549
|
+
version: unknown;
|
|
550
|
+
factory: Address;
|
|
551
|
+
type: GqlPoolType;
|
|
552
|
+
/**
|
|
553
|
+
* For example, if value is 300000n and precision is 1000n, the user-set amplification parameter would be 300000n / 1000n = 300n.
|
|
554
|
+
*
|
|
555
|
+
* The first number is the raw value, the second number is a boolean indicating if the amplification parameter is being updated, and the third number is the precision factor.
|
|
556
|
+
* @see https://github.com/balancer/docs-developers/blob/main/references/valuing-balancer-lp-tokens/pools/stablepools.md#getamplificationparameter
|
|
557
|
+
*/
|
|
558
|
+
amplificationParameter: readonly [number, boolean, number] | undefined;
|
|
559
|
+
}
|
|
560
|
+
declare function getOnChainPool({ poolId, publicClient, ...args }: {
|
|
561
|
+
poolId: string;
|
|
562
|
+
publicClient: PublicClient;
|
|
563
|
+
} & BeraJS.BaseFunctionArgs): Promise<OnChainPool>;
|
|
564
|
+
|
|
499
565
|
declare function getPoolEvents({ poolId, typeInArray, ...args }: {
|
|
500
566
|
poolId: string;
|
|
501
567
|
typeInArray: GqlPoolEventType[];
|
|
@@ -521,13 +587,16 @@ declare function getVaultPausedState({ publicClient, ...args }: BeraJS.BaseFunct
|
|
|
521
587
|
}): Promise<boolean>;
|
|
522
588
|
|
|
523
589
|
/**
|
|
524
|
-
* Browser-only.
|
|
525
|
-
*
|
|
526
|
-
*
|
|
590
|
+
* Browser-only. Returns daily honey snapshots in the `beep` response shape
|
|
591
|
+
* (`HoneySnapshotResponse`) the chart consumes.
|
|
592
|
+
*
|
|
593
|
+
* Reads from the `beep` backend (`fetchBeep`). Server callers must compose the
|
|
594
|
+
* upstream query directly (this action is not server-safe — `fetch` against a
|
|
595
|
+
* relative URL has no origin off-browser).
|
|
527
596
|
*/
|
|
528
597
|
declare function getChartData({ days, }: {
|
|
529
598
|
days: number;
|
|
530
|
-
}): Promise<
|
|
599
|
+
}): Promise<HoneySnapshotResponse>;
|
|
531
600
|
|
|
532
601
|
/**
|
|
533
602
|
* Arguments for the getCollateralWeights function.
|
|
@@ -565,7 +634,12 @@ interface GetGlobalCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
|
565
634
|
*/
|
|
566
635
|
declare function getGlobalCapLimit({ client, asset, amount, isMint, isPythWrapperEnabled, latestPrices, ...args }: GetGlobalCapLimitArgs): Promise<boolean | undefined>;
|
|
567
636
|
|
|
568
|
-
/**
|
|
637
|
+
/**
|
|
638
|
+
* Browser-only. Sums the last 24 hourly honey snapshots into a 24h volume.
|
|
639
|
+
*
|
|
640
|
+
* Reads from the `beep` backend (`fetchBeep`), which exposes `totalVolume` per
|
|
641
|
+
* snapshot.
|
|
642
|
+
*/
|
|
569
643
|
declare function getHoney24hVolume(): Promise<BigNumber | undefined>;
|
|
570
644
|
|
|
571
645
|
interface GetHoneyCollateralsArgs extends BeraJS.BaseFunctionArgs {
|
|
@@ -621,6 +695,25 @@ declare function getHoneyRootPriceOracle({ publicClient, factory, ...args }: Ber
|
|
|
621
695
|
factory?: Address;
|
|
622
696
|
}): Promise<Address>;
|
|
623
697
|
|
|
698
|
+
type HoneyTxn = HoneyTransactionsLatestResponse[number];
|
|
699
|
+
/** beep's transaction type discriminator (`"MINT" | "REDEEM"`). */
|
|
700
|
+
type HoneyTxnType = HoneyTxn["type"];
|
|
701
|
+
interface GetHoneyTxnsArgs {
|
|
702
|
+
/** Zero-based page index (the page size is applied internally). */
|
|
703
|
+
index: number;
|
|
704
|
+
/** Page size. */
|
|
705
|
+
limit: number;
|
|
706
|
+
/** Optional MINT/REDEEM filter; omit for all transactions. */
|
|
707
|
+
txnType?: HoneyTxnType;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Browser-only. Returns a page of honey transactions in the `beep` response
|
|
711
|
+
* shape (`HoneyTransactionsLatestResponse`) the transactions table consumes.
|
|
712
|
+
*
|
|
713
|
+
* Reads from the `beep` backend (`fetchBeep`).
|
|
714
|
+
*/
|
|
715
|
+
declare function getHoneyTxns({ index, limit, txnType, }: GetHoneyTxnsArgs): Promise<HoneyTransactionsLatestResponse>;
|
|
716
|
+
|
|
624
717
|
interface GetRelativeCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
625
718
|
client: PublicClient;
|
|
626
719
|
asset: Address;
|
|
@@ -750,8 +843,8 @@ declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.
|
|
|
750
843
|
assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
751
844
|
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
752
845
|
_type: "deposit" | "withdrawal";
|
|
753
|
-
sender:
|
|
754
|
-
owner:
|
|
846
|
+
sender: _berachain_graphql_beep.components["schemas"]["EvmAddress"];
|
|
847
|
+
owner: _berachain_graphql_beep.components["schemas"]["EvmAddress"];
|
|
755
848
|
total_assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
756
849
|
} | {
|
|
757
850
|
_height: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
@@ -759,8 +852,8 @@ declare function getEarnedStakedBeraVault({ address, account, ...args }: BeraJS.
|
|
|
759
852
|
assets: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
760
853
|
shares: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
761
854
|
_type: "transfer";
|
|
762
|
-
from:
|
|
763
|
-
to:
|
|
855
|
+
from: _berachain_graphql_beep.components["schemas"]["EvmAddress"];
|
|
856
|
+
to: _berachain_graphql_beep.components["schemas"]["EvmAddress"];
|
|
764
857
|
value: _berachain_graphql_beep.components["schemas"]["BigIntStr"];
|
|
765
858
|
})[];
|
|
766
859
|
}>;
|
|
@@ -799,13 +892,6 @@ declare function getHeroEarnVaults({ bestAprExcludedAddresses, ...args }?: {
|
|
|
799
892
|
bestAprExcludedAddresses?: string[];
|
|
800
893
|
} & BeraJS.BaseFunctionArgs): Promise<HeroEarnVaults>;
|
|
801
894
|
|
|
802
|
-
type IncentiveFeeClaimStats = {
|
|
803
|
-
sumAllClaims: number;
|
|
804
|
-
sumClaimsInLast24Hours: number;
|
|
805
|
-
};
|
|
806
|
-
/** Browser-only. Hits `/api/pol/incentive-fee-claims` (server computes totals). */
|
|
807
|
-
declare function getIncentiveFeeClaimStats(): Promise<IncentiveFeeClaimStats>;
|
|
808
|
-
|
|
809
895
|
type GetLSTStakeConfigArgs = {
|
|
810
896
|
tokenList: TokenWithMetadata[];
|
|
811
897
|
publicClient?: PublicClient;
|
|
@@ -1594,4 +1680,4 @@ declare function getValidatorBoostApy({ validator, bgtPrice, }: {
|
|
|
1594
1680
|
bgtPrice: number;
|
|
1595
1681
|
}): number;
|
|
1596
1682
|
|
|
1597
|
-
export { type ActiveBoostAndCommissionChangeDelay, type GetAllowances, type GetAllowancesResponse, type GetBeraTokenTotalSupplyArgs, type GetLSTStakeConfigArgs, type GetStakedBeraSnapshotsArgs, type GetTokenInformation, type GetTokenInformationResponse, type GetUserVaultInfoParams, type GetUserVaultsInfo, type GetWalletBalances, type HeroEarnVaults, type
|
|
1683
|
+
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 MaxDeposit, type OnChainPool, type PoolDayData, type PoolStatus, 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, getLSTStakeConfig, getMaxDeposit, getOnChainPool, getPoolEvents, getPoolHistoricalData, getPoolPausedState, 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
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
getAutoclaimedIncentives,
|
|
15
15
|
getAutoclaimedIncentivesTxHash,
|
|
16
16
|
getBgtAprSimulation,
|
|
17
|
+
getBgtIncentiveDistributorPaused,
|
|
17
18
|
getBlockTimestamp,
|
|
18
19
|
getChartData,
|
|
19
20
|
getCollateralWeights,
|
|
@@ -28,7 +29,6 @@ import {
|
|
|
28
29
|
getHoneyCollaterals,
|
|
29
30
|
getHoneyPreview,
|
|
30
31
|
getHoneyVaultsBalance,
|
|
31
|
-
getIncentiveFeeClaimStats,
|
|
32
32
|
getMarkets,
|
|
33
33
|
getOnChainPool,
|
|
34
34
|
getPoolEvents,
|
|
@@ -76,13 +76,15 @@ import {
|
|
|
76
76
|
isDefaultRewardAllocation,
|
|
77
77
|
isImpersonateAccount,
|
|
78
78
|
isSameRewardAllocation
|
|
79
|
-
} from "../chunk-
|
|
80
|
-
import
|
|
79
|
+
} from "../chunk-XDG26EG6.mjs";
|
|
80
|
+
import {
|
|
81
|
+
fetchBeep
|
|
82
|
+
} from "../chunk-YLTWPFCJ.mjs";
|
|
81
83
|
import {
|
|
82
84
|
BeraApolloClient,
|
|
83
85
|
getApolloClient,
|
|
84
86
|
gql
|
|
85
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-MKSFQIKC.mjs";
|
|
86
88
|
import "../chunk-CDK4YV3D.mjs";
|
|
87
89
|
import {
|
|
88
90
|
getBalanceCall,
|
|
@@ -91,7 +93,7 @@ import {
|
|
|
91
93
|
} from "../chunk-HYDP32P6.mjs";
|
|
92
94
|
import "../chunk-HQCOU6GY.mjs";
|
|
93
95
|
import "../chunk-AUOPN6NK.mjs";
|
|
94
|
-
import "../chunk-
|
|
96
|
+
import "../chunk-FGION6F6.mjs";
|
|
95
97
|
import {
|
|
96
98
|
assertAddress,
|
|
97
99
|
assertDefined,
|
|
@@ -104,7 +106,7 @@ import {
|
|
|
104
106
|
} from "../chunk-E7YFXBBQ.mjs";
|
|
105
107
|
import {
|
|
106
108
|
beraFetchJson
|
|
107
|
-
} from "../chunk-
|
|
109
|
+
} from "../chunk-T43JPYQS.mjs";
|
|
108
110
|
import {
|
|
109
111
|
isToken
|
|
110
112
|
} from "../chunk-IXIBY5FP.mjs";
|
|
@@ -112,12 +114,16 @@ import {
|
|
|
112
114
|
parseBaseArgs
|
|
113
115
|
} from "../chunk-DQRH5VE3.mjs";
|
|
114
116
|
import "../chunk-SZ5C44L5.mjs";
|
|
115
|
-
import "../chunk-
|
|
116
|
-
import
|
|
117
|
+
import "../chunk-RFJGL4MF.mjs";
|
|
118
|
+
import {
|
|
119
|
+
BeraError
|
|
120
|
+
} from "../chunk-KHXJDYA4.mjs";
|
|
117
121
|
|
|
118
122
|
// src/actions/bend/getMaxDeposit.ts
|
|
119
123
|
import { formatEther } from "viem";
|
|
120
124
|
import { metaMorphoV11Abi as metaMorphoAbi } from "@berachain/abis/bend-metamorpho/metaMorphoV11";
|
|
125
|
+
var UINT_184_MAX = (1n << 184n) - 1n;
|
|
126
|
+
var UNCAPPED_THRESHOLD = UINT_184_MAX * 99n / 100n;
|
|
121
127
|
async function getMaxDeposit({
|
|
122
128
|
vaultAddress,
|
|
123
129
|
publicClient
|
|
@@ -128,7 +134,10 @@ async function getMaxDeposit({
|
|
|
128
134
|
functionName: "maxDeposit",
|
|
129
135
|
args: [vaultAddress]
|
|
130
136
|
});
|
|
131
|
-
return
|
|
137
|
+
return {
|
|
138
|
+
formatted: formatEther(maxDeposit),
|
|
139
|
+
isUncapped: maxDeposit >= UNCAPPED_THRESHOLD
|
|
140
|
+
};
|
|
132
141
|
}
|
|
133
142
|
|
|
134
143
|
// src/actions/dex/getPoolWithState.ts
|
|
@@ -273,6 +282,23 @@ async function getHoneyRootPriceOracle({
|
|
|
273
282
|
});
|
|
274
283
|
}
|
|
275
284
|
|
|
285
|
+
// src/actions/honey/getHoneyTxns.ts
|
|
286
|
+
async function getHoneyTxns({
|
|
287
|
+
index,
|
|
288
|
+
limit,
|
|
289
|
+
txnType
|
|
290
|
+
}) {
|
|
291
|
+
if (typeof window === "undefined") {
|
|
292
|
+
throw new BeraError({
|
|
293
|
+
message: "getHoneyTxns is browser-only; call from a Client Component / SWR hook",
|
|
294
|
+
level: "error"
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
return fetchBeep("/v0/honey/transactions/latest", {
|
|
298
|
+
query: { page: String(index + 1), perPage: String(limit), type: txnType }
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
|
|
276
302
|
// src/actions/pol/getBeraTokenTotalSupply.ts
|
|
277
303
|
import { ChainId } from "@berachain/config";
|
|
278
304
|
async function getBeraTokenTotalSupply(args = {}) {
|
|
@@ -291,21 +317,6 @@ async function getBeraTokenTotalSupply(args = {}) {
|
|
|
291
317
|
return data.totalSupply.toString();
|
|
292
318
|
}
|
|
293
319
|
|
|
294
|
-
// src/actions/pol/getBgtIncentiveDistributorPaused.ts
|
|
295
|
-
import { bgtIncentiveDistributorAbi } from "@berachain/abis/pol/rewards/bgtIncentiveDistributor";
|
|
296
|
-
async function getBgtIncentiveDistributorPaused({
|
|
297
|
-
publicClient,
|
|
298
|
-
...args
|
|
299
|
-
}) {
|
|
300
|
-
assertPublicClient(publicClient);
|
|
301
|
-
const { config } = parseBaseArgs(args);
|
|
302
|
-
return publicClient.readContract({
|
|
303
|
-
address: config.pol.bgtIncentiveDistributor,
|
|
304
|
-
abi: bgtIncentiveDistributorAbi,
|
|
305
|
-
functionName: "paused"
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
320
|
// src/actions/pol/getBlockTime.ts
|
|
310
321
|
async function getBlockTime({
|
|
311
322
|
defaultBlockTime,
|
|
@@ -790,8 +801,8 @@ export {
|
|
|
790
801
|
getHoneyPythFeeds,
|
|
791
802
|
getHoneyPythOracle,
|
|
792
803
|
getHoneyRootPriceOracle,
|
|
804
|
+
getHoneyTxns,
|
|
793
805
|
getHoneyVaultsBalance,
|
|
794
|
-
getIncentiveFeeClaimStats,
|
|
795
806
|
getLSTStakeConfig,
|
|
796
807
|
getMarkets,
|
|
797
808
|
getMaxDeposit,
|
|
@@ -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 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getApolloClient
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-MKSFQIKC.mjs";
|
|
4
4
|
import "../../chunk-DQRH5VE3.mjs";
|
|
5
5
|
import "../../chunk-SZ5C44L5.mjs";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-RFJGL4MF.mjs";
|
|
7
7
|
import "../../chunk-KHXJDYA4.mjs";
|
|
8
8
|
|
|
9
9
|
// src/actions/server/getDailyValidatorBlockStats.ts
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// ../utils/src/pkg/swr/index.ts
|
|
2
|
+
import {
|
|
3
|
+
mutate,
|
|
4
|
+
preload,
|
|
5
|
+
SWRConfig,
|
|
6
|
+
unstable_serialize,
|
|
7
|
+
useSWRConfig
|
|
8
|
+
} from "swr";
|
|
9
|
+
import useOriginalSWR from "swr";
|
|
10
|
+
import useOriginalSWRImmutable from "swr/immutable";
|
|
11
|
+
function useSWR(key, fetcher, options) {
|
|
12
|
+
const { isEnabled = true, ...swrConfig } = options ?? {};
|
|
13
|
+
const response = useOriginalSWR(
|
|
14
|
+
isEnabled ? key : null,
|
|
15
|
+
fetcher,
|
|
16
|
+
swrConfig
|
|
17
|
+
);
|
|
18
|
+
return {
|
|
19
|
+
...response,
|
|
20
|
+
refresh: () => {
|
|
21
|
+
response.mutate();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function useSWRImmutable(key, fetcher, options) {
|
|
26
|
+
const { isEnabled = true, ...swrConfig } = options ?? {};
|
|
27
|
+
const response = useOriginalSWRImmutable(
|
|
28
|
+
isEnabled ? key : null,
|
|
29
|
+
fetcher,
|
|
30
|
+
swrConfig
|
|
31
|
+
);
|
|
32
|
+
return {
|
|
33
|
+
...response,
|
|
34
|
+
refresh: () => {
|
|
35
|
+
response.mutate();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var swr_default = useSWR;
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
useSWR,
|
|
43
|
+
useSWRImmutable,
|
|
44
|
+
swr_default,
|
|
45
|
+
SWRConfig
|
|
46
|
+
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-SZ5C44L5.mjs";
|
|
7
7
|
import {
|
|
8
8
|
RequestError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RFJGL4MF.mjs";
|
|
10
10
|
import {
|
|
11
11
|
BeraError
|
|
12
12
|
} from "./chunk-KHXJDYA4.mjs";
|
|
@@ -155,7 +155,6 @@ function getClient(endpoint, {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
var SUBGRAPH_CLIENTS = [
|
|
158
|
-
"honey.subgraph",
|
|
159
158
|
"pol.subgraph"
|
|
160
159
|
];
|
|
161
160
|
function isSubgraphClient(name) {
|
|
@@ -197,8 +196,6 @@ function getApolloClient(clientName, { ...args }) {
|
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
198
|
return store(cacheKey, getClient(config.bend.whiskApi));
|
|
200
|
-
case "honey.subgraph":
|
|
201
|
-
return store(cacheKey, getClient(config.honey.subgraph));
|
|
202
199
|
case "pol.subgraph":
|
|
203
200
|
return store(cacheKey, getClient(config.pol.subgraph));
|
|
204
201
|
}
|
|
@@ -32,9 +32,9 @@ var RequestError = class _RequestError extends BeraError {
|
|
|
32
32
|
"https://open-api.openocean.finance/v4/bera/swap",
|
|
33
33
|
// vercel internal proxy
|
|
34
34
|
"/api/aggregators?aggregator",
|
|
35
|
-
// bonder endpoints have date-based query params
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// beep (next-gen backend) bonder endpoints have date-based query params
|
|
36
|
+
// (e.g. ?start=2025-11-28) on both networks
|
|
37
|
+
mainnet.beep,
|
|
38
38
|
bepolia.beep
|
|
39
39
|
];
|
|
40
40
|
statusCode;
|