@berachain/berajs 0.2.3 → 0.2.5

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.
Files changed (185) hide show
  1. package/.claude/skills/berajs/SKILL.md +222 -0
  2. package/.claude/skills/berajs/references/dex.md +235 -0
  3. package/.claude/skills/berajs/references/pol.md +194 -0
  4. package/.claude/skills/berajs/references/staking.md +198 -0
  5. package/.claude/skills/berajs/references/tokens.md +170 -0
  6. package/dist/{BexStatusProvider-nS3NcdxI.d.cts → BexStatusProvider-DRymVlQf.d.cts} +1 -1
  7. package/dist/{BexStatusProvider-nS3NcdxI.d.ts → BexStatusProvider-DRymVlQf.d.ts} +1 -1
  8. package/dist/{HoneyConfigProvider-CK6mOKFH.d.ts → HoneyConfigProvider-DVP_9KZn.d.ts} +1 -1
  9. package/dist/{HoneyConfigProvider-Ca3ouozs.d.cts → HoneyConfigProvider-DfkjmzEf.d.cts} +1 -1
  10. package/dist/abi/exports.cjs +1 -1
  11. package/dist/abi/exports.cjs.map +1 -1
  12. package/dist/abi/exports.d.cts +1893 -25347
  13. package/dist/abi/exports.d.ts +1893 -25347
  14. package/dist/abi/exports.mjs +1 -1
  15. package/dist/abi/exports.mjs.map +1 -1
  16. package/dist/actions/exports.cjs +1 -1
  17. package/dist/actions/exports.cjs.map +1 -1
  18. package/dist/actions/exports.d.cts +10 -9
  19. package/dist/actions/exports.d.ts +10 -9
  20. package/dist/actions/exports.mjs +1 -1
  21. package/dist/actions/exports.mjs.map +1 -1
  22. package/dist/chunk-BKDBIBVO.mjs +4 -0
  23. package/dist/chunk-BKDBIBVO.mjs.map +1 -0
  24. package/dist/chunk-NLVWRMGD.mjs +2 -0
  25. package/dist/chunk-NLVWRMGD.mjs.map +1 -0
  26. package/dist/chunk-OUD27MU7.cjs +2 -0
  27. package/dist/chunk-OUD27MU7.cjs.map +1 -0
  28. package/dist/chunk-UXGB54NE.cjs +4 -0
  29. package/dist/chunk-UXGB54NE.cjs.map +1 -0
  30. package/dist/contexts/exports.d.cts +3 -3
  31. package/dist/contexts/exports.d.ts +3 -3
  32. package/dist/enum/exports.d.cts +1 -1
  33. package/dist/enum/exports.d.ts +1 -1
  34. package/dist/errors/exports.d.cts +1 -1
  35. package/dist/errors/exports.d.ts +1 -1
  36. package/dist/{getValidatorQueuedOperatorAddress-NrjpnEn8.d.ts → getValidatorQueuedOperatorAddress-CqR6cyqC.d.ts} +3 -3
  37. package/dist/{getValidatorQueuedOperatorAddress-D_LEt3vv.d.cts → getValidatorQueuedOperatorAddress-DZgrPmZ2.d.cts} +3 -3
  38. package/dist/{global.d-X3cqpCEB.d.ts → global.d-BeYWDreg.d.ts} +4 -4
  39. package/dist/{global.d-DLRtrPG5.d.cts → global.d-DghRxpHd.d.cts} +4 -4
  40. package/dist/hooks/exports.cjs +3 -3
  41. package/dist/hooks/exports.cjs.map +1 -1
  42. package/dist/hooks/exports.d.cts +40 -38
  43. package/dist/hooks/exports.d.ts +40 -38
  44. package/dist/hooks/exports.mjs +3 -3
  45. package/dist/hooks/exports.mjs.map +1 -1
  46. package/dist/{txnEnum-BlBYhNRl.d.cts → txnEnum-DxPRHSJt.d.cts} +1 -1
  47. package/dist/{txnEnum-BlBYhNRl.d.ts → txnEnum-DxPRHSJt.d.ts} +1 -1
  48. package/dist/types/exports.d.cts +3 -3
  49. package/dist/types/exports.d.ts +3 -3
  50. package/dist/{useHoneySwapState-D1DKG_Of.d.ts → useHoneySwapState-B494PQDl.d.ts} +1 -1
  51. package/dist/{useHoneySwapState-B-vmIP1b.d.cts → useHoneySwapState-D6vpv19r.d.cts} +1 -1
  52. package/dist/utils/exports.d.cts +2 -2
  53. package/dist/utils/exports.d.ts +2 -2
  54. package/package.json +8 -9
  55. package/src/abi/exports.ts +0 -27
  56. package/src/actions/bend/getConvertToAssets.ts +1 -1
  57. package/src/actions/bend/getMaxDeposit.ts +1 -1
  58. package/src/actions/dex/aggregators/bex.ts +2 -1
  59. package/src/actions/dex/aggregators/enso/enso.ts +3 -2
  60. package/src/actions/dex/aggregators/enso/ensoErc4626.debug.test.ts +2 -3
  61. package/src/actions/dex/aggregators/erc4626.ts +2 -1
  62. package/src/actions/dex/aggregators/fly.ts +2 -1
  63. package/src/actions/dex/aggregators/haiku.ts +2 -1
  64. package/src/actions/dex/aggregators/kyberswap.ts +2 -2
  65. package/src/actions/dex/aggregators/oogabooga.ts +2 -1
  66. package/src/actions/dex/aggregators/openOcean.ts +2 -1
  67. package/src/actions/dex/aggregators/wbera.ts +2 -1
  68. package/src/actions/dex/getVaultPausedState.ts +2 -1
  69. package/src/actions/enso/getEnsoUserTokensWithBalances.debug.test.ts +1 -1
  70. package/src/actions/governance/__tests__/checkProposalField.unit.test.ts +2 -1
  71. package/src/actions/governance/__tests__/getDecodedFunctionData.integration.test.ts +66 -78
  72. package/src/actions/governance/__tests__/getQuorum.integration.test.ts +6 -7
  73. package/src/actions/governance/getDecodedFunctionData.ts +2 -2
  74. package/src/actions/governance/getProposalFromTx.ts +2 -1
  75. package/src/actions/governance/getProposalParams.ts +3 -2
  76. package/src/actions/governance/getQuorum.ts +2 -1
  77. package/src/actions/honey/getCollateralWeights.ts +2 -1
  78. package/src/actions/honey/getGlobalCapLimit.ts +2 -1
  79. package/src/actions/honey/getHoneyCollaterals.ts +2 -1
  80. package/src/actions/honey/getHoneyFees.ts +2 -1
  81. package/src/actions/honey/getHoneyPausedState.ts +2 -1
  82. package/src/actions/honey/getHoneyPreview.ts +2 -1
  83. package/src/actions/honey/getHoneyPythPriceOracle.ts +1 -1
  84. package/src/actions/honey/getHoneyRootPriceOracle.ts +2 -1
  85. package/src/actions/honey/getHoneyVaultsBalance.ts +3 -2
  86. package/src/actions/honey/getRelativeCapLimit.ts +2 -1
  87. package/src/actions/honey/getSharesWithoutFees.ts +3 -2
  88. package/src/actions/honey/getSwapPayload.ts +3 -2
  89. package/src/actions/honey/isBadCollateralAsset.ts +3 -2
  90. package/src/actions/honey/isBasketModeEnabled.ts +3 -2
  91. package/src/actions/pol/getBgtTokenTotalBoosts.ts +2 -1
  92. package/src/actions/pol/getLSTStakeConfig.ts +2 -1
  93. package/src/actions/pol/getRewardTokenToBeraRate.ts +2 -1
  94. package/src/actions/pol/getRewardVaultBeaconImplementation.ts +2 -1
  95. package/src/actions/pol/getRewardVaultDurationConstants.ts +2 -1
  96. package/src/actions/pol/getRewardVaultFromToken.ts +2 -1
  97. package/src/actions/pol/getRewardVaultIncentives.ts +2 -1
  98. package/src/actions/pol/getRewardVaultRewards.ts +2 -1
  99. package/src/actions/pol/getRewardVaultStakingToken.ts +1 -1
  100. package/src/actions/pol/getRewardVaults.ts +2 -1
  101. package/src/actions/pol/getSWBeraVaultMetadata.ts +2 -1
  102. package/src/actions/pol/getSWBeraWithdrawal.ts +2 -1
  103. package/src/actions/pol/getStakeWithdrawalCooldown.ts +1 -1
  104. package/src/actions/pol/getTotalStakedAmount.ts +2 -1
  105. package/src/actions/pol/getUserVaults.ts +2 -1
  106. package/src/actions/pol/getUserVaultsBalance.ts +2 -1
  107. package/src/actions/pol/getUserVaultsReward.ts +1 -1
  108. package/src/actions/pol/getVaultsSupply.ts +1 -1
  109. package/src/actions/pyth/getHoneyPythFeeds.ts +2 -1
  110. package/src/actions/transactions/beraWriteContract.integration.test.ts +48 -51
  111. package/src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts +3 -2
  112. package/src/actions/validators/getBaselineRewardAllocation.ts +2 -1
  113. package/src/actions/validators/getDefaultRewardAllocation.ts +2 -1
  114. package/src/actions/validators/getUserBoostsOnValidator.ts +2 -1
  115. package/src/actions/validators/getValidatorCommission.ts +2 -1
  116. package/src/actions/validators/getValidatorOperatorAddress.ts +2 -1
  117. package/src/actions/validators/getValidatorQueuedCommission.ts +2 -1
  118. package/src/actions/validators/getValidatorQueuedOperatorAddress.ts +2 -1
  119. package/src/actions/validators/getValidatorQueuedRewardAllocation.ts +2 -1
  120. package/src/actions/validators/getValidatorRewardAllocation.ts +2 -1
  121. package/src/actions/validators/getValidatorRewardAllocatorAddress.ts +2 -1
  122. package/src/actions/validators/utils/__tests__/validatorUtils.integration.test.ts +10 -11
  123. package/src/errors/getRevertReason.integration.test.ts +115 -107
  124. package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +2 -1
  125. package/src/hooks/dex/useCreatePool.ts +2 -1
  126. package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +2 -1
  127. package/src/hooks/governance/useGetPastVotes.ts +2 -1
  128. package/src/hooks/governance/useHasVoted.ts +2 -1
  129. package/src/hooks/governance/useIsCanceller.ts +2 -1
  130. package/src/hooks/governance/usePollProposalThreshold.ts +2 -1
  131. package/src/hooks/governance/usePollUserDelegates.ts +2 -1
  132. package/src/hooks/governance/useProposalSnapshot.ts +2 -1
  133. package/src/hooks/governance/useProposalState.ts +2 -1
  134. package/src/hooks/governance/useProposalTimelockState.ts +5 -4
  135. package/src/hooks/pol/useBgtUnstakedBalance.ts +2 -1
  136. package/src/hooks/pol/useOnChainRewardVault.ts +2 -1
  137. package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +2 -1
  138. package/src/hooks/pol/useRewardVaultFromToken.ts +2 -1
  139. package/src/hooks/validators/useOnChainValidator.ts +4 -3
  140. package/dist/chunk-A4UDYSB6.mjs +0 -4
  141. package/dist/chunk-A4UDYSB6.mjs.map +0 -1
  142. package/dist/chunk-CYKCYPFR.cjs +0 -2
  143. package/dist/chunk-CYKCYPFR.cjs.map +0 -1
  144. package/dist/chunk-F4BKSBEM.mjs +0 -2
  145. package/dist/chunk-F4BKSBEM.mjs.map +0 -1
  146. package/dist/chunk-FL2N3XHK.cjs +0 -2
  147. package/dist/chunk-FL2N3XHK.cjs.map +0 -1
  148. package/dist/chunk-MUCEYO3E.cjs +0 -4
  149. package/dist/chunk-MUCEYO3E.cjs.map +0 -1
  150. package/dist/chunk-Q3SCM6WL.mjs +0 -2
  151. package/dist/chunk-Q3SCM6WL.mjs.map +0 -1
  152. package/dist/chunk-TEBJWAVU.mjs +0 -2
  153. package/dist/chunk-TEBJWAVU.mjs.map +0 -1
  154. package/dist/chunk-VP7XUOSI.cjs +0 -2
  155. package/dist/chunk-VP7XUOSI.cjs.map +0 -1
  156. package/dist/pythWrapper-CBjsmmsK.d.cts +0 -1958
  157. package/dist/pythWrapper-CBjsmmsK.d.ts +0 -1958
  158. package/src/abi/bend/metaMorpho.ts +0 -2584
  159. package/src/abi/bend/morpho.ts +0 -444
  160. package/src/abi/bex/aggregatorsRouter.ts +0 -492
  161. package/src/abi/bex/balancerComposableStablePoolFactoryV6.ts +0 -283
  162. package/src/abi/bex/balancerPoolCreationHelper.ts +0 -267
  163. package/src/abi/bex/balancerVault.ts +0 -757
  164. package/src/abi/governance/governance.ts +0 -1016
  165. package/src/abi/governance/governanceTimelock.ts +0 -589
  166. package/src/abi/honey/collateralVault.ts +0 -1144
  167. package/src/abi/honey/honey.ts +0 -563
  168. package/src/abi/honey/honeyFactory.ts +0 -1270
  169. package/src/abi/honey/honeyFactoryReader.ts +0 -894
  170. package/src/abi/honey/honeyRootOracle.ts +0 -492
  171. package/src/abi/honey/pythPriceOracle.ts +0 -619
  172. package/src/abi/honey/pythWrapper.ts +0 -446
  173. package/src/abi/pol/LSTStakerVault.ts +0 -2032
  174. package/src/abi/pol/beaconDeposit.ts +0 -595
  175. package/src/abi/pol/beraChef.ts +0 -1019
  176. package/src/abi/pol/bgt.ts +0 -1008
  177. package/src/abi/pol/bgtIncentiveDistributor.ts +0 -640
  178. package/src/abi/pol/bgtStaker.ts +0 -1034
  179. package/src/abi/pol/rewardAllocationFactory.ts +0 -408
  180. package/src/abi/pol/rewardVault.ts +0 -1928
  181. package/src/abi/pol/rewardVaultFactory.ts +0 -586
  182. package/src/abi/pol/rewardVaultHelper.ts +0 -882
  183. package/src/abi/pol/stakeBeraVault.ts +0 -1116
  184. package/src/abi/pol/stakeBeraVaultWithdrawalRequest.ts +0 -618
  185. package/src/abi/pol/wbera.ts +0 -366
