@berachain/berajs 0.2.11 → 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/actions/clients/exports.d.ts +5 -21
- package/dist/actions/clients/exports.mjs +5 -7
- package/dist/actions/exports.d.ts +65 -29
- package/dist/actions/exports.mjs +6 -36
- package/dist/actions/server/exports.mjs +2 -2
- package/dist/{chunk-UD5IUNCW.mjs → chunk-4ML4Y6UN.mjs} +14 -2
- 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-SXUNCX5E.mjs → chunk-W2VODV76.mjs} +3 -7
- package/dist/{chunk-VAA2FVPP.mjs → chunk-XDG26EG6.mjs} +90 -183
- package/dist/{chunk-MRQGHXAN.mjs → chunk-YLTWPFCJ.mjs} +2 -17
- package/dist/contexts/exports.mjs +4 -4
- package/dist/errors/exports.mjs +2 -2
- package/dist/{getApolloClient-BcUTGFUb.d.ts → getApolloClient-MWm_iq4u.d.ts} +4 -5
- package/dist/{getValidatorQueuedOperatorAddress-Cxt-DlL_.d.ts → getValidatorQueuedOperatorAddress-Cc05dlO3.d.ts} +6 -57
- package/dist/{global.d-q_LQWQqs.d.ts → global.d-CR3zicga.d.ts} +2 -7
- package/dist/hooks/exports.d.ts +109 -318
- package/dist/hooks/exports.mjs +102 -345
- package/dist/hooks/governance/exports.d.ts +10 -10
- package/dist/hooks/governance/exports.mjs +8 -20
- package/dist/types/exports.d.ts +1 -1
- package/dist/utils/exports.mjs +2 -2
- package/package.json +3 -3
- package/src/actions/clients/exports.ts +0 -1
- package/src/actions/clients/fetchBeep.ts +0 -7
- package/src/actions/clients/fetchOpenApi.ts +4 -4
- package/src/actions/clients/fetchOpenApi.unit.test.ts +3 -19
- package/src/actions/clients/getApolloClient.ts +4 -9
- package/src/actions/exports.ts +0 -1
- package/src/actions/honey/getChartData.ts +3 -44
- package/src/actions/honey/getHoney24hVolume.ts +2 -21
- package/src/actions/honey/getHoneyTxns.ts +1 -49
- 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 +2 -24
- package/src/errors/RequestError.ts +3 -3
- package/src/hooks/bend/useGetConvertToAssets.ts +1 -8
- package/src/hooks/dex/useAggregatorsQuotes.ts +3 -1
- package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +1 -6
- package/src/hooks/dex/useAllUserPools.ts +1 -8
- package/src/hooks/dex/useApiPool.ts +1 -8
- package/src/hooks/dex/useGlobalLiquidityAndSwapVolume.ts +0 -1
- package/src/hooks/dex/useOnChainPoolData.ts +2 -3
- package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +1 -7
- package/src/hooks/dex/usePoolHistoricalData.ts +1 -6
- package/src/hooks/dex/usePools.ts +2 -2
- package/src/hooks/enso/useBendZapSupply.ts +1 -1
- package/src/hooks/enso/useEnsoSwapBundle.ts +1 -1
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +1 -5
- package/src/hooks/enso/useZapStakeBera.ts +0 -3
- package/src/hooks/governance/usePollProposal.ts +4 -7
- package/src/hooks/governance/usePollProposalThreshold.ts +1 -6
- package/src/hooks/governance/usePollUserDelegates.ts +1 -6
- package/src/hooks/governance/useProposalFromTx.ts +3 -5
- package/src/hooks/governance/useProposalSnapshot.ts +2 -2
- package/src/hooks/governance/useProposalState.ts +2 -2
- package/src/hooks/governance/useProposalTimelockState.ts +2 -2
- package/src/hooks/honey/useCappedGlobally.ts +1 -6
- package/src/hooks/honey/useCappedRelatively.ts +1 -6
- package/src/hooks/honey/useCollateralWeights.ts +1 -6
- package/src/hooks/honey/useHoney24hVolume.ts +1 -5
- package/src/hooks/honey/useHoneyBalances.ts +1 -6
- package/src/hooks/honey/useHoneyChartData.ts +3 -11
- package/src/hooks/honey/useHoneyVaultsBalance.ts +1 -6
- package/src/hooks/honey/useIsBadCollateralAsset.ts +1 -6
- package/src/hooks/honey/useIsBasketModeEnabled.ts +1 -6
- package/src/hooks/honey/usePythLatestPrices.ts +4 -6
- package/src/hooks/pol/useAutoclaimedIncentives.ts +1 -6
- package/src/hooks/pol/useAutoclaimedIncentivesTxHash.ts +1 -6
- package/src/hooks/pol/useBgtIncentiveDistributorPaused.ts +1 -6
- package/src/hooks/pol/useBgtUnstakedBalance.ts +1 -6
- package/src/hooks/pol/useClaimableFees.ts +1 -5
- package/src/hooks/pol/useHighestVaultsAPR.ts +2 -5
- package/src/hooks/pol/usePollGlobalData.ts +1 -6
- package/src/hooks/pol/usePollMarkets.ts +1 -6
- package/src/hooks/pol/useQueuedBeraUnlock.ts +1 -10
- package/src/hooks/pol/useRewardVault.ts +2 -2
- package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +2 -2
- package/src/hooks/pol/useRewardVaultFromToken.ts +23 -29
- package/src/hooks/pol/useRewardVaultIncentives.ts +1 -6
- package/src/hooks/pol/useRewardVaultRewards.ts +1 -6
- package/src/hooks/pol/useRewardVaults.ts +1 -6
- package/src/hooks/pol/useStakedAPR.ts +1 -6
- package/src/hooks/pol/useStakedSnapshots.ts +3 -8
- package/src/hooks/pol/useTotalStakedAmount.ts +1 -6
- package/src/hooks/pol/useUserVaultInfo.ts +1 -6
- package/src/hooks/pol/useUserVaults.ts +1 -5
- package/src/hooks/pol/useVaultHistory.ts +1 -6
- package/src/hooks/pol/useVaultValidators.ts +1 -6
- package/src/hooks/tokens/useMultipleTokenInformation.ts +1 -6
- package/src/hooks/tokens/usePollAllowances.ts +1 -7
- package/src/hooks/tokens/usePollBalance.ts +0 -3
- package/src/hooks/tokens/usePollWalletBalances.ts +1 -1
- package/src/hooks/tokens/useStakingTokenInformation.ts +1 -10
- package/src/hooks/tokens/useTokenInformation.ts +1 -6
- package/src/hooks/validators/useAllValidators.ts +1 -6
- package/src/hooks/validators/useApiValidator.ts +1 -6
- package/src/hooks/validators/useDailyValidatorBlockStats.ts +1 -3
- package/src/hooks/validators/useDefaultRewardAllocation.ts +1 -6
- package/src/hooks/validators/useManagedValidatorRole.ts +0 -1
- package/src/hooks/validators/useOnChainValidator.ts +1 -8
- package/src/hooks/validators/useStakingPoolBatch.ts +1 -6
- package/src/hooks/validators/useUserActiveValidators.ts +1 -6
- package/src/hooks/validators/useUserBoostsOnValidator.ts +1 -3
- package/src/hooks/validators/useUserClaimableIncentives.ts +2 -2
- package/src/hooks/validators/useUserStakingPositions.ts +1 -8
- package/src/hooks/validators/useValidatorAnalytics.ts +1 -3
- package/src/hooks/validators/useValidatorCommission.ts +1 -6
- package/src/hooks/validators/useValidatorIncentiveDistribution.ts +1 -3
- package/src/hooks/validators/useValidatorQueuedCommission.ts +1 -6
- package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +1 -6
- package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +1 -6
- package/src/hooks/validators/useValidatorRewardAllocation.ts +1 -6
- package/src/types/global.d.ts +5 -7
- package/src/actions/clients/fetchRailwayBackend.ts +0 -34
- package/src/actions/pol/getGlobalCuttingBoard.ts +0 -25
- package/src/actions/pol/getIncentiveFeeClaimStats.ts +0 -24
package/dist/hooks/exports.mjs
CHANGED
|
@@ -71,12 +71,11 @@ import {
|
|
|
71
71
|
getVaultValidators,
|
|
72
72
|
isBadCollateralAsset,
|
|
73
73
|
isBasketModeEnabled
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-XDG26EG6.mjs";
|
|
75
75
|
import {
|
|
76
|
-
fetchBeep
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
import "../chunk-3JJLQ2JX.mjs";
|
|
76
|
+
fetchBeep
|
|
77
|
+
} from "../chunk-YLTWPFCJ.mjs";
|
|
78
|
+
import "../chunk-MKSFQIKC.mjs";
|
|
80
79
|
import "../chunk-CDK4YV3D.mjs";
|
|
81
80
|
import {
|
|
82
81
|
TokenContext,
|
|
@@ -85,12 +84,12 @@ import {
|
|
|
85
84
|
useBlockTime,
|
|
86
85
|
useEnsoUserTokensWithBalances,
|
|
87
86
|
useHoneyConfig
|
|
88
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-W2VODV76.mjs";
|
|
89
88
|
import {
|
|
90
89
|
swr_default,
|
|
91
90
|
useSWR,
|
|
92
91
|
useSWRImmutable
|
|
93
|
-
} from "../chunk-
|
|
92
|
+
} from "../chunk-4ML4Y6UN.mjs";
|
|
94
93
|
import {
|
|
95
94
|
getEnsoClient,
|
|
96
95
|
getWalletBalances
|
|
@@ -104,7 +103,7 @@ import {
|
|
|
104
103
|
import {
|
|
105
104
|
BeraMonitoring,
|
|
106
105
|
initBeraError
|
|
107
|
-
} from "../chunk-
|
|
106
|
+
} from "../chunk-FGION6F6.mjs";
|
|
108
107
|
import {
|
|
109
108
|
assertAddress,
|
|
110
109
|
assertAmount,
|
|
@@ -126,7 +125,7 @@ import {
|
|
|
126
125
|
} from "../chunk-E7YFXBBQ.mjs";
|
|
127
126
|
import {
|
|
128
127
|
beraFetchJson
|
|
129
|
-
} from "../chunk-
|
|
128
|
+
} from "../chunk-T43JPYQS.mjs";
|
|
130
129
|
import "../chunk-BGMRHTBQ.mjs";
|
|
131
130
|
import {
|
|
132
131
|
beraToken,
|
|
@@ -139,7 +138,7 @@ import {
|
|
|
139
138
|
import "../chunk-SZ5C44L5.mjs";
|
|
140
139
|
import {
|
|
141
140
|
RequestError
|
|
142
|
-
} from "../chunk-
|
|
141
|
+
} from "../chunk-RFJGL4MF.mjs";
|
|
143
142
|
import {
|
|
144
143
|
BeraError,
|
|
145
144
|
InvalidArgumentError
|
|
@@ -153,7 +152,7 @@ var useGetConvertToAssets = ({
|
|
|
153
152
|
vaultChainId
|
|
154
153
|
}, options) => {
|
|
155
154
|
const publicClient = usePublicClient({ chainId: vaultChainId });
|
|
156
|
-
|
|
155
|
+
return useSWR(
|
|
157
156
|
publicClient && sharesAmount && vaultAddress ? ["useGetConvertToAssets", sharesAmount, vaultAddress, vaultChainId] : null,
|
|
158
157
|
async ([_, sharesAmount2, vaultAddress2]) => {
|
|
159
158
|
assertPublicClient(publicClient);
|
|
@@ -167,12 +166,6 @@ var useGetConvertToAssets = ({
|
|
|
167
166
|
...options
|
|
168
167
|
}
|
|
169
168
|
);
|
|
170
|
-
return {
|
|
171
|
-
...swrResponse,
|
|
172
|
-
refresh: () => {
|
|
173
|
-
swrResponse.mutate();
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
169
|
};
|
|
177
170
|
|
|
178
171
|
// src/hooks/dex/useAggregatorsQuotes.ts
|
|
@@ -1446,7 +1439,7 @@ var useAggregatorsRouterFeeBps = () => {
|
|
|
1446
1439
|
const { config } = parseBaseArgs({
|
|
1447
1440
|
chainId: publicClient.chain?.id
|
|
1448
1441
|
});
|
|
1449
|
-
|
|
1442
|
+
return useSWRImmutable(
|
|
1450
1443
|
publicClient && config.bex.aggregatorsRouter && config.bex.aggregatorsRouter !== zeroAddress8 ? ["useAggregatorsRouterFeeBps", config.bex.aggregatorsRouter] : null,
|
|
1451
1444
|
async ([, aggregatorsRouter]) => {
|
|
1452
1445
|
const fee = await publicClient.readContract({
|
|
@@ -1457,10 +1450,6 @@ var useAggregatorsRouterFeeBps = () => {
|
|
|
1457
1450
|
return Number(fee);
|
|
1458
1451
|
}
|
|
1459
1452
|
);
|
|
1460
|
-
return {
|
|
1461
|
-
...swrResponse,
|
|
1462
|
-
refresh: swrResponse.mutate
|
|
1463
|
-
};
|
|
1464
1453
|
};
|
|
1465
1454
|
|
|
1466
1455
|
// src/hooks/dex/useSingleAggregatorQuote.ts
|
|
@@ -1801,7 +1790,9 @@ function useAggregatorsQuotes(args, options) {
|
|
|
1801
1790
|
}, [results]);
|
|
1802
1791
|
return {
|
|
1803
1792
|
...data,
|
|
1804
|
-
refresh: () =>
|
|
1793
|
+
refresh: () => {
|
|
1794
|
+
results.map((r) => r.refresh());
|
|
1795
|
+
}
|
|
1805
1796
|
};
|
|
1806
1797
|
}
|
|
1807
1798
|
|
|
@@ -1812,7 +1803,7 @@ var useAllUserPoolsQueryKey = ({
|
|
|
1812
1803
|
return ["useAllUserPools", query];
|
|
1813
1804
|
};
|
|
1814
1805
|
var useAllUserPools = (query, options) => {
|
|
1815
|
-
|
|
1806
|
+
return useSWR(
|
|
1816
1807
|
useAllUserPoolsQueryKey({ query }),
|
|
1817
1808
|
async ([_, params]) => {
|
|
1818
1809
|
return getAllPools({
|
|
@@ -1825,12 +1816,6 @@ var useAllUserPools = (query, options) => {
|
|
|
1825
1816
|
...options
|
|
1826
1817
|
}
|
|
1827
1818
|
);
|
|
1828
|
-
return {
|
|
1829
|
-
...swrResponse,
|
|
1830
|
-
refresh: () => {
|
|
1831
|
-
swrResponse.mutate();
|
|
1832
|
-
}
|
|
1833
|
-
};
|
|
1834
1819
|
};
|
|
1835
1820
|
|
|
1836
1821
|
// src/hooks/dex/useApiPool.ts
|
|
@@ -1845,7 +1830,7 @@ function useApiPool({
|
|
|
1845
1830
|
poolId,
|
|
1846
1831
|
account
|
|
1847
1832
|
}) {
|
|
1848
|
-
|
|
1833
|
+
return useSWR(
|
|
1849
1834
|
useApiPoolQueryKey({ poolId, account }),
|
|
1850
1835
|
async ([, poolId2, account2]) => {
|
|
1851
1836
|
if (account2 && !isAddress(account2)) {
|
|
@@ -1864,12 +1849,6 @@ function useApiPool({
|
|
|
1864
1849
|
refreshInterval: 1e5 /* NORMAL */
|
|
1865
1850
|
}
|
|
1866
1851
|
);
|
|
1867
|
-
return {
|
|
1868
|
-
...res,
|
|
1869
|
-
refresh: () => {
|
|
1870
|
-
res.mutate();
|
|
1871
|
-
}
|
|
1872
|
-
};
|
|
1873
1852
|
}
|
|
1874
1853
|
|
|
1875
1854
|
// src/hooks/dex/useCreatePool.ts
|
|
@@ -2164,8 +2143,7 @@ var useGlobalLiquidityAndSwapVolume = () => {
|
|
|
2164
2143
|
swapVolume24h: Number(
|
|
2165
2144
|
response.data?.protocolMetricsAggregated.swapVolume24h
|
|
2166
2145
|
)
|
|
2167
|
-
}
|
|
2168
|
-
refresh: () => response.mutate()
|
|
2146
|
+
}
|
|
2169
2147
|
};
|
|
2170
2148
|
};
|
|
2171
2149
|
|
|
@@ -2294,26 +2272,25 @@ var useRewardVaultFromToken = ({
|
|
|
2294
2272
|
} = {}) => {
|
|
2295
2273
|
const publicClient = usePublicClient5();
|
|
2296
2274
|
const QUERY_KEY = publicClient && tokenAddress && isAddress2(tokenAddress) && isEnabled ? ["useRewardVaultFromToken", tokenAddress] : null;
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2275
|
+
return useSWRImmutable(
|
|
2276
|
+
QUERY_KEY,
|
|
2277
|
+
async ([, tokenAddress2]) => {
|
|
2278
|
+
if (!tokenAddress2) {
|
|
2279
|
+
throw new Error("useRewardVaultFromToken needs a valid token address");
|
|
2280
|
+
}
|
|
2281
|
+
assertPublicClient(publicClient);
|
|
2282
|
+
const { config } = parseBaseArgs({
|
|
2283
|
+
chainId: publicClient.chain.id
|
|
2284
|
+
});
|
|
2285
|
+
const res = await publicClient.readContract({
|
|
2286
|
+
address: config.pol.factory,
|
|
2287
|
+
abi: rewardVaultFactoryAbi,
|
|
2288
|
+
functionName: "getVault",
|
|
2289
|
+
args: [tokenAddress2]
|
|
2290
|
+
});
|
|
2291
|
+
return res === zeroAddress12 ? void 0 : res;
|
|
2300
2292
|
}
|
|
2301
|
-
|
|
2302
|
-
const { config } = parseBaseArgs({
|
|
2303
|
-
chainId: publicClient.chain.id
|
|
2304
|
-
});
|
|
2305
|
-
const res = await publicClient.readContract({
|
|
2306
|
-
address: config.pol.factory,
|
|
2307
|
-
abi: rewardVaultFactoryAbi,
|
|
2308
|
-
functionName: "getVault",
|
|
2309
|
-
args: [tokenAddress2]
|
|
2310
|
-
});
|
|
2311
|
-
return res === zeroAddress12 ? void 0 : res;
|
|
2312
|
-
});
|
|
2313
|
-
return {
|
|
2314
|
-
...swrResponse,
|
|
2315
|
-
refresh: () => swrResponse.mutate()
|
|
2316
|
-
};
|
|
2293
|
+
);
|
|
2317
2294
|
};
|
|
2318
2295
|
|
|
2319
2296
|
// src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts
|
|
@@ -2327,7 +2304,7 @@ var useRewardVaultBalanceFromStakingToken = ({
|
|
|
2327
2304
|
const {
|
|
2328
2305
|
data: rewardVaultAddress = _rewardVaultAddress,
|
|
2329
2306
|
error,
|
|
2330
|
-
|
|
2307
|
+
refresh: mutateRewardVaultAddress,
|
|
2331
2308
|
isLoading: isLoadingRewardVaultAddress
|
|
2332
2309
|
} = useRewardVaultFromToken(
|
|
2333
2310
|
{
|
|
@@ -2364,7 +2341,7 @@ var useRewardVaultBalanceFromStakingToken = ({
|
|
|
2364
2341
|
...swrResponse,
|
|
2365
2342
|
refresh: () => {
|
|
2366
2343
|
mutateRewardVaultAddress();
|
|
2367
|
-
swrResponse.
|
|
2344
|
+
swrResponse.refresh();
|
|
2368
2345
|
},
|
|
2369
2346
|
isLoading: swrResponse.isLoading || isLoadingRewardVaultAddress
|
|
2370
2347
|
};
|
|
@@ -2390,7 +2367,7 @@ function useTokenInformation(args, options) {
|
|
|
2390
2367
|
chainId: args.chainId
|
|
2391
2368
|
});
|
|
2392
2369
|
const QUERY_KEY = args?.address && publicClient && isAddress4(args.address) ? ["useTokenInformation", args.address, args.chainId] : null;
|
|
2393
|
-
|
|
2370
|
+
return useSWRImmutable(
|
|
2394
2371
|
QUERY_KEY,
|
|
2395
2372
|
async ([_, address, chainId2 = defaultChainId2]) => {
|
|
2396
2373
|
if (isToken(address, "BERA")) {
|
|
@@ -2411,10 +2388,6 @@ function useTokenInformation(args, options) {
|
|
|
2411
2388
|
},
|
|
2412
2389
|
{ ...options }
|
|
2413
2390
|
);
|
|
2414
|
-
return {
|
|
2415
|
-
...swrResponse,
|
|
2416
|
-
refresh: () => swrResponse?.mutate?.()
|
|
2417
|
-
};
|
|
2418
2391
|
}
|
|
2419
2392
|
|
|
2420
2393
|
// src/hooks/tokens/usePollBalance.ts
|
|
@@ -2468,9 +2441,6 @@ function usePollBalance({
|
|
|
2468
2441
|
};
|
|
2469
2442
|
return {
|
|
2470
2443
|
...rest,
|
|
2471
|
-
refresh: () => {
|
|
2472
|
-
rest.mutate();
|
|
2473
|
-
},
|
|
2474
2444
|
isLoading: isLoading || isNativeToken ? isLoadingTokenInformation : false,
|
|
2475
2445
|
error: error || !isNativeToken ? error : void 0,
|
|
2476
2446
|
data: tokenBalance
|
|
@@ -2549,7 +2519,7 @@ function usePollAllowances(args, options) {
|
|
|
2549
2519
|
const config = useConfig2();
|
|
2550
2520
|
const { address: account } = useBeraWallet5();
|
|
2551
2521
|
const QUERY_KEY = config && account && args?.items ? ["usePollAllowances", account, args?.items] : null;
|
|
2552
|
-
|
|
2522
|
+
return useSWR(
|
|
2553
2523
|
QUERY_KEY,
|
|
2554
2524
|
async ([, account2, items]) => {
|
|
2555
2525
|
return getAllowances({
|
|
@@ -2563,10 +2533,6 @@ function usePollAllowances(args, options) {
|
|
|
2563
2533
|
refreshInterval: options?.refreshInterval ?? 1e5 /* NORMAL */
|
|
2564
2534
|
}
|
|
2565
2535
|
);
|
|
2566
|
-
return {
|
|
2567
|
-
...swrResponse,
|
|
2568
|
-
refresh: () => swrResponse?.mutate?.()
|
|
2569
|
-
};
|
|
2570
2536
|
}
|
|
2571
2537
|
|
|
2572
2538
|
// src/hooks/dex/useMultipleTokenApprovalsWithSlippage.ts
|
|
@@ -2648,7 +2614,7 @@ function useMultipleTokenInformation(args, options) {
|
|
|
2648
2614
|
args.addresses,
|
|
2649
2615
|
args.chainId ?? defaultChainId4
|
|
2650
2616
|
] : null;
|
|
2651
|
-
|
|
2617
|
+
return useSWRImmutable(
|
|
2652
2618
|
QUERY_KEY,
|
|
2653
2619
|
async ([, addresses, chainId2]) => {
|
|
2654
2620
|
assertPublicClient(publicClient);
|
|
@@ -2671,10 +2637,6 @@ function useMultipleTokenInformation(args, options) {
|
|
|
2671
2637
|
},
|
|
2672
2638
|
{ ...options }
|
|
2673
2639
|
);
|
|
2674
|
-
return {
|
|
2675
|
-
...swrResponse,
|
|
2676
|
-
refresh: () => swrResponse?.mutate?.()
|
|
2677
|
-
};
|
|
2678
2640
|
}
|
|
2679
2641
|
|
|
2680
2642
|
// src/hooks/tokens/useTokenCurrentPrices.ts
|
|
@@ -2801,7 +2763,7 @@ function useOnChainPoolData(poolId) {
|
|
|
2801
2763
|
data: poolData,
|
|
2802
2764
|
error,
|
|
2803
2765
|
isLoading,
|
|
2804
|
-
mutate
|
|
2766
|
+
refresh: mutate
|
|
2805
2767
|
} = useSWRImmutable(
|
|
2806
2768
|
// FIXME: why are we using useSWRImmutable when we fetch tokenSupply and swapFee?
|
|
2807
2769
|
publicClient ? QUERY_KEY : null,
|
|
@@ -2870,8 +2832,7 @@ function useOnChainPoolData(poolId) {
|
|
|
2870
2832
|
data: pool,
|
|
2871
2833
|
error,
|
|
2872
2834
|
isLoading: isLoading || isTokenInformationLoading || isTokenPricesLoading,
|
|
2873
|
-
mutate
|
|
2874
|
-
refresh: () => mutate()
|
|
2835
|
+
refresh: mutate
|
|
2875
2836
|
};
|
|
2876
2837
|
}
|
|
2877
2838
|
|
|
@@ -2886,7 +2847,7 @@ var usePollPoolCreationRelayerApproval = (options) => {
|
|
|
2886
2847
|
account,
|
|
2887
2848
|
publicClient.chain.id
|
|
2888
2849
|
] : null;
|
|
2889
|
-
|
|
2850
|
+
return useSWR(
|
|
2890
2851
|
QUERY_KEY,
|
|
2891
2852
|
async ([, account2]) => {
|
|
2892
2853
|
assertPublicClient(publicClient);
|
|
@@ -2901,10 +2862,6 @@ var usePollPoolCreationRelayerApproval = (options) => {
|
|
|
2901
2862
|
},
|
|
2902
2863
|
{ ...options }
|
|
2903
2864
|
);
|
|
2904
|
-
const refreshPoolCreationApproval = () => {
|
|
2905
|
-
swrResponse.mutate();
|
|
2906
|
-
};
|
|
2907
|
-
return { ...swrResponse, refreshPoolCreationApproval };
|
|
2908
2865
|
};
|
|
2909
2866
|
|
|
2910
2867
|
// src/hooks/dex/usePool.ts
|
|
@@ -2945,7 +2902,7 @@ var usePoolEvents = ({
|
|
|
2945
2902
|
var usePoolHistoricalData = ({ poolId, ...baseArgs }, options) => {
|
|
2946
2903
|
const { config } = parseBaseArgs(baseArgs);
|
|
2947
2904
|
const QUERY_KEY = poolId ? ["usePoolHistoricalData", poolId] : null;
|
|
2948
|
-
|
|
2905
|
+
return useSWR(
|
|
2949
2906
|
QUERY_KEY,
|
|
2950
2907
|
async ([, poolId2]) => {
|
|
2951
2908
|
return getPoolHistoricalData({
|
|
@@ -2955,10 +2912,6 @@ var usePoolHistoricalData = ({ poolId, ...baseArgs }, options) => {
|
|
|
2955
2912
|
},
|
|
2956
2913
|
options
|
|
2957
2914
|
);
|
|
2958
|
-
return {
|
|
2959
|
-
...swrResponse,
|
|
2960
|
-
refresh: () => void swrResponse.mutate()
|
|
2961
|
-
};
|
|
2962
2915
|
};
|
|
2963
2916
|
|
|
2964
2917
|
// src/hooks/dex/usePools.ts
|
|
@@ -2974,7 +2927,7 @@ var usePools = (query, options) => {
|
|
|
2974
2927
|
const {
|
|
2975
2928
|
data: userPools,
|
|
2976
2929
|
isLoading: isUserPoolsLoading,
|
|
2977
|
-
|
|
2930
|
+
refresh: mutateUserPools
|
|
2978
2931
|
} = useAllUserPools({
|
|
2979
2932
|
userAddress: account,
|
|
2980
2933
|
chain: query.chain
|
|
@@ -2982,7 +2935,7 @@ var usePools = (query, options) => {
|
|
|
2982
2935
|
const {
|
|
2983
2936
|
data: pools,
|
|
2984
2937
|
isLoading: isPoolsLoading,
|
|
2985
|
-
|
|
2938
|
+
refresh: mutatePools,
|
|
2986
2939
|
error: poolsError
|
|
2987
2940
|
} = useSWR(
|
|
2988
2941
|
usePoolsQueryKey({ query }),
|
|
@@ -4302,7 +4255,7 @@ function useBendZapSupply({
|
|
|
4302
4255
|
isCrossChain,
|
|
4303
4256
|
nativeFee,
|
|
4304
4257
|
refresh: () => {
|
|
4305
|
-
swrResponse.
|
|
4258
|
+
swrResponse.refresh();
|
|
4306
4259
|
}
|
|
4307
4260
|
};
|
|
4308
4261
|
}
|
|
@@ -4476,7 +4429,7 @@ function usePollWalletBalances(args, options) {
|
|
|
4476
4429
|
return {
|
|
4477
4430
|
...swrResponse,
|
|
4478
4431
|
refresh: () => {
|
|
4479
|
-
swrResponse?.
|
|
4432
|
+
swrResponse?.refresh();
|
|
4480
4433
|
refresh();
|
|
4481
4434
|
}
|
|
4482
4435
|
};
|
|
@@ -4542,7 +4495,7 @@ function useEnsoSwapBundle({
|
|
|
4542
4495
|
return {
|
|
4543
4496
|
...swrResponse,
|
|
4544
4497
|
refresh: () => {
|
|
4545
|
-
swrResponse.
|
|
4498
|
+
swrResponse.refresh();
|
|
4546
4499
|
refreshBalances();
|
|
4547
4500
|
}
|
|
4548
4501
|
};
|
|
@@ -4612,9 +4565,6 @@ function useZapStakeBera({
|
|
|
4612
4565
|
...swrResponse.data,
|
|
4613
4566
|
priceImpactPercentage,
|
|
4614
4567
|
isCrossChain: inputToken && tokenOut.chainId !== inputToken?.chainId
|
|
4615
|
-
},
|
|
4616
|
-
refresh: () => {
|
|
4617
|
-
swrResponse.mutate();
|
|
4618
4568
|
}
|
|
4619
4569
|
};
|
|
4620
4570
|
}
|
|
@@ -4628,7 +4578,7 @@ function usePythLatestPrices({
|
|
|
4628
4578
|
}, options) {
|
|
4629
4579
|
const priceFeedIds = priceFeedMap ? Object.values(priceFeedMap) : null;
|
|
4630
4580
|
const QUERY_KEY = priceFeedIds ? ["usePythLatestPrices", priceFeedIds] : null;
|
|
4631
|
-
|
|
4581
|
+
return useSWR(
|
|
4632
4582
|
QUERY_KEY,
|
|
4633
4583
|
async ([_, priceFeeds]) => {
|
|
4634
4584
|
const data = await getPythLatestPrices({ priceFeedId: priceFeeds });
|
|
@@ -4636,7 +4586,6 @@ function usePythLatestPrices({
|
|
|
4636
4586
|
},
|
|
4637
4587
|
options
|
|
4638
4588
|
);
|
|
4639
|
-
return swrResponse;
|
|
4640
4589
|
}
|
|
4641
4590
|
|
|
4642
4591
|
// src/hooks/honey/useCappedGlobally.ts
|
|
@@ -4664,7 +4613,7 @@ var useCappedGlobally = ({
|
|
|
4664
4613
|
flags.isPythWrapperEnabled,
|
|
4665
4614
|
isBasketModeEnabled2
|
|
4666
4615
|
] : null;
|
|
4667
|
-
|
|
4616
|
+
return useSWR(
|
|
4668
4617
|
QUERY_KEY,
|
|
4669
4618
|
async ([
|
|
4670
4619
|
_,
|
|
@@ -4692,10 +4641,6 @@ var useCappedGlobally = ({
|
|
|
4692
4641
|
refreshInterval: 0
|
|
4693
4642
|
}
|
|
4694
4643
|
);
|
|
4695
|
-
return {
|
|
4696
|
-
...swrResponse,
|
|
4697
|
-
refresh: () => void swrResponse.mutate()
|
|
4698
|
-
};
|
|
4699
4644
|
};
|
|
4700
4645
|
|
|
4701
4646
|
// src/hooks/honey/useCappedRelatively.ts
|
|
@@ -4715,7 +4660,7 @@ var useCappedRelatively = ({
|
|
|
4715
4660
|
collateralList,
|
|
4716
4661
|
referenceCollateral
|
|
4717
4662
|
] : null;
|
|
4718
|
-
|
|
4663
|
+
return useSWR(
|
|
4719
4664
|
QUERY_KEY,
|
|
4720
4665
|
async ([_, asset2, amount2, collaterals, referenceCollateral2]) => {
|
|
4721
4666
|
if (isBasketModeEnabled2) {
|
|
@@ -4753,10 +4698,6 @@ var useCappedRelatively = ({
|
|
|
4753
4698
|
...options
|
|
4754
4699
|
}
|
|
4755
4700
|
);
|
|
4756
|
-
return {
|
|
4757
|
-
...swrResponse,
|
|
4758
|
-
refresh: () => void swrResponse.mutate()
|
|
4759
|
-
};
|
|
4760
4701
|
};
|
|
4761
4702
|
|
|
4762
4703
|
// src/hooks/honey/useCollateralWeights.ts
|
|
@@ -4766,7 +4707,7 @@ var useCollateralWeights = ({
|
|
|
4766
4707
|
}, options) => {
|
|
4767
4708
|
const publicClient = usePublicClient20();
|
|
4768
4709
|
const QUERY_KEY = publicClient && collateralList ? ["useCollateralWeights", collateralList] : void 0;
|
|
4769
|
-
|
|
4710
|
+
return useSWR(
|
|
4770
4711
|
QUERY_KEY,
|
|
4771
4712
|
async ([_, collateralList2]) => {
|
|
4772
4713
|
assertPublicClient(publicClient);
|
|
@@ -4780,10 +4721,6 @@ var useCollateralWeights = ({
|
|
|
4780
4721
|
refreshInterval: options?.refreshInterval ?? 1e5 /* NORMAL */
|
|
4781
4722
|
}
|
|
4782
4723
|
);
|
|
4783
|
-
return {
|
|
4784
|
-
...swrResponse,
|
|
4785
|
-
refresh: () => void swrResponse.mutate()
|
|
4786
|
-
};
|
|
4787
4724
|
};
|
|
4788
4725
|
|
|
4789
4726
|
// src/hooks/honey/useHoney24hVolume.ts
|
|
@@ -4791,10 +4728,7 @@ function useHoney24hVolume() {
|
|
|
4791
4728
|
const response = useSWR(["useHoney24hVolume"], () => getHoney24hVolume(), {
|
|
4792
4729
|
refreshInterval: 18e4 /* SLOW */
|
|
4793
4730
|
});
|
|
4794
|
-
return
|
|
4795
|
-
...response,
|
|
4796
|
-
refresh: () => response.mutate()
|
|
4797
|
-
};
|
|
4731
|
+
return response;
|
|
4798
4732
|
}
|
|
4799
4733
|
|
|
4800
4734
|
// src/hooks/honey/useHoneyAlerts.ts
|
|
@@ -4812,7 +4746,7 @@ var useHoneyBalances = () => {
|
|
|
4812
4746
|
const { collateralList } = useHoneyConfig();
|
|
4813
4747
|
const wagmiConfig = useConfig5();
|
|
4814
4748
|
const QUERY_KEY = account && collateralList && publicClient ? ["useHoneyBalances", account, collateralList] : null;
|
|
4815
|
-
|
|
4749
|
+
return useSWR(
|
|
4816
4750
|
QUERY_KEY,
|
|
4817
4751
|
async ([_, account2, collateralList2]) => {
|
|
4818
4752
|
assertPublicClient(publicClient);
|
|
@@ -4835,10 +4769,6 @@ var useHoneyBalances = () => {
|
|
|
4835
4769
|
refreshInterval: 1e4 /* FAST */
|
|
4836
4770
|
}
|
|
4837
4771
|
);
|
|
4838
|
-
return {
|
|
4839
|
-
...swrResponse,
|
|
4840
|
-
refresh: () => swrResponse.mutate()
|
|
4841
|
-
};
|
|
4842
4772
|
};
|
|
4843
4773
|
|
|
4844
4774
|
// src/hooks/honey/useHoneyVaultsBalance.ts
|
|
@@ -4847,7 +4777,7 @@ var useHoneyVaultsBalance = (options) => {
|
|
|
4847
4777
|
const publicClient = usePublicClient22();
|
|
4848
4778
|
const { collateralList } = useHoneyConfig();
|
|
4849
4779
|
const QUERY_KEY = collateralList && publicClient ? ["useHoneyVaultsBalance", collateralList] : null;
|
|
4850
|
-
|
|
4780
|
+
return useSWR(
|
|
4851
4781
|
QUERY_KEY,
|
|
4852
4782
|
async ([_, collateralList2]) => {
|
|
4853
4783
|
assertPublicClient(publicClient);
|
|
@@ -4858,10 +4788,6 @@ var useHoneyVaultsBalance = (options) => {
|
|
|
4858
4788
|
},
|
|
4859
4789
|
{ ...options, refreshInterval: 1e5 /* NORMAL */ }
|
|
4860
4790
|
);
|
|
4861
|
-
return {
|
|
4862
|
-
...swrResponse,
|
|
4863
|
-
refresh: () => void swrResponse.mutate()
|
|
4864
|
-
};
|
|
4865
4791
|
};
|
|
4866
4792
|
|
|
4867
4793
|
// src/hooks/honey/useIsBadCollateralAsset.ts
|
|
@@ -4885,7 +4811,7 @@ var useIsBadCollateralAsset = ({ collateral }, options) => {
|
|
|
4885
4811
|
latestPrices,
|
|
4886
4812
|
flags.isPythWrapperEnabled
|
|
4887
4813
|
] : null;
|
|
4888
|
-
|
|
4814
|
+
return useSWR(
|
|
4889
4815
|
QUERY_KEY,
|
|
4890
4816
|
async ([_, collateral2, latestPrices2, isPythWrapperEnabled]) => {
|
|
4891
4817
|
assertPublicClient(publicClient);
|
|
@@ -4901,10 +4827,6 @@ var useIsBadCollateralAsset = ({ collateral }, options) => {
|
|
|
4901
4827
|
refreshInterval: options?.refreshInterval ?? 1e5 /* NORMAL */
|
|
4902
4828
|
}
|
|
4903
4829
|
);
|
|
4904
|
-
return {
|
|
4905
|
-
...swrResponse,
|
|
4906
|
-
refresh: () => void swrResponse.mutate()
|
|
4907
|
-
};
|
|
4908
4830
|
};
|
|
4909
4831
|
|
|
4910
4832
|
// src/hooks/honey/useHoneyAlerts.ts
|
|
@@ -5086,16 +5008,9 @@ var useHoneyAlerts = ({
|
|
|
5086
5008
|
|
|
5087
5009
|
// src/hooks/honey/useHoneyChartData.ts
|
|
5088
5010
|
function useHoneyChartData({ days }) {
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
return await getChartData({ days: days2 });
|
|
5093
|
-
}
|
|
5094
|
-
);
|
|
5095
|
-
return {
|
|
5096
|
-
...swrResponse,
|
|
5097
|
-
refresh: () => swrResponse.mutate()
|
|
5098
|
-
};
|
|
5011
|
+
return useSWR(["useHoneyChartData", days], async ([_, days2]) => {
|
|
5012
|
+
return await getChartData({ days: days2 });
|
|
5013
|
+
});
|
|
5099
5014
|
}
|
|
5100
5015
|
|
|
5101
5016
|
// src/hooks/honey/useHoneySwapState.ts
|
|
@@ -5124,7 +5039,7 @@ function useIsBasketModeEnabled({ state }, options) {
|
|
|
5124
5039
|
flags.isPythWrapperEnabled,
|
|
5125
5040
|
collateralList
|
|
5126
5041
|
] : null;
|
|
5127
|
-
|
|
5042
|
+
return useSWR(
|
|
5128
5043
|
QUERY_KEY,
|
|
5129
5044
|
async ([_, isMint2, latestPrices2, isPythWrapperEnabled, collateralList2]) => {
|
|
5130
5045
|
assertPublicClient(publicClient);
|
|
@@ -5142,11 +5057,6 @@ function useIsBasketModeEnabled({ state }, options) {
|
|
|
5142
5057
|
refreshInterval: options?.refreshInterval ?? 1e4 /* FAST */
|
|
5143
5058
|
}
|
|
5144
5059
|
);
|
|
5145
|
-
return {
|
|
5146
|
-
...swrResponse,
|
|
5147
|
-
data: swrResponse.data,
|
|
5148
|
-
refresh: () => void swrResponse.mutate()
|
|
5149
|
-
};
|
|
5150
5060
|
}
|
|
5151
5061
|
|
|
5152
5062
|
// src/hooks/honey/useHoneySwapState.ts
|
|
@@ -5317,7 +5227,7 @@ function useAutoclaimedIncentives({
|
|
|
5317
5227
|
}) {
|
|
5318
5228
|
const { address: account } = useBeraWallet17();
|
|
5319
5229
|
const QUERY_KEY = enabled && account ? ["useAutoclaimedIncentives", account] : null;
|
|
5320
|
-
|
|
5230
|
+
return useSWR(
|
|
5321
5231
|
QUERY_KEY,
|
|
5322
5232
|
async ([, account2]) => getAutoclaimedIncentives({ account: account2 }),
|
|
5323
5233
|
{
|
|
@@ -5326,10 +5236,6 @@ function useAutoclaimedIncentives({
|
|
|
5326
5236
|
revalidateIfStale: false
|
|
5327
5237
|
}
|
|
5328
5238
|
);
|
|
5329
|
-
return {
|
|
5330
|
-
...swrResponse,
|
|
5331
|
-
refresh: () => swrResponse?.mutate?.()
|
|
5332
|
-
};
|
|
5333
5239
|
}
|
|
5334
5240
|
|
|
5335
5241
|
// src/hooks/pol/useAutoclaimedIncentivesTxHash.ts
|
|
@@ -5339,7 +5245,7 @@ function useAutoclaimedIncentivesTxHash({
|
|
|
5339
5245
|
}) {
|
|
5340
5246
|
const { address: account } = useBeraWallet18();
|
|
5341
5247
|
const QUERY_KEY = enabled && account ? ["useAutoclaimedIncentivesTxHash", account] : null;
|
|
5342
|
-
|
|
5248
|
+
return useSWR(
|
|
5343
5249
|
QUERY_KEY,
|
|
5344
5250
|
async ([, account2]) => getAutoclaimedIncentivesTxHash({ account: account2 }),
|
|
5345
5251
|
{
|
|
@@ -5353,10 +5259,6 @@ function useAutoclaimedIncentivesTxHash({
|
|
|
5353
5259
|
revalidateIfStale: false
|
|
5354
5260
|
}
|
|
5355
5261
|
);
|
|
5356
|
-
return {
|
|
5357
|
-
...swrResponse,
|
|
5358
|
-
refresh: () => swrResponse?.mutate?.()
|
|
5359
|
-
};
|
|
5360
5262
|
}
|
|
5361
5263
|
|
|
5362
5264
|
// src/hooks/pol/useBgtAprSimulation.ts
|
|
@@ -5375,7 +5277,7 @@ import { usePublicClient as usePublicClient26 } from "@berachain/wagmi/hooks";
|
|
|
5375
5277
|
function useBgtIncentiveDistributorPaused(options) {
|
|
5376
5278
|
const publicClient = usePublicClient26();
|
|
5377
5279
|
const QUERY_KEY = publicClient ? ["useBgtIncentiveDistributorPaused", publicClient.chain?.id] : null;
|
|
5378
|
-
|
|
5280
|
+
return swr_default(
|
|
5379
5281
|
QUERY_KEY,
|
|
5380
5282
|
async () => getBgtIncentiveDistributorPaused({ publicClient }).catch(() => false),
|
|
5381
5283
|
{
|
|
@@ -5384,10 +5286,6 @@ function useBgtIncentiveDistributorPaused(options) {
|
|
|
5384
5286
|
...options
|
|
5385
5287
|
}
|
|
5386
5288
|
);
|
|
5387
|
-
return {
|
|
5388
|
-
...swrResponse,
|
|
5389
|
-
refresh: () => swrResponse?.mutate?.()
|
|
5390
|
-
};
|
|
5391
5289
|
}
|
|
5392
5290
|
|
|
5393
5291
|
// src/hooks/pol/useBgtUnstakedBalance.ts
|
|
@@ -5398,7 +5296,7 @@ var useBgtUnstakedBalance = (options) => {
|
|
|
5398
5296
|
const { address: account } = useBeraWallet19();
|
|
5399
5297
|
const publicClient = usePublicClient27();
|
|
5400
5298
|
const QUERY_KEY = account && publicClient ? ["useBgtUnstakedBalance", account] : null;
|
|
5401
|
-
|
|
5299
|
+
return useSWR(
|
|
5402
5300
|
QUERY_KEY,
|
|
5403
5301
|
async ([, account2]) => {
|
|
5404
5302
|
assertPublicClient(publicClient);
|
|
@@ -5418,10 +5316,6 @@ var useBgtUnstakedBalance = (options) => {
|
|
|
5418
5316
|
refreshInterval: options?.refreshInterval ?? 1e5 /* NORMAL */
|
|
5419
5317
|
}
|
|
5420
5318
|
);
|
|
5421
|
-
return {
|
|
5422
|
-
...swrResponse,
|
|
5423
|
-
refresh: () => swrResponse.mutate()
|
|
5424
|
-
};
|
|
5425
5319
|
};
|
|
5426
5320
|
|
|
5427
5321
|
// src/hooks/pol/useClaimableFees.ts
|
|
@@ -5431,7 +5325,7 @@ var useClaimableFees = () => {
|
|
|
5431
5325
|
const { address: account } = useBeraWallet20();
|
|
5432
5326
|
const publicClient = usePublicClient28();
|
|
5433
5327
|
const QUERY_KEY = account && publicClient ? ["useClaimableFees", account] : null;
|
|
5434
|
-
|
|
5328
|
+
return useSWR(
|
|
5435
5329
|
QUERY_KEY,
|
|
5436
5330
|
async ([, account2]) => {
|
|
5437
5331
|
assertPublicClient(publicClient);
|
|
@@ -5449,10 +5343,6 @@ var useClaimableFees = () => {
|
|
|
5449
5343
|
refreshInterval: 18e4 /* SLOW */ * 2
|
|
5450
5344
|
}
|
|
5451
5345
|
);
|
|
5452
|
-
return {
|
|
5453
|
-
...swrResponse,
|
|
5454
|
-
refresh: () => swrResponse?.mutate?.()
|
|
5455
|
-
};
|
|
5456
5346
|
};
|
|
5457
5347
|
|
|
5458
5348
|
// src/hooks/pol/useHighestVaultsAPR.ts
|
|
@@ -5472,7 +5362,7 @@ var useRewardVaults = (args, options) => {
|
|
|
5472
5362
|
args.onChainIncentives
|
|
5473
5363
|
);
|
|
5474
5364
|
const publicClient = usePublicClient29();
|
|
5475
|
-
|
|
5365
|
+
return useSWR(
|
|
5476
5366
|
QUERY_KEY,
|
|
5477
5367
|
async ([, filter, onChainIncentives]) => {
|
|
5478
5368
|
return await getRewardVaults({
|
|
@@ -5482,10 +5372,6 @@ var useRewardVaults = (args, options) => {
|
|
|
5482
5372
|
},
|
|
5483
5373
|
options
|
|
5484
5374
|
);
|
|
5485
|
-
return {
|
|
5486
|
-
...swrResponse,
|
|
5487
|
-
refresh: swrResponse.mutate
|
|
5488
|
-
};
|
|
5489
5375
|
};
|
|
5490
5376
|
|
|
5491
5377
|
// src/hooks/pol/useHighestVaultsAPR.ts
|
|
@@ -5508,8 +5394,7 @@ var useHighestVaultsAPR = (where = {}, { isEnabled = true } = {}) => {
|
|
|
5508
5394
|
);
|
|
5509
5395
|
return {
|
|
5510
5396
|
isLoading: swrResponse.isLoading,
|
|
5511
|
-
highestApr: swrResponse.data?.
|
|
5512
|
-
refresh: swrResponse.mutate
|
|
5397
|
+
highestApr: swrResponse.data?.rewardVaultList[0].dynamicData?.apr
|
|
5513
5398
|
};
|
|
5514
5399
|
};
|
|
5515
5400
|
|
|
@@ -5517,7 +5402,7 @@ var useHighestVaultsAPR = (where = {}, { isEnabled = true } = {}) => {
|
|
|
5517
5402
|
import { usePublicClient as usePublicClient30 } from "@berachain/wagmi/hooks";
|
|
5518
5403
|
var usePollGlobalData = (options) => {
|
|
5519
5404
|
const publicClient = usePublicClient30();
|
|
5520
|
-
|
|
5405
|
+
return useSWR(
|
|
5521
5406
|
publicClient ? "usePollGlobalData" : null,
|
|
5522
5407
|
async () => {
|
|
5523
5408
|
assertPublicClient(publicClient);
|
|
@@ -5528,10 +5413,6 @@ var usePollGlobalData = (options) => {
|
|
|
5528
5413
|
...options
|
|
5529
5414
|
}
|
|
5530
5415
|
);
|
|
5531
|
-
return {
|
|
5532
|
-
...swrResponse,
|
|
5533
|
-
refresh: swrResponse.mutate
|
|
5534
|
-
};
|
|
5535
5416
|
};
|
|
5536
5417
|
|
|
5537
5418
|
// src/hooks/pol/usePollMarkets.ts
|
|
@@ -5540,7 +5421,7 @@ var usePollMarketsQueryKey = () => {
|
|
|
5540
5421
|
};
|
|
5541
5422
|
var usePollMarkets = (options) => {
|
|
5542
5423
|
const QUERY_KEY = usePollMarketsQueryKey();
|
|
5543
|
-
|
|
5424
|
+
return useSWRImmutable(
|
|
5544
5425
|
QUERY_KEY,
|
|
5545
5426
|
async () => {
|
|
5546
5427
|
const res = await getMarkets();
|
|
@@ -5550,10 +5431,6 @@ var usePollMarkets = (options) => {
|
|
|
5550
5431
|
...options
|
|
5551
5432
|
}
|
|
5552
5433
|
);
|
|
5553
|
-
return {
|
|
5554
|
-
...swrResponse,
|
|
5555
|
-
refresh: () => swrResponse.mutate()
|
|
5556
|
-
};
|
|
5557
5434
|
};
|
|
5558
5435
|
|
|
5559
5436
|
// src/hooks/pol/useQueuedBeraUnlock.ts
|
|
@@ -5571,7 +5448,7 @@ function useQueuedBeraUnlock({
|
|
|
5571
5448
|
account,
|
|
5572
5449
|
version
|
|
5573
5450
|
] : null;
|
|
5574
|
-
|
|
5451
|
+
return useSWRImmutable(
|
|
5575
5452
|
QUERY_KEY,
|
|
5576
5453
|
async ([, receiptTokenAddresses2, account2, version2]) => {
|
|
5577
5454
|
assertPublicClient(publicClient);
|
|
@@ -5591,10 +5468,6 @@ function useQueuedBeraUnlock({
|
|
|
5591
5468
|
...options
|
|
5592
5469
|
}
|
|
5593
5470
|
);
|
|
5594
|
-
return {
|
|
5595
|
-
...swrResponse,
|
|
5596
|
-
refresh: () => swrResponse.mutate()
|
|
5597
|
-
};
|
|
5598
5471
|
}
|
|
5599
5472
|
|
|
5600
5473
|
// src/hooks/pol/useRewardTokenToBeraRate.ts
|
|
@@ -5783,8 +5656,8 @@ var useRewardVault = (id, options) => {
|
|
|
5783
5656
|
isLoading: onChainRewardVault.isLoading || swrResponse.isLoading,
|
|
5784
5657
|
isValidating: onChainRewardVault.isValidating ?? swrResponse.isValidating,
|
|
5785
5658
|
refresh: () => {
|
|
5786
|
-
swrResponse.
|
|
5787
|
-
onChainRewardVault.
|
|
5659
|
+
swrResponse.refresh();
|
|
5660
|
+
onChainRewardVault.refresh();
|
|
5788
5661
|
}
|
|
5789
5662
|
};
|
|
5790
5663
|
};
|
|
@@ -5797,7 +5670,7 @@ function useRewardVaultIncentives({
|
|
|
5797
5670
|
}) {
|
|
5798
5671
|
const publicClient = usePublicClient34();
|
|
5799
5672
|
const QUERY_KEY = publicClient && address && stakingToken ? ["useRewardVaultIncentives", address, stakingToken] : null;
|
|
5800
|
-
|
|
5673
|
+
return useSWR(QUERY_KEY, async ([, address2, stakingToken2]) => {
|
|
5801
5674
|
assertPublicClient(publicClient);
|
|
5802
5675
|
return await getRewardVaultIncentives({
|
|
5803
5676
|
address: address2,
|
|
@@ -5805,10 +5678,6 @@ function useRewardVaultIncentives({
|
|
|
5805
5678
|
publicClient
|
|
5806
5679
|
});
|
|
5807
5680
|
});
|
|
5808
|
-
return {
|
|
5809
|
-
...swrResponse,
|
|
5810
|
-
refresh: () => swrResponse?.mutate?.()
|
|
5811
|
-
};
|
|
5812
5681
|
}
|
|
5813
5682
|
|
|
5814
5683
|
// src/hooks/pol/useRewardVaultRewards.ts
|
|
@@ -5816,7 +5685,7 @@ import { usePublicClient as usePublicClient35 } from "@berachain/wagmi/hooks";
|
|
|
5816
5685
|
var useRewardVaultRewards = (address, options) => {
|
|
5817
5686
|
const publicClient = usePublicClient35();
|
|
5818
5687
|
const QUERY_KEY = publicClient && address ? ["useRewardVaultRewards", address] : null;
|
|
5819
|
-
|
|
5688
|
+
return useSWR(
|
|
5820
5689
|
QUERY_KEY,
|
|
5821
5690
|
async ([, address2]) => {
|
|
5822
5691
|
assertPublicClient(publicClient);
|
|
@@ -5826,10 +5695,6 @@ var useRewardVaultRewards = (address, options) => {
|
|
|
5826
5695
|
...options
|
|
5827
5696
|
}
|
|
5828
5697
|
);
|
|
5829
|
-
return {
|
|
5830
|
-
...swrResponse,
|
|
5831
|
-
refresh: () => swrResponse?.mutate?.()
|
|
5832
|
-
};
|
|
5833
5698
|
};
|
|
5834
5699
|
|
|
5835
5700
|
// src/utils/filter.ts
|
|
@@ -5859,7 +5724,7 @@ function useStakedAPR({
|
|
|
5859
5724
|
range
|
|
5860
5725
|
}) {
|
|
5861
5726
|
const QUERY_KEY = range ? ["useStakedAPR", range] : null;
|
|
5862
|
-
|
|
5727
|
+
return useSWR(QUERY_KEY, async ([, range2]) => {
|
|
5863
5728
|
const unsortedStakedBeraSnapshots = await getStakedBeraSnapshots({
|
|
5864
5729
|
range: range2
|
|
5865
5730
|
});
|
|
@@ -5871,10 +5736,6 @@ function useStakedAPR({
|
|
|
5871
5736
|
apr: item.apr
|
|
5872
5737
|
}));
|
|
5873
5738
|
});
|
|
5874
|
-
return {
|
|
5875
|
-
...swrResponse,
|
|
5876
|
-
refresh: () => swrResponse.mutate()
|
|
5877
|
-
};
|
|
5878
5739
|
}
|
|
5879
5740
|
|
|
5880
5741
|
// src/hooks/pol/useStakedData.ts
|
|
@@ -6041,13 +5902,6 @@ async function getStakingDailyAssets({
|
|
|
6041
5902
|
address,
|
|
6042
5903
|
range
|
|
6043
5904
|
}) {
|
|
6044
|
-
const { config } = parseBaseArgs({});
|
|
6045
|
-
if (!config.beep) {
|
|
6046
|
-
return fetchRailwayBackend("/vaults/{vault}/stats-by-day", {
|
|
6047
|
-
path: { vault: address },
|
|
6048
|
-
query: { days: `${range}` }
|
|
6049
|
-
});
|
|
6050
|
-
}
|
|
6051
5905
|
return fetchBeep("/v0/stake/{vault}/stats-by-day", {
|
|
6052
5906
|
path: { vault: address },
|
|
6053
5907
|
query: { days: `${range}` }
|
|
@@ -6060,7 +5914,7 @@ function useStakedSnapshots({
|
|
|
6060
5914
|
addresses
|
|
6061
5915
|
}) {
|
|
6062
5916
|
const QUERY_KEY = range ? ["useStakedSnapshots", range, addresses] : null;
|
|
6063
|
-
|
|
5917
|
+
return useSWR(QUERY_KEY, async ([, range2, addresses2]) => {
|
|
6064
5918
|
const [...sortedStakingDailyAssetsArray] = await Promise.all([
|
|
6065
5919
|
...addresses2.map(async (address) => {
|
|
6066
5920
|
const unstakingDailyAssets = await getStakingDailyAssets({
|
|
@@ -6080,10 +5934,6 @@ function useStakedSnapshots({
|
|
|
6080
5934
|
{}
|
|
6081
5935
|
);
|
|
6082
5936
|
});
|
|
6083
|
-
return {
|
|
6084
|
-
...swrResponse,
|
|
6085
|
-
refresh: () => swrResponse.mutate()
|
|
6086
|
-
};
|
|
6087
5937
|
}
|
|
6088
5938
|
|
|
6089
5939
|
// src/hooks/pol/useStakingVaultsMetadata.ts
|
|
@@ -6117,16 +5967,12 @@ function useTotalStakedAmount({
|
|
|
6117
5967
|
vaultAddresses
|
|
6118
5968
|
}) {
|
|
6119
5969
|
const publicClient = usePublicClient38();
|
|
6120
|
-
|
|
5970
|
+
return useSWR(
|
|
6121
5971
|
vaultAddresses && publicClient ? ["useTotalStakedAmount", vaultAddresses] : null,
|
|
6122
5972
|
([, vaultAddresses2]) => {
|
|
6123
5973
|
return getTotalStakedAmount({ vaultAddresses: vaultAddresses2, publicClient });
|
|
6124
5974
|
}
|
|
6125
5975
|
);
|
|
6126
|
-
return {
|
|
6127
|
-
...swrResponse,
|
|
6128
|
-
refresh: () => swrResponse.mutate()
|
|
6129
|
-
};
|
|
6130
5976
|
}
|
|
6131
5977
|
|
|
6132
5978
|
// src/hooks/pol/useUserVaultInfo.ts
|
|
@@ -6135,7 +5981,7 @@ var useUserVaultInfo = (args, options) => {
|
|
|
6135
5981
|
const { address: account } = useBeraWallet22();
|
|
6136
5982
|
const publicClient = usePublicClient39();
|
|
6137
5983
|
const QUERY_KEY = account && publicClient && args.vaultAddress ? ["useUserVaultInfo", account, args.vaultAddress] : null;
|
|
6138
|
-
|
|
5984
|
+
return useSWR(
|
|
6139
5985
|
QUERY_KEY,
|
|
6140
5986
|
async ([, account2, vaultAddress]) => {
|
|
6141
5987
|
assertPublicClient(publicClient);
|
|
@@ -6150,10 +5996,6 @@ var useUserVaultInfo = (args, options) => {
|
|
|
6150
5996
|
refreshInterval: options?.refreshInterval ?? 1e5 /* NORMAL */
|
|
6151
5997
|
}
|
|
6152
5998
|
);
|
|
6153
|
-
return {
|
|
6154
|
-
...swrResponse,
|
|
6155
|
-
refresh: () => swrResponse.mutate()
|
|
6156
|
-
};
|
|
6157
5999
|
};
|
|
6158
6000
|
|
|
6159
6001
|
// src/hooks/pol/useUserVaults.ts
|
|
@@ -6162,7 +6004,7 @@ var useUserVaults = (options) => {
|
|
|
6162
6004
|
const { address: account } = useBeraWallet23();
|
|
6163
6005
|
const publicClient = usePublicClient40();
|
|
6164
6006
|
const QUERY_KEY = account && publicClient ? ["useUserVaults", account] : null;
|
|
6165
|
-
|
|
6007
|
+
return useSWR(
|
|
6166
6008
|
QUERY_KEY,
|
|
6167
6009
|
async ([, account2]) => {
|
|
6168
6010
|
assertPublicClient(publicClient);
|
|
@@ -6177,10 +6019,6 @@ var useUserVaults = (options) => {
|
|
|
6177
6019
|
keepPreviousData: true
|
|
6178
6020
|
}
|
|
6179
6021
|
);
|
|
6180
|
-
return {
|
|
6181
|
-
...swrResponse,
|
|
6182
|
-
refresh: () => swrResponse?.mutate?.()
|
|
6183
|
-
};
|
|
6184
6022
|
};
|
|
6185
6023
|
|
|
6186
6024
|
// src/hooks/pol/useVaultAddress.ts
|
|
@@ -6207,20 +6045,16 @@ var useVaultHistory = ({
|
|
|
6207
6045
|
resolution
|
|
6208
6046
|
}) => {
|
|
6209
6047
|
const QUERY_KEY = vault ? ["useVaultHistory", vault, range, resolution] : null;
|
|
6210
|
-
|
|
6048
|
+
return useSWR(
|
|
6211
6049
|
QUERY_KEY,
|
|
6212
6050
|
([, vault2, range2, resolution2]) => getVaultHistory({ vault: vault2, range: range2, resolution: resolution2 })
|
|
6213
6051
|
);
|
|
6214
|
-
return {
|
|
6215
|
-
...swrResponse,
|
|
6216
|
-
refresh: () => swrResponse.mutate()
|
|
6217
|
-
};
|
|
6218
6052
|
};
|
|
6219
6053
|
|
|
6220
6054
|
// src/hooks/pol/useVaultValidators.ts
|
|
6221
6055
|
var useVaultValidators = (id, options) => {
|
|
6222
6056
|
const QUERY_KEY = id ? ["useVaultValidators", id] : null;
|
|
6223
|
-
|
|
6057
|
+
return useSWR(
|
|
6224
6058
|
QUERY_KEY,
|
|
6225
6059
|
async ([, address]) => {
|
|
6226
6060
|
return await getVaultValidators({
|
|
@@ -6231,10 +6065,6 @@ var useVaultValidators = (id, options) => {
|
|
|
6231
6065
|
...options
|
|
6232
6066
|
}
|
|
6233
6067
|
);
|
|
6234
|
-
return {
|
|
6235
|
-
...swrResponse,
|
|
6236
|
-
refresh: () => swrResponse.mutate()
|
|
6237
|
-
};
|
|
6238
6068
|
};
|
|
6239
6069
|
|
|
6240
6070
|
// src/hooks/tokens/useBeraCurrentPrice.ts
|
|
@@ -6265,7 +6095,7 @@ import { usePublicClient as usePublicClient42 } from "@berachain/wagmi/hooks";
|
|
|
6265
6095
|
var useStakingTokenInformation = (args, options) => {
|
|
6266
6096
|
const publicClient = usePublicClient42();
|
|
6267
6097
|
const QUERY_KEY = args?.address && publicClient && isAddress12(args.address) ? ["useStakingTokenInformation", args.address] : null;
|
|
6268
|
-
|
|
6098
|
+
return useSWRImmutable(
|
|
6269
6099
|
QUERY_KEY,
|
|
6270
6100
|
async ([_, address]) => {
|
|
6271
6101
|
if (isToken(address, "BERA")) {
|
|
@@ -6283,10 +6113,6 @@ var useStakingTokenInformation = (args, options) => {
|
|
|
6283
6113
|
},
|
|
6284
6114
|
{ ...options }
|
|
6285
6115
|
);
|
|
6286
|
-
return {
|
|
6287
|
-
...swrResponse,
|
|
6288
|
-
refresh: () => swrResponse?.mutate?.()
|
|
6289
|
-
};
|
|
6290
6116
|
};
|
|
6291
6117
|
|
|
6292
6118
|
// src/hooks/tokens/useTokenPrice.ts
|
|
@@ -6557,7 +6383,7 @@ var useAllValidatorsQueryKey = ({
|
|
|
6557
6383
|
};
|
|
6558
6384
|
var useAllValidators = (variables, options) => {
|
|
6559
6385
|
const { config } = parseBaseArgs(variables);
|
|
6560
|
-
|
|
6386
|
+
return useSWR(
|
|
6561
6387
|
useAllValidatorsQueryKey({ variables }),
|
|
6562
6388
|
async ([, variables2]) => {
|
|
6563
6389
|
const result = await getAllValidators({
|
|
@@ -6573,10 +6399,6 @@ var useAllValidators = (variables, options) => {
|
|
|
6573
6399
|
...options
|
|
6574
6400
|
}
|
|
6575
6401
|
);
|
|
6576
|
-
return {
|
|
6577
|
-
...swrResponse,
|
|
6578
|
-
refresh: () => swrResponse.mutate()
|
|
6579
|
-
};
|
|
6580
6402
|
};
|
|
6581
6403
|
|
|
6582
6404
|
// src/hooks/validators/useApiEnrichedAllocation.ts
|
|
@@ -6596,7 +6418,7 @@ import { isHex } from "viem";
|
|
|
6596
6418
|
var useApiValidatorQueryKey = (id) => id ? ["useApiValidator", id] : null;
|
|
6597
6419
|
var useApiValidator = (id, options) => {
|
|
6598
6420
|
const QUERY_KEY = useApiValidatorQueryKey(id);
|
|
6599
|
-
|
|
6421
|
+
return useSWR(
|
|
6600
6422
|
id ? QUERY_KEY : null,
|
|
6601
6423
|
async ([, id2]) => {
|
|
6602
6424
|
if (!id2 || !isHex(id2)) throw new Error(`Invalid validator ID: ${id2}`);
|
|
@@ -6604,10 +6426,6 @@ var useApiValidator = (id, options) => {
|
|
|
6604
6426
|
},
|
|
6605
6427
|
options
|
|
6606
6428
|
);
|
|
6607
|
-
return {
|
|
6608
|
-
...swrResponse,
|
|
6609
|
-
refresh: () => swrResponse.mutate()
|
|
6610
|
-
};
|
|
6611
6429
|
};
|
|
6612
6430
|
|
|
6613
6431
|
// src/hooks/validators/useBaselineRewardAllocation.ts
|
|
@@ -6648,7 +6466,7 @@ var useDailyValidatorBlockStats = ({
|
|
|
6648
6466
|
first = 1
|
|
6649
6467
|
}) => {
|
|
6650
6468
|
const QUERY_KEY = pubKey ? ["useDailyValidatorBlockStats", pubKey, first] : null;
|
|
6651
|
-
|
|
6469
|
+
return useSWR(
|
|
6652
6470
|
QUERY_KEY,
|
|
6653
6471
|
async ([, pubKey2, first2]) => {
|
|
6654
6472
|
return await getDailyValidatorBlockStats({
|
|
@@ -6660,7 +6478,6 @@ var useDailyValidatorBlockStats = ({
|
|
|
6660
6478
|
refreshInterval: 18e4 /* SLOW */
|
|
6661
6479
|
}
|
|
6662
6480
|
);
|
|
6663
|
-
return { ...swrResponse, refresh: () => swrResponse.mutate() };
|
|
6664
6481
|
};
|
|
6665
6482
|
|
|
6666
6483
|
// src/hooks/validators/useDefaultRewardAllocation.ts
|
|
@@ -6668,7 +6485,7 @@ import { usePublicClient as usePublicClient46 } from "@berachain/wagmi/hooks";
|
|
|
6668
6485
|
function useDefaultRewardAllocation(options) {
|
|
6669
6486
|
const publicClient = usePublicClient46();
|
|
6670
6487
|
const QUERY_KEY = publicClient ? ["useDefaultRewardAllocation"] : null;
|
|
6671
|
-
|
|
6488
|
+
return useSWR(
|
|
6672
6489
|
QUERY_KEY,
|
|
6673
6490
|
async () => {
|
|
6674
6491
|
assertPublicClient(publicClient);
|
|
@@ -6680,10 +6497,6 @@ function useDefaultRewardAllocation(options) {
|
|
|
6680
6497
|
...options
|
|
6681
6498
|
}
|
|
6682
6499
|
);
|
|
6683
|
-
return {
|
|
6684
|
-
...swrResponse,
|
|
6685
|
-
refresh: () => swrResponse.mutate()
|
|
6686
|
-
};
|
|
6687
6500
|
}
|
|
6688
6501
|
|
|
6689
6502
|
// src/hooks/validators/useManagedValidatorRole.ts
|
|
@@ -6778,8 +6591,7 @@ function useManagedValidatorRole({
|
|
|
6778
6591
|
...swrResponse.data,
|
|
6779
6592
|
hasOperatorRole,
|
|
6780
6593
|
hasRewardAllocatorRole
|
|
6781
|
-
} : void 0
|
|
6782
|
-
refresh: () => swrResponse.mutate()
|
|
6594
|
+
} : void 0
|
|
6783
6595
|
};
|
|
6784
6596
|
}
|
|
6785
6597
|
|
|
@@ -6792,7 +6604,7 @@ import { usePublicClient as usePublicClient48 } from "@berachain/wagmi/hooks";
|
|
|
6792
6604
|
var useOnChainValidator = ({ pubkey }, options) => {
|
|
6793
6605
|
const publicClient = usePublicClient48();
|
|
6794
6606
|
const QUERY_KEY = pubkey ? ["useOnChainValidator", pubkey] : null;
|
|
6795
|
-
|
|
6607
|
+
return useSWR(
|
|
6796
6608
|
publicClient ? QUERY_KEY : null,
|
|
6797
6609
|
async ([, pubkey2]) => {
|
|
6798
6610
|
assertPublicClient(publicClient);
|
|
@@ -6828,12 +6640,6 @@ var useOnChainValidator = ({ pubkey }, options) => {
|
|
|
6828
6640
|
},
|
|
6829
6641
|
options
|
|
6830
6642
|
);
|
|
6831
|
-
return {
|
|
6832
|
-
...swrResponse,
|
|
6833
|
-
refresh: () => {
|
|
6834
|
-
swrResponse.mutate();
|
|
6835
|
-
}
|
|
6836
|
-
};
|
|
6837
6643
|
};
|
|
6838
6644
|
|
|
6839
6645
|
// src/hooks/validators/useStakingPoolBatch.ts
|
|
@@ -6844,7 +6650,7 @@ var useStakingPoolBatch = ({
|
|
|
6844
6650
|
}) => {
|
|
6845
6651
|
const publicClient = usePublicClient49();
|
|
6846
6652
|
const QUERY_KEY = publicClient && valPubKey ? ["useStakingPoolBatch", valPubKey] : null;
|
|
6847
|
-
|
|
6653
|
+
return useSWR(
|
|
6848
6654
|
QUERY_KEY,
|
|
6849
6655
|
async ([, valPubKey2]) => {
|
|
6850
6656
|
assertPublicClient(publicClient);
|
|
@@ -6858,10 +6664,6 @@ var useStakingPoolBatch = ({
|
|
|
6858
6664
|
...options
|
|
6859
6665
|
}
|
|
6860
6666
|
);
|
|
6861
|
-
return {
|
|
6862
|
-
...swrResponse,
|
|
6863
|
-
refresh: () => swrResponse.mutate()
|
|
6864
|
-
};
|
|
6865
6667
|
};
|
|
6866
6668
|
|
|
6867
6669
|
// src/hooks/validators/useUserActiveValidators.ts
|
|
@@ -6870,7 +6672,7 @@ var useUserActiveValidators = (options) => {
|
|
|
6870
6672
|
const { address: account } = useBeraWallet25();
|
|
6871
6673
|
const publicClient = usePublicClient50();
|
|
6872
6674
|
const QUERY_KEY = publicClient && account ? ["useUserActiveValidators", account] : null;
|
|
6873
|
-
|
|
6675
|
+
return useSWR(
|
|
6874
6676
|
QUERY_KEY,
|
|
6875
6677
|
async ([, account2]) => {
|
|
6876
6678
|
return await getUserActiveValidators({
|
|
@@ -6884,10 +6686,6 @@ var useUserActiveValidators = (options) => {
|
|
|
6884
6686
|
keepPreviousData: true
|
|
6885
6687
|
}
|
|
6886
6688
|
);
|
|
6887
|
-
return {
|
|
6888
|
-
...swrResponse,
|
|
6889
|
-
refresh: () => swrResponse?.mutate?.()
|
|
6890
|
-
};
|
|
6891
6689
|
};
|
|
6892
6690
|
|
|
6893
6691
|
// src/hooks/validators/useUserBoostsOnValidator.ts
|
|
@@ -6900,7 +6698,7 @@ var useUserBoostsOnValidator = ({
|
|
|
6900
6698
|
const publicClient = usePublicClient51();
|
|
6901
6699
|
const account = args.account ?? connectedAccount;
|
|
6902
6700
|
const QUERY_KEY = account && pubkey ? ["useUserBoostsOnValidator", pubkey, account] : null;
|
|
6903
|
-
|
|
6701
|
+
return useSWR(
|
|
6904
6702
|
QUERY_KEY,
|
|
6905
6703
|
async ([, pubkey2, account2]) => {
|
|
6906
6704
|
return await getUserBoostsOnValidator({
|
|
@@ -6913,7 +6711,6 @@ var useUserBoostsOnValidator = ({
|
|
|
6913
6711
|
refreshInterval: 1e5 /* NORMAL */
|
|
6914
6712
|
}
|
|
6915
6713
|
);
|
|
6916
|
-
return { ...swrResponse, refresh: () => swrResponse.mutate() };
|
|
6917
6714
|
};
|
|
6918
6715
|
|
|
6919
6716
|
// src/hooks/validators/useUserClaimableIncentives.ts
|
|
@@ -7027,8 +6824,8 @@ var useUserClaimableIncentives = () => {
|
|
|
7027
6824
|
}
|
|
7028
6825
|
);
|
|
7029
6826
|
const refresh = useCallback4(() => {
|
|
7030
|
-
allRewardsResponse?.
|
|
7031
|
-
swrResponse?.
|
|
6827
|
+
allRewardsResponse?.refresh();
|
|
6828
|
+
swrResponse?.refresh();
|
|
7032
6829
|
}, [allRewardsResponse, swrResponse]);
|
|
7033
6830
|
return {
|
|
7034
6831
|
...swrResponse,
|
|
@@ -7044,7 +6841,7 @@ var useUserStakingPositions = ({
|
|
|
7044
6841
|
validatorAddress
|
|
7045
6842
|
}) => {
|
|
7046
6843
|
const queryClient = account ? ["useUserStakingPositions", account, validatorAddress] : null;
|
|
7047
|
-
|
|
6844
|
+
return useSWRImmutable(
|
|
7048
6845
|
queryClient,
|
|
7049
6846
|
async ([_, account2, validatorAddress2]) => {
|
|
7050
6847
|
const userStakingPolls = await getUserStakingPositions(account2);
|
|
@@ -7056,12 +6853,6 @@ var useUserStakingPositions = ({
|
|
|
7056
6853
|
return userStakingPolls;
|
|
7057
6854
|
}
|
|
7058
6855
|
);
|
|
7059
|
-
return {
|
|
7060
|
-
...swrResponse,
|
|
7061
|
-
refresh: () => {
|
|
7062
|
-
swrResponse.mutate();
|
|
7063
|
-
}
|
|
7064
|
-
};
|
|
7065
6856
|
};
|
|
7066
6857
|
|
|
7067
6858
|
// src/hooks/validators/useValidator.ts
|
|
@@ -7114,7 +6905,7 @@ function useValidatorAnalytics({
|
|
|
7114
6905
|
dayRange
|
|
7115
6906
|
}) {
|
|
7116
6907
|
const QUERY_KEY = pubkey && dayRange ? ["useValidatorAnalytics", pubkey, dayRange] : null;
|
|
7117
|
-
|
|
6908
|
+
return useSWR(
|
|
7118
6909
|
QUERY_KEY,
|
|
7119
6910
|
async ([, pubkey2, dayRange2]) => {
|
|
7120
6911
|
return await getValidatorAnalytics({
|
|
@@ -7126,7 +6917,6 @@ function useValidatorAnalytics({
|
|
|
7126
6917
|
refreshInterval: 18e4 /* SLOW */
|
|
7127
6918
|
}
|
|
7128
6919
|
);
|
|
7129
|
-
return { ...swrResponse, refresh: () => swrResponse.mutate() };
|
|
7130
6920
|
}
|
|
7131
6921
|
|
|
7132
6922
|
// src/hooks/validators/useValidatorCommission.ts
|
|
@@ -7134,7 +6924,7 @@ import { usePublicClient as usePublicClient52 } from "@berachain/wagmi/hooks";
|
|
|
7134
6924
|
var useValidatorCommission = (pubKey, options) => {
|
|
7135
6925
|
const publicClient = usePublicClient52();
|
|
7136
6926
|
const QUERY_KEY = publicClient && pubKey ? ["useValidatorCommission", pubKey] : null;
|
|
7137
|
-
|
|
6927
|
+
return swr_default(
|
|
7138
6928
|
QUERY_KEY,
|
|
7139
6929
|
async ([, pubKey2]) => {
|
|
7140
6930
|
return await getValidatorCommission({
|
|
@@ -7146,10 +6936,6 @@ var useValidatorCommission = (pubKey, options) => {
|
|
|
7146
6936
|
...options
|
|
7147
6937
|
}
|
|
7148
6938
|
);
|
|
7149
|
-
return {
|
|
7150
|
-
...swrResponse,
|
|
7151
|
-
refresh: () => swrResponse.mutate()
|
|
7152
|
-
};
|
|
7153
6939
|
};
|
|
7154
6940
|
|
|
7155
6941
|
// src/hooks/validators/useValidatorEstimatedBgtPerYear.ts
|
|
@@ -7177,18 +6963,6 @@ async function getValidatorIncentiveDistribution({
|
|
|
7177
6963
|
level: "error"
|
|
7178
6964
|
});
|
|
7179
6965
|
}
|
|
7180
|
-
const { config } = parseBaseArgs({});
|
|
7181
|
-
if (!config.beep) {
|
|
7182
|
-
const params = new URLSearchParams({
|
|
7183
|
-
pubkey,
|
|
7184
|
-
dayRange: String(dayRange)
|
|
7185
|
-
});
|
|
7186
|
-
return beraFetchJson({
|
|
7187
|
-
url: `/api/pol/validator-incentive-distribution?${params}`,
|
|
7188
|
-
name: "pol-validator-incentive-distribution",
|
|
7189
|
-
type: "rest"
|
|
7190
|
-
});
|
|
7191
|
-
}
|
|
7192
6966
|
const SECONDS_PER_DAY = 86400;
|
|
7193
6967
|
const after = String(
|
|
7194
6968
|
Math.floor(
|
|
@@ -7221,7 +6995,7 @@ function useValidatorIncentiveDistribution({
|
|
|
7221
6995
|
dayRange
|
|
7222
6996
|
}) {
|
|
7223
6997
|
const QUERY_KEY = pubkey && dayRange ? ["useValidatorIncentiveDistribution", pubkey, dayRange] : null;
|
|
7224
|
-
|
|
6998
|
+
return useSWR(
|
|
7225
6999
|
QUERY_KEY,
|
|
7226
7000
|
async ([, pubkey2, dayRange2]) => {
|
|
7227
7001
|
return await getValidatorIncentiveDistribution({ pubkey: pubkey2, dayRange: dayRange2 });
|
|
@@ -7230,7 +7004,6 @@ function useValidatorIncentiveDistribution({
|
|
|
7230
7004
|
refreshInterval: 18e4 /* SLOW */
|
|
7231
7005
|
}
|
|
7232
7006
|
);
|
|
7233
|
-
return { ...swrResponse, refresh: () => swrResponse.mutate() };
|
|
7234
7007
|
}
|
|
7235
7008
|
|
|
7236
7009
|
// src/hooks/validators/useValidatorQueuedCommission.ts
|
|
@@ -7238,7 +7011,7 @@ import { usePublicClient as usePublicClient53 } from "@berachain/wagmi/hooks";
|
|
|
7238
7011
|
function useValidatorQueuedCommission(pubKey, options) {
|
|
7239
7012
|
const publicClient = usePublicClient53();
|
|
7240
7013
|
const QUERY_KEY = publicClient && pubKey ? ["useValidatorQueuedCommission", pubKey] : null;
|
|
7241
|
-
|
|
7014
|
+
return useSWR(
|
|
7242
7015
|
QUERY_KEY,
|
|
7243
7016
|
async ([, pubKey2]) => {
|
|
7244
7017
|
assertPublicClient(publicClient);
|
|
@@ -7251,10 +7024,6 @@ function useValidatorQueuedCommission(pubKey, options) {
|
|
|
7251
7024
|
...options
|
|
7252
7025
|
}
|
|
7253
7026
|
);
|
|
7254
|
-
return {
|
|
7255
|
-
...swrResponse,
|
|
7256
|
-
refresh: () => swrResponse.mutate()
|
|
7257
|
-
};
|
|
7258
7027
|
}
|
|
7259
7028
|
|
|
7260
7029
|
// src/hooks/validators/useValidatorQueuedOperatorAddress.ts
|
|
@@ -7262,7 +7031,7 @@ import { usePublicClient as usePublicClient54 } from "@berachain/wagmi/hooks";
|
|
|
7262
7031
|
var useValidatorQueuedOperatorAddress = (pubKey, options) => {
|
|
7263
7032
|
const publicClient = usePublicClient54();
|
|
7264
7033
|
const QUERY_KEY = publicClient && pubKey ? ["useValidatorQueuedOperatorAddress", pubKey] : null;
|
|
7265
|
-
|
|
7034
|
+
return useSWR(
|
|
7266
7035
|
QUERY_KEY,
|
|
7267
7036
|
async ([, pubKey2]) => {
|
|
7268
7037
|
return await getValidatorQueuedOperatorAddress({
|
|
@@ -7274,10 +7043,6 @@ var useValidatorQueuedOperatorAddress = (pubKey, options) => {
|
|
|
7274
7043
|
...options
|
|
7275
7044
|
}
|
|
7276
7045
|
);
|
|
7277
|
-
return {
|
|
7278
|
-
...swrResponse,
|
|
7279
|
-
refresh: () => swrResponse.mutate()
|
|
7280
|
-
};
|
|
7281
7046
|
};
|
|
7282
7047
|
|
|
7283
7048
|
// src/hooks/validators/useValidatorQueuedRewardAllocation.ts
|
|
@@ -7285,7 +7050,7 @@ import { usePublicClient as usePublicClient55 } from "@berachain/wagmi/hooks";
|
|
|
7285
7050
|
var useValidatorQueuedRewardAllocation = (pubKey, options) => {
|
|
7286
7051
|
const publicClient = usePublicClient55();
|
|
7287
7052
|
const QUERY_KEY = publicClient && pubKey ? ["useValidatorQueuedRewardAllocation", pubKey] : null;
|
|
7288
|
-
|
|
7053
|
+
return useSWR(
|
|
7289
7054
|
QUERY_KEY,
|
|
7290
7055
|
async ([, pubKey2]) => {
|
|
7291
7056
|
return await getValidatorQueuedRewardAllocation({
|
|
@@ -7297,10 +7062,6 @@ var useValidatorQueuedRewardAllocation = (pubKey, options) => {
|
|
|
7297
7062
|
...options
|
|
7298
7063
|
}
|
|
7299
7064
|
);
|
|
7300
|
-
return {
|
|
7301
|
-
...swrResponse,
|
|
7302
|
-
refresh: () => swrResponse.mutate()
|
|
7303
|
-
};
|
|
7304
7065
|
};
|
|
7305
7066
|
|
|
7306
7067
|
// src/hooks/validators/useValidatorRewardAllocation.ts
|
|
@@ -7308,7 +7069,7 @@ import { usePublicClient as usePublicClient56 } from "@berachain/wagmi/hooks";
|
|
|
7308
7069
|
function useValidatorRewardAllocation(pubKey, options) {
|
|
7309
7070
|
const publicClient = usePublicClient56();
|
|
7310
7071
|
const QUERY_KEY = publicClient && pubKey ? ["useValidatorRewardAllocation", pubKey] : null;
|
|
7311
|
-
|
|
7072
|
+
return useSWR(
|
|
7312
7073
|
QUERY_KEY,
|
|
7313
7074
|
async ([, pubKey2]) => {
|
|
7314
7075
|
return getValidatorRewardAllocation({
|
|
@@ -7320,10 +7081,6 @@ function useValidatorRewardAllocation(pubKey, options) {
|
|
|
7320
7081
|
...options
|
|
7321
7082
|
}
|
|
7322
7083
|
);
|
|
7323
|
-
return {
|
|
7324
|
-
...swrResponse,
|
|
7325
|
-
refresh: () => swrResponse.mutate()
|
|
7326
|
-
};
|
|
7327
7084
|
}
|
|
7328
7085
|
export {
|
|
7329
7086
|
OracleMode,
|