@berachain/berajs 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BeraError-D1HS_rbb.d.cts → BeraError-_mQdkanr.d.cts} +35 -10
- package/dist/{BeraError-D1HS_rbb.d.ts → BeraError-_mQdkanr.d.ts} +35 -10
- package/dist/HoneyConfigProvider-CK6mOKFH.d.ts +390 -0
- package/dist/HoneyConfigProvider-Ca3ouozs.d.cts +390 -0
- package/dist/{RequestError-D8AE6xnI.d.cts → RequestError-A8XJ6QR9.d.cts} +1 -1
- package/dist/{RequestError-m4jxyM7D.d.ts → RequestError-Dk97z8rm.d.ts} +1 -1
- package/dist/abi/exports.cjs +2 -0
- package/dist/abi/exports.cjs.map +1 -0
- package/dist/abi/{index.d.cts → exports.d.cts} +12369 -9122
- package/dist/abi/{index.d.ts → exports.d.ts} +12369 -9122
- package/dist/abi/exports.mjs +2 -0
- package/dist/abi/exports.mjs.map +1 -0
- package/dist/actions/exports.cjs +2 -0
- package/dist/actions/exports.cjs.map +1 -0
- package/dist/actions/{index.d.cts → exports.d.cts} +79 -107
- package/dist/actions/{index.d.ts → exports.d.ts} +79 -107
- package/dist/actions/exports.mjs +2 -0
- package/dist/actions/exports.mjs.map +1 -0
- package/dist/chunk-22J3YJDN.cjs +2 -0
- package/dist/chunk-22J3YJDN.cjs.map +1 -0
- package/dist/chunk-2LL3P5PN.mjs +2 -0
- package/dist/chunk-2LL3P5PN.mjs.map +1 -0
- package/dist/chunk-3YXSUBA5.mjs +2 -0
- package/dist/chunk-3YXSUBA5.mjs.map +1 -0
- package/dist/chunk-55L7STYD.mjs +2 -0
- package/dist/chunk-55L7STYD.mjs.map +1 -0
- package/dist/chunk-575OK77P.mjs +2 -0
- package/dist/chunk-575OK77P.mjs.map +1 -0
- package/dist/chunk-6LDOG5RL.cjs +2 -0
- package/dist/chunk-6LDOG5RL.cjs.map +1 -0
- package/dist/chunk-7LNBSOVV.cjs +2 -0
- package/dist/chunk-7LNBSOVV.cjs.map +1 -0
- package/dist/chunk-7SMWQ6SN.mjs +2 -0
- package/dist/chunk-7SMWQ6SN.mjs.map +1 -0
- package/dist/chunk-7WRTK7RJ.mjs +2 -0
- package/dist/chunk-7WRTK7RJ.mjs.map +1 -0
- package/dist/chunk-A4UDYSB6.mjs +4 -0
- package/dist/chunk-A4UDYSB6.mjs.map +1 -0
- package/dist/chunk-AX2YQQFQ.mjs +2 -0
- package/dist/chunk-AX2YQQFQ.mjs.map +1 -0
- package/dist/chunk-C3FHGFLK.mjs +2 -0
- package/dist/chunk-C3FHGFLK.mjs.map +1 -0
- package/dist/chunk-C6ZGUO4H.cjs +2 -0
- package/dist/chunk-C6ZGUO4H.cjs.map +1 -0
- package/dist/chunk-CYKCYPFR.cjs +2 -0
- package/dist/chunk-CYKCYPFR.cjs.map +1 -0
- package/dist/chunk-ECRMUMTA.mjs +2 -0
- package/dist/chunk-ECRMUMTA.mjs.map +1 -0
- package/dist/chunk-F4BKSBEM.mjs +2 -0
- package/dist/chunk-F4BKSBEM.mjs.map +1 -0
- package/dist/chunk-FCWDGE62.cjs +2 -0
- package/dist/chunk-FCWDGE62.cjs.map +1 -0
- package/dist/chunk-FL2N3XHK.cjs +2 -0
- package/dist/chunk-FL2N3XHK.cjs.map +1 -0
- package/dist/chunk-MUCEYO3E.cjs +4 -0
- package/dist/chunk-MUCEYO3E.cjs.map +1 -0
- package/dist/chunk-NAXAZJJY.mjs +2 -0
- package/dist/chunk-NAXAZJJY.mjs.map +1 -0
- package/dist/chunk-OGJMSGB2.mjs +2 -0
- package/dist/chunk-OGJMSGB2.mjs.map +1 -0
- package/dist/chunk-OIYXOKTT.cjs +2 -0
- package/dist/chunk-OIYXOKTT.cjs.map +1 -0
- package/dist/chunk-P2Q7CMUD.cjs +2 -0
- package/dist/chunk-P2Q7CMUD.cjs.map +1 -0
- package/dist/chunk-PKXAW6MO.cjs +2 -0
- package/dist/chunk-PKXAW6MO.cjs.map +1 -0
- package/dist/chunk-Q3SCM6WL.mjs +2 -0
- package/dist/chunk-Q3SCM6WL.mjs.map +1 -0
- package/dist/chunk-SWMJQOH6.cjs +2 -0
- package/dist/chunk-SWMJQOH6.cjs.map +1 -0
- package/dist/chunk-TEBJWAVU.mjs +2 -0
- package/dist/chunk-TEBJWAVU.mjs.map +1 -0
- package/dist/chunk-THATXCJK.mjs +2 -0
- package/dist/chunk-THATXCJK.mjs.map +1 -0
- package/dist/chunk-VP7XUOSI.cjs +2 -0
- package/dist/chunk-VP7XUOSI.cjs.map +1 -0
- package/dist/chunk-VXL2ZZ4X.cjs +2 -0
- package/dist/chunk-VXL2ZZ4X.cjs.map +1 -0
- package/dist/chunk-WRFDB3QJ.cjs +2 -0
- package/dist/chunk-WRFDB3QJ.cjs.map +1 -0
- package/dist/chunk-XNJLSA6P.cjs +2 -0
- package/dist/chunk-XNJLSA6P.cjs.map +1 -0
- package/dist/chunk-YXLFOEZN.mjs +2 -0
- package/dist/chunk-YXLFOEZN.mjs.map +1 -0
- package/dist/chunk-YZV5LKIP.cjs +2 -0
- package/dist/chunk-YZV5LKIP.cjs.map +1 -0
- package/dist/contexts/exports.cjs +2 -0
- package/dist/contexts/exports.cjs.map +1 -0
- package/dist/contexts/{index.d.cts → exports.d.cts} +10 -27
- package/dist/contexts/{index.d.ts → exports.d.ts} +10 -27
- package/dist/contexts/exports.mjs +2 -0
- package/dist/contexts/exports.mjs.map +1 -0
- package/dist/{defaultFlags-V-tJs2K8.d.cts → defaultFlags-d0kPbT0i.d.cts} +1 -1
- package/dist/{defaultFlags-V-tJs2K8.d.ts → defaultFlags-d0kPbT0i.d.ts} +1 -1
- package/dist/dex-C_BB0b0O.d.cts +37 -0
- package/dist/dex-C_BB0b0O.d.ts +37 -0
- package/dist/enum/exports.cjs +2 -0
- package/dist/enum/exports.cjs.map +1 -0
- package/dist/enum/exports.d.cts +23 -0
- package/dist/enum/exports.d.ts +23 -0
- package/dist/enum/exports.mjs +2 -0
- package/dist/enum/exports.mjs.map +1 -0
- package/dist/errors/exports.cjs +2 -0
- package/dist/errors/exports.cjs.map +1 -0
- package/dist/errors/exports.d.cts +408 -0
- package/dist/errors/exports.d.ts +408 -0
- package/dist/errors/exports.mjs +2 -0
- package/dist/{getValidatorQueuedOperatorAddress-Ne2zoiiV.d.ts → getValidatorQueuedOperatorAddress-Dstyaomr.d.cts} +125 -15
- package/dist/{getValidatorQueuedOperatorAddress-9xY2RUGe.d.cts → getValidatorQueuedOperatorAddress-RW4OMcD1.d.ts} +125 -15
- package/dist/global.d-CN6l2b9E.d.cts +473 -0
- package/dist/global.d-wYu8G8IQ.d.ts +473 -0
- package/dist/honey-CYm0RWf4.d.cts +14 -0
- package/dist/honey-CYm0RWf4.d.ts +14 -0
- package/dist/hooks/exports.cjs +4 -0
- package/dist/hooks/exports.cjs.map +1 -0
- package/dist/hooks/{index.d.cts → exports.d.cts} +218 -176
- package/dist/hooks/{index.d.ts → exports.d.ts} +218 -176
- package/dist/hooks/exports.mjs +4 -0
- package/dist/hooks/exports.mjs.map +1 -0
- package/dist/{txnEnum-BQKDfaeH.d.cts → txnEnum-BlBYhNRl.d.cts} +75 -1
- package/dist/{txnEnum-BQKDfaeH.d.ts → txnEnum-BlBYhNRl.d.ts} +75 -1
- package/dist/types/exports.cjs +1 -0
- package/dist/types/exports.cjs.map +1 -0
- package/dist/types/exports.d.cts +57 -0
- package/dist/types/exports.d.ts +57 -0
- package/dist/types/exports.mjs +1 -0
- package/dist/{useHoneySwapState-C-9BV4VB.d.cts → useHoneySwapState-B-vmIP1b.d.cts} +1 -1
- package/dist/{useHoneySwapState-CUY5Sm1b.d.ts → useHoneySwapState-D1DKG_Of.d.ts} +1 -1
- package/dist/utils/exports.cjs +2 -0
- package/dist/utils/exports.cjs.map +1 -0
- package/dist/utils/{index.d.cts → exports.d.cts} +83 -20
- package/dist/utils/{index.d.ts → exports.d.ts} +83 -20
- package/dist/utils/exports.mjs +2 -0
- package/dist/utils/exports.mjs.map +1 -0
- package/package.json +19 -20
- package/src/abi/{index.ts → exports.ts} +3 -0
- package/src/abi/pol/LSTStakerVault.ts +2032 -0
- package/src/abi/utils/openChainErrors.ts +71 -30
- package/src/abi/utils/thirdwebMinimalAccount.ts +616 -0
- package/src/actions/clients/BeraApolloClient.ts +8 -6
- package/src/actions/dex/__tests__/aggregators.unit.test.ts +2 -5
- package/src/actions/dex/aggregators/base.ts +74 -16
- package/src/actions/dex/aggregators/bex.ts +54 -74
- package/src/actions/dex/aggregators/bgt.ts +31 -8
- package/src/actions/dex/aggregators/{enso.ts → enso/enso.ts} +18 -14
- package/src/actions/dex/aggregators/enso/ensoErc4626.debug.test.ts +37 -0
- package/src/actions/dex/aggregators/enso/ensoErc4626.ts +176 -0
- package/src/actions/dex/aggregators/erc4626.ts +122 -0
- package/src/actions/dex/aggregators/fly.ts +59 -53
- package/src/actions/dex/aggregators/haiku.ts +52 -54
- package/src/actions/dex/aggregators/honey.ts +54 -45
- package/src/actions/dex/aggregators/kyberswap.ts +41 -39
- package/src/actions/dex/aggregators/oogabooga.ts +47 -46
- package/src/actions/dex/aggregators/openOcean.ts +51 -46
- package/src/actions/dex/aggregators/wbera.ts +54 -42
- package/src/actions/dex/b-sdk.ts +5 -2
- package/src/actions/dex/getIsTokenExploited.ts +2 -2
- package/src/actions/enso/{zap.ts → getEnsoSwapBundle.ts} +4 -5
- package/src/actions/enso/getEnsoUserTokensWithBalances.debug.test.ts +73 -0
- package/src/actions/enso/{getEnsoUserToken.ts → getEnsoUserTokensWithBalances.ts} +42 -30
- package/src/actions/enso/util.ts +1 -1
- package/src/actions/{index.ts → exports.ts} +5 -0
- package/src/actions/governance/__tests__/checkProposalField.unit.test.ts +1 -1
- package/src/actions/governance/__tests__/getQuorum.integration.test.ts +1 -1
- package/src/actions/governance/checkProposalField.ts +1 -1
- package/src/actions/governance/computeActualStatus.ts +1 -1
- package/src/actions/governance/getBodyErrors.ts +1 -1
- package/src/actions/governance/getDecodedFunctionData.ts +1 -4
- package/src/actions/governance/getProposalDetails.ts +2 -2
- package/src/actions/governance/getProposalFromTx.ts +1 -2
- package/src/actions/governance/getProposalParams.ts +7 -8
- package/src/actions/governance/getQuorum.ts +1 -2
- package/src/actions/honey/getCollateralWeights.ts +1 -1
- package/src/actions/honey/getHoneyCollaterals.ts +1 -0
- package/src/actions/honey/getHoneyVaultsBalance.ts +51 -55
- package/src/actions/honey/getSwapPayload.ts +37 -35
- package/src/actions/honey/tests/pyth.integration.test.ts +0 -1
- package/src/actions/pol/__tests__/getAllValidators.integration.test.ts +1 -1
- package/src/actions/pol/getEarnedStakedBeraVault.ts +31 -0
- package/src/actions/pol/getGlobalData.ts +14 -13
- package/src/actions/pol/getLSTStakeConfig.ts +67 -0
- package/src/actions/pol/getMarkets.ts +1 -1
- package/src/actions/pol/getRewardProofsByValidator.ts +1 -1
- package/src/actions/pol/getRewardVaultIncentives.ts +3 -5
- package/src/actions/pol/getRewardVaults.ts +2 -3
- package/src/actions/pol/getSWBeraVaultMetadata.ts +7 -5
- package/src/actions/pol/getSWBeraWithdrawal.ts +41 -27
- package/src/actions/pol/getStakeWithdrawalCooldown.ts +5 -7
- package/src/actions/pol/getStakingDailyAssets.ts +24 -0
- package/src/actions/pol/getStakingTokenInformation.ts +3 -4
- package/src/actions/pol/getTotalStakedAmount.ts +47 -0
- package/src/actions/pol/getUserClaimableIncentives.ts +1 -1
- package/src/actions/pol/getUserVaults.ts +8 -6
- package/src/actions/pol/getUserVaultsBalance.ts +4 -16
- package/src/actions/prices/getTokenCurrentPrices.ts +8 -3
- package/src/actions/tokens/getAllowances.ts +68 -41
- package/src/actions/tokens/getTokenInformation.ts +4 -1
- package/src/actions/tokens/getTokens.ts +1 -1
- package/src/actions/tokens/getUnderlyingToken.ts +53 -0
- package/src/actions/tokens/getWalletBalances.integration.test.ts +53 -14
- package/src/actions/tokens/getWalletBalances.ts +69 -43
- package/src/actions/transactions/beraWriteContract.integration.test.ts +18 -6
- package/src/actions/transactions/beraWriteContract.ts +3 -3
- package/src/actions/validators/getUserActiveValidators.ts +2 -3
- package/src/actions/validators/getUserBoostsOnValidator.ts +2 -3
- package/src/contexts/BeraFlags/defaultFlags.ts +4 -0
- package/src/contexts/SwrFallback.tsx +13 -3
- package/src/contexts/TokensProvider.tsx +35 -8
- package/src/contexts/block-time-provider.tsx +1 -1
- package/src/contexts/{index.ts → exports.ts} +0 -1
- package/src/data/contracts.ts +17 -2
- package/src/enum/contracts.ts +13 -0
- package/src/enum/dex.ts +29 -0
- package/src/enum/{index.ts → exports.ts} +3 -0
- package/src/enum/governance.ts +61 -0
- package/src/enum/honey.ts +12 -0
- package/src/enum/txnEnum.ts +1 -0
- package/src/errors/BeraError.ts +61 -13
- package/src/errors/BeraMonitoring.ts +66 -0
- package/src/errors/BeraTracing.ts +79 -0
- package/src/errors/BeraTracing.unit.test.ts +198 -0
- package/src/errors/RequestError.ts +29 -3
- package/src/errors/assert.ts +4 -2
- package/src/errors/assert.unit.test.ts +6 -2
- package/src/errors/errorMap.ts +19 -8
- package/src/errors/{index.ts → exports.ts} +7 -0
- package/src/errors/getErrorMessage.ts +67 -9
- package/src/errors/getRevertReason.integration.test.ts +18 -6
- package/src/errors/getRevertReason.ts +41 -2
- package/src/errors/initBeraError.ts +52 -7
- package/src/errors/parseViemError.ts +114 -27
- package/src/errors/severity.ts +12 -0
- package/src/hooks/bend/useGetConvertToAssets.ts +3 -2
- package/src/hooks/dex/useAggregatorsQuotes.ts +126 -365
- package/src/hooks/dex/useAllUserPools.ts +1 -1
- package/src/hooks/dex/useApiPool.ts +1 -1
- package/src/hooks/dex/useCreatePool.ts +6 -5
- package/src/hooks/dex/useExploitedTokens.ts +1 -1
- package/src/hooks/dex/useLiquidityMismatch.ts +2 -5
- package/src/hooks/dex/useLpPosition.ts +21 -20
- package/src/hooks/dex/useMultipleTokenApprovalsWithSlippage.ts +40 -29
- package/src/hooks/dex/usePollPoolCreationRelayerApproval.ts +1 -1
- package/src/hooks/dex/usePoolEvents.ts +1 -1
- package/src/hooks/dex/usePools.ts +1 -1
- package/src/hooks/dex/usePriceImpact.ts +40 -0
- package/src/hooks/dex/useSingleAggregatorQuote.ts +350 -0
- package/src/hooks/enso/useBendZapSupply.ts +216 -0
- package/src/hooks/enso/useEnsoSwapBundle.ts +107 -0
- package/src/hooks/enso/useEnsoUserTokensWithBalances.ts +43 -0
- package/src/hooks/enso/useZapStakeBera.ts +113 -0
- package/src/hooks/{index.ts → exports.ts} +17 -10
- package/src/hooks/governance/useCreateProposal.ts +8 -8
- package/src/hooks/governance/usePollAllProposals.ts +1 -1
- package/src/hooks/governance/usePollProposal.ts +1 -1
- package/src/hooks/governance/usePollProposalThreshold.ts +1 -1
- package/src/hooks/governance/usePollUserDelegates.ts +1 -1
- package/src/hooks/governance/useProposalState.ts +2 -2
- package/src/hooks/honey/useCappedGlobally.ts +2 -1
- package/src/hooks/honey/useCappedRelatively.ts +1 -1
- package/src/hooks/honey/useCollateralWeights.ts +2 -1
- package/src/hooks/honey/useHoneyAlerts.ts +11 -11
- package/src/hooks/honey/useHoneyBalances.ts +7 -3
- package/src/hooks/honey/useHoneyGlobalData.ts +2 -1
- package/src/hooks/honey/useHoneySwapState.ts +2 -1
- package/src/hooks/honey/useHoneyVaultsBalance.ts +1 -1
- package/src/hooks/honey/useIsBadCollateralAsset.ts +2 -1
- package/src/hooks/honey/useIsBasketModeEnabled.ts +1 -1
- package/src/hooks/honey/usePythLatestPrices.ts +1 -1
- package/src/hooks/pol/useOnChainRewardVault.ts +3 -2
- package/src/hooks/pol/usePollGlobalData.ts +1 -1
- package/src/hooks/pol/usePollMarkets.ts +1 -1
- package/src/hooks/pol/useQueuedBeraUnlock.ts +17 -15
- package/src/hooks/pol/useRewardTokenToBeraRate.ts +6 -3
- package/src/hooks/pol/useRewardVault.ts +1 -1
- package/src/hooks/pol/useRewardVaults.ts +1 -1
- package/src/hooks/pol/useSWBeraVaultMetadata.ts +35 -0
- package/src/hooks/pol/useStakedAPR.ts +38 -0
- package/src/hooks/pol/useStakedData.ts +117 -0
- package/src/hooks/pol/useStakedSnapshots.ts +52 -0
- package/src/hooks/pol/useTotalStakedAmount.ts +30 -0
- package/src/hooks/pol/useUserVaultInfo.ts +1 -1
- package/src/hooks/pol/useVaultValidators.ts +1 -1
- package/src/hooks/tokens/useMultipleTokenInformation.ts +15 -6
- package/src/hooks/tokens/usePollAllowances.ts +15 -19
- package/src/hooks/tokens/usePollBalance.ts +8 -4
- package/src/hooks/tokens/usePollWalletBalances.ts +14 -11
- package/src/hooks/tokens/useStakingTokenInformation.ts +2 -1
- package/src/hooks/tokens/useTokenCurrentPrice.ts +4 -2
- package/src/hooks/tokens/useTokenCurrentPrices.ts +92 -13
- package/src/hooks/tokens/useTokenInformation.ts +11 -6
- package/src/hooks/tokens/useTokenPrice.ts +21 -0
- package/src/hooks/tokens/useTokenPrices.ts +133 -0
- package/src/hooks/tokens/useTokens.ts +1 -0
- package/src/hooks/tokens/useUnderlyingAsset.ts +23 -0
- package/src/hooks/useContractWrite/useBeraContractWrite.ts +2 -1
- package/src/hooks/validators/useAllValidators.ts +1 -1
- package/src/hooks/validators/useApiValidator.ts +1 -1
- package/src/hooks/validators/useDailyValidatorBlockStats.ts +1 -1
- package/src/hooks/validators/useManagedValidatorByAccount.ts +1 -1
- package/src/hooks/validators/useManagedValidatorRole.ts +1 -1
- package/src/hooks/validators/useOnChainValidator.ts +1 -1
- package/src/hooks/validators/useStakingPoolBatch.ts +1 -1
- package/src/hooks/validators/useUserActiveValidators.ts +1 -1
- package/src/hooks/validators/useUserBoostsOnValidator.ts +1 -1
- package/src/hooks/validators/useUserClaimableIncentives.ts +8 -8
- package/src/hooks/validators/useValidator.ts +1 -1
- package/src/hooks/validators/useValidatorAnalytics.ts +1 -1
- package/src/hooks/validators/useValidatorCommission.ts +1 -1
- package/src/hooks/validators/useValidatorQueuedCommission.ts +1 -1
- package/src/hooks/validators/useValidatorQueuedOperatorAddress.ts +1 -1
- package/src/hooks/validators/useValidatorQueuedRewardAllocation.ts +1 -1
- package/src/hooks/validators/useValidatorRewardAllocation.ts +1 -1
- package/src/types/{dex.ts → dex.d.ts} +96 -67
- package/src/types/{enso.ts → enso.d.ts} +1 -1
- package/src/types/exports.ts +8 -0
- package/src/types/{global.ts → global.d.ts} +1 -30
- package/src/types/{governance.ts → governance.d.ts} +2 -64
- package/src/types/{honeySwap.ts → honeySwap.d.ts} +1 -13
- package/src/types/{pol.ts → pol.d.ts} +12 -1
- package/src/types/staking.d.ts +22 -0
- package/src/utils/createEmitter.ts +122 -0
- package/src/utils/createEmitter.unit.test.ts +149 -0
- package/src/utils/{index.ts → exports.ts} +3 -2
- package/src/utils/filter.ts +34 -0
- package/src/utils/formatNumber.ts +1 -1
- package/src/utils/formatNumber.unit.test.ts +2 -1
- package/src/utils/formatTokenList.ts +4 -10
- package/src/utils/getHoneySwapMessage.test.ts +1 -2
- package/src/utils/getServerSideClient.ts +4 -5
- package/src/utils/isDifferenceExceedingThreshold.ts +1 -1
- package/src/utils/layerZeroScan.ts +122 -0
- package/src/utils/math.ts +1 -1
- package/src/utils/parseWhiskToken.ts +15 -0
- package/src/utils/poolNamings.ts +1 -1
- package/src/utils/tokens.ts +23 -7
- package/dist/HoneyConfigProvider-6PXZJMSU.d.cts +0 -562
- package/dist/HoneyConfigProvider-CwDFrt02.d.ts +0 -562
- package/dist/abi/index.cjs +0 -2
- package/dist/abi/index.cjs.map +0 -1
- package/dist/abi/index.mjs +0 -2
- package/dist/actions/index.cjs +0 -2
- package/dist/actions/index.cjs.map +0 -1
- package/dist/actions/index.mjs +0 -2
- package/dist/aggregatorsRouter-Cny4B_MB.d.cts +0 -593
- package/dist/aggregatorsRouter-Cny4B_MB.d.ts +0 -593
- package/dist/chunk-22MQVFHP.cjs +0 -2
- package/dist/chunk-22MQVFHP.cjs.map +0 -1
- package/dist/chunk-3TKSVFZ3.mjs +0 -2
- package/dist/chunk-3TKSVFZ3.mjs.map +0 -1
- package/dist/chunk-6VF3RF53.cjs +0 -3
- package/dist/chunk-6VF3RF53.cjs.map +0 -1
- package/dist/chunk-6W22TFYA.mjs +0 -2
- package/dist/chunk-6W22TFYA.mjs.map +0 -1
- package/dist/chunk-AMRJ4B36.mjs +0 -2
- package/dist/chunk-AMRJ4B36.mjs.map +0 -1
- package/dist/chunk-DS2ZDVKU.mjs +0 -2
- package/dist/chunk-DS2ZDVKU.mjs.map +0 -1
- package/dist/chunk-ED43NYSE.cjs +0 -2
- package/dist/chunk-ED43NYSE.cjs.map +0 -1
- package/dist/chunk-EU4WFADK.cjs +0 -2
- package/dist/chunk-EU4WFADK.cjs.map +0 -1
- package/dist/chunk-HCTFDGXL.mjs +0 -2
- package/dist/chunk-HCTFDGXL.mjs.map +0 -1
- package/dist/chunk-IOSYBHKU.mjs +0 -2
- package/dist/chunk-IOSYBHKU.mjs.map +0 -1
- package/dist/chunk-JMKLDDKY.cjs +0 -2
- package/dist/chunk-JMKLDDKY.cjs.map +0 -1
- package/dist/chunk-KMKUXP2S.mjs +0 -3
- package/dist/chunk-KMKUXP2S.mjs.map +0 -1
- package/dist/chunk-OJXJ6CZ4.mjs +0 -4
- package/dist/chunk-OJXJ6CZ4.mjs.map +0 -1
- package/dist/chunk-PHIOKO3A.mjs +0 -2
- package/dist/chunk-PHIOKO3A.mjs.map +0 -1
- package/dist/chunk-QCK474XD.cjs +0 -2
- package/dist/chunk-QCK474XD.cjs.map +0 -1
- package/dist/chunk-REDXXUK7.cjs +0 -2
- package/dist/chunk-REDXXUK7.cjs.map +0 -1
- package/dist/chunk-S74ZMG2G.cjs +0 -2
- package/dist/chunk-S74ZMG2G.cjs.map +0 -1
- package/dist/chunk-TOAXF4YW.cjs +0 -2
- package/dist/chunk-TOAXF4YW.cjs.map +0 -1
- package/dist/chunk-UZ5CB33M.cjs +0 -2
- package/dist/chunk-UZ5CB33M.cjs.map +0 -1
- package/dist/chunk-VYWYJR63.mjs +0 -2
- package/dist/chunk-VYWYJR63.mjs.map +0 -1
- package/dist/chunk-XFPTQMAK.cjs +0 -4
- package/dist/chunk-XFPTQMAK.cjs.map +0 -1
- package/dist/chunk-YK4NINF5.mjs +0 -2
- package/dist/chunk-YK4NINF5.mjs.map +0 -1
- package/dist/contexts/index.cjs +0 -2
- package/dist/contexts/index.cjs.map +0 -1
- package/dist/contexts/index.mjs +0 -2
- package/dist/contexts/index.mjs.map +0 -1
- package/dist/enum/index.cjs +0 -2
- package/dist/enum/index.cjs.map +0 -1
- package/dist/enum/index.d.cts +0 -31
- package/dist/enum/index.d.ts +0 -31
- package/dist/enum/index.mjs +0 -2
- package/dist/enum/index.mjs.map +0 -1
- package/dist/errors/index.cjs +0 -2
- package/dist/errors/index.cjs.map +0 -1
- package/dist/errors/index.d.cts +0 -204
- package/dist/errors/index.d.ts +0 -204
- package/dist/errors/index.mjs +0 -2
- package/dist/errors/index.mjs.map +0 -1
- package/dist/hooks/index.cjs +0 -4
- package/dist/hooks/index.cjs.map +0 -1
- package/dist/hooks/index.mjs +0 -4
- package/dist/hooks/index.mjs.map +0 -1
- package/dist/staking-F9Nx9TKD.d.ts +0 -246
- package/dist/staking-f4BpYH7l.d.cts +0 -246
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.d.cts +0 -56
- package/dist/types/index.d.ts +0 -56
- package/dist/types/index.mjs +0 -2
- package/dist/types/index.mjs.map +0 -1
- package/dist/utils/index.cjs +0 -2
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.mjs +0 -2
- package/dist/utils/index.mjs.map +0 -1
- package/src/actions/dex/getTransactionCount.ts +0 -29
- package/src/actions/enso/bend.ts +0 -143
- package/src/actions/enso/getEnsoUserToken.debug.test.ts +0 -57
- package/src/contexts/berajsProvider/context.tsx +0 -49
- package/src/contexts/berajsProvider/index.ts +0 -2
- package/src/contexts/berajsProvider/useBeraJs.ts +0 -18
- package/src/hooks/dex/usePollVaultIsPaused.ts +0 -30
- package/src/hooks/enso/useBendTransactionRequests.ts +0 -247
- package/src/hooks/enso/useEnsoZap.ts +0 -166
- package/src/hooks/enso/useZapTransactionRequests.ts +0 -81
- package/src/hooks/pol/useEarnedStakedBeraVault.ts +0 -59
- package/src/hooks/pol/useStakedBeraSnapshots.ts +0 -27
- package/src/hooks/transactions/TransactionStoreContext.tsx +0 -59
- package/src/hooks/transactions/transactionStore.ts +0 -275
- package/src/hooks/transactions/transactionStore.unit.test.ts +0 -508
- package/src/hooks/transactions/useAddRecentTransaction.ts +0 -29
- package/src/hooks/transactions/useRecentTransactions.ts +0 -27
- package/src/hooks/validators/validatorRoleManager.ts +0 -0
- package/src/types/index.ts +0 -8
- package/src/types/staking.ts +0 -7
- package/src/utils/formatAggregatorsQuotes.ts +0 -57
- package/src/utils/formatAggregatorsQuotes.unit.test.ts +0 -191
- package/src/utils/sentryBeforeSend.ts +0 -52
- /package/dist/{abi/index.mjs.map → errors/exports.mjs.map} +0 -0
- /package/dist/{actions/index.mjs.map → types/exports.mjs.map} +0 -0
- /package/src/actions/dex/{__tests__ → aggregators}/haiku.integration.test.ts +0 -0
- /package/src/types/{bribe-boost.ts → bribe-boost.d.ts} +0 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { Address, PublicClient, Abi, Hex } from 'viem';
|
|
4
|
+
import { Token as Token$1 } from '@berachain/graphql/pol/api';
|
|
5
|
+
import { SwapKind } from '@berachain-foundation/berancer-sdk';
|
|
6
|
+
import { H as HoneySwapAction } from './honey-CYm0RWf4.cjs';
|
|
7
|
+
|
|
8
|
+
interface CollateralRates {
|
|
9
|
+
mintFee: number;
|
|
10
|
+
redeemFee: number;
|
|
11
|
+
}
|
|
12
|
+
interface HoneyFeeMap {
|
|
13
|
+
single: Record<Address, CollateralRates>;
|
|
14
|
+
basket: CollateralRates;
|
|
15
|
+
}
|
|
16
|
+
interface CollateralRatesArgs extends BeraJS.BaseFunctionArgs {
|
|
17
|
+
client: PublicClient;
|
|
18
|
+
collateralList: Token$1[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Fetches the mint and redeem rates for all collateral tokens and calculates the weighted basket rates
|
|
22
|
+
* @param {Object} params - The parameters object
|
|
23
|
+
* @param {PublicClient} params.client - The Viem public client instance
|
|
24
|
+
* @param {Address[]} params.collateralList - Array of collateral token addresses
|
|
25
|
+
* @returns {Promise<HoneyFeeMap | undefined>} Object containing individual collateral rates and weighted basket rates,
|
|
26
|
+
* or undefined if the operation fails
|
|
27
|
+
*/
|
|
28
|
+
declare function getHoneyFees({ client, collateralList, ...args }: CollateralRatesArgs): Promise<HoneyFeeMap>;
|
|
29
|
+
|
|
30
|
+
type MinimalERC20 = {
|
|
31
|
+
address: Address;
|
|
32
|
+
decimals: number;
|
|
33
|
+
symbol: string;
|
|
34
|
+
name: string;
|
|
35
|
+
chainId: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type TokenWithMetadata = MinimalERC20 & {
|
|
39
|
+
tags?: string[];
|
|
40
|
+
base64?: string;
|
|
41
|
+
logoURI?: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type Token = TokenWithMetadata & {
|
|
45
|
+
totalSupply?: string;
|
|
46
|
+
weight?: number | string | null;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
interface TokenPriceInfo {
|
|
50
|
+
price: number;
|
|
51
|
+
updatedAt: number;
|
|
52
|
+
chainId: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type TokenCurrentPriceMap = Record<
|
|
56
|
+
Lowercase<Address> | string,
|
|
57
|
+
TokenPriceInfo | undefined
|
|
58
|
+
>;
|
|
59
|
+
|
|
60
|
+
interface TokenWithAmount extends Token {
|
|
61
|
+
amount: string;
|
|
62
|
+
exceeding?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface TokenWithPrice extends Token {
|
|
66
|
+
price: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface BalanceToken extends Token {
|
|
70
|
+
balance: {
|
|
71
|
+
/**
|
|
72
|
+
* This is the string representation of the balance in wei.
|
|
73
|
+
*
|
|
74
|
+
* It can be safely parsed to a bigint, but we're returning it as a string to avoid serialization issues.
|
|
75
|
+
*
|
|
76
|
+
* @example "1200000000000000000"
|
|
77
|
+
*/
|
|
78
|
+
raw: string;
|
|
79
|
+
/**
|
|
80
|
+
* This is the formatted representation of the balance in the token's decimals.
|
|
81
|
+
*
|
|
82
|
+
* @example "1.2"
|
|
83
|
+
*/
|
|
84
|
+
formatted: string;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Price of the token in USD.
|
|
88
|
+
*/
|
|
89
|
+
price?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Balance value in USD.
|
|
92
|
+
* Calculated as balance * price.
|
|
93
|
+
*/
|
|
94
|
+
usdValue?: number;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface SwapRequest {
|
|
98
|
+
tokenIn: Address;
|
|
99
|
+
tokenOut: Address;
|
|
100
|
+
tokenInDecimals: number;
|
|
101
|
+
tokenOutDecimals: number;
|
|
102
|
+
amount: string;
|
|
103
|
+
wberaIsBera: boolean;
|
|
104
|
+
swapKind: SwapKind;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Object with properties to check the allowance of a token.
|
|
109
|
+
*/
|
|
110
|
+
interface AllowanceQueryItem {
|
|
111
|
+
token: MinimalERC20;
|
|
112
|
+
/**
|
|
113
|
+
* The amount of the token to approve.
|
|
114
|
+
*/
|
|
115
|
+
amount: {
|
|
116
|
+
raw: string;
|
|
117
|
+
formatted: string;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The address to approve the tokens to.
|
|
121
|
+
*/
|
|
122
|
+
spender: Address;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface AllowanceToken extends AllowanceQueryItem {
|
|
126
|
+
/**
|
|
127
|
+
* The current allowance of the token.
|
|
128
|
+
*/
|
|
129
|
+
allowance: {
|
|
130
|
+
raw: string;
|
|
131
|
+
formatted: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Whether the allowance is needed to perform the transaction.
|
|
135
|
+
*/
|
|
136
|
+
needsApproval: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface IUserPosition {
|
|
140
|
+
lpBalance?: BalanceToken;
|
|
141
|
+
tokenBalances?: Omit<BalanceToken, "chainId">[];
|
|
142
|
+
userSharePercentage?: number;
|
|
143
|
+
stakedBalance?: Pick<BalanceToken, "address" | "balance" | "usdValue">;
|
|
144
|
+
/**
|
|
145
|
+
* Just a utility to detect if there is a price for the LP token.
|
|
146
|
+
*/
|
|
147
|
+
lpTokenPrice?: number;
|
|
148
|
+
}
|
|
149
|
+
type BexStatus = {
|
|
150
|
+
protocol: {
|
|
151
|
+
/**
|
|
152
|
+
* If the whole protocol is paused (i.e. ~the~ vault contract) disable any functionality except withdrawing proportional
|
|
153
|
+
* liquidity (provided that pool's recovery mode is enabled). Specifically we disable swaps and pool creation.
|
|
154
|
+
*/
|
|
155
|
+
isPaused: boolean;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Pool is undefined if pool status is still loading if no pool address was provided.
|
|
159
|
+
*/
|
|
160
|
+
pool?: {
|
|
161
|
+
/**
|
|
162
|
+
* Pool should be put into recovery mode if tx are reverting on-chain to do with fee computation or pool exits.
|
|
163
|
+
* It reduces the computation needed to withdraw liquidity and does not charge protocol fees on exits while enabled.
|
|
164
|
+
*
|
|
165
|
+
* NOTE: that you can potentially still do regular exits/joins/etc in recovery mode, but if the flag is true will only
|
|
166
|
+
* present the safe exit option to the user in FE.
|
|
167
|
+
*/
|
|
168
|
+
isInRecoveryMode: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* If the pool is paused you cannot do anything unless you also enable recovery mode (then you can withdraw safely).
|
|
171
|
+
*/
|
|
172
|
+
isPaused: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Disable withdrawals for a pool due to a combination of pool and vault statuses.
|
|
175
|
+
*/
|
|
176
|
+
disablePoolWithdrawals: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Disable deposits for a pool due to a combination of pool and vault statuses.
|
|
179
|
+
*/
|
|
180
|
+
disablePoolDeposits: boolean;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
type IAggregatorArgs = {
|
|
185
|
+
tokenIn: MinimalERC20;
|
|
186
|
+
tokenOut: MinimalERC20;
|
|
187
|
+
/**
|
|
188
|
+
* Amount of tokenIn to swap in wei.
|
|
189
|
+
*/
|
|
190
|
+
amount: string;
|
|
191
|
+
slippage: number;
|
|
192
|
+
account?: Address;
|
|
193
|
+
publicClient?: PublicClient;
|
|
194
|
+
aggregatorsFeeBps?: number;
|
|
195
|
+
proxyAggregatorsThroughVercel?: boolean;
|
|
196
|
+
referrer?: SwapReferrer;
|
|
197
|
+
/**
|
|
198
|
+
* If provided, the aggregator will swap to the underlying token and deposit it into the vault (tokenOut).
|
|
199
|
+
*
|
|
200
|
+
* The aggregator won't check if the tokenOut is an ERC4626 vault, so this needs to be asserted by the caller.
|
|
201
|
+
* This is used for Staked BERA/iBera and Bend Vaults.
|
|
202
|
+
*/
|
|
203
|
+
underlyingToken?: MinimalERC20 | null;
|
|
204
|
+
/**
|
|
205
|
+
* If provided, the aggregator will stake into the reward vault after the swap.
|
|
206
|
+
*/
|
|
207
|
+
rewardVault?: Address;
|
|
208
|
+
/**
|
|
209
|
+
* Only needed by the honey mint/redeem aggregator.
|
|
210
|
+
*/
|
|
211
|
+
honeyNativeState?: Pick<HoneyConfigContextReturn, "collateralList">;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
type Calldata = {
|
|
215
|
+
params?: readonly unknown[] | undefined;
|
|
216
|
+
functionName?: string;
|
|
217
|
+
abi?: Abi;
|
|
218
|
+
address: Address;
|
|
219
|
+
data?: Hex;
|
|
220
|
+
value: bigint;
|
|
221
|
+
gasLimit?: bigint;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
type IRawAggregatorQuote = {
|
|
225
|
+
amountOut: string;
|
|
226
|
+
amountIn: string;
|
|
227
|
+
name: Aggregators;
|
|
228
|
+
allowanceRequirements: AllowanceQueryItem[];
|
|
229
|
+
/**
|
|
230
|
+
* True if it's bera wrap/unwrap or bgt redeem.
|
|
231
|
+
*/
|
|
232
|
+
isNativeSwap?: boolean;
|
|
233
|
+
priceImpactPercentage?: number | null;
|
|
234
|
+
swapFeeBps: number;
|
|
235
|
+
getCalldata?: ({ account }: { account: Address }) => Calldata;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
type IAggregatorQuote =
|
|
239
|
+
// no need to force to swapAndStake as type check is done on each getQuote
|
|
240
|
+
IRawAggregatorQuote & {
|
|
241
|
+
amountOut: string;
|
|
242
|
+
amountOutUsd: string;
|
|
243
|
+
amountIn: string;
|
|
244
|
+
amountInUsd: string;
|
|
245
|
+
priceImpactPercentage: number;
|
|
246
|
+
exchangeRate: number;
|
|
247
|
+
relativeLossPercentage: number;
|
|
248
|
+
isBest?: boolean;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Interface representing the latest Pyth price updates
|
|
253
|
+
* @interface PythLatestUpdates
|
|
254
|
+
* @property {`0x${string}`[]} calldata - Array of hex-encoded calldata for price updates
|
|
255
|
+
* @property {string[]} prices - Array of formatted price strings
|
|
256
|
+
*/
|
|
257
|
+
interface PythLatestUpdates {
|
|
258
|
+
calldata: `0x${string}`[];
|
|
259
|
+
prices: string[];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Fetches the latest price updates from Pyth Network's Hermes service
|
|
263
|
+
* @param {Object} params - The parameters object
|
|
264
|
+
* @param {string[]} params.priceFeedId - Array of Pyth price feed IDs to fetch updates for
|
|
265
|
+
* @returns {Promise<PythLatestUpdates>} Promise resolving to the latest price updates
|
|
266
|
+
* @example
|
|
267
|
+
* ```ts
|
|
268
|
+
* const updates = await getPythLatestPrices({
|
|
269
|
+
* priceFeedId: ["0x123...", "0x456..."]
|
|
270
|
+
* });
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
declare function getPythLatestPrices({ priceFeedId, }: {
|
|
274
|
+
priceFeedId: string[];
|
|
275
|
+
}): Promise<PythLatestUpdates>;
|
|
276
|
+
|
|
277
|
+
declare enum HoneyPreviewMethod {
|
|
278
|
+
Mint = "previewMintHoney",
|
|
279
|
+
MintWithPrice = "previewMintHoneyWithPrices",
|
|
280
|
+
RequiredCollateral = "previewMintCollaterals",
|
|
281
|
+
RequiredCollateralWithPrice = "previewMintCollateralsWithPrices",
|
|
282
|
+
Redeem = "previewRedeemCollaterals",
|
|
283
|
+
RedeemWithPrice = "previewRedeemCollateralsWithPrices",
|
|
284
|
+
HoneyToRedeem = "previewRedeemHoney",
|
|
285
|
+
HoneyToRedeemWithPrice = "previewRedeemHoneyWithPrices"
|
|
286
|
+
}
|
|
287
|
+
interface HoneyPreviewArgs extends BeraJS.BaseFunctionArgs {
|
|
288
|
+
client: PublicClient;
|
|
289
|
+
collateral: Token;
|
|
290
|
+
collateralList: TokenWithOrder[];
|
|
291
|
+
amount: string;
|
|
292
|
+
method: HoneyPreviewMethod;
|
|
293
|
+
latestPrices?: PythLatestUpdates;
|
|
294
|
+
isPythWrapperEnabled: boolean;
|
|
295
|
+
}
|
|
296
|
+
interface HoneyPreviewResult {
|
|
297
|
+
collaterals: Record<Address, bigint>;
|
|
298
|
+
honey: bigint;
|
|
299
|
+
}
|
|
300
|
+
interface HoneyPreviewReadResult {
|
|
301
|
+
collaterals: bigint[];
|
|
302
|
+
honey: bigint;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Calculates preview amounts for Honey protocol operations including minting and redeeming.
|
|
306
|
+
* This function handles different preview methods to calculate either the amount of Honey tokens
|
|
307
|
+
* that can be minted with given collateral or the amount of collateral needed to mint/redeem Honey tokens.
|
|
308
|
+
*
|
|
309
|
+
* @param {Object} params - The parameters for the preview calculation
|
|
310
|
+
* @param {PublicClient} params.client - The Viem public client for blockchain interaction
|
|
311
|
+
* @param {Token} params.collateral - The primary collateral token being used
|
|
312
|
+
* @param {Address[]} params.collateralList - List of all supported collateral tokens
|
|
313
|
+
* @param {string} params.amount - The amount to calculate preview for (in token units)
|
|
314
|
+
* @param {HoneyPreviewMethod} params.method - The type of preview calculation to perform
|
|
315
|
+
* @param {PythLatestUpdates | undefined} params.latestPrices - Optional latest price updates from Pyth oracle
|
|
316
|
+
*
|
|
317
|
+
* @returns {Promise<HoneyPreviewResult | undefined>} An object containing:
|
|
318
|
+
* - collaterals: Record mapping collateral token addresses to their respective amounts
|
|
319
|
+
* - honey: The amount of Honey tokens involved in the operation
|
|
320
|
+
*
|
|
321
|
+
* @throws {Error} If there's an error during the contract interaction or calculation
|
|
322
|
+
*/
|
|
323
|
+
declare function getHoneyPreview({ client, collateral, collateralList, amount, method, latestPrices, isPythWrapperEnabled, ...baseArgs }: HoneyPreviewArgs): Promise<HoneyPreviewResult | undefined>;
|
|
324
|
+
|
|
325
|
+
type PythPriceFeedMap = Record<Address, Hex>;
|
|
326
|
+
|
|
327
|
+
type HoneySwapActions =
|
|
328
|
+
| { type: HoneySwapAction.RESET_AMOUNTS }
|
|
329
|
+
| { type: HoneySwapAction.ACTION_TYPE_CHANGE; value: "mint" | "redeem" }
|
|
330
|
+
| { type: HoneySwapAction.COLLATERALS_CHANGE; value: TokenWithOrder[] }
|
|
331
|
+
| { type: HoneySwapAction.FROM_AMOUNT_CHANGE; index: number; value: string }
|
|
332
|
+
| { type: HoneySwapAction.TO_AMOUNT_CHANGE; index: number; value: string }
|
|
333
|
+
| {
|
|
334
|
+
type: HoneySwapAction.PREVIEW_CHANGE;
|
|
335
|
+
value: HoneyPreviewResult;
|
|
336
|
+
changedAsset: Address;
|
|
337
|
+
}
|
|
338
|
+
| { type: HoneySwapAction.IS_BASKET_MODE_ENABLED_CHANGE; value: boolean }
|
|
339
|
+
| { type: HoneySwapAction.IS_TYPING_CHANGE; value: boolean }
|
|
340
|
+
| { type: HoneySwapAction.IS_SUBMITTING_CHANGE; value: boolean }
|
|
341
|
+
| { type: HoneySwapAction.IS_LOADING_CHANGE; value: boolean };
|
|
342
|
+
|
|
343
|
+
declare const HoneyConfigContext: react.Context<HoneyConfigContextReturn | undefined>;
|
|
344
|
+
type TokenWithOrder = TokenWithMetadata & {
|
|
345
|
+
order: number;
|
|
346
|
+
};
|
|
347
|
+
interface HoneyConfigContextReturn {
|
|
348
|
+
/**
|
|
349
|
+
* Map of the Pyth price feed ids for each collateral
|
|
350
|
+
*/
|
|
351
|
+
priceFeedMap: PythPriceFeedMap;
|
|
352
|
+
/**
|
|
353
|
+
* This is the list of all the collaterals that are supported by the Honey protocol
|
|
354
|
+
*/
|
|
355
|
+
collateralList: TokenWithOrder[];
|
|
356
|
+
/**
|
|
357
|
+
* This is the main collateral that is used to calculate the relative cap limit
|
|
358
|
+
*/
|
|
359
|
+
referenceCollateral: TokenWithOrder;
|
|
360
|
+
/**
|
|
361
|
+
* An object that maps the redeem/mint rate for each collateral and the weighted rates for the basket mode
|
|
362
|
+
*/
|
|
363
|
+
feeMap: HoneyFeeMap;
|
|
364
|
+
flags: {
|
|
365
|
+
/**
|
|
366
|
+
* If true, mint/redeem will also update pyth prices
|
|
367
|
+
*/
|
|
368
|
+
isPythWrapperEnabled: boolean;
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* Honey protocol configs
|
|
372
|
+
*/
|
|
373
|
+
protocol: {
|
|
374
|
+
/**
|
|
375
|
+
* Honey protocol paused state
|
|
376
|
+
*/
|
|
377
|
+
isPaused: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* The label for the Honey protocol paused message
|
|
380
|
+
*/
|
|
381
|
+
pausedBannerLabel?: string;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
interface HoneyConfigProviderProps extends HoneyConfigContextReturn {
|
|
385
|
+
children: React.ReactNode;
|
|
386
|
+
}
|
|
387
|
+
declare function HoneyConfigProvider({ children, ...props }: HoneyConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
388
|
+
declare function useHoneyConfig(): HoneyConfigContextReturn;
|
|
389
|
+
|
|
390
|
+
export { type AllowanceQueryItem as A, type BalanceToken as B, type CollateralRates as C, type IAggregatorQuote as D, type HoneySwapActions as H, type IAggregatorArgs as I, type MinimalERC20 as M, type PythLatestUpdates as P, type SwapRequest as S, type TokenWithOrder as T, type TokenWithMetadata as a, type Token as b, HoneyConfigContext as c, type HoneyConfigContextReturn as d, type HoneyConfigProviderProps as e, HoneyConfigProvider as f, type IRawAggregatorQuote as g, type PythPriceFeedMap as h, type TokenCurrentPriceMap as i, type AllowanceToken as j, type HoneyFeeMap as k, type CollateralRatesArgs as l, getHoneyFees as m, HoneyPreviewMethod as n, type HoneyPreviewArgs as o, type HoneyPreviewResult as p, type HoneyPreviewReadResult as q, getHoneyPreview as r, getPythLatestPrices as s, type TokenWithAmount as t, useHoneyConfig as u, type IUserPosition as v, type Calldata as w, type TokenPriceInfo as x, type TokenWithPrice as y, type BexStatus as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorLike } from '@apollo/client';
|
|
2
|
-
import { B as BeraError, I as IBeraErrorArgs } from './BeraError-
|
|
2
|
+
import { B as BeraError, I as IBeraErrorArgs } from './BeraError-_mQdkanr.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This is an error class that should be used to handle errors from fetch requests.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ErrorLike } from '@apollo/client';
|
|
2
|
-
import { B as BeraError, I as IBeraErrorArgs } from './BeraError-
|
|
2
|
+
import { B as BeraError, I as IBeraErrorArgs } from './BeraError-_mQdkanr.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This is an error class that should be used to handle errors from fetch requests.
|