@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
@@ -1,6 +1,7 @@
1
1
  import { type PublicClient, parseEther } from "viem";
2
2
 
3
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
3
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
4
+
4
5
  import type { Token } from "~/types/dex";
5
6
  import { CAP_LIMIT_BUFFER } from "~/utils/constants";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
@@ -3,7 +3,8 @@ import type { PublicClient } from "viem";
3
3
  import type { Address } from "@berachain/config";
4
4
  import type { EdgeConfigSchema } from "@berachain/config/internal/edge-config";
5
5
 
6
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
6
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
7
+
7
8
  import { getTokenInformation } from "~/actions/tokens/getTokenInformation";
8
9
  import type { TokenWithOrder } from "~/contexts/HoneyConfigProvider";
9
10
  import type { TokenWithMetadata } from "~/types/dex";
@@ -1,8 +1,9 @@
1
1
  import { type Address, formatUnits, type PublicClient } from "viem";
2
2
 
3
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
4
+
3
5
  import type { Token } from "@berachain/graphql/pol/api";
4
6
 
5
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
7
8
 
8
9
  export interface CollateralRates {
@@ -1,6 +1,7 @@
1
1
  import type { PublicClient } from "viem";
2
2
 
3
- import { honeyAbi } from "~/abi/honey/honey";
3
+ import { honeyAbi } from "@berachain/abis/honey/honey";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  import { type Address, type PublicClient, parseUnits } from "viem";
2
2
 
3
- import { honeyFactoryReaderAbi } from "~/abi/honey/honeyFactoryReader";
3
+ import { honeyFactoryReaderAbi } from "@berachain/abis/honey/honeyFactoryReader";
4
+
4
5
  import type { TokenWithOrder } from "~/contexts/HoneyConfigProvider";
5
6
  import type { Token } from "~/types/dex";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
@@ -1,6 +1,6 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { honeyRootOracleAbi } from "~/abi/honey/honeyRootOracle";
3
+ import { rootPriceOracleAbi as honeyRootOracleAbi } from "@berachain/abis/extras/rootPriceOracle";
4
4
 
5
5
  /**
6
6
  * Gets the address of the Honey Pyth Oracle, which is called by the Honey Root Price Oracle to get the price of the collaterals
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
3
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  /**
@@ -1,7 +1,8 @@
1
1
  import { type Address, formatUnits, type PublicClient } from "viem";
2
2
 
3
- import { collateralVaultAbi } from "~/abi/honey/collateralVault";
4
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
3
+ import { collateralVaultAbi } from "@berachain/abis/honey/collateralVault";
4
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
5
+
5
6
  import type { BalanceToken, Token } from "~/types/dex";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
7
8
 
@@ -1,6 +1,7 @@
1
1
  import { type Address, type PublicClient, parseEther } from "viem";
2
2
 
3
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
3
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
4
+
4
5
  import type { TokenWithOrder } from "~/contexts/HoneyConfigProvider";
5
6
  import { CAP_LIMIT_BUFFER } from "~/utils/constants";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
@@ -1,7 +1,8 @@
1
1
  import { type Address, type PublicClient, parseEther } from "viem";
2
2
 
3
- import { collateralVaultAbi } from "~/abi/honey/collateralVault";
4
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
3
+ import { collateralVaultAbi } from "@berachain/abis/honey/collateralVault";
4
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
5
+
5
6
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
6
7
 
7
8
  /**
@@ -6,8 +6,9 @@ import {
6
6
  parseUnits,
7
7
  } from "viem";
8
8
 
9
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
10
- import { pythWrapperAbi } from "~/abi/honey/pythWrapper";
9
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
10
+ import { honeyFactoryPythWrapperAbi as pythWrapperAbi } from "@berachain/abis/honey/honeyFactoryPythWrapper";
11
+
11
12
  import type { IHoneySwapState } from "~/hooks/honey/useHoneySwapState";
12
13
  import type { TokenWithMetadata } from "~/types/dex";
13
14
  import type { PythPriceFeedMap } from "~/types/honeySwap";
@@ -1,7 +1,8 @@
1
1
  import { type PublicClient, parseUnits } from "viem";
2
2
 
3
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
4
- import { honeyFactoryReaderAbi } from "~/abi/honey/honeyFactoryReader";
3
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
4
+ import { honeyFactoryReaderAbi } from "@berachain/abis/honey/honeyFactoryReader";
5
+
5
6
  import type { Token } from "~/types/dex";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
7
8
  import type { PythLatestUpdates } from "./getPythLatestPrices";
@@ -1,7 +1,8 @@
1
1
  import { type PublicClient, parseUnits } from "viem";
2
2
 
3
- import { honeyFactoryAbi } from "~/abi/honey/honeyFactory";
4
- import { honeyFactoryReaderAbi } from "~/abi/honey/honeyFactoryReader";
3
+ import { honeyFactoryAbi } from "@berachain/abis/honey/honeyFactory";
4
+ import { honeyFactoryReaderAbi } from "@berachain/abis/honey/honeyFactoryReader";
5
+
5
6
  import type { Token } from "~/types/dex";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
7
8
  import type { PythLatestUpdates } from "./getPythLatestPrices";
@@ -1,6 +1,7 @@
1
1
  import { formatEther, type PublicClient } from "viem";
2
2
 
3
- import { bgtAbi } from "~/abi/pol/bgt";
3
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
4
+
4
5
  import { assertPublicClient } from "~/errors/assert";
5
6
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
6
7
 
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { lstStakerVaultAbi } from "~/abi/pol/LSTStakerVault";
3
+ import { lstStakerVaultAbi } from "@berachain/abis/pol/lst/lstStakerVault";
4
+
4
5
  import { assertPublicClient } from "~/errors/assert";
5
6
  import type { TokenWithMetadata } from "~/types/dex";
6
7
  import type { StakingConfig } from "~/types/staking";
@@ -1,6 +1,7 @@
1
1
  import { type Address, formatUnits, type PublicClient, parseUnits } from "viem";
2
2
 
3
- import { stakeBeraVaultAbi } from "~/abi/pol/stakeBeraVault";
3
+ import { wberaStakerVaultAbi as stakeBeraVaultAbi } from "@berachain/abis/pol/wberaStakerVault";
4
+
4
5
  import { assertPublicClient } from "~/errors/assert";
5
6
 
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { rewardVaultFactoryAbi } from "~/abi/pol/rewardVaultFactory";
3
+ import { rewardVaultFactoryAbi } from "@berachain/abis/pol/rewards/rewardVaultFactory";
4
+
4
5
  import { upgradableBeaconAbi } from "~/abi/utils/upgradableBeacon";
5
6
  import { assertAddress, assertDefined } from "~/errors/assert";
6
7
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
@@ -1,6 +1,7 @@
1
1
  import type { PublicClient } from "viem";
2
2
 
3
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
+
4
5
  import { assertPublicClient } from "~/errors/assert";
5
6
  import { getRewardVaultBeaconImplementation } from "./getRewardVaultBeaconImplementation";
6
7
 
@@ -1,6 +1,7 @@
1
1
  import { type Address, type PublicClient, zeroAddress } from "viem";
2
2
 
3
- import { rewardVaultFactoryAbi } from "~/abi/pol/rewardVaultFactory";
3
+ import { rewardVaultFactoryAbi } from "@berachain/abis/pol/rewards/rewardVaultFactory";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export async function getRewardVaultFromToken({
@@ -1,7 +1,8 @@
1
1
  import { isSameAddress } from "@berachain-foundation/berancer-sdk";
2
2
  import { type Address, erc20Abi, formatUnits, type PublicClient } from "viem";
3
3
 
4
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
4
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
5
+
5
6
  import { BeraError } from "~/errors/BeraError";
6
7
  import { BeraMonitoring } from "~/errors/BeraMonitoring";
7
8
 
@@ -1,6 +1,7 @@
1
1
  import { type Address, formatUnits, type PublicClient } from "viem";
2
2
 
3
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
+
4
5
  import { msToSeconds } from "~/utils/time";
5
6
 
6
7
  export enum RewardVaultDistributionMode {
@@ -1,6 +1,6 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
4
 
5
5
  export async function getRewardVaultStakingToken({
6
6
  address,
@@ -1,5 +1,7 @@
1
1
  import { type Address, formatUnits, type PublicClient } from "viem";
2
2
 
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
+
3
5
  import {
4
6
  type ApiVaultFragment,
5
7
  GetVaults,
@@ -7,7 +9,6 @@ import {
7
9
  type GetVaultsQueryVariables,
8
10
  } from "@berachain/graphql/pol/api";
9
11
 
10
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
11
12
  import { getApolloClient } from "~/actions/clients/getApolloClient";
12
13
 
13
14
  export interface GetGaugeData {
@@ -1,8 +1,9 @@
1
1
  import { type Address, erc20Abi, type PublicClient } from "viem";
2
2
 
3
+ import { wberaStakerVaultAbi as stakeBeraVaultAbi } from "@berachain/abis/pol/wberaStakerVault";
4
+
3
5
  import BigNumber from "@berachain/utils/pkg/bignumber.js";
4
6
 
5
- import { stakeBeraVaultAbi } from "~/abi/pol/stakeBeraVault";
6
7
  import { assertPublicClient } from "~/errors/assert";
7
8
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
8
9
  import { getIncentiveFeeClaimStats } from "./getIncentiveFeeClaimStats";
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { stakeBeraVaultAbi } from "~/abi/pol/stakeBeraVault";
3
+ import { wberaStakerVaultAbi as stakeBeraVaultAbi } from "@berachain/abis/pol/wberaStakerVault";
4
+
4
5
  import { getStakeWithdrawalCooldown } from "~/actions/pol/getStakeWithdrawalCooldown";
5
6
  import { formatTimeLeft } from "~/utils/formatTimestamps";
6
7
  import { msToSeconds } from "~/utils/time";
@@ -1,6 +1,6 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { stakeBeraVaultAbi } from "~/abi/pol/stakeBeraVault";
3
+ import { wberaStakerVaultAbi as stakeBeraVaultAbi } from "@berachain/abis/pol/wberaStakerVault";
4
4
 
5
5
  export async function getStakeWithdrawalCooldown({
6
6
  publicClient,
@@ -2,7 +2,8 @@ import type { PublicClient } from "viem";
2
2
 
3
3
  import type { Address } from "@berachain/config";
4
4
 
5
- import { stakeBeraVaultAbi } from "~/abi/pol/stakeBeraVault";
5
+ import { wberaStakerVaultAbi as stakeBeraVaultAbi } from "@berachain/abis/pol/wberaStakerVault";
6
+
6
7
  import { assertPublicClient } from "~/errors/assert";
7
8
 
8
9
  /**
@@ -1,5 +1,7 @@
1
1
  import { type Address, formatUnits, type PublicClient } from "viem";
2
2
 
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
+
3
5
  import {
4
6
  type ApiVaultFragment,
5
7
  GetUserVaults,
@@ -8,7 +10,6 @@ import {
8
10
  type GqlChain,
9
11
  } from "@berachain/graphql/pol/api";
10
12
 
11
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
12
13
  import { getApolloClient } from "~/actions/clients/getApolloClient";
13
14
  import { BeraError } from "~/errors/BeraError";
14
15
  import { BeraMonitoring } from "~/errors/BeraMonitoring";
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
+
4
5
  import { assertAddress, assertPublicClient } from "~/errors/assert";
5
6
 
6
7
  export interface GetUserVaultsInfo {
@@ -1,6 +1,6 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
4
 
5
5
  export interface GetUserVaultsInfo {
6
6
  account: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
3
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
4
4
 
5
5
  export interface GetVaultsSupply {
6
6
  vaultAddress: Address;
@@ -2,7 +2,8 @@ import type { PublicClient } from "viem";
2
2
 
3
3
  import type { Address } from "@berachain/config";
4
4
 
5
- import { pythPriceOracleAbi } from "~/abi/honey/pythPriceOracle";
5
+ import { pythPriceOracleAbi } from "@berachain/abis/extras/pythPriceOracle";
6
+
6
7
  import type { PythPriceFeedMap } from "~/types/honeySwap";
7
8
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
8
9
 
@@ -17,16 +17,17 @@ import {
17
17
  transports,
18
18
  } from "@berachain/config/internal/wagmi";
19
19
 
20
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
21
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
22
+
20
23
  import { getConfig } from "@berachain/wagmi/config";
21
24
 
22
- import { bgtAbi } from "~/abi/pol/bgt";
23
25
  import { TransactionActionType } from "~/enum/txnEnum";
24
26
  import type { IContractWriteFn } from "~/types/global";
25
27
  import { getServerSidePublicClient } from "~/utils/getServerSideClient";
26
28
  import { getTestClient } from "~/utils/getTestClient";
27
29
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
28
30
  import { anvilMnemonic } from "~/utils/test-utils";
29
- import { rewardVaultAbi } from "../../abi/pol/rewardVault";
30
31
  import { getUserVaults } from "../pol/getUserVaults";
31
32
  import { beraWriteContract } from "./beraWriteContract";
32
33
 
@@ -128,55 +129,51 @@ describe("beraWriteContract", () => {
128
129
 
129
130
  const redeemAmount = parseEther("1");
130
131
 
131
- it(
132
- "should encode and send tx",
133
- {
134
- // Fails frequently on CI probably because of the anvil node
135
- retry: 3,
136
- },
137
- async () => {
138
- const testClient = getTestClient();
139
-
140
- await testClient.setBalance({
141
- address: wallet,
142
- value: parseEther("1000"),
143
- });
144
-
145
- const bgtBalance = await publicClient.readContract({
146
- address: config.tokens.bgt,
147
- abi: bgtAbi,
148
- functionName: "balanceOf",
149
- args: [wallet],
150
- });
151
-
152
- const tx = await beraWriteContract({
153
- wagmiConfig,
154
- walletClient,
155
- account: wallet,
156
- address: config.tokens.bgt,
157
- abi: bgtAbi,
158
- functionName: "redeem",
159
- params: [zeroAddress, redeemAmount],
160
- message: "test",
161
- actionType: TransactionActionType.REDEEM_BGT,
162
- onError: (e) => {
163
- assert.fail(e.message);
164
- },
165
- });
166
-
167
- expect(tx).toBeDefined();
168
-
169
- const postTxBgtBalance = await publicClient.readContract({
170
- address: config.tokens.bgt,
171
- abi: bgtAbi,
172
- blockTag: "pending",
173
- functionName: "balanceOf",
174
- args: [wallet],
175
- });
176
-
177
- expect(postTxBgtBalance).toBe(bgtBalance - redeemAmount);
178
- },
179
- );
132
+ it("should encode and send tx", {
133
+ // Fails frequently on CI probably because of the anvil node
134
+ retry: 3,
135
+ }, async () => {
136
+ const testClient = getTestClient();
137
+
138
+ await testClient.setBalance({
139
+ address: wallet,
140
+ value: parseEther("1000"),
141
+ });
142
+
143
+ const bgtBalance = await publicClient.readContract({
144
+ address: config.tokens.bgt,
145
+ abi: bgtAbi,
146
+ functionName: "balanceOf",
147
+ args: [wallet],
148
+ });
149
+
150
+ const tx = await beraWriteContract({
151
+ wagmiConfig,
152
+ walletClient,
153
+ account: wallet,
154
+ address: config.tokens.bgt,
155
+ abi: bgtAbi,
156
+ functionName: "redeem",
157
+ params: [zeroAddress, redeemAmount],
158
+ message: "test",
159
+ actionType: TransactionActionType.REDEEM_BGT,
160
+ onError: (e) => {
161
+ assert.fail(e.message);
162
+ },
163
+ });
164
+
165
+ expect(tx).toBeDefined();
166
+
167
+ const postTxBgtBalance = await publicClient.readContract({
168
+ address: config.tokens.bgt,
169
+ abi: bgtAbi,
170
+ blockTag: "pending",
171
+ functionName: "balanceOf",
172
+ args: [wallet],
173
+ });
174
+
175
+ expect(postTxBgtBalance).toBe(bgtBalance - redeemAmount);
176
+ });
180
177
 
181
178
  it("should send raw tx", async () => {
182
179
  const testClient = getTestClient();
@@ -2,8 +2,9 @@ import type { PublicClient } from "viem";
2
2
 
3
3
  import type { EdgeConfigSchema } from "@berachain/config/internal/edge-config";
4
4
 
5
- import { beraChefAbi } from "~/abi/pol/beraChef";
6
- import { bgtAbi } from "~/abi/pol/bgt";
5
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
6
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
7
+
7
8
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
8
9
 
9
10
  export interface ActiveBoostAndCommissionChangeDelay {
@@ -1,6 +1,7 @@
1
1
  import type { PublicClient } from "viem";
2
2
 
3
- import { rewardAllocationFactoryAbi } from "~/abi/pol/rewardAllocationFactory";
3
+ import { rewardAllocatorFactoryAbi as rewardAllocationFactoryAbi } from "@berachain/abis/pol/rewards/rewardAllocatorFactory";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
  import { formatValidatorRewardAllocation } from "./getValidatorRewardAllocation";
6
7
 
@@ -1,6 +1,7 @@
1
1
  import type { PublicClient } from "viem";
2
2
 
3
- import { beraChefAbi } from "~/abi/pol/beraChef";
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
  import {
6
7
  formatValidatorRewardAllocation,
@@ -1,6 +1,7 @@
1
1
  import { type Address, formatEther, type PublicClient } from "viem";
2
2
 
3
- import { bgtAbi } from "~/abi/pol/bgt";
3
+ import { bgtAbi } from "@berachain/abis/pol/bgt";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export type UserBoostsOnValidator = {
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { beraChefAbi } from "~/abi/pol/beraChef";
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export async function getValidatorCommission({
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { beaconDepositAbi } from "~/abi/pol/beaconDeposit";
3
+ import { beaconDepositAbi } from "@berachain/abis/pol/beaconDeposit";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export async function getValidatorOperatorAddress({
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { beraChefAbi } from "~/abi/pol/beraChef";
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export interface ValidatorQueuedCommission {
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { beaconDepositAbi } from "~/abi/pol/beaconDeposit";
3
+ import { beaconDepositAbi } from "@berachain/abis/pol/beaconDeposit";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export type ValidatorQueuedOperatorAddress = [bigint, string];
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { beraChefAbi } from "~/abi/pol/beraChef";
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
  import {
6
7
  formatValidatorRewardAllocation,
@@ -1,6 +1,7 @@
1
1
  import type { Address, PublicClient } from "viem";
2
2
 
3
- import { beraChefAbi } from "~/abi/pol/beraChef";
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export interface ValidatorRewardAllocationRaw {
@@ -1,6 +1,7 @@
1
1
  import { type Address, type PublicClient, zeroAddress } from "viem";
2
2
 
3
- import { beraChefAbi } from "~/abi/pol/beraChef";
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export type ValidatorRewardAllocatorAddress = Address;
@@ -22,15 +22,14 @@ describe("getValidatorBoostApy", async () => {
22
22
  throw new Error("BGT price not found");
23
23
  }
24
24
 
25
- it.each(valRes?.validators.validators ?? [])(
26
- "should return the correct boost apy for $pubkey",
27
- (validator) => {
28
- const returnPerBgt = getValidatorReturnPerBgt(validator);
29
- expect(returnPerBgt).toBeDefined();
30
- expect(returnPerBgt).not.toBeNaN();
31
- const boostApy = getValidatorBoostApy({ validator, bgtPrice });
32
- expect(boostApy).toBeDefined();
33
- expect(boostApy).not.toBeNaN();
34
- },
35
- );
25
+ it.each(
26
+ valRes?.validators.validators ?? [],
27
+ )("should return the correct boost apy for $pubkey", (validator) => {
28
+ const returnPerBgt = getValidatorReturnPerBgt(validator);
29
+ expect(returnPerBgt).toBeDefined();
30
+ expect(returnPerBgt).not.toBeNaN();
31
+ const boostApy = getValidatorBoostApy({ validator, bgtPrice });
32
+ expect(boostApy).toBeDefined();
33
+ expect(boostApy).not.toBeNaN();
34
+ });
36
35
  });