@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import useSWR from "swr";
|
|
3
2
|
import type { Address, PublicClient } from "viem";
|
|
4
3
|
|
|
5
4
|
import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
|
|
5
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
6
6
|
|
|
7
7
|
import { getValidatorOperatorAddress } from "../../actions/validators/getValidatorOperatorAddress";
|
|
8
8
|
import { getValidatorRewardAllocatorAddress } from "../../actions/validators/getValidatorRewardAllocatorAddress";
|
|
@@ -93,7 +93,7 @@ export function useManagedValidatorRole(
|
|
|
93
93
|
};
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
|
-
...options
|
|
96
|
+
...options,
|
|
97
97
|
},
|
|
98
98
|
);
|
|
99
99
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import { type Address, keccak256 } from "viem";
|
|
3
2
|
|
|
4
3
|
import { beaconDepositAbi } from "@berachain/abis/pol/beaconDeposit";
|
|
@@ -7,6 +6,7 @@ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
|
|
|
7
6
|
|
|
8
7
|
import type { ApiValidatorFragment } from "@berachain/graphql/pol/api";
|
|
9
8
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
9
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
10
10
|
|
|
11
11
|
import { assertPublicClient } from "../../errors/assert";
|
|
12
12
|
import type {
|
|
@@ -21,9 +21,8 @@ export const useOnChainValidator = (
|
|
|
21
21
|
): DefaultHookReturnType<Partial<ApiValidatorFragment>> => {
|
|
22
22
|
const publicClient = usePublicClient();
|
|
23
23
|
const QUERY_KEY = pubkey ? (["useOnChainValidator", pubkey] as const) : null;
|
|
24
|
-
const isEnabled = options.opts?.isEnabled ?? true;
|
|
25
24
|
const swrResponse = useSWR(
|
|
26
|
-
|
|
25
|
+
publicClient ? QUERY_KEY : null,
|
|
27
26
|
async ([, pubkey]) => {
|
|
28
27
|
assertPublicClient(publicClient);
|
|
29
28
|
|
|
@@ -59,6 +58,7 @@ export const useOnChainValidator = (
|
|
|
59
58
|
votingPower: Number(boostees),
|
|
60
59
|
} as Partial<ApiValidatorFragment>;
|
|
61
60
|
},
|
|
61
|
+
options,
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address } from "viem";
|
|
3
2
|
|
|
4
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getStakingPoolBatch } from "../../actions/validators/getStakingPoolBatch";
|
|
7
7
|
import { POLLING } from "../../enum/polling";
|
|
@@ -19,9 +19,8 @@ export const useStakingPoolBatch = ({
|
|
|
19
19
|
options?: DefaultHookOptions;
|
|
20
20
|
}): DefaultHookReturnType<number | undefined> => {
|
|
21
21
|
const publicClient = usePublicClient();
|
|
22
|
-
const isEnabled = options?.opts?.isEnabled ?? true;
|
|
23
22
|
const QUERY_KEY =
|
|
24
|
-
|
|
23
|
+
publicClient && valPubKey
|
|
25
24
|
? (["useStakingPoolBatch", valPubKey] as const)
|
|
26
25
|
: null;
|
|
27
26
|
|
|
@@ -37,7 +36,7 @@ export const useStakingPoolBatch = ({
|
|
|
37
36
|
},
|
|
38
37
|
{
|
|
39
38
|
refreshInterval: POLLING.FAST,
|
|
40
|
-
...options
|
|
39
|
+
...options,
|
|
41
40
|
},
|
|
42
41
|
);
|
|
43
42
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
|
-
|
|
3
1
|
import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
|
|
2
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
getUserActiveValidators,
|
|
@@ -35,7 +34,7 @@ export const useUserActiveValidators = (
|
|
|
35
34
|
},
|
|
36
35
|
{
|
|
37
36
|
...options,
|
|
38
|
-
refreshInterval: options?.
|
|
37
|
+
refreshInterval: options?.refreshInterval ?? POLLING.SLOW,
|
|
39
38
|
keepPreviousData: true,
|
|
40
39
|
},
|
|
41
40
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
|
-
import useSWR from "swr";
|
|
3
2
|
|
|
4
3
|
import { useBeraWallet } from "@berachain/wagmi/hooks";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getRewardProofsByValidator } from "../../actions/pol/getRewardProofsByValidator";
|
|
7
7
|
import { getUserClaimableIncentives } from "../../actions/pol/getUserClaimableIncentives";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address } from "viem";
|
|
3
2
|
|
|
4
3
|
import type { GetValidatorAnalyticsQuery } from "@berachain/graphql/pol/subgraph";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getValidatorAnalytics } from "../../actions/validators/getValidatorAnalytics";
|
|
7
7
|
import { POLLING } from "../../enum/polling";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address, PublicClient } from "viem";
|
|
3
2
|
|
|
4
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
|
+
import useSWR from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getValidatorCommission } from "../../actions/validators/getValidatorCommission";
|
|
7
7
|
import type {
|
|
@@ -28,7 +28,7 @@ export const useValidatorCommission = (
|
|
|
28
28
|
});
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
...options
|
|
31
|
+
...options,
|
|
32
32
|
},
|
|
33
33
|
);
|
|
34
34
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address } from "viem";
|
|
3
2
|
|
|
4
|
-
import type {
|
|
3
|
+
import type { ValidatorIncentivesResponse } from "@berachain/graphql/beep";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getValidatorIncentiveDistribution } from "../../actions/validators/getValidatorIncentiveDistribution";
|
|
7
7
|
import { POLLING } from "../../enum/polling";
|
|
@@ -19,7 +19,7 @@ export function useValidatorIncentiveDistribution({
|
|
|
19
19
|
}: {
|
|
20
20
|
pubkey: Address | undefined;
|
|
21
21
|
dayRange: number;
|
|
22
|
-
}): DefaultHookReturnType<
|
|
22
|
+
}): DefaultHookReturnType<ValidatorIncentivesResponse> {
|
|
23
23
|
const QUERY_KEY =
|
|
24
24
|
pubkey && dayRange
|
|
25
25
|
? (["useValidatorIncentiveDistribution", pubkey, dayRange] as const)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address } from "viem";
|
|
3
2
|
|
|
4
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
getValidatorQueuedCommission,
|
|
@@ -33,7 +33,7 @@ export function useValidatorQueuedCommission(
|
|
|
33
33
|
});
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
...options
|
|
36
|
+
...options,
|
|
37
37
|
},
|
|
38
38
|
);
|
|
39
39
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address, PublicClient } from "viem";
|
|
3
2
|
|
|
4
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
getValidatorQueuedOperatorAddress,
|
|
@@ -31,7 +31,7 @@ export const useValidatorQueuedOperatorAddress = (
|
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
...options
|
|
34
|
+
...options,
|
|
35
35
|
},
|
|
36
36
|
);
|
|
37
37
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address, PublicClient } from "viem";
|
|
3
2
|
|
|
4
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getValidatorQueuedRewardAllocation } from "../../actions/validators/getValidatorQueuedRewardAllocation";
|
|
7
7
|
import type { ValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
|
|
@@ -29,7 +29,7 @@ export const useValidatorQueuedRewardAllocation = (
|
|
|
29
29
|
});
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
...options
|
|
32
|
+
...options,
|
|
33
33
|
},
|
|
34
34
|
);
|
|
35
35
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import useSWR from "swr";
|
|
2
1
|
import type { Address, PublicClient } from "viem";
|
|
3
2
|
|
|
4
3
|
import { usePublicClient } from "@berachain/wagmi/hooks";
|
|
4
|
+
import { useSWR } from "@berachain/utils/pkg/swr";
|
|
5
5
|
|
|
6
6
|
import { getValidatorRewardAllocation } from "../../actions/validators/getValidatorRewardAllocation";
|
|
7
7
|
import type { DefaultHookOptions } from "../../types/global";
|
|
@@ -25,7 +25,7 @@ export function useValidatorRewardAllocation(
|
|
|
25
25
|
});
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
...options
|
|
28
|
+
...options,
|
|
29
29
|
},
|
|
30
30
|
);
|
|
31
31
|
|
package/src/types/global.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Config, GetWalletClientReturnType } from "@wagmi/core";
|
|
2
|
-
import type { SWRConfiguration, SWRResponse } from "swr";
|
|
3
2
|
import type {
|
|
4
3
|
Abi,
|
|
5
4
|
Account,
|
|
@@ -13,6 +12,8 @@ import type {
|
|
|
13
12
|
|
|
14
13
|
import type { BeraConfig, ChainId } from "@berachain/config";
|
|
15
14
|
|
|
15
|
+
import type { SWRConfiguration, SWRResponse } from "@berachain/utils/pkg/swr";
|
|
16
|
+
|
|
16
17
|
import type { ContractName } from "../enum/contracts";
|
|
17
18
|
import type { TransactionActionType } from "../enum/txnEnum";
|
|
18
19
|
import type {
|
|
@@ -20,9 +21,7 @@ import type {
|
|
|
20
21
|
TxnEventKeys,
|
|
21
22
|
} from "../hooks/useContractWrite/types";
|
|
22
23
|
|
|
23
|
-
export type DefaultHookOptions = {
|
|
24
|
-
opts?: SWRConfiguration & { isEnabled?: boolean };
|
|
25
|
-
};
|
|
24
|
+
export type DefaultHookOptions = SWRConfiguration & { isEnabled?: boolean };
|
|
26
25
|
|
|
27
26
|
export type DefaultHookReturnType<T = any> = Omit<
|
|
28
27
|
SWRResponse<T, any, any>,
|
package/src/types/pol.d.ts
CHANGED
|
@@ -55,10 +55,24 @@ export interface UserVaultInfo {
|
|
|
55
55
|
|
|
56
56
|
export type StakedBeraAsset = {
|
|
57
57
|
token: TokenWithMetadata;
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Staking APR, or `undefined` when unavailable (e.g. the APR backend is
|
|
60
|
+
* down). `undefined` lets the UI render a "—" placeholder instead of a
|
|
61
|
+
* misleading "0%".
|
|
62
|
+
*/
|
|
63
|
+
apr: number | undefined;
|
|
59
64
|
stakedAmount: number;
|
|
60
|
-
|
|
65
|
+
/**
|
|
66
|
+
* USD value of the staked amount, or `undefined` when the token price is
|
|
67
|
+
* unavailable (e.g. the price backend is down). `undefined` lets the UI
|
|
68
|
+
* render a "—" placeholder instead of a misleading "$0.00".
|
|
69
|
+
*/
|
|
70
|
+
stakedAmountUsd: number | undefined;
|
|
61
71
|
earnedAmount: number;
|
|
62
|
-
|
|
72
|
+
/**
|
|
73
|
+
* USD value of the earned amount, or `undefined` when the token price is
|
|
74
|
+
* unavailable. See {@link stakedAmountUsd}.
|
|
75
|
+
*/
|
|
76
|
+
earnedAmountUsd: number | undefined;
|
|
63
77
|
isLoadingEarnings?: boolean;
|
|
64
78
|
};
|