@berachain/berajs 0.2.3 → 0.2.4

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 (203) 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-4GU2O2OW.cjs +4 -0
  23. package/dist/chunk-4GU2O2OW.cjs.map +1 -0
  24. package/dist/chunk-5XWELBWR.mjs +2 -0
  25. package/dist/chunk-5XWELBWR.mjs.map +1 -0
  26. package/dist/chunk-BS6K7HGH.cjs +2 -0
  27. package/dist/chunk-BS6K7HGH.cjs.map +1 -0
  28. package/dist/chunk-NLVWRMGD.mjs +2 -0
  29. package/dist/chunk-NLVWRMGD.mjs.map +1 -0
  30. package/dist/chunk-OUD27MU7.cjs +2 -0
  31. package/dist/chunk-OUD27MU7.cjs.map +1 -0
  32. package/dist/chunk-RW3JFPED.mjs +4 -0
  33. package/dist/chunk-RW3JFPED.mjs.map +1 -0
  34. package/dist/chunk-S3EAKCVM.cjs +2 -0
  35. package/dist/{chunk-PKXAW6MO.cjs.map → chunk-S3EAKCVM.cjs.map} +1 -1
  36. package/dist/chunk-YNO7BCCM.mjs +2 -0
  37. package/dist/{chunk-3YXSUBA5.mjs.map → chunk-YNO7BCCM.mjs.map} +1 -1
  38. package/dist/contexts/exports.d.cts +3 -3
  39. package/dist/contexts/exports.d.ts +3 -3
  40. package/dist/enum/exports.d.cts +1 -1
  41. package/dist/enum/exports.d.ts +1 -1
  42. package/dist/errors/exports.d.cts +1 -1
  43. package/dist/errors/exports.d.ts +1 -1
  44. package/dist/{getValidatorQueuedOperatorAddress-NrjpnEn8.d.ts → getValidatorQueuedOperatorAddress-CqR6cyqC.d.ts} +3 -3
  45. package/dist/{getValidatorQueuedOperatorAddress-D_LEt3vv.d.cts → getValidatorQueuedOperatorAddress-DZgrPmZ2.d.cts} +3 -3
  46. package/dist/{global.d-X3cqpCEB.d.ts → global.d-BeYWDreg.d.ts} +4 -4
  47. package/dist/{global.d-DLRtrPG5.d.cts → global.d-DghRxpHd.d.cts} +4 -4
  48. package/dist/hooks/exports.cjs +3 -3
  49. package/dist/hooks/exports.cjs.map +1 -1
  50. package/dist/hooks/exports.d.cts +40 -38
  51. package/dist/hooks/exports.d.ts +40 -38
  52. package/dist/hooks/exports.mjs +3 -3
  53. package/dist/hooks/exports.mjs.map +1 -1
  54. package/dist/{txnEnum-BlBYhNRl.d.cts → txnEnum-DxPRHSJt.d.cts} +1 -1
  55. package/dist/{txnEnum-BlBYhNRl.d.ts → txnEnum-DxPRHSJt.d.ts} +1 -1
  56. package/dist/types/exports.d.cts +3 -3
  57. package/dist/types/exports.d.ts +3 -3
  58. package/dist/{useHoneySwapState-D1DKG_Of.d.ts → useHoneySwapState-B494PQDl.d.ts} +1 -1
  59. package/dist/{useHoneySwapState-B-vmIP1b.d.cts → useHoneySwapState-D6vpv19r.d.cts} +1 -1
  60. package/dist/utils/exports.cjs +1 -1
  61. package/dist/utils/exports.cjs.map +1 -1
  62. package/dist/utils/exports.d.cts +2 -2
  63. package/dist/utils/exports.d.ts +2 -2
  64. package/dist/utils/exports.mjs +1 -1
  65. package/dist/utils/exports.mjs.map +1 -1
  66. package/package.json +8 -9
  67. package/src/abi/exports.ts +0 -27
  68. package/src/actions/bend/getConvertToAssets.ts +1 -1
  69. package/src/actions/bend/getMaxDeposit.ts +1 -1
  70. package/src/actions/dex/aggregators/bex.ts +2 -1
  71. package/src/actions/dex/aggregators/enso/enso.ts +3 -2
  72. package/src/actions/dex/aggregators/enso/ensoErc4626.debug.test.ts +2 -3
  73. package/src/actions/dex/aggregators/erc4626.ts +2 -1
  74. package/src/actions/dex/aggregators/fly.ts +2 -1
  75. package/src/actions/dex/aggregators/haiku.ts +2 -1
  76. package/src/actions/dex/aggregators/kyberswap.ts +2 -2
  77. package/src/actions/dex/aggregators/oogabooga.ts +2 -1
  78. package/src/actions/dex/aggregators/openOcean.ts +2 -1
  79. package/src/actions/dex/aggregators/wbera.ts +2 -1
  80. package/src/actions/dex/getVaultPausedState.ts +2 -1
  81. package/src/actions/enso/getEnsoUserTokensWithBalances.debug.test.ts +1 -1
  82. package/src/actions/governance/__tests__/checkProposalField.unit.test.ts +2 -1
  83. package/src/actions/governance/__tests__/getDecodedFunctionData.integration.test.ts +66 -78
  84. package/src/actions/governance/__tests__/getQuorum.integration.test.ts +6 -7
  85. package/src/actions/governance/getDecodedFunctionData.ts +2 -2
  86. package/src/actions/governance/getProposalFromTx.ts +2 -1
  87. package/src/actions/governance/getProposalParams.ts +3 -2
  88. package/src/actions/governance/getQuorum.ts +2 -1
  89. package/src/actions/honey/getCollateralWeights.ts +2 -1
  90. package/src/actions/honey/getGlobalCapLimit.ts +2 -1
  91. package/src/actions/honey/getHoneyCollaterals.ts +2 -1
  92. package/src/actions/honey/getHoneyFees.ts +2 -1
  93. package/src/actions/honey/getHoneyPausedState.ts +2 -1
  94. package/src/actions/honey/getHoneyPreview.ts +2 -1
  95. package/src/actions/honey/getHoneyPythPriceOracle.ts +1 -1
  96. package/src/actions/honey/getHoneyRootPriceOracle.ts +2 -1
  97. package/src/actions/honey/getHoneyVaultsBalance.ts +3 -2
  98. package/src/actions/honey/getRelativeCapLimit.ts +2 -1
  99. package/src/actions/honey/getSharesWithoutFees.ts +3 -2
  100. package/src/actions/honey/getSwapPayload.ts +3 -2
  101. package/src/actions/honey/isBadCollateralAsset.ts +3 -2
  102. package/src/actions/honey/isBasketModeEnabled.ts +3 -2
  103. package/src/actions/pol/getBgtTokenTotalBoosts.ts +2 -1
  104. package/src/actions/pol/getLSTStakeConfig.ts +2 -1
  105. package/src/actions/pol/getRewardTokenToBeraRate.ts +2 -1
  106. package/src/actions/pol/getRewardVaultBeaconImplementation.ts +2 -1
  107. package/src/actions/pol/getRewardVaultDurationConstants.ts +2 -1
  108. package/src/actions/pol/getRewardVaultFromToken.ts +2 -1
  109. package/src/actions/pol/getRewardVaultIncentives.ts +2 -1
  110. package/src/actions/pol/getRewardVaultRewards.ts +2 -1
  111. package/src/actions/pol/getRewardVaultStakingToken.ts +1 -1
  112. package/src/actions/pol/getRewardVaults.ts +2 -1
  113. package/src/actions/pol/getSWBeraVaultMetadata.ts +2 -1
  114. package/src/actions/pol/getSWBeraWithdrawal.ts +2 -1
  115. package/src/actions/pol/getStakeWithdrawalCooldown.ts +1 -1
  116. package/src/actions/pol/getTotalStakedAmount.ts +2 -1
  117. package/src/actions/pol/getUserVaults.ts +2 -1
  118. package/src/actions/pol/getUserVaultsBalance.ts +2 -1
  119. package/src/actions/pol/getUserVaultsReward.ts +1 -1
  120. package/src/actions/pol/getVaultsSupply.ts +1 -1
  121. package/src/actions/pyth/getHoneyPythFeeds.ts +2 -1
  122. package/src/actions/transactions/beraWriteContract.integration.test.ts +48 -51
  123. package/src/actions/validators/getActiveBoostAndCommissionChangeDelay.ts +3 -2
  124. package/src/actions/validators/getBaselineRewardAllocation.ts +2 -1
  125. package/src/actions/validators/getDefaultRewardAllocation.ts +2 -1
  126. package/src/actions/validators/getUserBoostsOnValidator.ts +2 -1
  127. package/src/actions/validators/getValidatorCommission.ts +2 -1
  128. package/src/actions/validators/getValidatorOperatorAddress.ts +2 -1
  129. package/src/actions/validators/getValidatorQueuedCommission.ts +2 -1
  130. package/src/actions/validators/getValidatorQueuedOperatorAddress.ts +2 -1
  131. package/src/actions/validators/getValidatorQueuedRewardAllocation.ts +2 -1
  132. package/src/actions/validators/getValidatorRewardAllocation.ts +2 -1
  133. package/src/actions/validators/getValidatorRewardAllocatorAddress.ts +2 -1
  134. package/src/actions/validators/utils/__tests__/validatorUtils.integration.test.ts +10 -11
  135. package/src/errors/getRevertReason.integration.test.ts +115 -107
  136. package/src/hooks/dex/useAggregatorsRouterFeeBps.ts +2 -1
  137. package/src/hooks/dex/useCreatePool.ts +2 -1
  138. package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +2 -1
  139. package/src/hooks/governance/useGetPastVotes.ts +2 -1
  140. package/src/hooks/governance/useHasVoted.ts +2 -1
  141. package/src/hooks/governance/useIsCanceller.ts +2 -1
  142. package/src/hooks/governance/usePollProposalThreshold.ts +2 -1
  143. package/src/hooks/governance/usePollUserDelegates.ts +2 -1
  144. package/src/hooks/governance/useProposalSnapshot.ts +2 -1
  145. package/src/hooks/governance/useProposalState.ts +2 -1
  146. package/src/hooks/governance/useProposalTimelockState.ts +5 -4
  147. package/src/hooks/pol/useBgtUnstakedBalance.ts +2 -1
  148. package/src/hooks/pol/useOnChainRewardVault.ts +2 -1
  149. package/src/hooks/pol/useRewardVaultBalanceFromStakingToken.ts +2 -1
  150. package/src/hooks/pol/useRewardVaultFromToken.ts +2 -1
  151. package/src/hooks/validators/useOnChainValidator.ts +4 -3
  152. package/dist/chunk-3YXSUBA5.mjs +0 -2
  153. package/dist/chunk-A4UDYSB6.mjs +0 -4
  154. package/dist/chunk-A4UDYSB6.mjs.map +0 -1
  155. package/dist/chunk-CYKCYPFR.cjs +0 -2
  156. package/dist/chunk-CYKCYPFR.cjs.map +0 -1
  157. package/dist/chunk-ECRMUMTA.mjs +0 -2
  158. package/dist/chunk-ECRMUMTA.mjs.map +0 -1
  159. package/dist/chunk-F4BKSBEM.mjs +0 -2
  160. package/dist/chunk-F4BKSBEM.mjs.map +0 -1
  161. package/dist/chunk-FL2N3XHK.cjs +0 -2
  162. package/dist/chunk-FL2N3XHK.cjs.map +0 -1
  163. package/dist/chunk-MUCEYO3E.cjs +0 -4
  164. package/dist/chunk-MUCEYO3E.cjs.map +0 -1
  165. package/dist/chunk-P2Q7CMUD.cjs +0 -2
  166. package/dist/chunk-P2Q7CMUD.cjs.map +0 -1
  167. package/dist/chunk-PKXAW6MO.cjs +0 -2
  168. package/dist/chunk-Q3SCM6WL.mjs +0 -2
  169. package/dist/chunk-Q3SCM6WL.mjs.map +0 -1
  170. package/dist/chunk-TEBJWAVU.mjs +0 -2
  171. package/dist/chunk-TEBJWAVU.mjs.map +0 -1
  172. package/dist/chunk-VP7XUOSI.cjs +0 -2
  173. package/dist/chunk-VP7XUOSI.cjs.map +0 -1
  174. package/dist/pythWrapper-CBjsmmsK.d.cts +0 -1958
  175. package/dist/pythWrapper-CBjsmmsK.d.ts +0 -1958
  176. package/src/abi/bend/metaMorpho.ts +0 -2584
  177. package/src/abi/bend/morpho.ts +0 -444
  178. package/src/abi/bex/aggregatorsRouter.ts +0 -492
  179. package/src/abi/bex/balancerComposableStablePoolFactoryV6.ts +0 -283
  180. package/src/abi/bex/balancerPoolCreationHelper.ts +0 -267
  181. package/src/abi/bex/balancerVault.ts +0 -757
  182. package/src/abi/governance/governance.ts +0 -1016
  183. package/src/abi/governance/governanceTimelock.ts +0 -589
  184. package/src/abi/honey/collateralVault.ts +0 -1144
  185. package/src/abi/honey/honey.ts +0 -563
  186. package/src/abi/honey/honeyFactory.ts +0 -1270
  187. package/src/abi/honey/honeyFactoryReader.ts +0 -894
  188. package/src/abi/honey/honeyRootOracle.ts +0 -492
  189. package/src/abi/honey/pythPriceOracle.ts +0 -619
  190. package/src/abi/honey/pythWrapper.ts +0 -446
  191. package/src/abi/pol/LSTStakerVault.ts +0 -2032
  192. package/src/abi/pol/beaconDeposit.ts +0 -595
  193. package/src/abi/pol/beraChef.ts +0 -1019
  194. package/src/abi/pol/bgt.ts +0 -1008
  195. package/src/abi/pol/bgtIncentiveDistributor.ts +0 -640
  196. package/src/abi/pol/bgtStaker.ts +0 -1034
  197. package/src/abi/pol/rewardAllocationFactory.ts +0 -408
  198. package/src/abi/pol/rewardVault.ts +0 -1928
  199. package/src/abi/pol/rewardVaultFactory.ts +0 -586
  200. package/src/abi/pol/rewardVaultHelper.ts +0 -882
  201. package/src/abi/pol/stakeBeraVault.ts +0 -1116
  202. package/src/abi/pol/stakeBeraVaultWithdrawalRequest.ts +0 -618
  203. package/src/abi/pol/wbera.ts +0 -366
