@berachain/berajs 0.1.2 → 0.2.0
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} +80 -107
- package/dist/actions/{index.d.ts → exports.d.ts} +80 -107
- package/dist/actions/exports.mjs +2 -0
- package/dist/actions/exports.mjs.map +1 -0
- package/dist/chunk-575OK77P.mjs +2 -0
- package/dist/chunk-575OK77P.mjs.map +1 -0
- package/dist/chunk-7GWTHOLO.mjs +2 -0
- package/dist/chunk-7GWTHOLO.mjs.map +1 -0
- package/dist/chunk-7SC4VD3U.cjs +2 -0
- package/dist/chunk-7SC4VD3U.cjs.map +1 -0
- package/dist/chunk-BHNQX4XC.mjs +2 -0
- package/dist/chunk-BHNQX4XC.mjs.map +1 -0
- package/dist/chunk-BOYZVULX.cjs +2 -0
- package/dist/chunk-BOYZVULX.cjs.map +1 -0
- package/dist/chunk-C3FHGFLK.mjs +2 -0
- package/dist/chunk-C3FHGFLK.mjs.map +1 -0
- package/dist/chunk-C3G5KXCH.mjs +2 -0
- package/dist/chunk-C3G5KXCH.mjs.map +1 -0
- package/dist/chunk-CYKCYPFR.cjs +2 -0
- package/dist/chunk-CYKCYPFR.cjs.map +1 -0
- package/dist/chunk-F4BKSBEM.mjs +2 -0
- package/dist/chunk-F4BKSBEM.mjs.map +1 -0
- package/dist/chunk-FL2N3XHK.cjs +2 -0
- package/dist/chunk-FL2N3XHK.cjs.map +1 -0
- package/dist/chunk-G6NA6NSM.mjs +4 -0
- package/dist/chunk-G6NA6NSM.mjs.map +1 -0
- package/dist/chunk-H2QSRMVS.mjs +2 -0
- package/dist/chunk-H2QSRMVS.mjs.map +1 -0
- package/dist/chunk-IJM76AWK.cjs +4 -0
- package/dist/chunk-IJM76AWK.cjs.map +1 -0
- package/dist/chunk-MTS5SZLA.mjs +2 -0
- package/dist/chunk-MTS5SZLA.mjs.map +1 -0
- package/dist/chunk-MUNAP5TM.cjs +2 -0
- package/dist/chunk-MUNAP5TM.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-OS5AJMYJ.cjs +2 -0
- package/dist/chunk-OS5AJMYJ.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-TJWKS54T.mjs +2 -0
- package/dist/chunk-TJWKS54T.mjs.map +1 -0
- package/dist/chunk-UQUWMHVF.cjs +2 -0
- package/dist/chunk-UQUWMHVF.cjs.map +1 -0
- package/dist/chunk-UXUWSRVV.cjs +2 -0
- package/dist/chunk-UXUWSRVV.cjs.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-WTCBORPB.cjs +2 -0
- package/dist/chunk-WTCBORPB.cjs.map +1 -0
- package/dist/chunk-XNJLSA6P.cjs +2 -0
- package/dist/chunk-XNJLSA6P.cjs.map +1 -0
- package/dist/chunk-YQGZMWDT.mjs +2 -0
- package/dist/chunk-YQGZMWDT.mjs.map +1 -0
- package/dist/chunk-YXLFOEZN.mjs +2 -0
- package/dist/chunk-YXLFOEZN.mjs.map +1 -0
- package/dist/chunk-ZAKA4TGK.cjs +2 -0
- package/dist/chunk-ZAKA4TGK.cjs.map +1 -0
- package/dist/chunk-ZQRACIGR.mjs +2 -0
- package/dist/chunk-ZQRACIGR.mjs.map +1 -0
- package/dist/contexts/exports.cjs +2 -0
- package/dist/contexts/exports.cjs.map +1 -0
- package/dist/contexts/{index.d.ts → exports.d.cts} +19 -28
- package/dist/contexts/{index.d.cts → exports.d.ts} +19 -28
- package/dist/contexts/exports.mjs +2 -0
- package/dist/contexts/exports.mjs.map +1 -0
- package/dist/contracts-CQIPk0Jc.d.cts +74 -0
- package/dist/contracts-CQIPk0Jc.d.ts +74 -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 +24 -0
- package/dist/enum/exports.d.ts +24 -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 +385 -0
- package/dist/errors/exports.d.ts +385 -0
- package/dist/errors/exports.mjs +2 -0
- package/dist/{getValidatorQueuedOperatorAddress-9xY2RUGe.d.cts → getValidatorQueuedOperatorAddress-BX35p2Lv.d.ts} +125 -15
- package/dist/{getValidatorQueuedOperatorAddress-Ne2zoiiV.d.ts → getValidatorQueuedOperatorAddress-It0GsdvQ.d.cts} +125 -15
- package/dist/global.d-Ba-NIojH.d.cts +474 -0
- package/dist/global.d-By70bEv2.d.ts +474 -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} +223 -173
- package/dist/hooks/{index.d.ts → exports.d.ts} +223 -173
- package/dist/hooks/exports.mjs +4 -0
- package/dist/hooks/exports.mjs.map +1 -0
- package/dist/{BexStatusProvider-nS3NcdxI.d.cts → transactionStore-BvStaXf3.d.ts} +41 -1
- package/dist/{BexStatusProvider-nS3NcdxI.d.ts → transactionStore-CQrGYSY2.d.cts} +41 -1
- package/dist/{txnEnum-BQKDfaeH.d.cts → txnEnum-BYNbCxla.d.cts} +1 -0
- package/dist/{txnEnum-BQKDfaeH.d.ts → txnEnum-BYNbCxla.d.ts} +1 -0
- package/dist/types/exports.cjs +1 -0
- package/dist/types/exports.cjs.map +1 -0
- package/dist/types/exports.d.cts +58 -0
- package/dist/types/exports.d.ts +58 -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 +16 -17
- 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 +21 -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/{hooks/transactions → contexts}/TransactionStoreContext.tsx +32 -4
- package/src/contexts/block-time-provider.tsx +1 -1
- package/src/contexts/{index.ts → exports.ts} +1 -1
- package/src/data/contracts.ts +16 -1
- 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 +50 -11
- 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 +2 -2
- package/src/errors/assert.ts +4 -2
- package/src/errors/assert.unit.test.ts +6 -2
- package/src/errors/errorMap.ts +16 -6
- package/src/errors/{index.ts → exports.ts} +7 -0
- package/src/errors/getErrorMessage.ts +22 -3
- package/src/errors/getRevertReason.integration.test.ts +17 -5
- 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} +18 -7
- 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/transactions/transactionStore.ts +86 -65
- package/src/hooks/transactions/transactionStore.unit.test.ts +54 -1
- package/src/hooks/transactions/useAddRecentTransaction.ts +1 -1
- package/src/hooks/transactions/useRecentTransactions.ts +1 -1
- package/src/hooks/transactions/useSetTransactionStatus.ts +31 -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/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
|
@@ -3,6 +3,8 @@ import * as react from 'react';
|
|
|
3
3
|
import { Dispatch, SetStateAction, PropsWithChildren } from 'react';
|
|
4
4
|
import { Hex } from 'viem';
|
|
5
5
|
import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
|
|
6
|
+
import { Config } from '@wagmi/core';
|
|
7
|
+
import { T as TransactionActionType } from './txnEnum-BYNbCxla.js';
|
|
6
8
|
|
|
7
9
|
type FactoryStatus = {
|
|
8
10
|
/**
|
|
@@ -67,4 +69,42 @@ declare function useBexStatus(): {
|
|
|
67
69
|
};
|
|
68
70
|
declare function BexStatusProvider({ children, isVaultPaused, labels, factories, }: PropsWithChildren<BexStatusProviderProps>): react_jsx_runtime.JSX.Element;
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
type TransactionStatus = "pending" | "confirmed" | "failed";
|
|
73
|
+
interface Transaction {
|
|
74
|
+
hash: string;
|
|
75
|
+
description: string;
|
|
76
|
+
actionType?: TransactionActionType;
|
|
77
|
+
timestamp: number;
|
|
78
|
+
status: TransactionStatus;
|
|
79
|
+
confirmations?: number;
|
|
80
|
+
chainId: number;
|
|
81
|
+
}
|
|
82
|
+
type NewTransaction = Omit<Transaction, "status">;
|
|
83
|
+
type DataLegacy = Record<string, Record<number, Transaction[] | undefined>>;
|
|
84
|
+
type Data = Record<string, Transaction[] | undefined>;
|
|
85
|
+
declare function safeParseJsonData<T = DataLegacy | Data>(string: string | null): T;
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @param legacyData - The legacy data to convert to the new data format.
|
|
89
|
+
* removes the nested chains and converts the data to a flat array.
|
|
90
|
+
* @returns Data in the new format with the chainId added to each transaction.
|
|
91
|
+
*/
|
|
92
|
+
declare function convertLegacyDataToNewData(legacyData: DataLegacy): Data;
|
|
93
|
+
/**
|
|
94
|
+
* Filter out duplicate transactions by hash
|
|
95
|
+
*/
|
|
96
|
+
declare const filterDuplicatefn: (tx: Transaction, idx: number, arr: Transaction[]) => boolean;
|
|
97
|
+
declare function mergeData(legacyData: DataLegacy, newData: Data): Data;
|
|
98
|
+
declare function createTransactionStore({ config }: {
|
|
99
|
+
config: Config;
|
|
100
|
+
}): {
|
|
101
|
+
addTransaction: (account: string, transaction: NewTransaction) => void;
|
|
102
|
+
clearTransactions: (account: string) => void;
|
|
103
|
+
getTransactions: (account: string) => Transaction[];
|
|
104
|
+
onChange: (fn: () => void) => () => void;
|
|
105
|
+
refreshPendingTransactions: (account: string) => Promise<void>;
|
|
106
|
+
setTransactionStatus: (account: string, hash: string, status: TransactionStatus) => void;
|
|
107
|
+
};
|
|
108
|
+
type TransactionStore = ReturnType<typeof createTransactionStore>;
|
|
109
|
+
|
|
110
|
+
export { type BexStatusProviderProps as B, type DataLegacy as D, type NewTransaction as N, type TransactionStore as T, BexStateContext as a, BexStatusProvider as b, type Transaction as c, type TransactionStatus as d, type Data as e, convertLegacyDataToNewData as f, filterDuplicatefn as g, createTransactionStore as h, mergeData as m, safeParseJsonData as s, useBexStatus as u };
|
|
@@ -3,6 +3,8 @@ import * as react from 'react';
|
|
|
3
3
|
import { Dispatch, SetStateAction, PropsWithChildren } from 'react';
|
|
4
4
|
import { Hex } from 'viem';
|
|
5
5
|
import { EdgeConfigSchema } from '@berachain/config/internal/edge-config';
|
|
6
|
+
import { Config } from '@wagmi/core';
|
|
7
|
+
import { T as TransactionActionType } from './txnEnum-BYNbCxla.cjs';
|
|
6
8
|
|
|
7
9
|
type FactoryStatus = {
|
|
8
10
|
/**
|
|
@@ -67,4 +69,42 @@ declare function useBexStatus(): {
|
|
|
67
69
|
};
|
|
68
70
|
declare function BexStatusProvider({ children, isVaultPaused, labels, factories, }: PropsWithChildren<BexStatusProviderProps>): react_jsx_runtime.JSX.Element;
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
type TransactionStatus = "pending" | "confirmed" | "failed";
|
|
73
|
+
interface Transaction {
|
|
74
|
+
hash: string;
|
|
75
|
+
description: string;
|
|
76
|
+
actionType?: TransactionActionType;
|
|
77
|
+
timestamp: number;
|
|
78
|
+
status: TransactionStatus;
|
|
79
|
+
confirmations?: number;
|
|
80
|
+
chainId: number;
|
|
81
|
+
}
|
|
82
|
+
type NewTransaction = Omit<Transaction, "status">;
|
|
83
|
+
type DataLegacy = Record<string, Record<number, Transaction[] | undefined>>;
|
|
84
|
+
type Data = Record<string, Transaction[] | undefined>;
|
|
85
|
+
declare function safeParseJsonData<T = DataLegacy | Data>(string: string | null): T;
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @param legacyData - The legacy data to convert to the new data format.
|
|
89
|
+
* removes the nested chains and converts the data to a flat array.
|
|
90
|
+
* @returns Data in the new format with the chainId added to each transaction.
|
|
91
|
+
*/
|
|
92
|
+
declare function convertLegacyDataToNewData(legacyData: DataLegacy): Data;
|
|
93
|
+
/**
|
|
94
|
+
* Filter out duplicate transactions by hash
|
|
95
|
+
*/
|
|
96
|
+
declare const filterDuplicatefn: (tx: Transaction, idx: number, arr: Transaction[]) => boolean;
|
|
97
|
+
declare function mergeData(legacyData: DataLegacy, newData: Data): Data;
|
|
98
|
+
declare function createTransactionStore({ config }: {
|
|
99
|
+
config: Config;
|
|
100
|
+
}): {
|
|
101
|
+
addTransaction: (account: string, transaction: NewTransaction) => void;
|
|
102
|
+
clearTransactions: (account: string) => void;
|
|
103
|
+
getTransactions: (account: string) => Transaction[];
|
|
104
|
+
onChange: (fn: () => void) => () => void;
|
|
105
|
+
refreshPendingTransactions: (account: string) => Promise<void>;
|
|
106
|
+
setTransactionStatus: (account: string, hash: string, status: TransactionStatus) => void;
|
|
107
|
+
};
|
|
108
|
+
type TransactionStore = ReturnType<typeof createTransactionStore>;
|
|
109
|
+
|
|
110
|
+
export { type BexStatusProviderProps as B, type DataLegacy as D, type NewTransaction as N, type TransactionStore as T, BexStateContext as a, BexStatusProvider as b, type Transaction as c, type TransactionStatus as d, type Data as e, convertLegacyDataToNewData as f, filterDuplicatefn as g, createTransactionStore as h, mergeData as m, safeParseJsonData as s, useBexStatus as u };
|
|
@@ -60,6 +60,7 @@ declare enum TransactionActionType {
|
|
|
60
60
|
APPLYING_REWARD_ALLOCATOR_CHANGE = "Apply Reward Allocator Change",
|
|
61
61
|
APPLYING_COMMISSION_CHANGE = "Apply Commission Change",
|
|
62
62
|
BONDING_BERA = "Stake BERA",
|
|
63
|
+
ZAP_STAKE_BERA = "Zap Stake BERA",
|
|
63
64
|
UNBONDING_BERA = "Unstake BERA",
|
|
64
65
|
QUEUE_UNBONDING_BERA = "Queue Unstake BERA",
|
|
65
66
|
BEND_MARKET_REPAY_AND_WITHDRAW_COLLATERAL = "Bend Market Repay and Withdraw Collateral",
|
|
@@ -60,6 +60,7 @@ declare enum TransactionActionType {
|
|
|
60
60
|
APPLYING_REWARD_ALLOCATOR_CHANGE = "Apply Reward Allocator Change",
|
|
61
61
|
APPLYING_COMMISSION_CHANGE = "Apply Commission Change",
|
|
62
62
|
BONDING_BERA = "Stake BERA",
|
|
63
|
+
ZAP_STAKE_BERA = "Zap Stake BERA",
|
|
63
64
|
UNBONDING_BERA = "Unstake BERA",
|
|
64
65
|
QUEUE_UNBONDING_BERA = "Queue Unstake BERA",
|
|
65
66
|
BEND_MARKET_REPAY_AND_WITHDRAW_COLLATERAL = "Bend Market Repay and Withdraw Collateral",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";//# sourceMappingURL=exports.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/pong/coding/monobera/packages/berajs/dist/types/exports.cjs"],"names":[],"mappings":"AAAA","file":"/Users/pong/coding/monobera/packages/berajs/dist/types/exports.cjs"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export { A as AggregatedTokenTotals, g as BribeBoostReward, b as BribeBoostRewardItem, B as BribeBoostRewardProof, h as BribeBoostValidatorApr, t as ClaimedIncentives, u as ClaimedIncentivesLocalState, C as CustomProposal, n as CustomProposalActionErrors, a as CustomProposalErrors, D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, I as IContractWrite, i as IContractWriteFn, r as IncentiveReward, s as IncentiveRewardChunksWithValidatorData, m as PROPOSAL_GENRE, j as Proposal, p as ProposalAction, l as ProposalVotes, P as ProtocolMetadata, o as SafeProposalAction, d as StakedBeraAsset, S as StakingConfig, U as UserVaultInfo, q as VerifiedAbi, V as Vote, k as Voter } from '../global.d-Ba-NIojH.cjs';
|
|
2
|
+
export { A as AllowanceQueryItem, j as AllowanceToken, B as BalanceToken, z as BexStatus, w as Calldata, H as HoneySwapActions, I as IAggregatorArgs, D as IAggregatorQuote, g as IRawAggregatorQuote, v as IUserPosition, M as MinimalERC20, h as PythPriceFeedMap, S as SwapRequest, b as Token, i as TokenCurrentPriceMap, x as TokenPriceInfo, t as TokenWithAmount, a as TokenWithMetadata, y as TokenWithPrice } from '../HoneyConfigProvider-Ca3ouozs.cjs';
|
|
3
|
+
import { BundleData, EnsoClient } from '@ensofinance/sdk';
|
|
4
|
+
import { TransactionRequest, Address, Hex, PublicClient } from 'viem';
|
|
5
|
+
import '@berachain/graphql/governance';
|
|
6
|
+
import '../contracts-CQIPk0Jc.cjs';
|
|
7
|
+
import '@berachain/graphql/pol/api';
|
|
8
|
+
import '@wagmi/core';
|
|
9
|
+
import 'swr';
|
|
10
|
+
import '@berachain/config';
|
|
11
|
+
import '../txnEnum-BYNbCxla.cjs';
|
|
12
|
+
import '../BeraError-_mQdkanr.cjs';
|
|
13
|
+
import 'react/jsx-runtime';
|
|
14
|
+
import 'react';
|
|
15
|
+
import '@berachain-foundation/berancer-sdk';
|
|
16
|
+
import '../honey-CYm0RWf4.cjs';
|
|
17
|
+
|
|
18
|
+
type Quantity = string | number;
|
|
19
|
+
type ActionOutputReference<T> = T | StrictOutputReference<T>;
|
|
20
|
+
type StrictOutputReference<T> = {
|
|
21
|
+
useOutputOfCallAt: number;
|
|
22
|
+
index?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface GetEnsoSwapBundleArgs {
|
|
26
|
+
fromAddress: Address;
|
|
27
|
+
amountIn: Quantity;
|
|
28
|
+
tokenIn: Address;
|
|
29
|
+
tokenOut: Address;
|
|
30
|
+
chainId: number;
|
|
31
|
+
ensoClient: EnsoClient;
|
|
32
|
+
slippage: number;
|
|
33
|
+
destinationChainId?: number;
|
|
34
|
+
publicClient: PublicClient;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type GetZapTransaction = TransactionRequest & {
|
|
38
|
+
to: Address;
|
|
39
|
+
data: Hex;
|
|
40
|
+
value?: bigint;
|
|
41
|
+
gasLimit?: bigint;
|
|
42
|
+
};
|
|
43
|
+
type GetZapTransactions = GetZapTransaction[];
|
|
44
|
+
interface GetZapTransactionsArgs {
|
|
45
|
+
fromAddress: Address;
|
|
46
|
+
amountIn: Quantity;
|
|
47
|
+
tokenIn: Address;
|
|
48
|
+
chainId: number;
|
|
49
|
+
ensoClient: EnsoClient;
|
|
50
|
+
bundle: BundleData;
|
|
51
|
+
publicClient: PublicClient;
|
|
52
|
+
}
|
|
53
|
+
interface GetZapTransactionResponse {
|
|
54
|
+
bundle: BundleData;
|
|
55
|
+
transactions: GetZapTransactions;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type { ActionOutputReference, GetEnsoSwapBundleArgs, GetZapTransaction, GetZapTransactionResponse, GetZapTransactions, GetZapTransactionsArgs, Quantity };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export { A as AggregatedTokenTotals, g as BribeBoostReward, b as BribeBoostRewardItem, B as BribeBoostRewardProof, h as BribeBoostValidatorApr, t as ClaimedIncentives, u as ClaimedIncentivesLocalState, C as CustomProposal, n as CustomProposalActionErrors, a as CustomProposalErrors, D as DefaultHookOptions, c as DefaultHookReturnType, G as GovernanceTopic, I as IContractWrite, i as IContractWriteFn, r as IncentiveReward, s as IncentiveRewardChunksWithValidatorData, m as PROPOSAL_GENRE, j as Proposal, p as ProposalAction, l as ProposalVotes, P as ProtocolMetadata, o as SafeProposalAction, d as StakedBeraAsset, S as StakingConfig, U as UserVaultInfo, q as VerifiedAbi, V as Vote, k as Voter } from '../global.d-By70bEv2.js';
|
|
2
|
+
export { A as AllowanceQueryItem, j as AllowanceToken, B as BalanceToken, z as BexStatus, w as Calldata, H as HoneySwapActions, I as IAggregatorArgs, D as IAggregatorQuote, g as IRawAggregatorQuote, v as IUserPosition, M as MinimalERC20, h as PythPriceFeedMap, S as SwapRequest, b as Token, i as TokenCurrentPriceMap, x as TokenPriceInfo, t as TokenWithAmount, a as TokenWithMetadata, y as TokenWithPrice } from '../HoneyConfigProvider-CK6mOKFH.js';
|
|
3
|
+
import { BundleData, EnsoClient } from '@ensofinance/sdk';
|
|
4
|
+
import { TransactionRequest, Address, Hex, PublicClient } from 'viem';
|
|
5
|
+
import '@berachain/graphql/governance';
|
|
6
|
+
import '../contracts-CQIPk0Jc.js';
|
|
7
|
+
import '@berachain/graphql/pol/api';
|
|
8
|
+
import '@wagmi/core';
|
|
9
|
+
import 'swr';
|
|
10
|
+
import '@berachain/config';
|
|
11
|
+
import '../txnEnum-BYNbCxla.js';
|
|
12
|
+
import '../BeraError-_mQdkanr.js';
|
|
13
|
+
import 'react/jsx-runtime';
|
|
14
|
+
import 'react';
|
|
15
|
+
import '@berachain-foundation/berancer-sdk';
|
|
16
|
+
import '../honey-CYm0RWf4.js';
|
|
17
|
+
|
|
18
|
+
type Quantity = string | number;
|
|
19
|
+
type ActionOutputReference<T> = T | StrictOutputReference<T>;
|
|
20
|
+
type StrictOutputReference<T> = {
|
|
21
|
+
useOutputOfCallAt: number;
|
|
22
|
+
index?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface GetEnsoSwapBundleArgs {
|
|
26
|
+
fromAddress: Address;
|
|
27
|
+
amountIn: Quantity;
|
|
28
|
+
tokenIn: Address;
|
|
29
|
+
tokenOut: Address;
|
|
30
|
+
chainId: number;
|
|
31
|
+
ensoClient: EnsoClient;
|
|
32
|
+
slippage: number;
|
|
33
|
+
destinationChainId?: number;
|
|
34
|
+
publicClient: PublicClient;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type GetZapTransaction = TransactionRequest & {
|
|
38
|
+
to: Address;
|
|
39
|
+
data: Hex;
|
|
40
|
+
value?: bigint;
|
|
41
|
+
gasLimit?: bigint;
|
|
42
|
+
};
|
|
43
|
+
type GetZapTransactions = GetZapTransaction[];
|
|
44
|
+
interface GetZapTransactionsArgs {
|
|
45
|
+
fromAddress: Address;
|
|
46
|
+
amountIn: Quantity;
|
|
47
|
+
tokenIn: Address;
|
|
48
|
+
chainId: number;
|
|
49
|
+
ensoClient: EnsoClient;
|
|
50
|
+
bundle: BundleData;
|
|
51
|
+
publicClient: PublicClient;
|
|
52
|
+
}
|
|
53
|
+
interface GetZapTransactionResponse {
|
|
54
|
+
bundle: BundleData;
|
|
55
|
+
transactions: GetZapTransactions;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type { ActionOutputReference, GetEnsoSwapBundleArgs, GetZapTransaction, GetZapTransactionResponse, GetZapTransactions, GetZapTransactionsArgs, Quantity };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=exports.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { T as TokenWithOrder, H as HoneySwapActions } from './HoneyConfigProvider-
|
|
2
|
+
import { T as TokenWithOrder, H as HoneySwapActions } from './HoneyConfigProvider-Ca3ouozs.cjs';
|
|
3
3
|
|
|
4
4
|
interface IHoneySwapState {
|
|
5
5
|
actionType: "mint" | "redeem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { T as TokenWithOrder, H as HoneySwapActions } from './HoneyConfigProvider-
|
|
2
|
+
import { T as TokenWithOrder, H as HoneySwapActions } from './HoneyConfigProvider-CK6mOKFH.js';
|
|
3
3
|
|
|
4
4
|
interface IHoneySwapState {
|
|
5
5
|
actionType: "mint" | "redeem";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWTCBORPBcjs = require('../chunk-WTCBORPB.cjs');var _chunkMUNAP5TMcjs = require('../chunk-MUNAP5TM.cjs');var _chunkVXL2ZZ4Xcjs = require('../chunk-VXL2ZZ4X.cjs');var _chunkOS5AJMYJcjs = require('../chunk-OS5AJMYJ.cjs');var _chunk7SC4VD3Ucjs = require('../chunk-7SC4VD3U.cjs');var x0=e=>{if(e==="0")return e;let n=e.replace(/^0+/,"").replaceAll(/[^0-9.]/g,"");return n.startsWith(".")&&(n=`0${n}`),n};function F0(e,n){let o=n?{minimumFractionDigits:0,maximumFractionDigits:0}:{},t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",...o});try{let c=s=>typeof s=="number",r=s=>typeof s=="string";if(!c(e)&&!r(e))return t.format(0);let a;return r(e)?(a=Number.parseFloat(e),Number.isNaN(a)&&(a=0)):(a=e,Number.isNaN(a)&&(a=0)),t.format(a)}catch(c){return console.log(c),t.format(0)}}var _internal = require('@berachain/config/internal');var x=[{80069:"0x0000000000000000000000000000000000000000",80094:"0x0000000000000000000000000000000000000000",name:"zeroAddress"},{80094:"0x141De07E5D4C4759EC9301DA106115D4841f66cD",name:"nfts.bongBears"},{80094:"0xA0CF472E6132F6B822a944f6F31aA7b261c7c375",name:"nfts.bondBears"},{80094:"0xf49ec5db255854C4a567de5AB3826c9AAbaFc7cF",name:"nfts.booBears"},{80094:"0xDDeAf391c4be2d01ca52aBb8C159a06820ef078C",name:"nfts.babyBears"},{80094:"0x7711B2Eb2451259dbF211e30157ceB7CFeb79a19",name:"nfts.bandBears"},{80094:"0x72D876D9cdf4001b836f8E47254d0551EdA2eebB",name:"nfts.bitBears"},{80069:"",80094:"0x24147243f9c08d835C218Cda1e135f8dFD0517D0",name:"bend.morpho"},{80069:"",80094:"0xcf247Df3A2322Dea0D408f011c194906E77a6f62",name:"bend.adaptiveCurveIrm"},{80069:"",80094:"0xF920140A65D0f412f2AB3e76C4fEAB5Eef0657ae",name:"bend.bundler3"},{80069:"",80094:"0xd2B9667F5214115E27937C410cAeE83E3a901Df7",name:"bend.generalAdapter1"},{80069:"",80094:"0x5EDd48C6ACBd565Eeb31702FD9fa9Cbc86fbE616",name:"bend.metaMorphoFactoryV1_1"},{80069:"",80094:"0x80108Ee81A92091Db6B8B2326B1875ce9388f461",name:"bend.metaFeePartitioner"},{80069:"",80094:"0xB62F34Ab315eaDeAc698e8EaEB6Fc2650951BFe7",name:"bend.publicAllocator"},{80069:"",80094:"0xAf2FDC54f7bc9d6e8C2D2760E908f4e1beB04d9E",name:"bend.morphoChainlinkOracleV2Factory"},{80069:"",80094:"0x46fE2bc33b661E01A8946BbC3Bf43F2B8382d802",name:"bend.urdFactory"},{80069:"",80094:"0x30BbA9CD9Eb8c95824aa42Faa1Bb397b07545bc1",name:"bend.vaults.re7HoneyVault"},{80069:"0xb0d005Fe83E3F1ec876C1a64700c5F0d6265d9E3",80094:"0x77DA09bC82652f9A14d1b170a001e759640298e6",name:"pol.bgtIncentiveDistributor"},{80069:"0x1984Baf659607Cc5f206c55BB3B00eb3E180190B",80094:"0x1984Baf659607Cc5f206c55BB3B00eb3E180190B",name:"pol.bgtIncentiveFeeCollector"},{80069:"0x118D2cEeE9785eaf70C15Cd74CD84c9f8c3EeC9a",80094:"0x118D2cEeE9785eaf70C15Cd74CD84c9f8c3EeC9a",name:"pol.wberaStakerVault"},{80069:"0x4242424242424242424242424242424242424242",80094:"0x4242424242424242424242424242424242424242",name:"pol.beaconDeposit"},{80069:"0xdf960E8F3F19C481dDE769edEDD439ea1a63426a",80094:"0xdf960E8F3F19C481dDE769edEDD439ea1a63426a",name:"pol.berachef"},{80069:"0x1AE7dD7AE06F6C58B4524d9c1f816094B1bcCD8e",80094:"0x1AE7dD7AE06F6C58B4524d9c1f816094B1bcCD8e",name:"pol.blockRewardController"},{80069:"0xD2f19a79b026Fb636A7c300bF5947df113940761",80094:"0xD2f19a79b026Fb636A7c300bF5947df113940761",name:"pol.distributor"},{80069:"0x94Ad6Ac84f6C6FbA8b8CCbD71d9f4f101def52a8",80094:"0x94Ad6Ac84f6C6FbA8b8CCbD71d9f4f101def52a8",name:"pol.rewardVaultFactory"},{80069:"0x44F07Ce5AfeCbCC406e6beFD40cc2998eEb8c7C6",80094:"0x44F07Ce5AfeCbCC406e6beFD40cc2998eEb8c7C6",name:"pol.bgtStaker"},{80069:"0x7bb8DdaC7FbE3FFC0f4B3c73C4F158B06CF82650",80094:"0x7Bb8DdaC7FbE3FFC0f4B3c73C4F158B06CF82650",name:"pol.feeCollector"},{80069:"0x4f4A5c2194B8e856b7a05B348F6ba3978FB6f6D5",80094:"0x4f4A5c2194B8e856b7a05B348F6ba3978FB6f6D5",name:"pol.governance"},{80069:"0xb5f2000b5744f207c931526cAE2134cAa8b6862a",80094:"0xb5f2000b5744f207c931526cAE2134cAa8b6862a",name:"pol.timelock"},{80069:"0x176c081E95C82CA68DEa20CA419C7506Aa063C24",80094:"0xb79b43dBA821Cb67751276Ce050fF4111445fB99",name:"stakingPools.stakingPoolContractsFactory"},{80069:"0x8b472791aC2f9e9Bd85f8919401b8Ce3bdFd464c",80094:"0xAd17932a5B1aaeEa73D277a6AE670623F176E0D0",name:"stakingPools.delegationHandlerFactory"},{80069:"0xAFAc2f11Cb39F0521b22494F6101002ce653D2f4",80094:"0xE858802Ed532C6DAD2D196AB5B1F2C15F9cb52b4",name:"stakingPools.withdrawalVault"},{80069:"0x656b95E550C07a9ffe548bd4085c72418Ceb1dba",80094:"0x656b95E550C07a9ffe548bd4085c72418Ceb1dba",name:"tokens.bgt"},{80069:"0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce",80094:"0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce",name:"tokens.honey"},{80069:"0xA4aFef880F5cE1f63c9fb48F661E27F8B4216401",80094:"0xA4aFef880F5cE1f63c9fb48F661E27F8B4216401",name:"tokens.honeyFactory"},{80069:"0x285e147060CDc5ba902786d3A471224ee6cE0F91",80094:"0x285e147060CDc5ba902786d3A471224ee6cE0F91",name:"tokens.honeyFactoryReader"},{80069:"0x6969696969696969696969696969696969696969",80094:"0x6969696969696969696969696969696969696969",name:"tokens.wbera"},{80069:"",80094:"0x549943e04f40284185054145c6E4e9568C1D3241",name:"tokens.usdc"},{80069:"",80094:"0x0555E30da8f98308EdB960aa94C0Db47230d2B9c",name:"tokens.wbtc"},{80069:"",80094:"0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590",name:"tokens.weth"},{80069:"0x708cA656b68A6b7384a488A36aD33505a77241FE",80094:"0x4Be03f781C497A489E3cB0287833452cA9B9E80B",name:"bex.vault"},{80069:"0x05A607aCf3548E84DD1E44c3706F850c849058Da",80094:"0xB8Cf46Cf1b1476E707619913a70B2085d26f1707",name:"bex.protocolFeesCollector"},{80069:"0xC7c981ADcDC5d48fed0CD52807fb2bAB22676C8f",80094:"0x5083737EC75a728c265BE578C9d0d5333a2c5951",name:"bex.balancerHelpers"},{80069:"0x0dC9964F6CA33d9EF38DEB4925234766127C6B36",80094:"0x55dccE8165C88aAd4403a15A9cE3A8E244657dD2",name:"bex.poolCreationHelper"},{80069:"0x8c2D77f0CfcD4Af9cF41494EfE500FE324012c06",80094:"0x1635F0E1B3e8A6713d03aE155ba79458Ba3240C7",name:"bex.protocolFeesWithdrawer"},{80069:"0xB60DbBaCEaeC23486a64d12089F467ef949f1bb1",80094:"0xDfA30BDa0375d4763711AB0CC8D91B20bfCC87E1",name:"bex.stablePoolFactory"},{80069:"0xfD772657FC8c4Ed3884AfF151b680883814052FA",80094:"0xCB4AE3030bA06F7EEE54A7B96AfcA7457f9525cf",name:"bex.batchRelayerLibrary"},{80069:"0x263a1C5B2c5851beA2177eb8D6caefdfF2A25601",80094:"0x4151083172b2CEFB83A33fD7FC9F6cBabb3Fd08d",name:"bex.batchRelayerQueryLibrary"},{80069:"0x343215E156Ff586711a5B8C49Fe3099BAF22624C",80094:"0x6044f181aB5E9C05A4ed9Ce295f3B178d2492EE7",name:"bex.balancerRelayer"},{80069:"0xf1d23276C7b271B2aC595C78977b2312E9954D57",80094:"0xa966fA8F2d5B087FFFA499C0C1240589371Af409",name:"bex.weightedPoolFactory"},{80069:"0x8119E412E00fe3c857739E95dB147817Bf615dB8",80094:"0x33C88ffdEe710ed3908C791137Bd1D4421AabBBf",name:"bex.protocolFeePercentagesProvider"},{80069:"0xE3723383a0EA73D5c0dE424BAA97F97f86f6cF92",80094:"0x3C612e132624f4Bd500eE1495F54565F0bcc9b59",name:"bex.balancerQueries"},{80069:"0x1453b808C88AAa5e5965f8d86123921E96F045Aa",80094:"0x71047aE39A7aA4f7d923542F459e50B974644Ef2",name:"bex.authorizer"},{80069:"0x41675C099F32341bf84BFc5382aF534df5C7461a",80094:"0x41675C099F32341bf84BFc5382aF534df5C7461a",name:"safe.safe"},{80069:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",80094:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",name:"safe.safeProxyFactory"},{80069:"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",80094:"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",name:"safe.multiSend"},{80069:"0x9641d764fc13c8B624c04430C7356C1C7C8102e2",80094:"0x9641d764fc13c8B624c04430C7356C1C7C8102e2",name:"safe.multiSendCallOnly"},{80069:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99",80094:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99",name:"safe.compatibilityFallbackHandler"},{80069:"0xd53cd0aB83D845Ac265BE939c57F53AD838012c9",80094:"0xd53cd0aB83D845Ac265BE939c57F53AD838012c9",name:"safe.signMessageLib"},{80069:"0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",80094:"0x3d4BA2E0884aa488718476ca2FB8Efc291A46199",name:"safe.simulateTxAccessor"},{80069:"0x9b35Af71d77eaf8d7e40252370304687390A1A52",80094:"0x9b35Af71d77eaf8d7e40252370304687390A1A52",name:"safe.createCall"},{80069:"0x4e59b44847b379578588920cA78FbF26c0B4956C",80094:"0x4e59b44847b379578588920cA78FbF26c0B4956C",name:"other.create2"},{80069:"0xcA11bde05977b3631167028862bE2a173976CA11",80094:"0xcA11bde05977b3631167028862bE2a173976CA11",name:"other.multicall3"},{80069:"0x000000000022D473030F116dDEE9F6B43aC78BA3",80094:"0x000000000022D473030F116dDEE9F6B43aC78BA3",name:"other.permit2"},{80069:"0xEe233a69A36Db7fC10E03e921D90DEC52Cdce6e2",80094:"0xEe233a69A36Db7fC10E03e921D90DEC52Cdce6e2",name:"pol.rewardVaultHelper"},{80069:"0x7f09Cf6958631513aF0400488F65c7B5c0313F52",80094:"0xc8FD9a3fB3Dad4C22c9F8Cfa7cecC318A667A791",name:"pol.rewardAllocationFactory"},{80069:"0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b",80094:"0xba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b",name:"bex.balancerDelegatedOwnership"},{80069:"0x0000000000000000000000000000000000000000",80094:"0x1BDB1cf792419d2eaB5aBa8076B8f4257744fA58",name:"bex.aggregatorsRouter"},{80069:"0x0000000000000000000000000000000000000000",80094:"0x4AD3c5A427Af60F8Dd982023aE012233A66CA1f8",name:"bex.aggregatorsRouterExecutor"},{80069:null,80094:"0x24aC999FF132B32c5b3956973b6213B0d07eB2C7",name:"bex.haikuRouter"},{80069:null,80094:"0x69495273D6Dc572A830A4D6e00400a1e9d5B8f71",name:"bex.haikuAgentAddress"},{80069:"0x0eFeC4379805fAFA7269Ec599a6921f388C8841a",80094:"0xB5787B8f7b07a00229b617c4B7a616185857C147",name:"bex.recoverFundsContract"},{80069:"0x5CA67e134c52B1d11E038A5a4eD8Ddcdb1238943",80094:"0x5CA67e134c52B1d11E038A5a4eD8Ddcdb1238943",name:"honey.pythOracle"},{80069:"0xE5Ad9BA751714ec8cdd554b5a9f12BFcA13980cB",80094:"0x4b7cb1c197f8EE4d309866B16C2c12E3B4E7E606",name:"honey.pythWrapper"},{80069:"0x2880aB155794e7179c9eE2e38200202908C17B43",80094:"0x2880aB155794e7179c9eE2e38200202908C17B43",name:"external.pyth"},{80069:null,80094:"0xC5FabF3a7E98a2ed89f5d5057Ab010634Ca7e71f",name:"bend.staging.morpho"},{80069:null,80094:"0x1d5376e532CcF25b740270624111D665830E5dB9",name:"bend.staging.adaptiveCurveIrm"},{80069:null,80094:"0x524061B659380a5e4576d76F0951303B20B5932f",name:"bend.staging.metaMorphoFactory"},{80069:null,80094:"0xFD6e68bC20be2a01Ec1Df687c83f927087D52811",name:"bend.staging.publicAllocator"},{80069:null,80094:"0x56811e1BFfF951B98c7940d3aCe0e549Ec4fDee8",name:"bend.staging.bundler3"},{80069:null,80094:"0x257a41E20BBfe90D750646C2e00bA700D55958C5",name:"bend.staging.generalAdapter1"},{80094:"0x19DcFf4e8Ff0B554D8a1f22d289A449fd4FbddBa",name:"bend.staging.supportedVaults.0"},{80094:"0xC0808A144CE2ea85bF84EBD1dDF5D59429f59dDE",name:"bend.staging.supportedVaults.1"}];function D0({address:e,chainId:n=_internal.defaultChainId}){return e?_optionalChain([x, 'access', _2 => _2.find, 'call', _3 => _3(t=>_optionalChain([t, 'access', _4 => _4[n], 'optionalAccess', _5 => _5.toLowerCase, 'call', _6 => _6()])===e.toLowerCase()), 'optionalAccess', _7 => _7.name]):void 0}function h0({collaterals:e,actionType:n,toAmount:o,fromAmount:t,isBasketModeEnabled:c}){if(e.length>0){if(n==="mint"){let a=["Minting"];if(a.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(o[0]),5)),a.push("Honey from"),c)for(let s in e)a.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(t[s]),5)),a.push(`${e[s].symbol}`),+s<e.length-2?a[a.length-1]=a[a.length-1].concat(","):+s===e.length-1?a[a.length-1]=a[a.length-1].concat("."):a.push("and");else a.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(t[0]),5)),a.push(`${e[0].symbol}`);return a.join(" ")}let r=["Redeeming"];if(c)for(let a in e)r.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(o[a]),5)),r.push(`${e[a].symbol}`),+a<e.length-2?r[r.length-1]=r[r.length-1].concat(","):+a===e.length-1?(r.push("for"),r.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(t[0]),5)),r.push("Honey.")):r.push("and");else r.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(o[0]),5)),r.push(`${e[0].symbol}`),r.push("for"),r.push(_chunkMUNAP5TMcjs.B.call(void 0, Number(t[0]),5)),r.push("Honey.");return r.join(" ")}return""}var _viem = require('viem');var _chains = require('viem/chains');var d=new Map,T0= exports.getServerSidePublicClient =(e={})=>{let n=_nullishCoalesce(e.chainId, () => (_internal.defaultChainId));if(d.has(n))return d.get(n);let o=_internal.getRpcUrls.call(void 0, n),t=[o.privateRcpUrl,o.jsonRpcUrl,o.alchemyJsonRpcUrl,o.publicJsonRpcUrl].filter(a=>a).map(a=>_viem.http.call(void 0, a));t.length===0&&t.push(_viem.http.call(void 0, ));let c=n===_internal.ChainId.MAINNET?_chains.berachain:_chains.berachainBepolia,r=_viem.createPublicClient.call(void 0, {chain:c,transport:_viem.fallback.call(void 0, t)});return d.set(n,r),r};var _bignumberjs = require('@berachain/utils/pkg/bignumber.js'); var _bignumberjs2 = _interopRequireDefault(_bignumberjs);var S0=(e,n,o)=>{let t=new (0, _bignumberjs2.default)(1+o).times(e),c=new (0, _bignumberjs2.default)(1-o).times(e);return t.isLessThan(n)||c.isGreaterThan(n)};var S="https://api-mainnet.layerzero-scan.com",M= exports.LayerZeroMessageStatus =(t=>(t.INFLIGHT="INFLIGHT",t.DELIVERED="DELIVERED",t.FAILED="FAILED",t))(M||{}),N=e=>new Promise(n=>setTimeout(n,e));async function v(e){return _chunkMUNAP5TMcjs.c.call(void 0, {url:`${S}/tx/${e}`,type:"rest",name:"LayerZero Scan"})}async function U0(e,n={}){let{pollInterval:o=3e3,timeout:t=6e5}=n;if(!e)throw new (0, _chunk7SC4VD3Ucjs.g)({property:"srcTxHash",value:e,expected:"string"});let c=Date.now();for(;;){if(Date.now()-c>t)throw new (0, _chunk7SC4VD3Ucjs.e)({message:`LayerZero message tracking timed out after ${t}ms`,reason:"LAYERZERO_TIMEOUT",level:"warning"});try{let{messages:r}=await v(e),a=r[0];if(r.length>1)throw new (0, _chunk7SC4VD3Ucjs.e)({message:"More than one LayerZero message found for transaction",reason:"LAYERZERO_MULTIPLE_MESSAGES"});if(_optionalChain([a, 'optionalAccess', _8 => _8.status])==="FAILED")throw new (0, _chunk7SC4VD3Ucjs.e)({message:`LayerZero message failed: ${a.dstTxError}`,reason:"LAYERZERO_MESSAGE_FAILED"});if(_optionalChain([a, 'optionalAccess', _9 => _9.status])==="DELIVERED")return a}catch(r){if(r instanceof _chunk7SC4VD3Ucjs.e&&!(r instanceof _chunk7SC4VD3Ucjs.f))throw r}await N(o)}}function Z0(e){return{...e,chainId:e.chain.id}}var $0=(e,n=4,o=4,t=!1)=>{if(!e)return"";let c=t?e.toUpperCase().replace(/^0X/,"0x"):e;return`${c.substring(0,n)}...${c.substring(c.length-o)}`};var _api = require('@berachain/graphql/pol/api');function W0(e){if(e)return e===_api.GqlValidatorBlockUptimeStatus.Proposed}function q0(e){if(e)return e===_api.GqlValidatorBlockUptimeStatus.Signed}exports.CAP_LIMIT_BUFFER = _chunkMUNAP5TMcjs.d; exports.DEFAULT_METAMASK_GAS_LIMIT = _chunkMUNAP5TMcjs.i; exports.LayerZeroMessageStatus = M; exports.MAX_CUSTOM_DEADLINE = _chunkMUNAP5TMcjs.e; exports.MAX_CUSTOM_SLIPPAGE = _chunkMUNAP5TMcjs.h; exports.MIN_CUSTOM_DEADLINE = _chunkMUNAP5TMcjs.f; exports.MIN_CUSTOM_SLIPPAGE = _chunkMUNAP5TMcjs.g; exports.beraFetch = _chunkMUNAP5TMcjs.b; exports.beraFetchJson = _chunkMUNAP5TMcjs.c; exports.calculateTimestampFromDays = _chunkMUNAP5TMcjs.y; exports.computePriceImpact = _chunkWTCBORPBcjs.c; exports.days = _chunkMUNAP5TMcjs.q; exports.daysInSeconds = _chunkMUNAP5TMcjs.r; exports.defaultBeraFlags = _chunkVXL2ZZ4Xcjs.a; exports.formatInputTokenValue = x0; exports.formatNumber = _chunkMUNAP5TMcjs.B; exports.formatTimeLeft = _chunkMUNAP5TMcjs.A; exports.formatUnixTimestamp = _chunkMUNAP5TMcjs.z; exports.formatUsd = F0; exports.getContractName = D0; exports.getHoneySwapMessage = h0; exports.getHoneyToken = _chunkOS5AJMYJcjs.d; exports.getPythDefaultUpdateFee = _chunkMUNAP5TMcjs.j; exports.getSafeNumber = _chunkMUNAP5TMcjs.C; exports.getServerSidePublicClient = T0; exports.getTestClient = _chunkMUNAP5TMcjs.E; exports.hours = _chunkMUNAP5TMcjs.o; exports.hoursInSeconds = _chunkMUNAP5TMcjs.p; exports.internal_beraToken = _chunkOS5AJMYJcjs.b; exports.internal_wBeraToken = _chunkOS5AJMYJcjs.c; exports.isDifferenceExceedingThreshold = S0; exports.isSubgraphStale = _chunkMUNAP5TMcjs.F; exports.isToken = _chunkOS5AJMYJcjs.e; exports.isValidatorProposer = W0; exports.isValidatorSigner = q0; exports.minutes = _chunkMUNAP5TMcjs.m; exports.minutesInSeconds = _chunkMUNAP5TMcjs.n; exports.months = _chunkMUNAP5TMcjs.u; exports.monthsInSeconds = _chunkMUNAP5TMcjs.v; exports.msToSeconds = _chunkMUNAP5TMcjs.k; exports.parseBaseArgs = _chunkOS5AJMYJcjs.a; exports.parseWhiskToken = Z0; exports.seconds = _chunkMUNAP5TMcjs.l; exports.truncateDecimal = _chunkMUNAP5TMcjs.D; exports.truncateHash = $0; exports.waitForLayerZeroMessageReceived = U0; exports.weeks = _chunkMUNAP5TMcjs.s; exports.weeksInSeconds = _chunkMUNAP5TMcjs.t; exports.wrapNativeToken = _chunkWTCBORPBcjs.a; exports.wrapNativeTokens = _chunkWTCBORPBcjs.b; exports.years = _chunkMUNAP5TMcjs.w; exports.yearsInSeconds = _chunkMUNAP5TMcjs.x;
|
|
2
|
+
//# sourceMappingURL=exports.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/pong/coding/monobera/packages/berajs/dist/utils/exports.cjs","../../src/utils/formatInputTokenValue.ts"],"names":["formatInputTokenValue","inputValue","filteredValue"],"mappings":"AAAA,00BAA0D,yDAAuQ,yDAA0C,yDAAsE,yDAAwD,ICA5dA,EAAAA,CAAyBC,CAAAA,EAAuB,CAC3D,EAAA,CAAIA,CAAAA,GAAe,GAAA,CAAK,OAAOA,CAAAA,CAE/B,IAAIC,CAAAA,CAAgBD,CAAAA,CAAW,OAAA,CAAQ,KAAA,CAAO,EAAE,CAAA,CAAE,UAAA,CAAW,UAAA,CAAY,EAAE,CAAA,CAG3E,OAAIC,CAAAA,CAAc,UAAA,CAAW,GAAG,CAAA,EAAA,CAC9BA,CAAAA,CAAgB,CAAA,CAAA,EAAIA,CAAa,CAAA,CAAA","file":"/Users/pong/coding/monobera/packages/berajs/dist/utils/exports.cjs","sourcesContent":[null,"export const formatInputTokenValue = (inputValue: string) => {\n if (inputValue === \"0\") return inputValue;\n // Remove all non-numeric characters except for the decimal point, and remove leading zeros\n let filteredValue = inputValue.replace(/^0+/, \"\").replaceAll(/[^0-9.]/g, \"\");\n\n // Keep the 0\n if (filteredValue.startsWith(\".\")) {\n filteredValue = `0${filteredValue}`;\n }\n\n return filteredValue;\n};\n"]}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
export { d as defaultBeraFlags } from '../defaultFlags-
|
|
2
|
-
import { R as RequestError } from '../RequestError-
|
|
3
|
-
import
|
|
1
|
+
export { d as defaultBeraFlags } from '../defaultFlags-d0kPbT0i.cjs';
|
|
2
|
+
import { R as RequestError } from '../RequestError-A8XJ6QR9.cjs';
|
|
3
|
+
import BigNumber from '@berachain/utils/pkg/bignumber.js';
|
|
4
4
|
import * as viem from 'viem';
|
|
5
5
|
import { Address, PublicClient } from 'viem';
|
|
6
6
|
import * as _berachain_config_internal from '@berachain/config/internal';
|
|
7
7
|
import { ChainId, BeraConfig } from '@berachain/config/internal';
|
|
8
|
-
import { I as IHoneySwapState } from '../useHoneySwapState-
|
|
9
|
-
import * as
|
|
8
|
+
import { I as IHoneySwapState } from '../useHoneySwapState-B-vmIP1b.cjs';
|
|
9
|
+
import * as _berachain_graphql_bend_whisk from '@berachain/graphql/bend/whisk';
|
|
10
|
+
import { TokenInfoFragmentFragment } from '@berachain/graphql/bend/whisk';
|
|
11
|
+
import * as _berachain_config from '@berachain/config';
|
|
10
12
|
import { GqlValidatorBlockUptimeStatus } from '@berachain/graphql/pol/api';
|
|
11
13
|
import '@berachain/config/internal/flags';
|
|
12
14
|
import '@apollo/client';
|
|
13
|
-
import '../BeraError-
|
|
14
|
-
import 'react/jsx-runtime';
|
|
15
|
+
import '../BeraError-_mQdkanr.cjs';
|
|
15
16
|
import 'react';
|
|
17
|
+
import '../HoneyConfigProvider-Ca3ouozs.cjs';
|
|
18
|
+
import 'react/jsx-runtime';
|
|
16
19
|
import '@berachain-foundation/berancer-sdk';
|
|
17
|
-
import '../
|
|
18
|
-
import '@wagmi/core';
|
|
19
|
-
import 'swr';
|
|
20
|
-
import '@berachain/config';
|
|
21
|
-
import '../txnEnum-BQKDfaeH.cjs';
|
|
20
|
+
import '../honey-CYm0RWf4.cjs';
|
|
22
21
|
|
|
23
22
|
type RequestOptions = RequestInit;
|
|
24
23
|
declare function beraFetch(endpoint: ConstructorParameters<typeof RequestError>[0]["endpoint"], options?: RequestOptions): Promise<Response>;
|
|
@@ -51,8 +50,6 @@ declare const MAX_CUSTOM_SLIPPAGE = 50;
|
|
|
51
50
|
*/
|
|
52
51
|
declare const DEFAULT_METAMASK_GAS_LIMIT = 7920027n;
|
|
53
52
|
|
|
54
|
-
declare const formatAggregatorsQuotes: (rawQuotes: (IRawAggregatorQuote | IRawAggregatorQuote<false>)[], selectedFrom: Token | undefined, selectedTo: Token | undefined, tokenInPrice: number, tokenOutPrice: number) => IAggregatorQuote[];
|
|
55
|
-
|
|
56
53
|
declare const formatInputTokenValue: (inputValue: string) => string;
|
|
57
54
|
|
|
58
55
|
type BigNumberValue = string | number | BigNumber;
|
|
@@ -135,6 +132,7 @@ declare function getTestClient(chainId?: ChainId): {
|
|
|
135
132
|
cacheTime: number;
|
|
136
133
|
ccipRead?: viem.ClientConfig["ccipRead"] | undefined;
|
|
137
134
|
chain: undefined;
|
|
135
|
+
dataSuffix?: viem.DataSuffix | undefined;
|
|
138
136
|
experimental_blockTag?: viem.BlockTag | undefined;
|
|
139
137
|
key: string;
|
|
140
138
|
name: string;
|
|
@@ -183,6 +181,7 @@ declare function getTestClient(chainId?: ChainId): {
|
|
|
183
181
|
cacheTime?: undefined;
|
|
184
182
|
ccipRead?: undefined;
|
|
185
183
|
chain?: undefined;
|
|
184
|
+
dataSuffix?: undefined;
|
|
186
185
|
experimental_blockTag?: undefined;
|
|
187
186
|
key?: undefined;
|
|
188
187
|
name?: undefined;
|
|
@@ -205,18 +204,81 @@ declare function isSubgraphStale({ lastBlockTimestamp, blockTime, }: {
|
|
|
205
204
|
blockTime: number;
|
|
206
205
|
}): boolean;
|
|
207
206
|
|
|
207
|
+
declare enum LayerZeroMessageStatus {
|
|
208
|
+
INFLIGHT = "INFLIGHT",
|
|
209
|
+
DELIVERED = "DELIVERED",
|
|
210
|
+
FAILED = "FAILED"
|
|
211
|
+
}
|
|
212
|
+
type LayerZeroMessage = {
|
|
213
|
+
srcUaAddress: string;
|
|
214
|
+
dstUaAddress: string;
|
|
215
|
+
srcChainId: number;
|
|
216
|
+
dstChainId: number;
|
|
217
|
+
dstTxHash?: string;
|
|
218
|
+
dstTxError?: string;
|
|
219
|
+
srcTxHash?: string;
|
|
220
|
+
srcBlockHash?: string;
|
|
221
|
+
srcBlockNumber?: string;
|
|
222
|
+
srcUaNonce: number;
|
|
223
|
+
status: LayerZeroMessageStatus;
|
|
224
|
+
};
|
|
225
|
+
type LayerZeroDeliveredMessage = LayerZeroMessage & {
|
|
226
|
+
dstTxHash: string;
|
|
227
|
+
};
|
|
228
|
+
type WaitForMessageReceivedOptions = {
|
|
229
|
+
pollInterval?: number;
|
|
230
|
+
timeout?: number;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Polls LayerZero scan API until the cross-chain message is delivered or fails.
|
|
234
|
+
* HTTP errors are silently retried until timeout.
|
|
235
|
+
*
|
|
236
|
+
* @param srcTxHash - The source transaction hash to track
|
|
237
|
+
* @param options - Configuration options
|
|
238
|
+
* @param options.pollInterval - Polling interval in ms (default: 3000)
|
|
239
|
+
* @param options.timeout - Timeout in ms (default: 600000 / 10 minutes)
|
|
240
|
+
* @returns The delivered message with destination tx hash
|
|
241
|
+
* @throws InvalidArgumentError if srcTxHash is missing
|
|
242
|
+
* @throws BeraError if message fails, times out, or multiple messages found
|
|
243
|
+
*/
|
|
244
|
+
declare function waitForLayerZeroMessageReceived(srcTxHash: string, options?: WaitForMessageReceivedOptions): Promise<LayerZeroDeliveredMessage>;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Compute the price impact of a swap
|
|
248
|
+
* @param {string} tokenInPrice - The price of the input token
|
|
249
|
+
* @param {string} tokenOutPrice - The price of the output token
|
|
250
|
+
* @param {string} inAmount - The amount of the input token
|
|
251
|
+
* @param {string} outAmount - The amount of the output token
|
|
252
|
+
* @returns {number} The price impact of the swap
|
|
253
|
+
*/
|
|
254
|
+
declare const computePriceImpact: (tokenInPrice: string, tokenOutPrice: string, inAmount: string, outAmount: string) => number;
|
|
255
|
+
|
|
208
256
|
declare function parseBaseArgs(args: BeraJS.BaseFunctionArgs): {
|
|
209
257
|
config: BeraConfig;
|
|
210
258
|
chainId: _berachain_config_internal.ChainId;
|
|
211
259
|
};
|
|
212
260
|
|
|
213
|
-
declare const getPythDefaultUpdateFee: (tokenListLength: number) => bigint;
|
|
214
|
-
|
|
215
261
|
/**
|
|
216
|
-
*
|
|
262
|
+
* Parse a token from the Whisk API into a TokenWithMetadata object.
|
|
263
|
+
*
|
|
217
264
|
* @returns
|
|
218
265
|
*/
|
|
219
|
-
declare function
|
|
266
|
+
declare function parseWhiskToken(token: TokenInfoFragmentFragment): {
|
|
267
|
+
readonly chainId: 80094;
|
|
268
|
+
readonly __typename?: "Token";
|
|
269
|
+
readonly address: `0x${string}`;
|
|
270
|
+
readonly symbol: string;
|
|
271
|
+
readonly decimals: number;
|
|
272
|
+
readonly icon: string | null;
|
|
273
|
+
readonly category: _berachain_graphql_bend_whisk.TokenCategory | null;
|
|
274
|
+
readonly name: string;
|
|
275
|
+
readonly chain: {
|
|
276
|
+
__typename?: "Chain";
|
|
277
|
+
id: 80094;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
declare const getPythDefaultUpdateFee: (tokenListLength: number) => bigint;
|
|
220
282
|
|
|
221
283
|
/**
|
|
222
284
|
* Convert milliseconds to seconds
|
|
@@ -301,6 +363,7 @@ declare function getHoneyToken(baseArgs: BeraJS.BaseFunctionArgs): {
|
|
|
301
363
|
readonly symbol: "HONEY";
|
|
302
364
|
readonly name: "Honey";
|
|
303
365
|
readonly decimals: 18;
|
|
366
|
+
readonly chainId: _berachain_config.ChainId;
|
|
304
367
|
};
|
|
305
368
|
type KnownTokens = "BERA" | "WBERA" | "BGT" | "HONEY" | "SWBERA" | "ETH";
|
|
306
369
|
type BaseToken$1 = {
|
|
@@ -309,7 +372,7 @@ type BaseToken$1 = {
|
|
|
309
372
|
type InputToken = BaseToken$1 | string | undefined;
|
|
310
373
|
type IsTokenParams = [
|
|
311
374
|
token: InputToken,
|
|
312
|
-
compareTo: BaseToken$1 | Extract<KnownTokens, "BERA" | "WBERA" | "ETH">
|
|
375
|
+
compareTo: BaseToken$1 | Extract<KnownTokens, "BERA" | "WBERA" | "ETH" | "SWBERA">
|
|
313
376
|
] | [
|
|
314
377
|
token: InputToken,
|
|
315
378
|
compareTo: BaseToken$1 | KnownTokens,
|
|
@@ -346,4 +409,4 @@ declare function isValidatorProposer(status: GqlValidatorBlockUptimeStatus | und
|
|
|
346
409
|
*/
|
|
347
410
|
declare function isValidatorSigner(status: GqlValidatorBlockUptimeStatus | undefined): boolean | undefined;
|
|
348
411
|
|
|
349
|
-
export { type BigNumberValue, CAP_LIMIT_BUFFER, DEFAULT_METAMASK_GAS_LIMIT, type FormatNumberOptions, MAX_CUSTOM_DEADLINE, MAX_CUSTOM_SLIPPAGE, MIN_CUSTOM_DEADLINE, MIN_CUSTOM_SLIPPAGE, beraFetch, beraFetchJson, calculateTimestampFromDays, days, daysInSeconds,
|
|
412
|
+
export { type BigNumberValue, CAP_LIMIT_BUFFER, DEFAULT_METAMASK_GAS_LIMIT, type FormatNumberOptions, type LayerZeroDeliveredMessage, type LayerZeroMessage, LayerZeroMessageStatus, MAX_CUSTOM_DEADLINE, MAX_CUSTOM_SLIPPAGE, MIN_CUSTOM_DEADLINE, MIN_CUSTOM_SLIPPAGE, type WaitForMessageReceivedOptions, beraFetch, beraFetchJson, calculateTimestampFromDays, computePriceImpact, days, daysInSeconds, formatInputTokenValue, formatNumber, formatTimeLeft, formatUnixTimestamp, formatUsd, getContractName, getHoneySwapMessage, getHoneyToken, getPythDefaultUpdateFee, getSafeNumber, getServerSidePublicClient, getTestClient, hours, hoursInSeconds, beraToken as internal_beraToken, wBeraToken as internal_wBeraToken, isDifferenceExceedingThreshold, isSubgraphStale, isToken, isValidatorProposer, isValidatorSigner, minutes, minutesInSeconds, months, monthsInSeconds, msToSeconds, parseBaseArgs, parseWhiskToken, seconds, truncateDecimal, truncateHash, waitForLayerZeroMessageReceived, weeks, weeksInSeconds, wrapNativeToken, wrapNativeTokens, years, yearsInSeconds };
|