@@ -23,11 +23,12 @@ import {
23
23
  getRpcUrls,
24
24
  } from "@berachain/config/internal";
25
25
 
26
+ import { metaMorphoV11Abi as metaMorphoAbi } from "@berachain/abis/bend-metamorpho/metaMorphoV11";
27
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
28
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
29
+
26
30
  import { getConfig } from "@berachain/wagmi/config";
27
31
 
28
- import { metaMorphoAbi } from "~/abi/bend/metaMorpho";
29
- import { bgtAbi } from "~/abi/pol/bgt";
30
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
31
32
  import { beraWriteContract } from "~/actions/transactions/beraWriteContract";
32
33
  import { ContractName } from "~/enum/contracts";
33
34
  import { TransactionActionType } from "~/enum/txnEnum";
@@ -146,38 +147,38 @@ describe.skipIf(defaultChainId !== ChainId.MAINNET)("getRevertReason", () => {
146
147
  expect(revertReason.reason).toBe("ERC20InsufficientAllowance");
147
148
  });
148
149
 
149
- it.concurrent.each(errors)(
150
- "should return the expected revert onchain reason ($error)",
151
- async ({ tx, error, ...args }) => {
152
- const revertReason = await getRevertReason({
153
- publicClient,
154
- abi: [...vaultV2Abi, ...metaMorphoAbi, ...rewardVaultAbi],
155
- txHash: tx,
156
- });
150
+ it.concurrent.each(
151
+ errors,
152
+ )("should return the expected revert onchain reason ($error)", async ({
153
+ tx,
154
+ error,
155
+ ...args
156
+ }) => {
157
+ const revertReason = await getRevertReason({
158
+ publicClient,
159
+ abi: [...vaultV2Abi, ...metaMorphoAbi, ...rewardVaultAbi],
160
+ txHash: tx,
161
+ });
157
162
 
158
- expect(revertReason.reason).toBe(error);
163
+ expect(revertReason.reason).toBe(error);
159
164
 
160
- if ("message" in args) {
161
- expect(getErrorMessage({ reason: error })).toBe(args.message);
162
- }
163
- },
164
- );
165
-
166
- it.concurrent(
167
- "should parse the error from nested contract calls",
168
- async () => {
169
- const revertReason = await getRevertReason({
170
- publicClient,
171
- account: "0xC0090EFF4C7818E46FE4eDd46588c6799180aFD4",
172
- to: "0x56811e1BFfF951B98c7940d3aCe0e549Ec4fDee8",
173
- value: 0n,
174
- data: "0x374f435d0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000257a41e20bbfe90d750646c2e00ba700d55958c500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064d96ca0b90000000000000000000000000de23153bc280dd95be914ddafb5591ae877e067000000000000000000000000257a41e20bbfe90d750646c2e00ba700d55958c50000000000000000000000000000000000000000000089a4921338674240000000000000000000000000000000000000000000000000000000000000000000000000000000000000257a41e20bbfe90d750646c2e00ba700d55958c500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000846ef5eeae000000000000000000000000c0808a144ce2ea85bf84ebd1ddf5d59429f59dde0000000000000000000000000000000000000000000089a492133867424000000000000000000000000000000000000000000000033b6ec5be4c67d4cc54f101000000000000000000000000c0090eff4c7818e46fe4edd46588c6799180afd400000000000000000000000000000000000000000000000000000000",
175
- abi: [...rewardVaultAbi, ...metaMorphoAbi],
176
- blockNumber: 11765133n,
177
- });
178
- expect(revertReason.reason).toBe("AllCapsReached");
179
- },
180
- );
165
+ if ("message" in args) {
166
+ expect(getErrorMessage({ reason: error })).toBe(args.message);
167
+ }
168
+ });
169
+
170
+ it.concurrent("should parse the error from nested contract calls", async () => {
171
+ const revertReason = await getRevertReason({
172
+ publicClient,
173
+ account: "0xC0090EFF4C7818E46FE4eDd46588c6799180aFD4",
174
+ to: "0x56811e1BFfF951B98c7940d3aCe0e549Ec4fDee8",
175
+ value: 0n,
176
+ data: "0x374f435d0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000180000000000000000000000000257a41e20bbfe90d750646c2e00ba700d55958c500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064d96ca0b90000000000000000000000000de23153bc280dd95be914ddafb5591ae877e067000000000000000000000000257a41e20bbfe90d750646c2e00ba700d55958c50000000000000000000000000000000000000000000089a4921338674240000000000000000000000000000000000000000000000000000000000000000000000000000000000000257a41e20bbfe90d750646c2e00ba700d55958c500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000846ef5eeae000000000000000000000000c0808a144ce2ea85bf84ebd1ddf5d59429f59dde0000000000000000000000000000000000000000000089a492133867424000000000000000000000000000000000000000000000033b6ec5be4c67d4cc54f101000000000000000000000000c0090eff4c7818e46fe4edd46588c6799180afd400000000000000000000000000000000000000000000000000000000",
177
+ abi: [...rewardVaultAbi, ...metaMorphoAbi],
178
+ blockNumber: 11765133n,
179
+ });
180
+ expect(revertReason.reason).toBe("AllCapsReached");
181
+ });
181
182
 