@@ -12,7 +12,8 @@ import { decodeFunctionData, formatEther, zeroAddress } from "viem";
12
12
  import { getUriFromLink } from "@berachain/config";
13
13
  import { ChainId } from "@berachain/config/internal";
14
14
 
15
- import { balancerVaultAbi } from "~/abi/bex/balancerVault";
15
+ import { vaultAbi as balancerVaultAbi } from "@berachain/abis/bex/vault";
16
+
16
17
  import { BalancerApi } from "~/actions/dex/b-sdk";
17
18
  import { Aggregators } from "~/enum/dex";
18
19
  import { assertPublicClient } from "~/errors/assert";
@@ -2,12 +2,13 @@ import { zeroAddress } from "viem";
2
2
 
3
3
  import { ChainId } from "@berachain/config/internal";
4
4
 
5
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
5
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
6
+
6
7
  import { Aggregators } from "~/enum/dex";
7
8
  import type { IAggregatorArgs, IRawAggregatorQuote } from "~/types/dex";
8
9
  import { BaseAggregator } from "../base";
9
10
 
10
- export class EnsoAggregator extends BaseAggregator {
11
+ class EnsoAggregator extends BaseAggregator {
11
12
  name = Aggregators.Enso;
12
13
  supportedChains = [ChainId.MAINNET];
13
14
  readonly type = "rest";
@@ -1,5 +1,5 @@
1
1
  import { berachain } from "viem/chains";
2
- import { describe, it } from "vitest";
2
+ import { describe, expect, it } from "vitest";
3
3
 
4
4
  import { mainnet } from "@berachain/config/mainnet";
5
5
 
@@ -31,7 +31,6 @@ describe("ensoErc4626", () => {
31
31
  underlyingToken: getHoneyToken({ chainId: re7Honey.chainId }),
32
32
  rewardVault: "0xdb6e93cd7bddc45ebc411619792fc5f977316c38",
33
33
  });
34
-
35
- console.log(quote);
34
+ expect(quote).toBeDefined();
36
35
  });
