@berachain/berajs 0.2.8-beta.8 → 0.2.8-beta.9
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/RequestError-BRIiJgHk.d.ts +144 -0
- package/dist/RequestError-DSUzJ1Iy.d.cts +144 -0
- package/dist/abi/exports.cjs +1 -4452
- package/dist/abi/exports.cjs.map +1 -1
- package/dist/abi/exports.mjs +1 -4452
- package/dist/abi/exports.mjs.map +1 -1
- package/dist/actions/exports.cjs +1 -913
- package/dist/actions/exports.cjs.map +1 -1
- package/dist/actions/exports.d.cts +11 -5
- package/dist/actions/exports.d.ts +11 -5
- package/dist/actions/exports.mjs +1 -913
- package/dist/actions/exports.mjs.map +1 -1
- package/dist/chunk-45HIEVNI.cjs +4 -0
- package/dist/chunk-45HIEVNI.cjs.map +1 -0
- package/dist/chunk-47ILYVHC.mjs +2 -0
- package/dist/{chunk-SGZP4O6R.mjs.map → chunk-47ILYVHC.mjs.map} +1 -1
- package/dist/chunk-575OK77P.mjs +2 -0
- package/dist/{chunk-GLWPRM33.mjs.map → chunk-575OK77P.mjs.map} +1 -1
- package/dist/chunk-5NVZG5N6.mjs +2 -0
- package/dist/{chunk-4GFN4LEP.mjs.map → chunk-5NVZG5N6.mjs.map} +1 -1
- package/dist/chunk-6DIA6PXV.cjs +2 -0
- package/dist/chunk-6DIA6PXV.cjs.map +1 -0
- package/dist/chunk-6JJIZCVY.cjs +2 -0
- package/dist/chunk-6JJIZCVY.cjs.map +1 -0
- package/dist/chunk-7F72ZH4Q.mjs +2 -0
- package/dist/{chunk-VA5L5FDG.mjs.map → chunk-7F72ZH4Q.mjs.map} +1 -1
- package/dist/chunk-AUA42YIG.mjs +4 -0
- package/dist/chunk-AUA42YIG.mjs.map +1 -0
- package/dist/chunk-BC2WX6O6.cjs +2 -0
- package/dist/chunk-BC2WX6O6.cjs.map +1 -0
- package/dist/chunk-CJOZC5Z2.cjs +2 -0
- package/dist/chunk-CJOZC5Z2.cjs.map +1 -0
- package/dist/chunk-D6L7LTA2.cjs +2 -0
- package/dist/chunk-D6L7LTA2.cjs.map +1 -0
- package/dist/chunk-DDEQFR3M.cjs +2 -0
- package/dist/chunk-DDEQFR3M.cjs.map +1 -0
- package/dist/chunk-GXV2JA36.mjs +2 -0
- package/dist/{chunk-7QKRRIHI.mjs.map → chunk-GXV2JA36.mjs.map} +1 -1
- package/dist/chunk-ISYNEDET.mjs +2 -0
- package/dist/{chunk-VA3BQ34H.mjs.map → chunk-ISYNEDET.mjs.map} +1 -1
- package/dist/chunk-JDDRTHFG.mjs +2 -0
- package/dist/chunk-JDDRTHFG.mjs.map +1 -0
- package/dist/chunk-JDZGYU5T.mjs +2 -0
- package/dist/{chunk-I3FTWD6I.mjs.map → chunk-JDZGYU5T.mjs.map} +1 -1
- package/dist/chunk-LVOXBZMA.cjs +2 -0
- package/dist/chunk-LVOXBZMA.cjs.map +1 -0
- package/dist/chunk-MK5NS5B5.mjs +2 -0
- package/dist/{chunk-7TFV6UKF.mjs.map → chunk-MK5NS5B5.mjs.map} +1 -1
- package/dist/chunk-NAXAZJJY.mjs +2 -0
- package/dist/{chunk-ZCEFC2TK.mjs.map → chunk-NAXAZJJY.mjs.map} +1 -1
- package/dist/chunk-NLVWRMGD.mjs +2 -0
- package/dist/{chunk-GWSTVITN.mjs.map → chunk-NLVWRMGD.mjs.map} +1 -1
- package/dist/chunk-OGBD5YOG.mjs +2 -0
- package/dist/{chunk-JA4DHMTG.mjs.map → chunk-OGBD5YOG.mjs.map} +1 -1
- package/dist/chunk-OGJMSGB2.mjs +2 -0
- package/dist/{chunk-KL6YZ5VR.mjs.map → chunk-OGJMSGB2.mjs.map} +1 -1
- package/dist/chunk-OIYXOKTT.cjs +2 -0
- package/dist/chunk-OIYXOKTT.cjs.map +1 -0
- package/dist/chunk-OUD27MU7.cjs +2 -0
- package/dist/chunk-OUD27MU7.cjs.map +1 -0
- package/dist/chunk-PRLVZIKD.mjs +2 -0
- package/dist/chunk-PRLVZIKD.mjs.map +1 -0
- package/dist/chunk-Q2SNRLW3.cjs +2 -0
- package/dist/chunk-Q2SNRLW3.cjs.map +1 -0
- package/dist/chunk-REWME3FY.cjs +2 -0
- package/dist/chunk-REWME3FY.cjs.map +1 -0
- package/dist/chunk-RJN36GBU.mjs +2 -0
- package/dist/chunk-RJN36GBU.mjs.map +1 -0
- package/dist/chunk-RWOICHRW.cjs +2 -0
- package/dist/chunk-RWOICHRW.cjs.map +1 -0
- package/dist/chunk-S4CDSVLK.cjs +2 -0
- package/dist/chunk-S4CDSVLK.cjs.map +1 -0
- package/dist/chunk-SFEULGSX.cjs +2 -0
- package/dist/chunk-SFEULGSX.cjs.map +1 -0
- package/dist/chunk-WBTS6KFG.mjs +2 -0
- package/dist/{chunk-ZBTRKBSI.mjs.map → chunk-WBTS6KFG.mjs.map} +1 -1
- package/dist/chunk-WRFDB3QJ.cjs +2 -0
- package/dist/chunk-WRFDB3QJ.cjs.map +1 -0
- package/dist/chunk-XNJLSA6P.cjs +2 -0
- package/dist/chunk-XNJLSA6P.cjs.map +1 -0
- package/dist/contexts/exports.cjs +1 -82
- package/dist/contexts/exports.cjs.map +1 -1
- package/dist/contexts/exports.mjs +1 -82
- package/dist/contexts/exports.mjs.map +1 -1
- package/dist/enum/exports.cjs +1 -58
- package/dist/enum/exports.cjs.map +1 -1
- package/dist/enum/exports.mjs +1 -58
- package/dist/enum/exports.mjs.map +1 -1
- package/dist/errors/exports.cjs +1 -38
- package/dist/errors/exports.cjs.map +1 -1
- package/dist/errors/exports.d.cts +3 -89
- package/dist/errors/exports.d.ts +3 -89
- package/dist/errors/exports.mjs +1 -38
- package/dist/hooks/exports.cjs +3 -8332
- package/dist/hooks/exports.cjs.map +1 -1
- package/dist/hooks/exports.d.cts +13 -27
- package/dist/hooks/exports.d.ts +13 -27
- package/dist/hooks/exports.mjs +3 -8332
- package/dist/hooks/exports.mjs.map +1 -1
- package/dist/utils/exports.cjs +1 -786
- package/dist/utils/exports.cjs.map +1 -1
- package/dist/utils/exports.d.cts +10 -2
- package/dist/utils/exports.d.ts +10 -2
- package/dist/utils/exports.mjs +1 -786
- package/dist/utils/exports.mjs.map +1 -1
- package/package.json +14 -3
- package/src/actions/clients/BeraApolloClient.ts +9 -0
- package/src/actions/clients/getApolloClient.ts +12 -2
- package/src/actions/dex/aggregators/base.ts +1 -1
- package/src/actions/exports.ts +1 -1
- package/src/actions/honey/getChartData.ts +5 -5
- package/src/actions/honey/getHoney24hVolume.ts +30 -0
- package/src/actions/pol/getEarnedStakedBeraVault.ts +12 -2
- package/src/actions/pol/getStakingDailyAssets.ts +7 -1
- package/src/data/contracts.ts +5 -0
- package/src/errors/RequestError.ts +2 -1
- package/src/hooks/exports.ts +1 -1
- package/src/hooks/honey/useHoney24hVolume.ts +16 -0
- package/src/utils/beraFetch.ts +70 -15
- package/dist/RequestError-A8XJ6QR9.d.cts +0 -57
- package/dist/RequestError-Dk97z8rm.d.ts +0 -57
- package/dist/chunk-2R73G2PO.mjs +0 -4698
- package/dist/chunk-2R73G2PO.mjs.map +0 -1
- package/dist/chunk-3M47ZRXT.mjs +0 -417
- package/dist/chunk-3M47ZRXT.mjs.map +0 -1
- package/dist/chunk-4GFN4LEP.mjs +0 -97
- package/dist/chunk-5N7QQS55.cjs +0 -130
- package/dist/chunk-5N7QQS55.cjs.map +0 -1
- package/dist/chunk-5NMATIH4.mjs +0 -130
- package/dist/chunk-5NMATIH4.mjs.map +0 -1
- package/dist/chunk-7QKRRIHI.mjs +0 -1844
- package/dist/chunk-7TFV6UKF.mjs +0 -24
- package/dist/chunk-A4FPM7U3.cjs +0 -63
- package/dist/chunk-A4FPM7U3.cjs.map +0 -1
- package/dist/chunk-BDHINMWQ.cjs +0 -417
- package/dist/chunk-BDHINMWQ.cjs.map +0 -1
- package/dist/chunk-BEHP54S3.cjs +0 -24
- package/dist/chunk-BEHP54S3.cjs.map +0 -1
- package/dist/chunk-EGDXV2PT.cjs +0 -36
- package/dist/chunk-EGDXV2PT.cjs.map +0 -1
- package/dist/chunk-EWBKSMPG.cjs +0 -13
- package/dist/chunk-EWBKSMPG.cjs.map +0 -1
- package/dist/chunk-F6ZW7ZDD.cjs +0 -403
- package/dist/chunk-F6ZW7ZDD.cjs.map +0 -1
- package/dist/chunk-FTXTRUYT.cjs +0 -170
- package/dist/chunk-FTXTRUYT.cjs.map +0 -1
- package/dist/chunk-GLWPRM33.mjs +0 -13
- package/dist/chunk-GWSTVITN.mjs +0 -572
- package/dist/chunk-H3Z37RYU.cjs +0 -15
- package/dist/chunk-H3Z37RYU.cjs.map +0 -1
- package/dist/chunk-I3FTWD6I.mjs +0 -170
- package/dist/chunk-JA4DHMTG.mjs +0 -15
- package/dist/chunk-KL6YZ5VR.mjs +0 -63
- package/dist/chunk-MXWPP6MS.cjs +0 -572
- package/dist/chunk-MXWPP6MS.cjs.map +0 -1
- package/dist/chunk-SGZP4O6R.mjs +0 -135
- package/dist/chunk-TDW5SPXR.cjs +0 -244
- package/dist/chunk-TDW5SPXR.cjs.map +0 -1
- package/dist/chunk-TGK3IXDN.cjs +0 -169
- package/dist/chunk-TGK3IXDN.cjs.map +0 -1
- package/dist/chunk-TJEW6YCJ.cjs +0 -97
- package/dist/chunk-TJEW6YCJ.cjs.map +0 -1
- package/dist/chunk-VA3BQ34H.mjs +0 -403
- package/dist/chunk-VA5L5FDG.mjs +0 -36
- package/dist/chunk-XSGCRLSD.cjs +0 -1844
- package/dist/chunk-XSGCRLSD.cjs.map +0 -1
- package/dist/chunk-XV3GG3HC.cjs +0 -135
- package/dist/chunk-XV3GG3HC.cjs.map +0 -1
- package/dist/chunk-Y5B224UX.cjs +0 -4698
- package/dist/chunk-Y5B224UX.cjs.map +0 -1
- package/dist/chunk-ZBTRKBSI.mjs +0 -169
- package/dist/chunk-ZCEFC2TK.mjs +0 -244
- package/src/actions/honey/getHoneyGlobalData.ts +0 -21
- package/src/hooks/honey/useHoneyGlobalData.ts +0 -23
package/dist/actions/exports.mjs
CHANGED
|
@@ -1,914 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BalancerApi,
|
|
3
|
-
BaseAggregator,
|
|
4
|
-
BeraApolloClient,
|
|
5
|
-
HoneyPreviewMethod,
|
|
6
|
-
MOCKED_PROPOSAL_STATUSES,
|
|
7
|
-
RewardVaultDistributionMode,
|
|
8
|
-
beraWriteContract,
|
|
9
|
-
checkProposalField,
|
|
10
|
-
computeActualStatus,
|
|
11
|
-
formatValidatorRewardAllocation,
|
|
12
|
-
getAllPools,
|
|
13
|
-
getAllProposals,
|
|
14
|
-
getAllValidators,
|
|
15
|
-
getAllowances,
|
|
16
|
-
getApiEnrichedAllocation,
|
|
17
|
-
getApiPool,
|
|
18
|
-
getApiValidator,
|
|
19
|
-
getApolloClient,
|
|
20
|
-
getBgtAprSimulation,
|
|
21
|
-
getBlockTimestamp,
|
|
22
|
-
getBodyErrors,
|
|
23
|
-
getChartData,
|
|
24
|
-
getCollateralWeights,
|
|
25
|
-
getConvertToAssets,
|
|
26
|
-
getDailyValidatorBlockStats,
|
|
27
|
-
getDefaultRewardAllocation,
|
|
28
|
-
getEarnedStakedBeraVault,
|
|
29
|
-
getGlobalCapLimit,
|
|
30
|
-
getGlobalData,
|
|
31
|
-
getGlobalLiquidityAndSwapVolume,
|
|
32
|
-
getHoneyCollaterals,
|
|
33
|
-
getHoneyGlobalData,
|
|
34
|
-
getHoneyPreview,
|
|
35
|
-
getHoneyVaultsBalance,
|
|
36
|
-
getIncentiveFeeClaimStats,
|
|
37
|
-
getMarkets,
|
|
38
|
-
getOnChainPool,
|
|
39
|
-
getPoolEvents,
|
|
40
|
-
getPoolHistoricalData,
|
|
41
|
-
getPoolPausedState,
|
|
42
|
-
getProposalDetails,
|
|
43
|
-
getProposalFromTx,
|
|
44
|
-
getProposalVotes,
|
|
45
|
-
getPythLatestPrices,
|
|
46
|
-
getPythUpdateFee,
|
|
47
|
-
getRelativeCapLimit,
|
|
48
|
-
getRewardProofsByValidator,
|
|
49
|
-
getRewardTokenToBeraRate,
|
|
50
|
-
getRewardVault,
|
|
51
|
-
getRewardVaultIncentives,
|
|
52
|
-
getRewardVaultRewards,
|
|
53
|
-
getRewardVaultStakingToken,
|
|
54
|
-
getRewardVaults,
|
|
55
|
-
getSWBeraVaultMetadata,
|
|
56
|
-
getSWBeraWithdrawal,
|
|
57
|
-
getStakeWithdrawalCooldown,
|
|
58
|
-
getStakedBeraAPR,
|
|
59
|
-
getStakedBeraSnapshots,
|
|
60
|
-
getStakingPoolBatch,
|
|
61
|
-
getSwapPayload,
|
|
62
|
-
getTokenCurrentPrices,
|
|
63
|
-
getTokenInformation,
|
|
64
|
-
getTotalStakedAmount,
|
|
65
|
-
getUserActiveValidators,
|
|
66
|
-
getUserBoostsOnValidator,
|
|
67
|
-
getUserClaimableIncentives,
|
|
68
|
-
getUserStakingPositions,
|
|
69
|
-
getUserVaultInfo,
|
|
70
|
-
getUserVaults,
|
|
71
|
-
getUserVaultsReward,
|
|
72
|
-
getValidatorAnalytics,
|
|
73
|
-
getValidatorCommission,
|
|
74
|
-
getValidatorEstimatedBgtPerYear,
|
|
75
|
-
getValidatorOperatorAddress,
|
|
76
|
-
getValidatorQueuedCommission,
|
|
77
|
-
getValidatorQueuedOperatorAddress,
|
|
78
|
-
getValidatorQueuedRewardAllocation,
|
|
79
|
-
getValidatorRewardAllocation,
|
|
80
|
-
getVaultHistory,
|
|
81
|
-
getVaultValidators,
|
|
82
|
-
gql,
|
|
83
|
-
isBadCollateralAsset,
|
|
84
|
-
isBasketModeEnabled,
|
|
85
|
-
isDefaultRewardAllocation,
|
|
86
|
-
isImpersonateAccount,
|
|
87
|
-
isSameRewardAllocation,
|
|
88
|
-
parseProposalBody
|
|
89
|
-
} from "../chunk-2R73G2PO.mjs";
|
|
90
|
-
import "../chunk-GWSTVITN.mjs";
|
|
91
|
-
import {
|
|
92
|
-
getBalanceCall,
|
|
93
|
-
getEnsoClient,
|
|
94
|
-
getWalletBalances
|
|
95
|
-
} from "../chunk-SGZP4O6R.mjs";
|
|
96
|
-
import "../chunk-ZCEFC2TK.mjs";
|
|
97
|
-
import "../chunk-KL6YZ5VR.mjs";
|
|
98
|
-
import "../chunk-5NMATIH4.mjs";
|
|
99
|
-
import {
|
|
100
|
-
assertAddress,
|
|
101
|
-
assertDefined,
|
|
102
|
-
assertPublicClient
|
|
103
|
-
} from "../chunk-ZBTRKBSI.mjs";
|
|
104
|
-
import {
|
|
105
|
-
beraFetchJson,
|
|
106
|
-
bignumber_js_default,
|
|
107
|
-
hoursInSeconds,
|
|
108
|
-
msToSeconds
|
|
109
|
-
} from "../chunk-3M47ZRXT.mjs";
|
|
110
|
-
import {
|
|
111
|
-
isToken,
|
|
112
|
-
parseBaseArgs
|
|
113
|
-
} from "../chunk-4GFN4LEP.mjs";
|
|
114
|
-
import "../chunk-7QKRRIHI.mjs";
|
|
115
|
-
|
|
116
|
-
// src/actions/bend/getMaxDeposit.ts
|
|
117
|
-
import { formatEther } from "viem";
|
|
118
|
-
import { metaMorphoV11Abi as metaMorphoAbi } from "@berachain/abis/bend-metamorpho/metaMorphoV11";
|
|
119
|
-
async function getMaxDeposit({
|
|
120
|
-
vaultAddress,
|
|
121
|
-
publicClient
|
|
122
|
-
}) {
|
|
123
|
-
const maxDeposit = await publicClient.readContract({
|
|
124
|
-
address: vaultAddress,
|
|
125
|
-
abi: metaMorphoAbi,
|
|
126
|
-
functionName: "maxDeposit",
|
|
127
|
-
args: [vaultAddress]
|
|
128
|
-
});
|
|
129
|
-
return formatEther(maxDeposit);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// src/actions/dex/getPoolWithState.ts
|
|
133
|
-
import {
|
|
134
|
-
mapPoolType
|
|
135
|
-
} from "@berachain-foundation/berancer-sdk";
|
|
136
|
-
var getPoolState = (apiPool) => {
|
|
137
|
-
return {
|
|
138
|
-
type: mapPoolType(apiPool.type),
|
|
139
|
-
protocolVersion: apiPool.protocolVersion,
|
|
140
|
-
tokens: apiPool.tokens.map(
|
|
141
|
-
(pt) => ({
|
|
142
|
-
...pt,
|
|
143
|
-
address: pt.address
|
|
144
|
-
})
|
|
145
|
-
),
|
|
146
|
-
id: apiPool.id,
|
|
147
|
-
address: apiPool.address
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
// src/actions/dex/getVaultPausedState.ts
|
|
152
|
-
import { vaultAbi as balancerVaultAbi } from "@berachain/abis/bex/vault";
|
|
153
|
-
async function getVaultPausedState({
|
|
154
|
-
publicClient,
|
|
155
|
-
...args
|
|
156
|
-
}) {
|
|
157
|
-
const { config } = parseBaseArgs(args);
|
|
158
|
-
const vaultPausedState = await publicClient.readContract({
|
|
159
|
-
address: config.bex.vault,
|
|
160
|
-
abi: balancerVaultAbi,
|
|
161
|
-
functionName: "getPausedState"
|
|
162
|
-
});
|
|
163
|
-
return vaultPausedState[0];
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// src/actions/governance/getDecodedFunctionData.ts
|
|
167
|
-
import {
|
|
168
|
-
decodeFunctionData,
|
|
169
|
-
erc20Abi,
|
|
170
|
-
pad,
|
|
171
|
-
toFunctionSignature,
|
|
172
|
-
trim
|
|
173
|
-
} from "viem";
|
|
174
|
-
import { appConfig, defaultChainId } from "@berachain/config/internal";
|
|
175
|
-
import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
|
|
176
|
-
import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
|
|
177
|
-
function isProxyABI(abi) {
|
|
178
|
-
return abi.some((item) => {
|
|
179
|
-
const i = item;
|
|
180
|
-
return i.name === "implementation" || i.name === "proxyType" || i.type === "constructor" && i.inputs?.[0]?.name === "implementation";
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
async function _getAbi({
|
|
184
|
-
contractAddress,
|
|
185
|
-
chainId,
|
|
186
|
-
publicClient
|
|
187
|
-
}) {
|
|
188
|
-
const url = `https://api.etherscan.io/v2/api?module=contract&action=getabi&address=${contractAddress}&apikey=${appConfig.apiKeys.private.etherscan}&chainId=${chainId}`;
|
|
189
|
-
const response = await fetch(url);
|
|
190
|
-
if (!response.ok) {
|
|
191
|
-
throw new Error(`Failed to fetch ABI: ${response.statusText}`);
|
|
192
|
-
}
|
|
193
|
-
const data = await response.json();
|
|
194
|
-
if (data.status === "0") throw new Error(data.result);
|
|
195
|
-
const abi = JSON.parse(data.result);
|
|
196
|
-
if (!isProxyABI(abi)) return abi;
|
|
197
|
-
const implementationResult = await publicClient.getStorageAt({
|
|
198
|
-
address: contractAddress,
|
|
199
|
-
// bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)).
|
|
200
|
-
slot: "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"
|
|
201
|
-
});
|
|
202
|
-
if (!implementationResult || trim(implementationResult) === "0x00")
|
|
203
|
-
return abi;
|
|
204
|
-
const implementationAddress = pad(trim(implementationResult), { size: 20 });
|
|
205
|
-
return _getAbi({
|
|
206
|
-
contractAddress: implementationAddress,
|
|
207
|
-
chainId,
|
|
208
|
-
publicClient
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
async function _getAbiForCallData({
|
|
212
|
-
address,
|
|
213
|
-
callData,
|
|
214
|
-
knownAbi,
|
|
215
|
-
chainId,
|
|
216
|
-
publicClient
|
|
217
|
-
}) {
|
|
218
|
-
try {
|
|
219
|
-
if (decodeFunctionData({ data: callData, abi: knownAbi })) {
|
|
220
|
-
return knownAbi;
|
|
221
|
-
}
|
|
222
|
-
} catch {
|
|
223
|
-
}
|
|
224
|
-
return _getAbi({ contractAddress: address, chainId, publicClient }).catch(
|
|
225
|
-
() => void 0
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
function _decodeCallData(callData, abi) {
|
|
229
|
-
try {
|
|
230
|
-
return decodeFunctionData({ data: callData, abi });
|
|
231
|
-
} catch {
|
|
232
|
-
return void 0;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
function _findAbiItem(abi, functionName) {
|
|
236
|
-
return abi.find(
|
|
237
|
-
(a) => a.type === "function" && a.name === functionName
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
function _getFunctionSignature(abiItem) {
|
|
241
|
-
if (!abiItem) return;
|
|
242
|
-
try {
|
|
243
|
-
return toFunctionSignature(abiItem);
|
|
244
|
-
} catch (error) {
|
|
245
|
-
console.error(error);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
async function getDecodedFunctionData({
|
|
249
|
-
address,
|
|
250
|
-
callData,
|
|
251
|
-
chainId = defaultChainId,
|
|
252
|
-
publicClient
|
|
253
|
-
}) {
|
|
254
|
-
const knownAbi = [...beraChefAbi, ...rewardVaultAbi, ...erc20Abi];
|
|
255
|
-
const abi = await _getAbiForCallData({
|
|
256
|
-
address,
|
|
257
|
-
callData,
|
|
258
|
-
knownAbi,
|
|
259
|
-
chainId,
|
|
260
|
-
publicClient
|
|
261
|
-
});
|
|
262
|
-
const decodedData = _decodeCallData(callData, abi);
|
|
263
|
-
if (!abi || !decodedData) {
|
|
264
|
-
return { args: [] };
|
|
265
|
-
}
|
|
266
|
-
const abiItem = _findAbiItem(abi, decodedData.functionName);
|
|
267
|
-
const functionSignature = _getFunctionSignature(abiItem);
|
|
268
|
-
return {
|
|
269
|
-
abiItem,
|
|
270
|
-
functionSignature,
|
|
271
|
-
functionName: decodedData.functionName,
|
|
272
|
-
args: decodedData.args
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// src/actions/honey/getHoneyFees.ts
|
|
277
|
-
import { formatUnits } from "viem";
|
|
278
|
-
import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
|
|
279
|
-
async function getHoneyFees({
|
|
280
|
-
client,
|
|
281
|
-
collateralList,
|
|
282
|
-
...args
|
|
283
|
-
}) {
|
|
284
|
-
const { config } = parseBaseArgs(args);
|
|
285
|
-
try {
|
|
286
|
-
const promiseList = {
|
|
287
|
-
mint: [],
|
|
288
|
-
redeem: []
|
|
289
|
-
};
|
|
290
|
-
for (const coll of collateralList) {
|
|
291
|
-
promiseList.mint.push(
|
|
292
|
-
client.readContract({
|
|
293
|
-
address: config.honey.factory,
|
|
294
|
-
abi: honeyFactoryAbi,
|
|
295
|
-
functionName: "mintRates",
|
|
296
|
-
args: [coll.address]
|
|
297
|
-
})
|
|
298
|
-
);
|
|
299
|
-
promiseList.redeem.push(
|
|
300
|
-
client.readContract({
|
|
301
|
-
address: config.honey.factory,
|
|
302
|
-
abi: honeyFactoryAbi,
|
|
303
|
-
functionName: "redeemRates",
|
|
304
|
-
args: [coll.address]
|
|
305
|
-
})
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
const [mintRates, redeemRates, collateralWeights] = await Promise.all([
|
|
309
|
-
Promise.all(promiseList.mint),
|
|
310
|
-
Promise.all(promiseList.redeem),
|
|
311
|
-
// fetch the collateral weights, needed to calculate the weighted basket rates
|
|
312
|
-
client.readContract({
|
|
313
|
-
address: config.honey.factory,
|
|
314
|
-
abi: honeyFactoryAbi,
|
|
315
|
-
functionName: "getWeights"
|
|
316
|
-
})
|
|
317
|
-
]);
|
|
318
|
-
return collateralList.reduce(
|
|
319
|
-
(acc, coll) => {
|
|
320
|
-
const collIdx = collateralList.indexOf(coll);
|
|
321
|
-
acc.single[coll.address] = {
|
|
322
|
-
mintFee: 1 - +formatUnits(mintRates[collIdx], 18),
|
|
323
|
-
redeemFee: 1 - +formatUnits(redeemRates[collIdx], 18)
|
|
324
|
-
};
|
|
325
|
-
acc.basket.mintFee += acc.single[coll.address].mintFee * +formatUnits(collateralWeights[collIdx], 18);
|
|
326
|
-
acc.basket.redeemFee += acc.single[coll.address].redeemFee * +formatUnits(collateralWeights[collIdx], 18);
|
|
327
|
-
return acc;
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
single: {},
|
|
331
|
-
basket: { mintFee: 0, redeemFee: 0 }
|
|
332
|
-
}
|
|
333
|
-
);
|
|
334
|
-
} catch (e) {
|
|
335
|
-
console.log(e);
|
|
336
|
-
throw e;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
// src/actions/honey/getHoneyPausedState.ts
|
|
341
|
-
import { honeyAbi } from "@berachain/abis/honey/honey";
|
|
342
|
-
async function getHoneyPausedState({
|
|
343
|
-
client,
|
|
344
|
-
...args
|
|
345
|
-
}) {
|
|
346
|
-
const { config } = parseBaseArgs(args);
|
|
347
|
-
const honeyAddress = config.honey.token;
|
|
348
|
-
const honeyPausedState = await client.readContract({
|
|
349
|
-
address: honeyAddress,
|
|
350
|
-
abi: honeyAbi,
|
|
351
|
-
functionName: "paused"
|
|
352
|
-
});
|
|
353
|
-
return honeyPausedState;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// src/actions/honey/getHoneyPythPriceOracle.ts
|
|
357
|
-
import { rootPriceOracleAbi as honeyRootOracleAbi } from "@berachain/abis/extras/rootPriceOracle";
|
|
358
|
-
async function getHoneyPythOracle({
|
|
359
|
-
pythOracle,
|
|
360
|
-
publicClient
|
|
361
|
-
}) {
|
|
362
|
-
return publicClient.readContract({
|
|
363
|
-
address: pythOracle,
|
|
364
|
-
abi: honeyRootOracleAbi,
|
|
365
|
-
functionName: "pythOracle"
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// src/actions/honey/getHoneyRootPriceOracle.ts
|
|
370
|
-
import { honeyFactoryAbi as honeyFactoryAbi2 } from "@berachain/abis/honey/honeyFactory";
|
|
371
|
-
async function getHoneyRootPriceOracle({
|
|
372
|
-
publicClient,
|
|
373
|
-
factory,
|
|
374
|
-
...args
|
|
375
|
-
}) {
|
|
376
|
-
const { config } = parseBaseArgs(args);
|
|
377
|
-
return publicClient.readContract({
|
|
378
|
-
address: factory ?? config.honey.factory,
|
|
379
|
-
abi: honeyFactoryAbi2,
|
|
380
|
-
functionName: "priceOracle"
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// src/actions/pol/getBlockTime.ts
|
|
385
|
-
async function getBlockTime({
|
|
386
|
-
defaultBlockTime,
|
|
387
|
-
publicClient,
|
|
388
|
-
blocksSpan,
|
|
389
|
-
...args
|
|
390
|
-
}) {
|
|
391
|
-
assertPublicClient(publicClient);
|
|
392
|
-
const { config } = parseBaseArgs(args);
|
|
393
|
-
const blockTime = defaultBlockTime ?? config.averageBlockTime;
|
|
394
|
-
const span = blocksSpan ?? Math.floor(hoursInSeconds(1) / blockTime);
|
|
395
|
-
const currentBlock = await publicClient?.getBlock({ blockTag: "latest" });
|
|
396
|
-
const oldestBlock = await publicClient?.getBlock({
|
|
397
|
-
blockNumber: currentBlock.number - BigInt(span)
|
|
398
|
-
});
|
|
399
|
-
return (
|
|
400
|
-
// we need to use current timestamp as the latest block might not have been minted (chain halted)
|
|
401
|
-
(msToSeconds(Date.now()) - Number(oldestBlock?.timestamp)) / (Number(currentBlock?.number) - Number(oldestBlock?.number))
|
|
402
|
-
);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// src/actions/pol/getLSTStakeConfig.ts
|
|
406
|
-
import { lstStakerVaultAbi } from "@berachain/abis/pol/lst/lstStakerVault";
|
|
407
|
-
async function getLSTStakeConfig({
|
|
408
|
-
tokenList,
|
|
409
|
-
publicClient,
|
|
410
|
-
lstStakingVaults,
|
|
411
|
-
...args
|
|
412
|
-
}) {
|
|
413
|
-
assertPublicClient(publicClient);
|
|
414
|
-
const { config } = parseBaseArgs({
|
|
415
|
-
...args,
|
|
416
|
-
chainId: publicClient.chain?.id ?? args.chainId
|
|
417
|
-
});
|
|
418
|
-
const lstStakingTokens = tokenList.filter(
|
|
419
|
-
(token) => lstStakingVaults.includes(token.address)
|
|
420
|
-
);
|
|
421
|
-
if (lstStakingTokens.length === 0) {
|
|
422
|
-
return [];
|
|
423
|
-
}
|
|
424
|
-
const assets = await Promise.all(
|
|
425
|
-
lstStakingTokens.map(async (stakingToken) => {
|
|
426
|
-
const assetTokenAddress = await publicClient.readContract({
|
|
427
|
-
address: stakingToken.address,
|
|
428
|
-
abi: lstStakerVaultAbi,
|
|
429
|
-
functionName: "asset"
|
|
430
|
-
});
|
|
431
|
-
return { assetTokenAddress, stakingToken };
|
|
432
|
-
})
|
|
433
|
-
);
|
|
434
|
-
return assets.reduce(
|
|
435
|
-
(acc, { assetTokenAddress, stakingToken }) => {
|
|
436
|
-
const assetToken = tokenList.find(
|
|
437
|
-
(token) => isToken(token, assetTokenAddress)
|
|
438
|
-
);
|
|
439
|
-
if (!assetToken) return acc;
|
|
440
|
-
acc.push({
|
|
441
|
-
id: stakingToken.address,
|
|
442
|
-
receiptToken: stakingToken,
|
|
443
|
-
inputTokens: [assetToken]
|
|
444
|
-
});
|
|
445
|
-
return acc;
|
|
446
|
-
},
|
|
447
|
-
[]
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
// src/actions/pol/getRewardVaultDurationConstants.ts
|
|
452
|
-
import { rewardVaultAbi as rewardVaultAbi2 } from "@berachain/abis/pol/rewards/rewardVault";
|
|
453
|
-
|
|
454
|
-
// src/actions/pol/getRewardVaultBeaconImplementation.ts
|
|
455
|
-
import { rewardVaultFactoryAbi } from "@berachain/abis/pol/rewards/rewardVaultFactory";
|
|
456
|
-
|
|
457
|
-
// src/abi/utils/upgradableBeacon.ts
|
|
458
|
-
var upgradableBeaconAbi = [
|
|
459
|
-
{
|
|
460
|
-
inputs: [
|
|
461
|
-
{ internalType: "address", name: "initialOwner", type: "address" },
|
|
462
|
-
{
|
|
463
|
-
internalType: "address",
|
|
464
|
-
name: "initialImplementation",
|
|
465
|
-
type: "address"
|
|
466
|
-
}
|
|
467
|
-
],
|
|
468
|
-
stateMutability: "payable",
|
|
469
|
-
type: "constructor"
|
|
470
|
-
},
|
|
471
|
-
{ inputs: [], name: "NewImplementationHasNoCode", type: "error" },
|
|
472
|
-
{ inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
|
|
473
|
-
{ inputs: [], name: "Unauthorized", type: "error" },
|
|
474
|
-
{
|
|
475
|
-
anonymous: false,
|
|
476
|
-
inputs: [
|
|
477
|
-
{
|
|
478
|
-
indexed: true,
|
|
479
|
-
internalType: "address",
|
|
480
|
-
name: "oldOwner",
|
|
481
|
-
type: "address"
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
indexed: true,
|
|
485
|
-
internalType: "address",
|
|
486
|
-
name: "newOwner",
|
|
487
|
-
type: "address"
|
|
488
|
-
}
|
|
489
|
-
],
|
|
490
|
-
name: "OwnershipTransferred",
|
|
491
|
-
type: "event"
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
anonymous: false,
|
|
495
|
-
inputs: [
|
|
496
|
-
{
|
|
497
|
-
indexed: true,
|
|
498
|
-
internalType: "address",
|
|
499
|
-
name: "implementation",
|
|
500
|
-
type: "address"
|
|
501
|
-
}
|
|
502
|
-
],
|
|
503
|
-
name: "Upgraded",
|
|
504
|
-
type: "event"
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
inputs: [],
|
|
508
|
-
name: "implementation",
|
|
509
|
-
outputs: [{ internalType: "address", name: "result", type: "address" }],
|
|
510
|
-
stateMutability: "view",
|
|
511
|
-
type: "function"
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
inputs: [],
|
|
515
|
-
name: "owner",
|
|
516
|
-
outputs: [{ internalType: "address", name: "result", type: "address" }],
|
|
517
|
-
stateMutability: "view",
|
|
518
|
-
type: "function"
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
inputs: [],
|
|
522
|
-
name: "renounceOwnership",
|
|
523
|
-
outputs: [],
|
|
524
|
-
stateMutability: "nonpayable",
|
|
525
|
-
type: "function"
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
|
|
529
|
-
name: "transferOwnership",
|
|
530
|
-
outputs: [],
|
|
531
|
-
stateMutability: "nonpayable",
|
|
532
|
-
type: "function"
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
inputs: [
|
|
536
|
-
{ internalType: "address", name: "newImplementation", type: "address" }
|
|
537
|
-
],
|
|
538
|
-
name: "upgradeTo",
|
|
539
|
-
outputs: [],
|
|
540
|
-
stateMutability: "nonpayable",
|
|
541
|
-
type: "function"
|
|
542
|
-
}
|
|
543
|
-
];
|
|
544
|
-
|
|
545
|
-
// src/actions/pol/getRewardVaultBeaconImplementation.ts
|
|
546
|
-
async function getRewardVaultBeaconImplementation({
|
|
547
|
-
publicClient,
|
|
548
|
-
...args
|
|
549
|
-
}) {
|
|
550
|
-
const { config } = parseBaseArgs(args);
|
|
551
|
-
const factoryAddress = config.pol.factory;
|
|
552
|
-
assertDefined(publicClient, "publicClient");
|
|
553
|
-
assertAddress(config.pol.factory, "factoryAddress");
|
|
554
|
-
const beacon = await publicClient.readContract({
|
|
555
|
-
address: factoryAddress,
|
|
556
|
-
abi: rewardVaultFactoryAbi,
|
|
557
|
-
functionName: "beacon"
|
|
558
|
-
});
|
|
559
|
-
return publicClient.readContract({
|
|
560
|
-
address: beacon,
|
|
561
|
-
abi: upgradableBeaconAbi,
|
|
562
|
-
functionName: "implementation"
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// src/actions/pol/getRewardVaultDurationConstants.ts
|
|
567
|
-
async function getRewardVaultDurationConstants({
|
|
568
|
-
publicClient,
|
|
569
|
-
...baseArgs
|
|
570
|
-
}) {
|
|
571
|
-
assertPublicClient(publicClient);
|
|
572
|
-
const beaconImplementation = await getRewardVaultBeaconImplementation({
|
|
573
|
-
publicClient,
|
|
574
|
-
...baseArgs
|
|
575
|
-
});
|
|
576
|
-
const [minRewardDuration, maxRewardDuration] = await Promise.all([
|
|
577
|
-
publicClient.readContract({
|
|
578
|
-
address: beaconImplementation,
|
|
579
|
-
abi: rewardVaultAbi2,
|
|
580
|
-
functionName: "MIN_REWARD_DURATION"
|
|
581
|
-
}),
|
|
582
|
-
publicClient.readContract({
|
|
583
|
-
address: beaconImplementation,
|
|
584
|
-
abi: rewardVaultAbi2,
|
|
585
|
-
functionName: "MAX_REWARD_DURATION"
|
|
586
|
-
})
|
|
587
|
-
]);
|
|
588
|
-
return {
|
|
589
|
-
minRewardDuration: Number(minRewardDuration),
|
|
590
|
-
maxRewardDuration: Number(maxRewardDuration)
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// src/actions/pol/getRewardVaultFromToken.ts
|
|
595
|
-
import { zeroAddress } from "viem";
|
|
596
|
-
import { rewardVaultFactoryAbi as rewardVaultFactoryAbi2 } from "@berachain/abis/pol/rewards/rewardVaultFactory";
|
|
597
|
-
async function getRewardVaultFromToken({
|
|
598
|
-
tokenAddress,
|
|
599
|
-
publicClient,
|
|
600
|
-
factoryAddress,
|
|
601
|
-
...args
|
|
602
|
-
}) {
|
|
603
|
-
const { config } = parseBaseArgs(args);
|
|
604
|
-
const vaultAddress = await publicClient.readContract({
|
|
605
|
-
address: factoryAddress ?? config.pol.factory,
|
|
606
|
-
abi: rewardVaultFactoryAbi2,
|
|
607
|
-
functionName: "getVault",
|
|
608
|
-
args: [tokenAddress]
|
|
609
|
-
});
|
|
610
|
-
if (vaultAddress === zeroAddress) {
|
|
611
|
-
return null;
|
|
612
|
-
}
|
|
613
|
-
return vaultAddress;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// src/actions/pyth/getHoneyPythFeeds.ts
|
|
617
|
-
import { pythPriceOracleAbi } from "@berachain/abis/extras/pythPriceOracle";
|
|
618
|
-
async function getHoneyPythFeeds({
|
|
619
|
-
tokenList,
|
|
620
|
-
publicClient,
|
|
621
|
-
...args
|
|
622
|
-
}) {
|
|
623
|
-
const { config } = parseBaseArgs(args);
|
|
624
|
-
try {
|
|
625
|
-
const priceFeedIds = await Promise.all(
|
|
626
|
-
tokenList.map(
|
|
627
|
-
(token) => publicClient.readContract({
|
|
628
|
-
address: config.honey.pythOracle,
|
|
629
|
-
abi: pythPriceOracleAbi,
|
|
630
|
-
functionName: "feeds",
|
|
631
|
-
args: [token]
|
|
632
|
-
})
|
|
633
|
-
)
|
|
634
|
-
);
|
|
635
|
-
return tokenList.reduce(
|
|
636
|
-
(acc, token, index) => ({
|
|
637
|
-
...acc,
|
|
638
|
-
[token]: priceFeedIds[index]
|
|
639
|
-
}),
|
|
640
|
-
{}
|
|
641
|
-
);
|
|
642
|
-
} catch (e) {
|
|
643
|
-
console.error("getPythPriceFeedId", e);
|
|
644
|
-
throw e;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
// src/actions/tokens/getTokens.ts
|
|
649
|
-
async function getTokens({
|
|
650
|
-
url,
|
|
651
|
-
...args
|
|
652
|
-
} = {}) {
|
|
653
|
-
const { config } = parseBaseArgs(args);
|
|
654
|
-
const tokenList = await beraFetchJson({
|
|
655
|
-
url: url ?? config.lists.tokenList,
|
|
656
|
-
type: "rest",
|
|
657
|
-
name: "GitHub"
|
|
658
|
-
});
|
|
659
|
-
return tokenList.tokens ?? [];
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
// src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts
|
|
663
|
-
import { bgtAbi } from "@berachain/abis/pol/bgt";
|
|
664
|
-
import { beraChefAbi as beraChefAbi2 } from "@berachain/abis/pol/rewards/beraChef";
|
|
665
|
-
async function getActiveBoostAndCommissionChangeDelay({
|
|
666
|
-
publicClient,
|
|
667
|
-
ui,
|
|
668
|
-
...args
|
|
669
|
-
}) {
|
|
670
|
-
const { config } = parseBaseArgs(args);
|
|
671
|
-
const [
|
|
672
|
-
maxCommissionRate,
|
|
673
|
-
commissionChangeDelay,
|
|
674
|
-
rewardAllocationBlockDelay,
|
|
675
|
-
maxWeightPerVault,
|
|
676
|
-
maxNumWeightsPerRewardAllocation,
|
|
677
|
-
dropBoostDelay,
|
|
678
|
-
activateBoostDelay,
|
|
679
|
-
rewardAllocationInactivityBlockSpan
|
|
680
|
-
] = await Promise.all([
|
|
681
|
-
publicClient.readContract({
|
|
682
|
-
address: config.pol.beraChef,
|
|
683
|
-
abi: beraChefAbi2,
|
|
684
|
-
functionName: "MAX_COMMISSION_RATE"
|
|
685
|
-
}),
|
|
686
|
-
publicClient.readContract({
|
|
687
|
-
address: config.pol.beraChef,
|
|
688
|
-
abi: beraChefAbi2,
|
|
689
|
-
functionName: "commissionChangeDelay"
|
|
690
|
-
}),
|
|
691
|
-
publicClient.readContract({
|
|
692
|
-
address: config.pol.beraChef,
|
|
693
|
-
abi: beraChefAbi2,
|
|
694
|
-
functionName: "rewardAllocationBlockDelay"
|
|
695
|
-
}),
|
|
696
|
-
publicClient.readContract({
|
|
697
|
-
address: config.pol.beraChef,
|
|
698
|
-
abi: beraChefAbi2,
|
|
699
|
-
functionName: "maxWeightPerVault"
|
|
700
|
-
}),
|
|
701
|
-
publicClient.readContract({
|
|
702
|
-
address: config.pol.beraChef,
|
|
703
|
-
abi: beraChefAbi2,
|
|
704
|
-
functionName: "maxNumWeightsPerRewardAllocation"
|
|
705
|
-
}),
|
|
706
|
-
publicClient.readContract({
|
|
707
|
-
address: config.tokens.bgt,
|
|
708
|
-
abi: bgtAbi,
|
|
709
|
-
functionName: "dropBoostDelay"
|
|
710
|
-
}),
|
|
711
|
-
publicClient.readContract({
|
|
712
|
-
address: config.tokens.bgt,
|
|
713
|
-
abi: bgtAbi,
|
|
714
|
-
functionName: "activateBoostDelay"
|
|
715
|
-
}),
|
|
716
|
-
publicClient.readContract({
|
|
717
|
-
address: config.pol.beraChef,
|
|
718
|
-
abi: beraChefAbi2,
|
|
719
|
-
functionName: "rewardAllocationInactivityBlockSpan"
|
|
720
|
-
})
|
|
721
|
-
]);
|
|
722
|
-
return {
|
|
723
|
-
maxCommissionRate: Number(maxCommissionRate) / 1e4,
|
|
724
|
-
boostDelay: Number(activateBoostDelay),
|
|
725
|
-
unboostDelay: Number(dropBoostDelay),
|
|
726
|
-
commissionChangeDelay: Number(commissionChangeDelay),
|
|
727
|
-
rewardAllocationBlockDelay: Number(rewardAllocationBlockDelay),
|
|
728
|
-
maxWeightPerVault: Number(maxWeightPerVault) / 1e4,
|
|
729
|
-
maxNumWeightsPerRewardAllocation: Number(maxNumWeightsPerRewardAllocation),
|
|
730
|
-
rewardAllocationInactivityBlockSpan: Number(
|
|
731
|
-
rewardAllocationInactivityBlockSpan
|
|
732
|
-
),
|
|
733
|
-
ui
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
// src/actions/validators/utils/aggregateValidatorIncentives.ts
|
|
738
|
-
function aggregateValidatorIncentives({
|
|
739
|
-
rewardAllocationWeights,
|
|
740
|
-
activeOnly = true
|
|
741
|
-
}) {
|
|
742
|
-
const map = rewardAllocationWeights.filter((x) => x?.receivingVault).reduce((acc, rv) => {
|
|
743
|
-
for (const incentive of rv.receivingVault?.activeIncentives ?? []) {
|
|
744
|
-
if (activeOnly && incentive.remainingAmount === "0") {
|
|
745
|
-
continue;
|
|
746
|
-
}
|
|
747
|
-
const incentiveRate = new bignumber_js_default(incentive.incentiveRate).times(
|
|
748
|
-
rv.percentage
|
|
749
|
-
);
|
|
750
|
-
const incentiveRateUsd = new bignumber_js_default(
|
|
751
|
-
incentive.incentiveRateUsd
|
|
752
|
-
).times(rv.percentage);
|
|
753
|
-
const token = incentive.token.address.toLowerCase();
|
|
754
|
-
const existing = acc.get(token);
|
|
755
|
-
if (existing) {
|
|
756
|
-
acc.set(token, {
|
|
757
|
-
...existing,
|
|
758
|
-
incentiveRate: new bignumber_js_default(existing.incentiveRate).plus(incentiveRate).toString(),
|
|
759
|
-
incentiveRateUsd: new bignumber_js_default(existing.incentiveRateUsd).plus(incentiveRateUsd).toString(),
|
|
760
|
-
remainingAmount: new bignumber_js_default(existing.remainingAmount).plus(incentive.remainingAmount).toString(),
|
|
761
|
-
remainingAmountUsd: new bignumber_js_default(existing.remainingAmountUsd).plus(incentive.remainingAmountUsd).toString()
|
|
762
|
-
});
|
|
763
|
-
} else {
|
|
764
|
-
acc.set(token, {
|
|
765
|
-
...incentive,
|
|
766
|
-
tokenAddress: incentive.token.address,
|
|
767
|
-
token: incentive.token,
|
|
768
|
-
incentiveRate: incentiveRate.toString(),
|
|
769
|
-
incentiveRateUsd: incentiveRateUsd.toString(),
|
|
770
|
-
remainingAmount: incentive.remainingAmount
|
|
771
|
-
});
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
return acc;
|
|
775
|
-
}, /* @__PURE__ */ new Map());
|
|
776
|
-
return Array.from(map.values());
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
// src/actions/validators/utils/getValidatorBoostApy.ts
|
|
780
|
-
function getValidatorReturnPerBgt(validator) {
|
|
781
|
-
return validator?.rewardAllocationWeights?.reduce((acc, ab) => {
|
|
782
|
-
if (!ab) return acc;
|
|
783
|
-
const totalIncentiveValue = ab.receivingVault?.activeIncentives.filter((inc) => Number(inc.remainingAmount) > 0).reduce((totalIncentiveValue2, currIncentive) => {
|
|
784
|
-
const tokenPrice = Number(currIncentive.remainingAmountUsd) / Number(currIncentive.remainingAmount);
|
|
785
|
-
return totalIncentiveValue2 + Number(currIncentive.incentiveRate) * tokenPrice;
|
|
786
|
-
}, 0) ?? 0;
|
|
787
|
-
return acc + totalIncentiveValue * ab.percentage;
|
|
788
|
-
}, 0);
|
|
789
|
-
}
|
|
790
|
-
function getValidatorBoostApy({
|
|
791
|
-
validator,
|
|
792
|
-
bgtPrice
|
|
793
|
-
}) {
|
|
794
|
-
const validatorActiveBoostAmount = Number(
|
|
795
|
-
validator.dynamicData?.activeBoostAmount ?? 0
|
|
796
|
-
);
|
|
797
|
-
const returnPerBgt = getValidatorReturnPerBgt(validator);
|
|
798
|
-
if (!returnPerBgt || !validatorActiveBoostAmount) {
|
|
799
|
-
return 0;
|
|
800
|
-
}
|
|
801
|
-
const boostApy = returnPerBgt * Number(validator.dynamicData?.lastDayDistributedBGTAmount ?? 0) * 365 / (validatorActiveBoostAmount * bgtPrice);
|
|
802
|
-
return boostApy;
|
|
803
|
-
}
|
|
804
|
-
export {
|
|
805
|
-
BalancerApi,
|
|
806
|
-
BaseAggregator,
|
|
807
|
-
BeraApolloClient,
|
|
808
|
-
HoneyPreviewMethod,
|
|
809
|
-
MOCKED_PROPOSAL_STATUSES,
|
|
810
|
-
RewardVaultDistributionMode,
|
|
811
|
-
aggregateValidatorIncentives,
|
|
812
|
-
beraWriteContract,
|
|
813
|
-
checkProposalField,
|
|
814
|
-
computeActualStatus,
|
|
815
|
-
formatValidatorRewardAllocation,
|
|
816
|
-
getActiveBoostAndCommissionChangeDelay,
|
|
817
|
-
getAllPools,
|
|
818
|
-
getAllProposals,
|
|
819
|
-
getAllValidators,
|
|
820
|
-
getAllowances,
|
|
821
|
-
getApiEnrichedAllocation,
|
|
822
|
-
getApiPool,
|
|
823
|
-
getApiValidator,
|
|
824
|
-
getApolloClient,
|
|
825
|
-
getBalanceCall,
|
|
826
|
-
getBgtAprSimulation,
|
|
827
|
-
getBlockTime,
|
|
828
|
-
getBlockTimestamp,
|
|
829
|
-
getBodyErrors,
|
|
830
|
-
getChartData,
|
|
831
|
-
getCollateralWeights,
|
|
832
|
-
getConvertToAssets,
|
|
833
|
-
getDailyValidatorBlockStats,
|
|
834
|
-
getDecodedFunctionData,
|
|
835
|
-
getDefaultRewardAllocation,
|
|
836
|
-
getEarnedStakedBeraVault,
|
|
837
|
-
getEnsoClient,
|
|
838
|
-
getGlobalCapLimit,
|
|
839
|
-
getGlobalData,
|
|
840
|
-
getGlobalLiquidityAndSwapVolume,
|
|
841
|
-
getHoneyCollaterals,
|
|
842
|
-
getHoneyFees,
|
|
843
|
-
getHoneyGlobalData,
|
|
844
|
-
getHoneyPausedState,
|
|
845
|
-
getHoneyPreview,
|
|
846
|
-
getHoneyPythFeeds,
|
|
847
|
-
getHoneyPythOracle,
|
|
848
|
-
getHoneyRootPriceOracle,
|
|
849
|
-
getHoneyVaultsBalance,
|
|
850
|
-
getIncentiveFeeClaimStats,
|
|
851
|
-
getLSTStakeConfig,
|
|
852
|
-
getMarkets,
|
|
853
|
-
getMaxDeposit,
|
|
854
|
-
getOnChainPool,
|
|
855
|
-
getPoolEvents,
|
|
856
|
-
getPoolHistoricalData,
|
|
857
|
-
getPoolPausedState,
|
|
858
|
-
getPoolState,
|
|
859
|
-
getProposalDetails,
|
|
860
|
-
getProposalFromTx,
|
|
861
|
-
getProposalVotes,
|
|
862
|
-
getPythLatestPrices,
|
|
863
|
-
getPythUpdateFee,
|
|
864
|
-
getRelativeCapLimit,
|
|
865
|
-
getRewardProofsByValidator,
|
|
866
|
-
getRewardTokenToBeraRate,
|
|
867
|
-
getRewardVault,
|
|
868
|
-
getRewardVaultDurationConstants,
|
|
869
|
-
getRewardVaultFromToken,
|
|
870
|
-
getRewardVaultIncentives,
|
|
871
|
-
getRewardVaultRewards,
|
|
872
|
-
getRewardVaultStakingToken,
|
|
873
|
-
getRewardVaults,
|
|
874
|
-
getSWBeraVaultMetadata,
|
|
875
|
-
getSWBeraWithdrawal,
|
|
876
|
-
getStakeWithdrawalCooldown,
|
|
877
|
-
getStakedBeraAPR,
|
|
878
|
-
getStakedBeraSnapshots,
|
|
879
|
-
getStakingPoolBatch,
|
|
880
|
-
getSwapPayload,
|
|
881
|
-
getTokenCurrentPrices,
|
|
882
|
-
getTokenInformation,
|
|
883
|
-
getTokens,
|
|
884
|
-
getTotalStakedAmount,
|
|
885
|
-
getUserActiveValidators,
|
|
886
|
-
getUserBoostsOnValidator,
|
|
887
|
-
getUserClaimableIncentives,
|
|
888
|
-
getUserStakingPositions,
|
|
889
|
-
getUserVaultInfo,
|
|
890
|
-
getUserVaults,
|
|
891
|
-
getUserVaultsReward,
|
|
892
|
-
getValidatorAnalytics,
|
|
893
|
-
getValidatorBoostApy,
|
|
894
|
-
getValidatorCommission,
|
|
895
|
-
getValidatorEstimatedBgtPerYear,
|
|
896
|
-
getValidatorOperatorAddress,
|
|
897
|
-
getValidatorQueuedCommission,
|
|
898
|
-
getValidatorQueuedOperatorAddress,
|
|
899
|
-
getValidatorQueuedRewardAllocation,
|
|
900
|
-
getValidatorReturnPerBgt,
|
|
901
|
-
getValidatorRewardAllocation,
|
|
902
|
-
getVaultHistory,
|
|
903
|
-
getVaultPausedState,
|
|
904
|
-
getVaultValidators,
|
|
905
|
-
getWalletBalances,
|
|
906
|
-
gql,
|
|
907
|
-
isBadCollateralAsset,
|
|
908
|
-
isBasketModeEnabled,
|
|
909
|
-
isDefaultRewardAllocation,
|
|
910
|
-
isImpersonateAccount,
|
|
911
|
-
isSameRewardAllocation,
|
|
912
|
-
parseProposalBody
|
|
913
|
-
};
|
|
1
|
+
import{$ as rt,A as ve,Aa as Rt,B as De,Ba as Tt,C as Re,Ca as It,D as Te,Da as Mt,E as Ie,Ea as Vt,F as Me,Fa as Ot,G as Ve,Ga as Wt,H as Oe,I as We,J as Je,K as Ue,L as _e,M as He,N as Ee,O as Ge,P as $e,Q as Le,R as qe,S as ze,T as Xe,U as je,V as Ke,W as Ze,X as Qe,Y as Ye,Z as et,_ as tt,a as ae,aa as ot,b as R,ba as nt,c as T,ca as at,d as I,da as it,e as se,ea as st,f as me,fa as mt,g as de,ga as dt,h as ce,ha as ct,i as pe,ia as pt,j as ue,ja as ut,k as le,ka as lt,l as fe,la as yt,m as ge,ma as bt,n as ye,na as At,o as be,oa as xt,p as Ae,pa as ht,q as xe,qa as Ct,r as he,ra as Pt,s as Ce,sa as wt,t as Pe,ta as kt,u as we,ua as Bt,v as ke,va as Ft,w as Be,wa as Nt,x as Fe,xa as St,y as Ne,ya as vt,z as Se,za as Dt}from"../chunk-AUA42YIG.mjs";import"../chunk-NLVWRMGD.mjs";import{a as ie,b as ft,c as gt}from"../chunk-47ILYVHC.mjs";import"../chunk-NAXAZJJY.mjs";import"../chunk-OGJMSGB2.mjs";import"../chunk-RJN36GBU.mjs";import{b as h,c as l,d as C}from"../chunk-WBTS6KFG.mjs";import{a as u,d as A,l as P,q as w}from"../chunk-JDDRTHFG.mjs";import{a as d,e as x}from"../chunk-5NVZG5N6.mjs";import"../chunk-PRLVZIKD.mjs";import"../chunk-GXV2JA36.mjs";import{formatEther as M}from"viem";import{metaMorphoV11Abi as V}from"@berachain/abis/bend-metamorpho/metaMorphoV11";async function _t({vaultAddress:e,publicClient:t}){let r=await t.readContract({address:e,abi:V,functionName:"maxDeposit",args:[e]});return M(r)}import{mapPoolType as O}from"@berachain-foundation/berancer-sdk";var Gt=e=>({type:O(e.type),protocolVersion:e.protocolVersion,tokens:e.tokens.map(t=>({...t,address:t.address})),id:e.id,address:e.address});import{vaultAbi as W}from"@berachain/abis/bex/vault";async function zt({publicClient:e,...t}){let{config:r}=d(t);return(await e.readContract({address:r.bex.vault,abi:W,functionName:"getPausedState"}))[0]}import{decodeFunctionData as B,erc20Abi as J,pad as U,toFunctionSignature as _,trim as k}from"viem";import{appConfig as H,defaultChainId as E}from"@berachain/config/internal";import{beraChefAbi as G}from"@berachain/abis/pol/rewards/beraChef";import{rewardVaultAbi as $}from"@berachain/abis/pol/rewards/rewardVault";function L(e){return e.some(t=>{let r=t;return r.name==="implementation"||r.name==="proxyType"||r.type==="constructor"&&r.inputs?.[0]?.name==="implementation"})}async function F({contractAddress:e,chainId:t,publicClient:r}){let o=`https://api.etherscan.io/v2/api?module=contract&action=getabi&address=${e}&apikey=${H.apiKeys.private.etherscan}&chainId=${t}`,n=await fetch(o);if(!n.ok)throw new Error(`Failed to fetch ABI: ${n.statusText}`);let a=await n.json();if(a.status==="0")throw new Error(a.result);let m=JSON.parse(a.result);if(!L(m))return m;let i=await r.getStorageAt({address:e,slot:"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"});if(!i||k(i)==="0x00")return m;let s=U(k(i),{size:20});return F({contractAddress:s,chainId:t,publicClient:r})}async function q({address:e,callData:t,knownAbi:r,chainId:o,publicClient:n}){try{if(B({data:t,abi:r}))return r}catch{}return F({contractAddress:e,chainId:o,publicClient:n}).catch(()=>{})}function z(e,t){try{return B({data:e,abi:t})}catch{return}}function X(e,t){return e.find(r=>r.type==="function"&&r.name===t)}function j(e){if(e)try{return _(e)}catch(t){console.error(t)}}async function Yt({address:e,callData:t,chainId:r=E,publicClient:o}){let n=[...G,...$,...J],a=await q({address:e,callData:t,knownAbi:n,chainId:r,publicClient:o}),m=z(t,a);if(!a||!m)return{args:[]};let i=X(a,m.functionName),s=j(i);return{abiItem:i,functionSignature:s,functionName:m.functionName,args:m.args}}import{formatUnits as g}from"viem";import{honeyFactoryAbi as b}from"@berachain/abis/honey/honeyFactory";async function nr({client:e,collateralList:t,...r}){let{config:o}=d(r);try{let n={mint:[],redeem:[]};for(let s of t)n.mint.push(e.readContract({address:o.honey.factory,abi:b,functionName:"mintRates",args:[s.address]})),n.redeem.push(e.readContract({address:o.honey.factory,abi:b,functionName:"redeemRates",args:[s.address]}));let[a,m,i]=await Promise.all([Promise.all(n.mint),Promise.all(n.redeem),e.readContract({address:o.honey.factory,abi:b,functionName:"getWeights"})]);return t.reduce((s,c)=>{let p=t.indexOf(c);return s.single[c.address]={mintFee:1-+g(a[p],18),redeemFee:1-+g(m[p],18)},s.basket.mintFee+=s.single[c.address].mintFee*+g(i[p],18),s.basket.redeemFee+=s.single[c.address].redeemFee*+g(i[p],18),s},{single:{},basket:{mintFee:0,redeemFee:0}})}catch(n){throw console.log(n),n}}import{honeyAbi as K}from"@berachain/abis/honey/honey";async function mr({client:e,...t}){let{config:r}=d(t),o=r.honey.token;return await e.readContract({address:o,abi:K,functionName:"paused"})}import{rootPriceOracleAbi as Z}from"@berachain/abis/extras/rootPriceOracle";async function pr({pythOracle:e,publicClient:t}){return t.readContract({address:e,abi:Z,functionName:"pythOracle"})}import{honeyFactoryAbi as Q}from"@berachain/abis/honey/honeyFactory";async function gr({publicClient:e,factory:t,...r}){let{config:o}=d(r);return e.readContract({address:t??o.honey.factory,abi:Q,functionName:"priceOracle"})}async function hr({defaultBlockTime:e,publicClient:t,blocksSpan:r,...o}){l(t);let{config:n}=d(o),a=e??n.averageBlockTime,m=r??Math.floor(w(1)/a),i=await t?.getBlock({blockTag:"latest"}),s=await t?.getBlock({blockNumber:i.number-BigInt(m)});return(P(Date.now())-Number(s?.timestamp))/(Number(i?.number)-Number(s?.number))}import{lstStakerVaultAbi as Y}from"@berachain/abis/pol/lst/lstStakerVault";async function Fr({tokenList:e,publicClient:t,lstStakingVaults:r,...o}){l(t);let{config:n}=d({...o,chainId:t.chain?.id??o.chainId}),a=e.filter(i=>r.includes(i.address));return a.length===0?[]:(await Promise.all(a.map(async i=>({assetTokenAddress:await t.readContract({address:i.address,abi:Y,functionName:"asset"}),stakingToken:i})))).reduce((i,{assetTokenAddress:s,stakingToken:c})=>{let p=e.find(y=>x(y,s));return p&&i.push({id:c.address,receiptToken:c,inputTokens:[p]}),i},[])}import{rewardVaultAbi as v}from"@berachain/abis/pol/rewards/rewardVault";import{rewardVaultFactoryAbi as ee}from"@berachain/abis/pol/rewards/rewardVaultFactory";var N=[{inputs:[{internalType:"address",name:"initialOwner",type:"address"},{internalType:"address",name:"initialImplementation",type:"address"}],stateMutability:"payable",type:"constructor"},{inputs:[],name:"NewImplementationHasNoCode",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"implementation",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"nonpayable",type:"function"}];async function S({publicClient:e,...t}){let{config:r}=d(t),o=r.pol.factory;h(e,"publicClient"),C(r.pol.factory,"factoryAddress");let n=await e.readContract({address:o,abi:ee,functionName:"beacon"});return e.readContract({address:n,abi:N,functionName:"implementation"})}async function Wr({publicClient:e,...t}){l(e);let r=await S({publicClient:e,...t}),[o,n]=await Promise.all([e.readContract({address:r,abi:v,functionName:"MIN_REWARD_DURATION"}),e.readContract({address:r,abi:v,functionName:"MAX_REWARD_DURATION"})]);return{minRewardDuration:Number(o),maxRewardDuration:Number(n)}}import{zeroAddress as te}from"viem";import{rewardVaultFactoryAbi as re}from"@berachain/abis/pol/rewards/rewardVaultFactory";async function Er({tokenAddress:e,publicClient:t,factoryAddress:r,...o}){let{config:n}=d(o),a=await t.readContract({address:r??n.pol.factory,abi:re,functionName:"getVault",args:[e]});return a===te?null:a}import{pythPriceOracleAbi as oe}from"@berachain/abis/extras/pythPriceOracle";async function qr({tokenList:e,publicClient:t,...r}){let{config:o}=d(r);try{let n=await Promise.all(e.map(a=>t.readContract({address:o.honey.pythOracle,abi:oe,functionName:"feeds",args:[a]})));return e.reduce((a,m,i)=>({...a,[m]:n[i]}),{})}catch(n){throw console.error("getPythPriceFeedId",n),n}}async function Kr({url:e,...t}={}){let{config:r}=d(t);return(await A({url:e??r.lists.tokenList,type:"rest",name:"GitHub"})).tokens??[]}import{bgtAbi as D}from"@berachain/abis/pol/bgt";import{beraChefAbi as f}from"@berachain/abis/pol/rewards/beraChef";async function to({publicClient:e,ui:t,...r}){let{config:o}=d(r),[n,a,m,i,s,c,p,y]=await Promise.all([e.readContract({address:o.pol.beraChef,abi:f,functionName:"MAX_COMMISSION_RATE"}),e.readContract({address:o.pol.beraChef,abi:f,functionName:"commissionChangeDelay"}),e.readContract({address:o.pol.beraChef,abi:f,functionName:"rewardAllocationBlockDelay"}),e.readContract({address:o.pol.beraChef,abi:f,functionName:"maxWeightPerVault"}),e.readContract({address:o.pol.beraChef,abi:f,functionName:"maxNumWeightsPerRewardAllocation"}),e.readContract({address:o.tokens.bgt,abi:D,functionName:"dropBoostDelay"}),e.readContract({address:o.tokens.bgt,abi:D,functionName:"activateBoostDelay"}),e.readContract({address:o.pol.beraChef,abi:f,functionName:"rewardAllocationInactivityBlockSpan"})]);return{maxCommissionRate:Number(n)/1e4,boostDelay:Number(p),unboostDelay:Number(c),commissionChangeDelay:Number(a),rewardAllocationBlockDelay:Number(m),maxWeightPerVault:Number(i)/1e4,maxNumWeightsPerRewardAllocation:Number(s),rewardAllocationInactivityBlockSpan:Number(y),ui:t}}function no({rewardAllocationWeights:e,activeOnly:t=!0}){let r=e.filter(o=>o?.receivingVault).reduce((o,n)=>{for(let a of n.receivingVault?.activeIncentives??[]){if(t&&a.remainingAmount==="0")continue;let m=new u(a.incentiveRate).times(n.percentage),i=new u(a.incentiveRateUsd).times(n.percentage),s=a.token.address.toLowerCase(),c=o.get(s);c?o.set(s,{...c,incentiveRate:new u(c.incentiveRate).plus(m).toString(),incentiveRateUsd:new u(c.incentiveRateUsd).plus(i).toString(),remainingAmount:new u(c.remainingAmount).plus(a.remainingAmount).toString(),remainingAmountUsd:new u(c.remainingAmountUsd).plus(a.remainingAmountUsd).toString()}):o.set(s,{...a,tokenAddress:a.token.address,token:a.token,incentiveRate:m.toString(),incentiveRateUsd:i.toString(),remainingAmount:a.remainingAmount})}return o},new Map);return Array.from(r.values())}function ne(e){return e?.rewardAllocationWeights?.reduce((t,r)=>{if(!r)return t;let o=r.receivingVault?.activeIncentives.filter(n=>Number(n.remainingAmount)>0).reduce((n,a)=>{let m=Number(a.remainingAmountUsd)/Number(a.remainingAmount);return n+Number(a.incentiveRate)*m},0)??0;return t+o*r.percentage},0)}function io({validator:e,bgtPrice:t}){let r=Number(e.dynamicData?.activeBoostAmount??0),o=ne(e);return!o||!r?0:o*Number(e.dynamicData?.lastDayDistributedBGTAmount??0)*365/(r*t)}export{me as BalancerApi,se as BaseAggregator,R as BeraApolloClient,Te as HoneyPreviewMethod,be as MOCKED_PROPOSAL_STATUSES,He as RewardVaultDistributionMode,no as aggregateValidatorIncentives,bt as beraWriteContract,ye as checkProposalField,Ae as computeActualStatus,Pt as formatValidatorRewardAllocation,to as getActiveBoostAndCommissionChangeDelay,de as getAllPools,xe as getAllProposals,At as getAllValidators,lt as getAllowances,xt as getApiEnrichedAllocation,ce as getApiPool,ht as getApiValidator,T as getApolloClient,ft as getBalanceCall,Ge as getBgtAprSimulation,hr as getBlockTime,_e as getBlockTimestamp,he as getBodyErrors,Be as getChartData,Fe as getCollateralWeights,ae as getConvertToAssets,Ct as getDailyValidatorBlockStats,Yt as getDecodedFunctionData,Ft as getDefaultRewardAllocation,$e as getEarnedStakedBeraVault,ie as getEnsoClient,De as getGlobalCapLimit,qe as getGlobalData,pe as getGlobalLiquidityAndSwapVolume,Re as getHoney24hVolume,Se as getHoneyCollaterals,nr as getHoneyFees,mr as getHoneyPausedState,Ie as getHoneyPreview,qr as getHoneyPythFeeds,pr as getHoneyPythOracle,gr as getHoneyRootPriceOracle,Me as getHoneyVaultsBalance,ze as getIncentiveFeeClaimStats,Fr as getLSTStakeConfig,Xe as getMarkets,_t as getMaxDeposit,le as getOnChainPool,fe as getPoolEvents,ge as getPoolHistoricalData,ue as getPoolPausedState,Gt as getPoolState,Ce as getProposalDetails,we as getProposalFromTx,ke as getProposalVotes,Ve as getPythLatestPrices,We as getPythUpdateFee,Oe as getRelativeCapLimit,je as getRewardProofsByValidator,Ke as getRewardTokenToBeraRate,Ze as getRewardVault,Wr as getRewardVaultDurationConstants,Er as getRewardVaultFromToken,Qe as getRewardVaultIncentives,Ee as getRewardVaultRewards,Ye as getRewardVaultStakingToken,Le as getRewardVaults,ot as getSWBeraVaultMetadata,nt as getSWBeraWithdrawal,rt as getStakeWithdrawalCooldown,et as getStakedBeraAPR,tt as getStakedBeraSnapshots,Nt as getStakingPoolBatch,Je as getSwapPayload,ut as getTokenCurrentPrices,Ne as getTokenInformation,Kr as getTokens,at as getTotalStakedAmount,vt as getUserActiveValidators,St as getUserBoostsOnValidator,it as getUserClaimableIncentives,Dt as getUserStakingPositions,mt as getUserVaultInfo,dt as getUserVaults,st as getUserVaultsReward,Rt as getValidatorAnalytics,io as getValidatorBoostApy,Tt as getValidatorCommission,It as getValidatorEstimatedBgtPerYear,Mt as getValidatorOperatorAddress,Vt as getValidatorQueuedCommission,Ot as getValidatorQueuedOperatorAddress,Wt as getValidatorQueuedRewardAllocation,ne as getValidatorReturnPerBgt,kt as getValidatorRewardAllocation,ct as getVaultHistory,zt as getVaultPausedState,pt as getVaultValidators,gt as getWalletBalances,I as gql,ve as isBadCollateralAsset,Ue as isBasketModeEnabled,Bt as isDefaultRewardAllocation,yt as isImpersonateAccount,wt as isSameRewardAllocation,Pe as parseProposalBody};
|
|
914
2
|
//# sourceMappingURL=exports.mjs.map
|