182
183
  it.concurrent("should return the expected simulation error", async () => {
183
184
  expect.hasAssertions();
@@ -287,43 +288,47 @@ describe("test errors contract", () => {
287
288
 
288
289
  const anvilMockAccount = mnemonicToAccount(anvilMnemonic);
289
290
 
290
- it.concurrent.each(expectedRevertReasons)(
291
- "should return the expected revert reason for $functionName",
292
- async ({ functionName, ...rest }) => {
293
- expect.hasAssertions();
294
- const resultPromise = getRevertReason({
295
- publicClient,
296
- abi: testErrorContractAbi,
297
- blockNumber: 11768554n,
298
- to: "0x47a9E3A4b5a26eEDD0E53BC468bae31c24c9B158",
299
- functionName,
300
- args: "args" in rest ? rest.args : undefined,
301
- account: anvilMockAccount.address,
302
- });
291
+ it.concurrent.each(
292
+ expectedRevertReasons,
293
+ )("should return the expected revert reason for $functionName", async ({
294
+ functionName,
295
+ ...rest
296
+ }) => {
297
+ expect.hasAssertions();
298
+ const resultPromise = getRevertReason({
299
+ publicClient,
300
+ abi: testErrorContractAbi,
301
+ blockNumber: 11768554n,
302
+ to: "0x47a9E3A4b5a26eEDD0E53BC468bae31c24c9B158",
303
+ functionName,
304
+ args: "args" in rest ? rest.args : undefined,
305
+ account: anvilMockAccount.address,
306
+ });
303
307
 
304
- const result = await resultPromise;
308
+ const result = await resultPromise;
305
309
 
306
- expect(result.reason).toBe(
307
- "onChainReason" in rest ? rest.onChainReason : rest.revertReason,
308
- );
309
- },
310
- );
311
-
312
- it.concurrent.each(expectedRevertReasons.filter((i) => !!i.txHashWith5972))(
313
- "should return the expected revert reason for $functionName with txHashWith5972",
314
- async ({ txHashWith5972, ...rest }) => {
315
- expect.hasAssertions();
316
- const result = await getRevertReason({
317
- publicClient,
318
- abi: testErrorContractAbi,
319
- txHash: txHashWith5972,
320
- });
310
+ expect(result.reason).toBe(
311
+ "onChainReason" in rest ? rest.onChainReason : rest.revertReason,
312
+ );
313
+ });
321
314
 
322
- expect(result.reason).toBe(
323
- "onChainReason" in rest ? rest.onChainReason : rest.revertReason,
324
- );
325
- },
326
- );
315
+ it.concurrent.each(
316
+ expectedRevertReasons.filter((i) => !!i.txHashWith5972),
317
+ )("should return the expected revert reason for $functionName with txHashWith5972", async ({
318
+ txHashWith5972,
319
+ ...rest
320
+ }) => {
321
+ expect.hasAssertions();
322
+ const result = await getRevertReason({
323
+ publicClient,
324
+ abi: testErrorContractAbi,
325
+ txHash: txHashWith5972,
326
+ });
327
+
328
+ expect(result.reason).toBe(
329
+ "onChainReason" in rest ? rest.onChainReason : rest.revertReason,
330
+ );
331
+ });
327
332
  });
328
333
 
329
334
  /**
@@ -418,44 +423,47 @@ describe("eip5972 transactions", () => {
418
423
  });
419
424
  const wagmiConfig = beraWagmiConfig.wagmi;
420
425
 
421
- it.concurrent.each(expectedRevertReasons)(
422
- "should return the expected revert reason on sendCalls for $functionName to be $revertReason",
423
- async ({ functionName, revertReason, ...rest }) => {
424
- await beraWriteContract({
425
- wagmiConfig,
426
- walletClient,
427
- errorsAbi: testErrorContractAbi,
428
- account: anvilMockAccount,
429
- enableSimulateCalls: true,
430
- calls: [
431
- {
432
- address: config.tokens.wbera,
433
- contractName: ContractName.ERC20,
434
- abi: erc20Abi,
435
- functionName: "approve",
436
- params: [zeroAddress, 0n],
437
- } as NonNullable<IContractWrite["calls"]>[number],
438
- {
439
- contractName: ContractName.ERC20,
440
- address: "0x47a9E3A4b5a26eEDD0E53BC468bae31c24c9B158",
441
- abi: testErrorContractAbi,
442
- functionName,
443
- params: "args" in rest ? rest.args : undefined,
444
- } as NonNullable<IContractWrite["calls"]>[number],
445
- ],
446
- message: "test",
447
- actionType: TransactionActionType.REDEEM_BGT,
448
- onSuccess: () => {
449
- assert.fail("Transaction should fail");
450
- },
451
- onError: (e) => {
452
- expect(e).toBeInstanceOf(BeraError);
453
- if (e instanceof BeraError) {
454
- expect(e.reason).toBe(revertReason);
455
- }
456
- },
457
- });
458
- // assert.fail("Transaction should fail");
459
- },
460
- );
426
+ it.concurrent.each(
427
+ expectedRevertReasons,
428
+ )("should return the expected revert reason on sendCalls for $functionName to be $revertReason", async ({
429
+ functionName,
430
+ revertReason,
431
+ ...rest
432
+ }) => {
433
+ await beraWriteContract({
434
+ wagmiConfig,
435
+ walletClient,
436
+ errorsAbi: testErrorContractAbi,
437
+ account: anvilMockAccount,
438
+ enableSimulateCalls: true,
439
+ calls: [
440
+ {
441
+ address: config.tokens.wbera,
442
+ contractName: ContractName.ERC20,
443
+ abi: erc20Abi,
444
+ functionName: "approve",
445
+ params: [zeroAddress, 0n],
446
+ } as NonNullable<IContractWrite["calls"]>[number],
447
+ {
448
+ contractName: ContractName.ERC20,
449
+ address: "0x47a9E3A4b5a26eEDD0E53BC468bae31c24c9B158",
450
+ abi: testErrorContractAbi,
451
+ functionName,
452
+ params: "args" in rest ? rest.args : undefined,
453
+ } as NonNullable<IContractWrite["calls"]>[number],
454
+ ],
455
+ message: "test",
456
+ actionType: TransactionActionType.REDEEM_BGT,
457
+ onSuccess: () => {
458
+ assert.fail("Transaction should fail");
459
+ },
460
+ onError: (e) => {
461
+ expect(e).toBeInstanceOf(BeraError);
462
+ if (e instanceof BeraError) {
463
+ expect(e.reason).toBe(revertReason);
464
+ }
465
+ },
466
+ });
467
+ // assert.fail("Transaction should fail");
468
+ });
461
469
  });
@@ -1,9 +1,10 @@
1
1
  import useSWRImmutable from "swr/immutable";
2
2
  import { type PublicClient, zeroAddress } from "viem";
3
3
 
4
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
5
+
4
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
7
8
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
8
9
 
9
10
  export const useAggregatorsRouterFeeBps = () => {
@@ -9,13 +9,14 @@ import {
9
9
  zeroAddress,
10
10
  } from "viem";
11
11
 
12
+ import { poolCreationHelperAbi as balancerPoolCreationHelperAbi } from "@berachain/abis/bex/poolCreationHelper";
13
+
12
14
  import {
13
15
  GetDedupedSubgraphPools,
14
16
  type GetDedupedSubgraphPoolsQuery,
15
17
  type SubgraphPoolFragment,
16
18
  } from "@berachain/graphql/dex/subgraph";
17
19
 
18
- import { balancerPoolCreationHelperAbi } from "~/abi/bex/balancerPoolCreationHelper";
19
20
  import { getApolloClient } from "~/actions/clients/getApolloClient";
20
21
  import { TransactionActionType } from "~/enum/txnEnum";
21
22
  import type { Token, TokenWithAmount } from "~/types/dex";
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import type { Address } from "viem";
3
3
 
4
+ import { vaultAbi as balancerVaultAbi } from "@berachain/abis/bex/vault";
5
+
4
6
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { balancerVaultAbi } from "~/abi/bex/balancerVault";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import type { DefaultHookOptions } from "~/types/global";
9
10
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
@@ -1,9 +1,10 @@
1
1
  import useSWRImmutable from "swr/immutable";
2
2
  import { type Address, formatUnits } from "viem";
3
3
 
4
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
5
+
4
6
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { bgtAbi } from "~/abi/pol/bgt";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
9
10
  import { useProposalSnapshot } from "./useProposalSnapshot";
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import { type Address, isAddress } from "viem";
3
3
 
4
+ import { berachainGovernanceAbi as governanceAbi } from "@berachain/abis/gov/berachainGovernance";
5
+
4
6
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { governanceAbi } from "~/abi/governance/governance";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
9
10
 
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import type { Address } from "viem";
3
3
 
4
+ import { timeLockAbi as governanceTimelockAbi } from "@berachain/abis/gov/timeLock";
5
+
4
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { governanceTimelockAbi } from "~/abi/governance/governanceTimelock";
7
8
  import { CANCELLER_ROLE } from "~/actions/governance/constants";
8
9
  import { POLLING } from "~/enum/polling";
9
10
  import { assertPublicClient } from "~/errors/assert";
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import { type Address, formatEther } from "viem";
3
3
 
4
+ import { berachainGovernanceAbi as governanceAbi } from "@berachain/abis/gov/berachainGovernance";
5
+
4
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { governanceAbi } from "~/abi/governance/governance";
7
8
  import { POLLING } from "~/enum/polling";
8
9
  import { assertPublicClient } from "~/errors/assert";
9
10
  import type { DefaultHookReturnType } from "~/types/global";
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import { type Address, formatEther } from "viem";
3
3
 
4
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
5
+
4
6
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { bgtAbi } from "~/abi/pol/bgt";
7
8
  import { POLLING } from "~/enum/polling";
8
9
  import { assertPublicClient } from "~/errors/assert";
9
10
  import type { DefaultHookOptions, DefaultHookReturnType } from "~/types/global";
@@ -1,9 +1,10 @@
1
1
  import type { SWRResponse } from "swr";
2
2
  import useSWRImmutable from "swr/immutable";
3
3
 
4
+ import { berachainGovernanceAbi as governanceAbi } from "@berachain/abis/gov/berachainGovernance";
5
+
4
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { governanceAbi } from "~/abi/governance/governance";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
9
10
 
@@ -2,9 +2,10 @@ import type { SWRResponse } from "swr";
2
2
  import useSWRImmutable from "swr/immutable";
3
3
  import type { Address } from "viem";
4
4
 
5
+ import { berachainGovernanceAbi as governanceAbi } from "@berachain/abis/gov/berachainGovernance";
6
+
5
7
  import { usePublicClient } from "@berachain/wagmi/hooks";
6
8
 
7
- import { governanceAbi } from "~/abi/governance/governance";
8
9
  import { ProposalState } from "~/enum/governance";
9
10
  import { assertPublicClient } from "~/errors/assert";
10
11
 
@@ -1,11 +1,12 @@
1
1
  import useSWR, { type SWRResponse } from "swr";
2
2
  import type { Address } from "viem";
3
3
 
4
+ import { timeLockAbi as governanceTimelockAbi } from "@berachain/abis/gov/timeLock";
5
+
4
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
8
  import { POLLING } from "~/enum/polling";
7
9
  import { assertPublicClient } from "~/errors/assert";
8
- import { governanceTimelockAbi } from "../../abi/governance/governanceTimelock";
9
10
 
10
11
  const TimelockOperationState = {
11
12
  0: "unset",
@@ -18,7 +19,7 @@ const TimelockOperationState = {
18
19
  * Fetches the state of a proposal timelock
19
20
  * @returns state of the proposal timelock (unset, waiting, ready, done)
20
21
  */
21
- export const useProposalTimelockState = ({
22
+ export function useProposalTimelockState({
22
23
  proposalTimelockId,
23
24
  timelockAddress,
24
25
  }: {
@@ -26,7 +27,7 @@ export const useProposalTimelockState = ({
26
27
  timelockAddress: Address;
27
28
  }): SWRResponse<
28
29
  (typeof TimelockOperationState)[keyof typeof TimelockOperationState]
29
- > => {
30
+ > {
30
31
  const publicClient = usePublicClient();
31
32
 
32
33
  const QUERY_KEY =
@@ -58,4 +59,4 @@ export const useProposalTimelockState = ({
58
59
  refreshInterval: POLLING.SLOW,
59
60
  },
60
61
  );
61
- };
62
+ }
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import { formatEther } from "viem";
3
3
 
4
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
5
+
4
6
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { bgtAbi } from "~/abi/pol/bgt";
7
8
  import { POLLING } from "~/enum/polling";
8
9
  import { assertPublicClient } from "~/errors/assert";
9
10
  import type { DefaultHookOptions, DefaultHookReturnType } from "~/types/global";
@@ -1,10 +1,11 @@
1
1
  import useSWR from "swr";
2
2
  import { type Address, erc20Abi, formatUnits, isAddress } from "viem";
3
3
 
4
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
5
+
4
6
  import type { ApiVaultFragment } from "@berachain/graphql/pol/api";
5
7
  import { usePublicClient } from "@berachain/wagmi/hooks";
6
8
 
7
- import { beraChefAbi } from "~/abi/pol/beraChef";
8
9
  import { getRewardVaultIncentives } from "~/actions/pol/getRewardVaultIncentives";
9
10
  import { getRewardVaultStakingToken } from "~/actions/pol/getRewardVaultStakingToken";
10
11
  import { getStakingTokenInformation } from "~/actions/pol/getStakingTokenInformation";
@@ -1,9 +1,10 @@
1
1
  import useSWR from "swr";
2
2
  import { type Address, isAddress, zeroAddress } from "viem";
3
3
 
4
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
5
+
4
6
  import { useBeraWallet, usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import type { DefaultHookOptions } from "~/types/global";
9
10
  import { useRewardVaultFromToken } from "./useRewardVaultFromToken";
@@ -1,9 +1,10 @@
1
1
  import useSWRImmutable from "swr/immutable";
2
2
  import { type Address, isAddress, zeroAddress } from "viem";
3
3
 
4
+ import { rewardVaultFactoryAbi } from "@berachain/abis/pol/rewards/rewardVaultFactory";
5
+
4
6
  import { usePublicClient } from "@berachain/wagmi/hooks";
5
7
 
6
- import { rewardVaultFactoryAbi } from "~/abi/pol/rewardVaultFactory";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
9
10
 
@@ -1,12 +1,13 @@
1
1
  import useSWR from "swr";
2
2
  import { type Address, keccak256 } from "viem";
3
3
 
4
+ import { beaconDepositAbi } from "@berachain/abis/pol/beaconDeposit";
5
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
6
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
7
+
4
8
  import type { ApiValidatorFragment } from "@berachain/graphql/pol/api";
5
9
  import { usePublicClient } from "@berachain/wagmi/hooks";
6
10
 
7
- import { beaconDepositAbi } from "~/abi/pol/beaconDeposit";
8
- import { beraChefAbi } from "~/abi/pol/beraChef";
9
- import { bgtAbi } from "~/abi/pol/bgt";
10
11
  import { assertPublicClient } from "~/errors/assert";
11
12
  import type { DefaultHookOptions, DefaultHookReturnType } from "~/types/global";
12
13
  import { parseBaseArgs } from "~/utils/parseBaseArgs";