37
36
  });
@@ -1,6 +1,7 @@
1
1
  import { erc4626Abi, formatUnits } 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 { ContractName } from "~/enum/contracts";
5
6
  import { Aggregators } from "~/enum/dex";
6
7
  import { assertDefined, assertPublicClient } from "~/errors/assert";
@@ -2,7 +2,8 @@ import { type Address, type Hex, zeroAddress } from "viem";
2
2
 
3
3
  import { ChainId } from "@berachain/config/internal";
4
4
 
5
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
5
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
6
+
6
7
  import { Aggregators } from "~/enum/dex";
7
8
  import type { IAggregatorArgs, IRawAggregatorQuote } from "~/types/dex";
8
9
  import { isToken } from "~/utils/tokens";
@@ -2,7 +2,8 @@ import { formatUnits, parseUnits, zeroAddress } from "viem";
2
2
 
3
3
  import { ChainId } from "@berachain/config/internal";
4
4
 
5
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
5
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
6
+
6
7
  import { Aggregators, SwapReferrer } from "~/enum/dex";
7
8
  import { BeraError } from "~/errors/BeraError";
8
9
  import type { IAggregatorArgs, IRawAggregatorQuote } from "~/types/dex";
@@ -2,7 +2,8 @@ import { zeroAddress } from "viem";
2
2
 
