@berachain/berajs 0.2.10 → 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.mjs +1 -1
- package/dist/actions/exports.d.ts +67 -17
- package/dist/actions/exports.mjs +60 -19
- package/dist/actions/governance/exports.d.ts +3 -11
- package/dist/{chunk-P5WXXULM.mjs → chunk-MRQGHXAN.mjs} +1 -1
- package/dist/{chunk-WNBWX23Q.mjs → chunk-SXUNCX5E.mjs} +5 -4
- package/dist/chunk-UD5IUNCW.mjs +34 -0
- package/dist/{chunk-QBBOWFMH.mjs → chunk-VAA2FVPP.mjs} +58 -12
- package/dist/contexts/exports.d.ts +2 -2
- package/dist/contexts/exports.mjs +4 -2
- package/dist/enum/exports.d.ts +8 -2
- package/dist/getProposalVotes-DAUrdX2n.d.ts +12 -0
- package/dist/{getValidatorQueuedOperatorAddress-DphU3qhE.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 +100 -149
- package/dist/hooks/exports.mjs +468 -484
- package/dist/hooks/governance/exports.d.ts +20 -15
- package/dist/hooks/governance/exports.mjs +39 -37
- 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 +4 -0
- package/package.json +8 -7
- package/src/actions/bend/getMaxDeposit.ts +28 -2
- package/src/actions/clients/fetchOpenApi.ts +6 -2
- package/src/actions/clients/fetchOpenApi.unit.test.ts +24 -2
- package/src/actions/exports.ts +1 -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/validators/getValidatorIncentiveDistribution.ts +64 -12
- package/src/contexts/SwrFallback.tsx +2 -1
- package/src/data/contracts.ts +4 -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 +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 +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 +1 -2
- package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +1 -2
- 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/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/global.d.ts +3 -4
- package/src/types/pol.d.ts +17 -3
- package/dist/polling-BKnyavLI.d.ts +0 -8
|
@@ -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,5 +1,5 @@
|
|
|
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
4
|
export { B as BeraApolloClient, g as getApolloClient } from '../getApolloClient-BcUTGFUb.js';
|
|
5
5
|
import { EnsoClient } from '@ensofinance/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, 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-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
|
/**
|
|
@@ -521,13 +539,18 @@ declare function getVaultPausedState({ publicClient, ...args }: BeraJS.BaseFunct
|
|
|
521
539
|
}): Promise<boolean>;
|
|
522
540
|
|
|
523
541
|
/**
|
|
524
|
-
* Browser-only.
|
|
525
|
-
*
|
|
526
|
-
*
|
|
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).
|
|
527
550
|
*/
|
|
528
551
|
declare function getChartData({ days, }: {
|
|
529
552
|
days: number;
|
|
530
|
-
}): Promise<
|
|
553
|
+
}): Promise<HoneySnapshotResponse>;
|
|
531
554
|
|
|
532
555
|
/**
|
|
533
556
|
* Arguments for the getCollateralWeights function.
|
|
@@ -565,7 +588,13 @@ interface GetGlobalCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
|
565
588
|
*/
|
|
566
589
|
declare function getGlobalCapLimit({ client, asset, amount, isMint, isPythWrapperEnabled, latestPrices, ...args }: GetGlobalCapLimitArgs): Promise<boolean | undefined>;
|
|
567
590
|
|
|
568
|
-
/**
|
|
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
|
+
*/
|
|
569
598
|
declare function getHoney24hVolume(): Promise<BigNumber | undefined>;
|
|
570
599
|
|
|
571
600
|
interface GetHoneyCollateralsArgs extends BeraJS.BaseFunctionArgs {
|
|
@@ -621,6 +650,27 @@ declare function getHoneyRootPriceOracle({ publicClient, factory, ...args }: Ber
|
|
|
621
650
|
factory?: Address;
|
|
622
651
|
}): Promise<Address>;
|
|
623
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
|
+
|
|
624
674
|
interface GetRelativeCapLimitArgs extends BeraJS.BaseFunctionArgs {
|
|
625
675
|
client: PublicClient;
|
|
626
676
|
asset: Address;
|
|
@@ -1594,4 +1644,4 @@ declare function getValidatorBoostApy({ validator, bgtPrice, }: {
|
|
|
1594
1644
|
bgtPrice: number;
|
|
1595
1645
|
}): number;
|
|
1596
1646
|
|
|
1597
|
-
export { type ActiveBoostAndCommissionChangeDelay, type GetAllowances, type GetAllowancesResponse, type GetBeraTokenTotalSupplyArgs, type GetLSTStakeConfigArgs, type GetStakedBeraSnapshotsArgs, type GetTokenInformation, type GetTokenInformationResponse, type GetUserVaultInfoParams, type GetUserVaultsInfo, type GetWalletBalances, type HeroEarnVaults, type IncentiveFeeClaimStats, type PoolDayData, PythLatestUpdates, type RewardVaultDurationConstants, ValidatorRewardAllocation, aggregateValidatorIncentives, beraWriteContract, getActiveBoostAndCommissionChangeDelay, getAllPools, getAllValidators, getAllowances, getApiEnrichedAllocation, getApiPool, getApiValidator, getAutoclaimedIncentives, getAutoclaimedIncentivesTxHash, getBalanceCall, getBeraTokenTotalSupply, getBgtIncentiveDistributorPaused, getBlockTime, getBlockTimestamp, getChartData, getCollateralWeights, getDailyValidatorBlockStats, getDefaultRewardAllocation, getEarnedStakedBeraVault, getEnsoClient, getGlobalCapLimit, getGlobalLiquidityAndSwapVolume, getHeroEarnVaults, getHoney24hVolume, getHoneyCollaterals, getHoneyPausedState, getHoneyPythFeeds, getHoneyPythOracle, getHoneyRootPriceOracle, getIncentiveFeeClaimStats, getLSTStakeConfig, getMaxDeposit, getPoolEvents, getPoolHistoricalData, getPoolState, getPythUpdateFee, getRelativeCapLimit, getRewardProofsByValidator, getRewardTokenToBeraRate, getRewardVault, getRewardVaultDurationConstants, getRewardVaultFromToken, getRewardVaultStakingToken, getStakeWithdrawalCooldown, getStakedBeraAPR, getStakedBeraSnapshots, getStakingPoolBatch, getSwapPayload, getTokenCurrentPrices, getTokenInformation, getTokens, getTotalStakedAmount, getUserClaimableIncentives, getUserVaultInfo, getUserVaultsReward, getValidatorAnalytics, getValidatorBoostApy, getValidatorCommission, getValidatorEstimatedBgtPerYear, getValidatorOperatorAddress, getValidatorQueuedRewardAllocation, getValidatorReturnPerBgt, getVaultPausedState, getVaultValidators, getWalletBalances, isBasketModeEnabled, isDefaultRewardAllocation, isImpersonateAccount };
|
|
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
|
@@ -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,
|
|
@@ -76,8 +77,10 @@ import {
|
|
|
76
77
|
isDefaultRewardAllocation,
|
|
77
78
|
isImpersonateAccount,
|
|
78
79
|
isSameRewardAllocation
|
|
79
|
-
} from "../chunk-
|
|
80
|
-
import
|
|
80
|
+
} from "../chunk-VAA2FVPP.mjs";
|
|
81
|
+
import {
|
|
82
|
+
fetchBeep
|
|
83
|
+
} from "../chunk-MRQGHXAN.mjs";
|
|
81
84
|
import {
|
|
82
85
|
BeraApolloClient,
|
|
83
86
|
getApolloClient,
|
|
@@ -113,11 +116,15 @@ import {
|
|
|
113
116
|
} from "../chunk-DQRH5VE3.mjs";
|
|
114
117
|
import "../chunk-SZ5C44L5.mjs";
|
|
115
118
|
import "../chunk-ZLTMIFCZ.mjs";
|
|
116
|
-
import
|
|
119
|
+
import {
|
|
120
|
+
BeraError
|
|
121
|
+
} from "../chunk-KHXJDYA4.mjs";
|
|
117
122
|
|
|
118
123
|
// src/actions/bend/getMaxDeposit.ts
|
|
119
124
|
import { formatEther } from "viem";
|
|
120
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;
|
|
121
128
|
async function getMaxDeposit({
|
|
122
129
|
vaultAddress,
|
|
123
130
|
publicClient
|
|
@@ -128,7 +135,10 @@ async function getMaxDeposit({
|
|
|
128
135
|
functionName: "maxDeposit",
|
|
129
136
|
args: [vaultAddress]
|
|
130
137
|
});
|
|
131
|
-
return
|
|
138
|
+
return {
|
|
139
|
+
formatted: formatEther(maxDeposit),
|
|
140
|
+
isUncapped: maxDeposit >= UNCAPPED_THRESHOLD
|
|
141
|
+
};
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
// src/actions/dex/getPoolWithState.ts
|
|
@@ -273,6 +283,51 @@ async function getHoneyRootPriceOracle({
|
|
|
273
283
|
});
|
|
274
284
|
}
|
|
275
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
|
+
|
|
276
331
|
// src/actions/pol/getBeraTokenTotalSupply.ts
|
|
277
332
|
import { ChainId } from "@berachain/config";
|
|
278
333
|
async function getBeraTokenTotalSupply(args = {}) {
|
|
@@ -291,21 +346,6 @@ async function getBeraTokenTotalSupply(args = {}) {
|
|
|
291
346
|
return data.totalSupply.toString();
|
|
292
347
|
}
|
|
293
348
|
|
|
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
349
|
// src/actions/pol/getBlockTime.ts
|
|
310
350
|
async function getBlockTime({
|
|
311
351
|
defaultBlockTime,
|
|
@@ -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 };
|
|
@@ -20,7 +20,7 @@ function fetchOpenApi(link, path, params, fallbackName) {
|
|
|
20
20
|
return encodeURIComponent(String(value));
|
|
21
21
|
});
|
|
22
22
|
const search = query ? new URLSearchParams(
|
|
23
|
-
Object.entries(query).map(([k, v]) => [k, String(v)])
|
|
23
|
+
Object.entries(query).filter(([, v]) => v !== void 0).map(([k, v]) => [k, String(v)])
|
|
24
24
|
).toString() : "";
|
|
25
25
|
const url = `${getUriFromLink(link)}${resolvedPath}${search ? `?${search}` : ""}`;
|
|
26
26
|
const name = typeof link === "string" ? fallbackName : link.name;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useSWR
|
|
3
|
+
} from "./chunk-UD5IUNCW.mjs";
|
|
1
4
|
import {
|
|
2
5
|
getBalanceCall,
|
|
3
6
|
getEnsoClient
|
|
@@ -163,7 +166,6 @@ function useHoneyConfig() {
|
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
// src/hooks/enso/useEnsoUserTokensWithBalances.ts
|
|
166
|
-
import useSWR from "swr";
|
|
167
169
|
import { useBeraWallet, useConfig } from "@berachain/wagmi/hooks";
|
|
168
170
|
|
|
169
171
|
// src/actions/enso/getEnsoUserTokensWithBalances.ts
|
|
@@ -289,7 +291,7 @@ function useEnsoUserTokensWithBalances({ chainId } = {}, options) {
|
|
|
289
291
|
const proxyAggregatorsThroughVercel = useBeraFlag(
|
|
290
292
|
"proxyAggregatorsThroughVercel"
|
|
291
293
|
);
|
|
292
|
-
const isEnabled = !!fromAddress
|
|
294
|
+
const isEnabled = !!fromAddress;
|
|
293
295
|
const QUERY_KEY = isEnabled && wagmiConfig ? [
|
|
294
296
|
"useEnsoUserTokensWithBalances",
|
|
295
297
|
fromAddress,
|
|
@@ -308,8 +310,7 @@ function useEnsoUserTokensWithBalances({ chainId } = {}, options) {
|
|
|
308
310
|
}),
|
|
309
311
|
{
|
|
310
312
|
refreshInterval: 1e5 /* NORMAL */,
|
|
311
|
-
|
|
312
|
-
...options?.opts
|
|
313
|
+
...options
|
|
313
314
|
}
|
|
314
315
|
);
|
|
315
316
|
return {
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
return useOriginalSWR(
|
|
14
|
+
isEnabled ? key : null,
|
|
15
|
+
fetcher,
|
|
16
|
+
swrConfig
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function useSWRImmutable(key, fetcher, options) {
|
|
20
|
+
const { isEnabled = true, ...swrConfig } = options ?? {};
|
|
21
|
+
return useOriginalSWRImmutable(
|
|
22
|
+
isEnabled ? key : null,
|
|
23
|
+
fetcher,
|
|
24
|
+
swrConfig
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
var swr_default = useSWR;
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
useSWR,
|
|
31
|
+
useSWRImmutable,
|
|
32
|
+
swr_default,
|
|
33
|
+
SWRConfig
|
|
34
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchBeep,
|
|
3
3
|
fetchRailwayBackend
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MRQGHXAN.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getApolloClient
|
|
7
7
|
} from "./chunk-3JJLQ2JX.mjs";
|
|
@@ -587,13 +587,32 @@ async function getChartData({
|
|
|
587
587
|
level: "error"
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
590
|
+
const { config } = parseBaseArgs({});
|
|
591
|
+
if (!config.beep) {
|
|
592
|
+
const params = new URLSearchParams({
|
|
593
|
+
interval: "day",
|
|
594
|
+
first: String(days)
|
|
595
|
+
});
|
|
596
|
+
const snapshots = await beraFetchJson({
|
|
597
|
+
url: `/api/honey/snapshots?${params}`,
|
|
598
|
+
name: "honey-snapshots",
|
|
599
|
+
type: "rest"
|
|
600
|
+
});
|
|
601
|
+
return snapshots.map(fromHoneySnapshot);
|
|
602
|
+
}
|
|
603
|
+
return fetchBeep("/v0/honey/snapshots/{interval}", {
|
|
604
|
+
path: { interval: "day" },
|
|
605
|
+
query: { perPage: String(days) }
|
|
595
606
|
});
|
|
596
|
-
|
|
607
|
+
}
|
|
608
|
+
function fromHoneySnapshot(snapshot) {
|
|
609
|
+
return {
|
|
610
|
+
timestamp: Math.floor(Number(snapshot.timestamp) / 1e6),
|
|
611
|
+
mintVolume: snapshot.mintVolume,
|
|
612
|
+
redeemVolume: snapshot.redeemVolume,
|
|
613
|
+
totalVolume: snapshot.totalVolume,
|
|
614
|
+
totalSupply: snapshot.totalSupply
|
|
615
|
+
};
|
|
597
616
|
}
|
|
598
617
|
|
|
599
618
|
// src/actions/honey/getCollateralWeights.ts
|
|
@@ -928,12 +947,23 @@ async function getHoney24hVolume() {
|
|
|
928
947
|
level: "error"
|
|
929
948
|
});
|
|
930
949
|
}
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
950
|
+
const { config } = parseBaseArgs({});
|
|
951
|
+
if (!config.beep) {
|
|
952
|
+
const params = new URLSearchParams({ interval: "hour", first: "24" });
|
|
953
|
+
const snapshots2 = await beraFetchJson({
|
|
954
|
+
url: `/api/honey/snapshots?${params}`,
|
|
955
|
+
name: "honey-snapshots",
|
|
956
|
+
type: "rest"
|
|
957
|
+
});
|
|
958
|
+
return sumTotalVolume(snapshots2);
|
|
959
|
+
}
|
|
960
|
+
const snapshots = await fetchBeep("/v0/honey/snapshots/{interval}", {
|
|
961
|
+
path: { interval: "hour" },
|
|
962
|
+
query: { perPage: "24" }
|
|
936
963
|
});
|
|
964
|
+
return sumTotalVolume(snapshots);
|
|
965
|
+
}
|
|
966
|
+
function sumTotalVolume(snapshots) {
|
|
937
967
|
return snapshots.reduce(
|
|
938
968
|
(acc, curr) => new bignumber_js_default(curr.totalVolume).plus(acc),
|
|
939
969
|
new bignumber_js_default(0)
|
|
@@ -1551,6 +1581,21 @@ function getBgtAprSimulation({
|
|
|
1551
1581
|
};
|
|
1552
1582
|
}
|
|
1553
1583
|
|
|
1584
|
+
// src/actions/pol/getBgtIncentiveDistributorPaused.ts
|
|
1585
|
+
import { bgtIncentiveDistributorAbi } from "@berachain/abis/pol/rewards/bgtIncentiveDistributor";
|
|
1586
|
+
async function getBgtIncentiveDistributorPaused({
|
|
1587
|
+
publicClient,
|
|
1588
|
+
...args
|
|
1589
|
+
}) {
|
|
1590
|
+
assertPublicClient(publicClient);
|
|
1591
|
+
const { config } = parseBaseArgs(args);
|
|
1592
|
+
return publicClient.readContract({
|
|
1593
|
+
address: config.pol.bgtIncentiveDistributor,
|
|
1594
|
+
abi: bgtIncentiveDistributorAbi,
|
|
1595
|
+
functionName: "paused"
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1554
1599
|
// src/actions/pol/getEarnedStakedBeraVault.ts
|
|
1555
1600
|
async function getEarnedStakedBeraVault({
|
|
1556
1601
|
address,
|
|
@@ -4080,6 +4125,7 @@ export {
|
|
|
4080
4125
|
RewardVaultDistributionMode,
|
|
4081
4126
|
getRewardVaultRewards,
|
|
4082
4127
|
getBgtAprSimulation,
|
|
4128
|
+
getBgtIncentiveDistributorPaused,
|
|
4083
4129
|
getEarnedStakedBeraVault,
|
|
4084
4130
|
getRewardVaults,
|
|
4085
4131
|
getGlobalData,
|
|
@@ -4,8 +4,8 @@ import { B as BeraFlags } from '../defaultFlags-D6KfkTZx.js';
|
|
|
4
4
|
export { B as BexStateContext, a as BexStatusProvider, b as BexStatusProviderProps, u as useBexStatus } from '../BexStatusProvider-DRymVlQf.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { PropsWithChildren } from 'react';
|
|
7
|
-
import { a as TokenWithMetadata, b as Token, B as BalanceToken } from '../HoneyConfigProvider-
|
|
8
|
-
export { c as HoneyConfigContext, d as HoneyConfigContextReturn, e as HoneyConfigProvider, f as HoneyConfigProviderProps, T as TokenWithOrder, u as useHoneyConfig } from '../HoneyConfigProvider-
|
|
7
|
+
import { a as TokenWithMetadata, b as Token, B as BalanceToken } from '../HoneyConfigProvider-COOuDNra.js';
|
|
8
|
+
export { c as HoneyConfigContext, d as HoneyConfigContextReturn, e as HoneyConfigProvider, f as HoneyConfigProviderProps, T as TokenWithOrder, u as useHoneyConfig } from '../HoneyConfigProvider-COOuDNra.js';
|
|
9
9
|
import '@berachain/config/internal/flags';
|
|
10
10
|
import 'viem';
|
|
11
11
|
import '@berachain/graphql/pol/api';
|
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
useBexStatus,
|
|
15
15
|
useBlockTime,
|
|
16
16
|
useHoneyConfig
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-SXUNCX5E.mjs";
|
|
18
|
+
import {
|
|
19
|
+
SWRConfig
|
|
20
|
+
} from "../chunk-UD5IUNCW.mjs";
|
|
18
21
|
import "../chunk-HYDP32P6.mjs";
|
|
19
22
|
import "../chunk-HQCOU6GY.mjs";
|
|
20
23
|
import "../chunk-SGIJVHZO.mjs";
|
|
@@ -32,7 +35,6 @@ import {
|
|
|
32
35
|
|
|
33
36
|
// src/contexts/SwrFallback.tsx
|
|
34
37
|
import { useEffect } from "react";
|
|
35
|
-
import { SWRConfig } from "swr";
|
|
36
38
|
import { jsx } from "react/jsx-runtime";
|
|
37
39
|
function SWRFallback({
|
|
38
40
|
fallback,
|
package/dist/enum/exports.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export { C as ContractName, T as TransactionActionType } from '../txnEnum-ByI5dtDi.js';
|
|
2
2
|
export { A as Aggregators, O as OwnershipType, P as ParameterPreset, a as PoolCreationStep, S as SwapReferrer } from '../dex-C_BB0b0O.js';
|
|
3
3
|
export { H as HoneySwapAction } from '../honey-CYm0RWf4.js';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
declare enum POLLING {
|
|
6
|
+
FAST = 10000,// 10 sec
|
|
7
|
+
NORMAL = 100000,// 100 sec
|
|
8
|
+
SLOW = 180000,// 3 min
|
|
9
|
+
REFRESH_BLOCK_INTERVAL = 10000
|
|
10
|
+
}
|
|
5
11
|
|
|
6
12
|
declare const DEFAULT_SLIPPAGE: 0.5;
|
|
7
13
|
declare const SLIPPAGE_DEGEN_VALUE: 25;
|
|
@@ -20,4 +26,4 @@ declare enum TRANSACTION_MODE {
|
|
|
20
26
|
INFINITY = "infinity"
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
export { DEFAULT_DEADLINE, DEFAULT_SLIPPAGE, SLIPPAGE_DEGEN_VALUE, SLIPPAGE_MODE, TRANSACTION_MODE };
|
|
29
|
+
export { DEFAULT_DEADLINE, DEFAULT_SLIPPAGE, POLLING, SLIPPAGE_DEGEN_VALUE, SLIPPAGE_MODE, TRANSACTION_MODE };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GetProposalVotesQueryVariables, GetProposalVotesQuery } from '@berachain/graphql/governance';
|
|
2
|
+
|
|
3
|
+
type GetProposalVotesArgs = BeraJS.BaseFunctionArgs & {
|
|
4
|
+
/** GraphQL variables forwarded to the GetProposalVotes query */
|
|
5
|
+
variables: GetProposalVotesQueryVariables;
|
|
6
|
+
};
|
|
7
|
+
/** Fetches the votes for a proposal from the subgraph */
|
|
8
|
+
declare function getProposalVotes(_args: GetProposalVotesArgs): Promise<{
|
|
9
|
+
data: GetProposalVotesQuery;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
export { type GetProposalVotesArgs as G, getProposalVotes as g };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Address, PublicClient, Hex } from 'viem';
|
|
2
2
|
import { BeraConfig, ChainId } from '@berachain/config/internal';
|
|
3
|
-
import { I as IAggregatorArgs, g as IRawAggregatorQuote, b as Token, d as HoneyConfigContextReturn, B as BalanceToken, P as PythLatestUpdates } from './HoneyConfigProvider-
|
|
3
|
+
import { I as IAggregatorArgs, g as IRawAggregatorQuote, b as Token, d as HoneyConfigContextReturn, B as BalanceToken, P as PythLatestUpdates } from './HoneyConfigProvider-COOuDNra.js';
|
|
4
4
|
import { A as Aggregators } from './dex-C_BB0b0O.js';
|
|
5
5
|
import { GqlPoolType, GlobalDataQuery, ApiVaultFragment, GetVaultsQueryVariables, GqlChain, GetVaultHistoryQueryVariables, GetVaultHistoryQuery, ApiValidatorInListFragment } from '@berachain/graphql/pol/api';
|
|
6
|
-
import { P as ProtocolMetadata } from './pol.d-
|
|
6
|
+
import { P as ProtocolMetadata } from './pol.d-CeRgXBL8.js';
|
|
7
7
|
|
|
8
8
|
interface GetConvertToAssetsProps {
|
|
9
9
|
sharesAmount: bigint;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Config, GetWalletClientReturnType } from '@wagmi/core';
|
|
2
|
-
import { SWRResponse, SWRConfiguration } from 'swr';
|
|
3
2
|
import { Abi, ContractFunctionName, ContractFunctionArgs, TransactionReceipt, WalletCallReceipt, Hex, Account, Address } from 'viem';
|
|
4
3
|
import { ChainId, BeraConfig } from '@berachain/config';
|
|
4
|
+
import { SWRResponse, SWRConfiguration } from '@berachain/utils/pkg/swr';
|
|
5
5
|
import { T as TransactionActionType, C as ContractName } from './txnEnum-ByI5dtDi.js';
|
|
6
6
|
import { B as BeraError } from './BeraError-7-A5JYy_.js';
|
|
7
7
|
|
|
@@ -55,9 +55,7 @@ interface IUseContractWriteArgs<abi extends Abi | undefined = undefined, functio
|
|
|
55
55
|
onWarning?: (e: BeraError, writeArgs: Omit<IContractWrite<abi, functionName, params>, TxnEventKeys>) => void;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
type DefaultHookOptions = {
|
|
59
|
-
opts?: SWRConfiguration & { isEnabled?: boolean };
|
|
60
|
-
};
|
|
58
|
+
type DefaultHookOptions = SWRConfiguration & { isEnabled?: boolean };
|
|
61
59
|
|
|
62
60
|
type DefaultHookReturnType<T = any> = Omit<
|
|
63
61
|
SWRResponse<T, any, any>,
|