3
3
  import { ChainId } from "@berachain/config/internal";
4
4
 
5
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
5
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
6
+
6
7
  import { Aggregators } from "~/enum/dex";
7
8
  import type { IAggregatorArgs, IRawAggregatorQuote } from "~/types/dex";
8
9
  import { BaseAggregator } from "./base";
@@ -22,7 +23,6 @@ class KyberSwapAggregator extends BaseAggregator {
22
23
  tokenOut,
23
24
  amount,
24
25
  slippage,
25
- account = zeroAddress,
26
26
  aggregatorsFeeBps,
27
27
  proxyAggregatorsThroughVercel = false,
28
28
  rewardVault,
@@ -2,7 +2,8 @@ import { zeroAddress } from "viem";
2
2
 
3
3
  import { ChainId } from "@berachain/config/internal";
4
4
 
5
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
5
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
6
+
6
7
  import { Aggregators } from "~/enum/dex";
7
8
  import type { IAggregatorArgs, IRawAggregatorQuote } from "~/types/dex";
8
9
  import { BaseAggregator } from "./base";
@@ -2,7 +2,8 @@ import { zeroAddress } from "viem";
2
2
 
3
3
  import { ChainId } from "@berachain/config/internal";
4
4
 
5
- import { aggregatorsRouterAbi } from "~/abi/bex/aggregatorsRouter";
5
+ import { metaAggregatorAbi as aggregatorsRouterAbi } from "@berachain/abis/meta-aggregator/metaAggregator";
6
+
6
7
  import { Aggregators } from "~/enum/dex";
7
8
  import { assertPublicClient } from "~/errors/assert";
8
9
  import { InvalidArgumentError } from "~/errors/InvalidArgumentError";
@@ -1,6 +1,7 @@
1
1
  import { ChainId } from "@berachain/config/internal";
2
2
 
3
- import { wberaAbi } from "~/abi/pol/wbera";
3
+ import { wberaAbi } from "@berachain/abis/wbera";
4
+
4
5
  import { Aggregators } from "~/enum/dex";
5
6
  import type { IAggregatorArgs, IRawAggregatorQuote, Token } from "~/types/dex";
6
7
  import type { IContractWrite } from "~/types/global";
@@ -1,6 +1,7 @@
1
1
  import type { PublicClient } from "viem";
2
2
 
3
- import { balancerVaultAbi } from "~/abi/bex/balancerVault";
3
+ import { vaultAbi as balancerVaultAbi } from "@berachain/abis/bex/vault";
4
+
4
5
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
6
 
6
7
  export async function getVaultPausedState({
@@ -28,7 +28,7 @@ describe("getEnsoUserTokensWithBalances", () => {
28
28
  beforeEach(() => {
29
29
  vi.clearAllMocks();
30
30
 
31
- captureSpy = vi.spyOn(BeraMonitoring, "capture");
31
+ captureSpy = vi.spyOn(BeraMonitoring, "captureException");
32
32
  fetchSpy = vi.spyOn(global, "fetch");
33
33
  });
34
34
 
@@ -1,8 +1,9 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
 
3
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
4
+
3
5
  import { ProposalErrorCodes } from "~/enum/governance";
4
6
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
5
- import { beraChefAbi } from "../../../abi/pol/beraChef";
6
7
  import { checkProposalField } from "../checkProposalField";
7
8
 
8
9
  describe("checkProposalField", () => {
@@ -3,7 +3,8 @@ import { describe, expect, it } from "vitest";
3
3
 
4
4
  import { ChainId, defaultChainId } from "@berachain/config/internal";
5
5
 
6
- import { beraChefAbi } from "~/abi/pol/beraChef";
6
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
7
+
7
8
  import { getServerSidePublicClient } from "~/utils/getServerSideClient";
8
9
  import { parseBaseArgs } from "~/utils/parseBaseArgs";
9
10
  import { getDecodedFunctionData } from "../getDecodedFunctionData";
@@ -36,92 +37,79 @@ describe.skipIf(defaultChainId !== ChainId.MAINNET)(
36
37
  });
37
38
 
38
39
  // requires upgrade once we add more ABIs
39
- it.concurrent(
40
- "should match remote abi for immutable contract",
41
- {
42
- // Fails frequently on CI probably because of connection issues?
43
- retry: 3,
44
- },
45
- async () => {
46
- // setDefaultFeeBps(10)
47
- const calldata =
48
- "0x4488b652000000000000000000000000000000000000000000000000000000000000000a";
49
- const data = await getDecodedFunctionData({
50
- address: chainConfig.tokens.wbtc,
51
- callData: calldata,
52
- chainId,
53
- publicClient,
54
- });
40
+ it.concurrent("should match remote abi for immutable contract", {
41
+ // Fails frequently on CI probably because of connection issues?
42
+ retry: 3,
43
+ }, async () => {
44
+ // setDefaultFeeBps(10)
45
+ const calldata =
46
+ "0x4488b652000000000000000000000000000000000000000000000000000000000000000a";
47
+ const data = await getDecodedFunctionData({
48
+ address: chainConfig.tokens.wbtc,
49
+ callData: calldata,
50
+ chainId,
51
+ publicClient,
52
+ });
55
53
 
56
- expect(data.functionSignature).toBe("setDefaultFeeBps(uint16)");
57
- expect(data.abiItem).toBeDefined();
58
- expect(data.args).toEqual([10]);
59
- expect(data.functionName).toBe("setDefaultFeeBps");
60
- },
61
- );
54
+ expect(data.functionSignature).toBe("setDefaultFeeBps(uint16)");
55
+ expect(data.abiItem).toBeDefined();
56
+ expect(data.args).toEqual([10]);
57
+ expect(data.functionName).toBe("setDefaultFeeBps");
58
+ });
62
59
 
63
60
  // requires upgrade once we add more ABIs
64
- it.concurrent(
65
- "should not match remote abi for wrong immutable contract",
66
- async () => {
67
- // setDefaultFeeBps(10)
68
- const calldata =
69
- "0x4488b652000000000000000000000000000000000000000000000000000000000000000a";
70
- const data = await getDecodedFunctionData({
71
- // purposely use a wrong contract, method is from wbtc
72
- address: chainConfig.tokens.wbera,
73
- callData: calldata,
74
- chainId,
75
- publicClient,
76
- });
61
+ it.concurrent("should not match remote abi for wrong immutable contract", async () => {
62
+ // setDefaultFeeBps(10)
63
+ const calldata =
64
+ "0x4488b652000000000000000000000000000000000000000000000000000000000000000a";
65
+ const data = await getDecodedFunctionData({
66
+ // purposely use a wrong contract, method is from wbtc
67
+ address: chainConfig.tokens.wbera,
68
+ callData: calldata,
69
+ chainId,
70
+ publicClient,
71
+ });
77
72
 
78
- expect(data.args).toEqual([]);
79
- expect(data.functionSignature).toBeUndefined();
80
- expect(data.abiItem).toBeUndefined();
81
- expect(data.functionName).toBeUndefined();
82
- },
83
- );
73
+ expect(data.args).toEqual([]);
74
+ expect(data.functionSignature).toBeUndefined();
75
+ expect(data.abiItem).toBeUndefined();
76
+ expect(data.functionName).toBeUndefined();
77
+ });
84
78
 
85
79
  // requires upgrade once we add more ABIs
86
- it.concurrent(
87
- "should match remote abi for upgradeable contract",
88
- async () => {
89
- // mint(wbera, 100e18)
90
- const calldata =
91
- "0x40c10f1900000000000000000000000069696969696969696969696969696969696969690000000000000000000000000000000000000000000000056bc75e2d63100000";
92
- const data = await getDecodedFunctionData({
93
- address: chainConfig.honey.token,
94
- callData: calldata,
95
- chainId,
96
- publicClient,
97
- });
80
+ it.concurrent("should match remote abi for upgradeable contract", async () => {
81
+ // mint(wbera, 100e18)
82
+ const calldata =
83
+ "0x40c10f1900000000000000000000000069696969696969696969696969696969696969690000000000000000000000000000000000000000000000056bc75e2d63100000";
84
+ const data = await getDecodedFunctionData({
85
+ address: chainConfig.honey.token,
86
+ callData: calldata,
87
+ chainId,
88
+ publicClient,
89
+ });
98
90
 
99
- expect(data.functionSignature).toBe("mint(address,uint256)");
100
- expect(data.abiItem).toBeDefined();
101
- expect(data.args).toEqual([chainConfig.tokens.wbera, BigInt(100e18)]);
102
- expect(data.functionName).toBe("mint");
103
- },
104
- );
91
+ expect(data.functionSignature).toBe("mint(address,uint256)");
92
+ expect(data.abiItem).toBeDefined();
93
+ expect(data.args).toEqual([chainConfig.tokens.wbera, BigInt(100e18)]);
94
+ expect(data.functionName).toBe("mint");
95
+ });
105
96
 
106
97
  // requires upgrade once we add more ABIs
107
- it.concurrent(
108
- "should not match remote abi for unverified/non-contract",
109
- async () => {
110
- // mint(wbera, 100e18)
111
- const calldata =
112
- "0x40c10f1900000000000000000000000069696969696969696969696969696969696969690000000000000000000000000000000000000000000000056bc75e2d63100000";
113
- const data = await getDecodedFunctionData({
114
- address: "0x000000000000000000000000000000000000dEaD",
115
- callData: calldata,
116
- chainId,
117
- publicClient,
118
- });
98
+ it.concurrent("should not match remote abi for unverified/non-contract", async () => {
99
+ // mint(wbera, 100e18)
100
+ const calldata =
101
+ "0x40c10f1900000000000000000000000069696969696969696969696969696969696969690000000000000000000000000000000000000000000000056bc75e2d63100000";
102
+ const data = await getDecodedFunctionData({
103
+ address: "0x000000000000000000000000000000000000dEaD",
104
+ callData: calldata,
105
+ chainId,
106
+ publicClient,
107
+ });
119
108
 
120
- expect(data.args).toEqual([]);
121
- expect(data.functionSignature).toBeUndefined();
122
- expect(data.abiItem).toBeUndefined();
123
- expect(data.functionName).toBeUndefined();
124
- },
125
- );
109
+ expect(data.args).toEqual([]);
110
+ expect(data.functionSignature).toBeUndefined();
111
+ expect(data.abiItem).toBeUndefined();
112
+ expect(data.functionName).toBeUndefined();
113
+ });
126
114
  },
127
115
  );
@@ -18,13 +18,12 @@ describe("getQuorum", () => {
18
18
  },
19
19
  } as const;
20
20
 
21
- it.each(Object.entries(quorums[defaultChainId as ChainId]))(
22
- "should match the quorum at %s",
23
- async (at, shouldBe) => {
24
- const quorum = await getQuorum({ publicClient, at });
25
- expect(quorum).toBe(shouldBe);
26
- },
27
- );
21
+ it.each(
22
+ Object.entries(quorums[defaultChainId as ChainId]),
23
+ )("should match the quorum at %s", async (at, shouldBe) => {
24
+ const quorum = await getQuorum({ publicClient, at });
25
+ expect(quorum).toBe(shouldBe);
26
+ });
28
27
 
29
28
  it("should have a quorum for the current time", async () => {
30
29
  const testClient = getTestClient();
@@ -13,8 +13,8 @@ import {
13
13
 
14
14
  import { appConfig, defaultChainId } from "@berachain/config/internal";
15
15
 
16
- import { beraChefAbi } from "~/abi/pol/beraChef";
17
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
16
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
17
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
18
18
 
19
19
  // Function to check if ABI contains proxy-related functions
20
20
  function isProxyABI(abi: Abi[]): boolean {
@@ -5,13 +5,14 @@ import {
5
5
  type TransactionReceipt,
6
6
  } from "viem";
7
7
 
8
+ import { berachainGovernanceAbi as governanceAbi } from "@berachain/abis/gov/berachainGovernance";
9
+
8
10
  import {
9
11
  type ExecutableCallSubsetFragment,
10
12
  ProposalStatus,
11
13
  type ProposalWithVotesFragment,
12
14
  } from "@berachain/graphql/governance";
13
15
 
14
- import { governanceAbi } from "~/abi/governance/governance";
15
16
  import { assertPublicClient } from "~/errors/assert";
16
17
  import { parseProposalBody } from "./parseProposalBody";
17
18
 
@@ -7,8 +7,9 @@ import {
7
7
  toHex,
8
8
  } from "viem";
9
9
 
10
- import { beraChefAbi } from "~/abi/pol/beraChef";
11
- import { rewardVaultAbi } from "~/abi/pol/rewardVault";
10
+ import { beraChefAbi } from "@berachain/abis/pol/rewards/beraChef";
11
+ import { rewardVaultAbi } from "@berachain/abis/pol/rewards/rewardVault";
12
+
12
13
  import { ProposalErrorCodes, ProposalTypeEnum } from "~/enum/governance";
13
14
  import type {
14
15
  CustomProposal,
@@ -1,6 +1,7 @@
1
1
  import { formatEther, type PublicClient } from "viem";
2
2
 
3
- import { governanceAbi } from "~/abi/governance/governance";
3
+ import { berachainGovernanceAbi as governanceAbi } from "@berachain/abis/gov/berachainGovernance";
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 { 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 { parseBaseArgs } from "~/utils/parseBaseArgs";
6
7
 
@@ -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({