@pimlico/alto 0.0.19 → 0.0.21
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/contracts/EIP712.sol/EIP712.json +1 -1
- package/contracts/ERC165.sol/ERC165.json +1 -1
- package/contracts/ERC20.sol/ERC20.json +1 -1
- package/contracts/Eip7702Support.sol/Eip7702Support.json +1 -1
- package/contracts/EntryPoint.sol/EntryPoint.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
- package/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
- package/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
- package/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
- package/contracts/Exec.sol/Exec.json +1 -1
- package/contracts/IAccount.sol/IAccount.json +1 -1
- package/contracts/IAccountExecute.sol/IAccountExecute.json +1 -1
- package/contracts/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/IERC165.sol/IERC165.json +1 -1
- package/contracts/IERC5267.sol/IERC5267.json +1 -1
- package/contracts/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride08.json +1 -0
- package/contracts/IEntryPointFilterOpsOverride.sol/IEntryPointFilterOpsOverride09.json +1 -0
- package/contracts/IEntryPointSimulations.sol/IEntryPointSimulations.json +1 -1
- package/contracts/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/IPaymaster.sol/IPaymaster.json +1 -1
- package/contracts/ISenderCreator.sol/ISenderCreator.json +1 -1
- package/contracts/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/LibBytes.sol/LibBytes.json +1 -1
- package/contracts/Math.sol/Math.json +1 -1
- package/contracts/MessageHashUtils.sol/MessageHashUtils.json +1 -1
- package/contracts/NonceManager.sol/NonceManager.json +1 -1
- package/contracts/Panic.sol/Panic.json +1 -1
- package/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
- package/contracts/ReentrancyGuard.sol/ReentrancyGuard.json +1 -1
- package/contracts/ReentrancyGuardTransient.sol/ReentrancyGuardTransient.json +1 -1
- package/contracts/SafeCast.sol/SafeCast.json +1 -1
- package/contracts/SenderCreator.sol/SenderCreator.json +1 -1
- package/contracts/ShortStrings.sol/ShortStrings.json +1 -1
- package/contracts/SignedMath.sol/SignedMath.json +1 -1
- package/contracts/SimulationOverrideHelper.sol/SimulationOverrideHelper.json +1 -0
- package/contracts/StakeManager.sol/StakeManager.json +1 -1
- package/contracts/StorageSlot.sol/StorageSlot.json +1 -1
- package/contracts/Strings.sol/Strings.json +1 -1
- package/contracts/TransientSlot.sol/TransientSlot.json +1 -1
- package/contracts/UserOperation.sol/UserOperationLib.json +1 -1
- package/contracts/UserOperationLib.sol/UserOperationLib.json +1 -1
- package/contracts/account-abstraction-v9/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -0
- package/contracts/account-abstraction-v9/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -0
- package/contracts/account-abstraction-v9/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -0
- package/contracts/account-abstraction-v9/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -0
- package/contracts/build-info/{880955d5786bfdae.json → 031b289b93191224.json} +1 -1
- package/contracts/build-info/181f3522c3744403.json +1 -0
- package/contracts/build-info/a2db592afab5c9de.json +1 -0
- package/contracts/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/core/Eip7702Support.sol/Eip7702Support.json +1 -0
- package/contracts/core/NonceManager.sol/NonceManager.json +1 -0
- package/contracts/core/SenderCreator.sol/SenderCreator.json +1 -0
- package/contracts/core/StakeManager.sol/StakeManager.json +1 -0
- package/contracts/core/UserOperationLib.sol/UserOperationLib.json +1 -0
- package/contracts/interfaces/IAccount.sol/IAccount.json +1 -0
- package/contracts/interfaces/IAccountExecute.sol/IAccountExecute.json +1 -0
- package/contracts/interfaces/IAggregator.sol/IAggregator.json +1 -1
- package/contracts/interfaces/IEntryPoint.sol/IEntryPoint.json +1 -1
- package/contracts/interfaces/INonceManager.sol/INonceManager.json +1 -1
- package/contracts/interfaces/IPaymaster.sol/IPaymaster.json +1 -0
- package/contracts/interfaces/ISenderCreator.sol/ISenderCreator.json +1 -0
- package/contracts/interfaces/IStakeManager.sol/IStakeManager.json +1 -1
- package/contracts/overrides/Eip7702Support.sol/Eip7702Support.json +1 -0
- package/contracts/overrides/NonceManager.sol/NonceManager.json +1 -0
- package/contracts/overrides/SenderCreator.sol/SenderCreator.json +1 -0
- package/contracts/overrides/StakeManager.sol/StakeManager.json +1 -0
- package/contracts/overrides/UserOperationLib.sol/UserOperationLib.json +1 -0
- package/contracts/utils/Exec.sol/Exec.json +1 -1
- package/contracts/utils/StorageSlot.sol/StorageSlot.json +1 -0
- package/contracts/v09/EntryPoint.sol/EntryPoint.json +1 -0
- package/esm/cli/alto.js +17 -6
- package/esm/cli/alto.js.map +1 -1
- package/esm/cli/config/bundler.d.ts +459 -321
- package/esm/cli/config/bundler.js +125 -91
- package/esm/cli/config/bundler.js.map +1 -1
- package/esm/cli/config/options.d.ts +4 -1
- package/esm/cli/config/options.js +233 -106
- package/esm/cli/config/options.js.map +1 -1
- package/esm/cli/customTransport.d.ts +3 -3
- package/esm/cli/deploySimulationsContract.d.ts +1 -0
- package/esm/cli/deploySimulationsContract.js +41 -5
- package/esm/cli/deploySimulationsContract.js.map +1 -1
- package/esm/cli/handler.js +76 -80
- package/esm/cli/handler.js.map +1 -1
- package/esm/cli/multiRpcTransport.d.ts +7 -0
- package/esm/cli/multiRpcTransport.js +52 -0
- package/esm/cli/multiRpcTransport.js.map +1 -0
- package/esm/cli/setupServer.js +92 -70
- package/esm/cli/setupServer.js.map +1 -1
- package/esm/cli/shutDown.d.ts +20 -0
- package/esm/cli/shutDown.js +285 -0
- package/esm/cli/shutDown.js.map +1 -0
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride06.json +1 -1
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride07.json +1 -1
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride08.json +1 -1
- package/esm/contracts/EntryPointFilterOpsOverride.sol/EntryPointFilterOpsOverride09.json +1 -0
- package/esm/contracts/EntryPointGasEstimationOverride.sol/EntryPointGasEstimationOverride06.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations07.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations08.json +1 -1
- package/esm/contracts/EntryPointSimulations.sol/EntryPointSimulations09.json +1 -0
- package/esm/contracts/PimlicoSimulations.sol/PimlicoSimulations.json +1 -1
- package/esm/createConfig.d.ts +9 -2
- package/esm/createConfig.js.map +1 -1
- package/esm/executor/{userOpMonitor.d.ts → bundleManager.d.ts} +56 -37
- package/esm/executor/bundleManager.js +393 -0
- package/esm/executor/bundleManager.js.map +1 -0
- package/esm/executor/executor.d.ts +4 -3
- package/esm/executor/executor.js +47 -23
- package/esm/executor/executor.js.map +1 -1
- package/esm/executor/executorManager.d.ts +20 -15
- package/esm/executor/executorManager.js +248 -67
- package/esm/executor/executorManager.js.map +1 -1
- package/esm/executor/filterOpsAndEstimateGas.d.ts +17 -2
- package/esm/executor/filterOpsAndEstimateGas.js +100 -77
- package/esm/executor/filterOpsAndEstimateGas.js.map +1 -1
- package/esm/executor/getBundleStatus.d.ts +5 -1
- package/esm/executor/getBundleStatus.js.map +1 -1
- package/esm/executor/index.d.ts +1 -0
- package/esm/executor/index.js +1 -0
- package/esm/executor/index.js.map +1 -1
- package/esm/executor/senderManager/createMemorySenderManager.js +13 -0
- package/esm/executor/senderManager/createMemorySenderManager.js.map +1 -1
- package/esm/executor/senderManager/createRedisSenderManager.d.ts +2 -1
- package/esm/executor/senderManager/createRedisSenderManager.js +45 -26
- package/esm/executor/senderManager/createRedisSenderManager.js.map +1 -1
- package/esm/executor/senderManager/flushOnStartUp.js +7 -5
- package/esm/executor/senderManager/flushOnStartUp.js.map +1 -1
- package/esm/executor/senderManager/index.d.ts +1 -0
- package/esm/executor/senderManager/index.js +6 -2
- package/esm/executor/senderManager/index.js.map +1 -1
- package/esm/executor/senderManager/validateAndRefill.js +268 -85
- package/esm/executor/senderManager/validateAndRefill.js.map +1 -1
- package/esm/executor/utils.d.ts +8 -3
- package/esm/executor/utils.js +59 -27
- package/esm/executor/utils.js.map +1 -1
- package/esm/handlers/arbitrumGasPriceManager.d.ts +3 -2
- package/esm/handlers/arbitrumGasPriceManager.js +6 -2
- package/esm/handlers/arbitrumGasPriceManager.js.map +1 -1
- package/esm/handlers/citreaManager.d.ts +10 -0
- package/esm/handlers/citreaManager.js +17 -0
- package/esm/handlers/citreaManager.js.map +1 -0
- package/esm/handlers/eventManager.d.ts +9 -9
- package/esm/handlers/eventManager.js +59 -60
- package/esm/handlers/eventManager.js.map +1 -1
- package/esm/handlers/gasPriceManager.d.ts +17 -10
- package/esm/handlers/gasPriceManager.js +245 -99
- package/esm/handlers/gasPriceManager.js.map +1 -1
- package/esm/handlers/mantleGasPriceManager.d.ts +4 -4
- package/esm/handlers/mantleGasPriceManager.js +4 -4
- package/esm/handlers/mantleGasPriceManager.js.map +1 -1
- package/esm/handlers/optimismManager.d.ts +1 -1
- package/esm/handlers/optimismManager.js +1 -1
- package/esm/handlers/optimismManager.js.map +1 -1
- package/esm/mempool/index.d.ts +1 -1
- package/esm/mempool/index.js +1 -1
- package/esm/mempool/index.js.map +1 -1
- package/esm/mempool/mempool.d.ts +61 -22
- package/esm/mempool/mempool.js +223 -133
- package/esm/mempool/mempool.js.map +1 -1
- package/esm/mempool/reputationManager.d.ts +14 -14
- package/esm/mempool/reputationManager.js +36 -39
- package/esm/mempool/reputationManager.js.map +1 -1
- package/esm/mempool/statusManager.d.ts +20 -0
- package/esm/mempool/statusManager.js +143 -0
- package/esm/mempool/statusManager.js.map +1 -0
- package/esm/receiptCache/createMemoryReceiptCache.d.ts +3 -0
- package/esm/receiptCache/createMemoryReceiptCache.js +30 -0
- package/esm/receiptCache/createMemoryReceiptCache.js.map +1 -0
- package/esm/receiptCache/createRedisReceiptCache.d.ts +10 -0
- package/esm/receiptCache/createRedisReceiptCache.js +56 -0
- package/esm/receiptCache/createRedisReceiptCache.js.map +1 -0
- package/esm/receiptCache/index.d.ts +11 -0
- package/esm/receiptCache/index.js +21 -0
- package/esm/receiptCache/index.js.map +1 -0
- package/esm/rpc/createMethodHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimationHandler.d.ts +2 -4
- package/esm/rpc/estimation/gasEstimationHandler.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations06.d.ts +6 -7
- package/esm/rpc/estimation/gasEstimations06.js +1 -5
- package/esm/rpc/estimation/gasEstimations06.js.map +1 -1
- package/esm/rpc/estimation/gasEstimations07.d.ts +13 -41
- package/esm/rpc/estimation/gasEstimations07.js +27 -34
- package/esm/rpc/estimation/gasEstimations07.js.map +1 -1
- package/esm/{utils/preVerificationGasCalulator.d.ts → rpc/estimation/preVerificationGasCalculator.d.ts} +20 -6
- package/esm/{utils/preVerificationGasCalulator.js → rpc/estimation/preVerificationGasCalculator.js} +134 -48
- package/esm/rpc/estimation/preVerificationGasCalculator.js.map +1 -0
- package/esm/rpc/estimation/types.d.ts +4 -2
- package/esm/rpc/estimation/utils.d.ts +10 -8
- package/esm/rpc/estimation/utils.js +56 -53
- package/esm/rpc/estimation/utils.js.map +1 -1
- package/esm/rpc/methods/boost_sendUserOperation.d.ts +304 -0
- package/esm/rpc/methods/boost_sendUserOperation.js +1 -1
- package/esm/rpc/methods/boost_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_clearReputation.js +1 -1
- package/esm/rpc/methods/debug_bundler_clearReputation.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_clearState.js +1 -1
- package/esm/rpc/methods/debug_bundler_clearState.js.map +1 -1
- package/esm/rpc/methods/debug_bundler_dumpMempool.d.ts +338 -0
- package/esm/rpc/methods/debug_bundler_dumpReputation.js +1 -1
- package/esm/rpc/methods/debug_bundler_dumpReputation.js.map +1 -1
- package/esm/rpc/methods/eth_estimateUserOperationGas.d.ts +622 -14
- package/esm/rpc/methods/eth_estimateUserOperationGas.js +61 -30
- package/esm/rpc/methods/eth_estimateUserOperationGas.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationByHash.d.ts +621 -11
- package/esm/rpc/methods/eth_getUserOperationByHash.js.map +1 -1
- package/esm/rpc/methods/eth_getUserOperationReceipt.d.ts +34 -34
- package/esm/rpc/methods/eth_getUserOperationReceipt.js +1 -1
- package/esm/rpc/methods/eth_sendUserOperation.d.ts +307 -3
- package/esm/rpc/methods/eth_sendUserOperation.js +153 -48
- package/esm/rpc/methods/eth_sendUserOperation.js.map +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js +1 -1
- package/esm/rpc/methods/pimlico_getUserOperationStatus.js.map +1 -1
- package/esm/rpc/methods/pimlico_sendUserOperationNow.d.ts +338 -34
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js +26 -29
- package/esm/rpc/methods/pimlico_sendUserOperationNow.js.map +1 -1
- package/esm/rpc/methods/pimlico_simulateAssetChange.d.ts +620 -12
- package/esm/rpc/methods/pimlico_simulateAssetChange.js +14 -19
- package/esm/rpc/methods/pimlico_simulateAssetChange.js.map +1 -1
- package/esm/rpc/rpcHandler.d.ts +38 -26
- package/esm/rpc/rpcHandler.js +97 -44
- package/esm/rpc/rpcHandler.js.map +1 -1
- package/esm/rpc/server.d.ts +5 -5
- package/esm/rpc/server.js +15 -11
- package/esm/rpc/server.js.map +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.js +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV06.js.map +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.js +1 -1
- package/esm/rpc/validation/BundlerCollectorTracerV07.js.map +1 -1
- package/esm/rpc/validation/SafeValidator.d.ts +13 -14
- package/esm/rpc/validation/SafeValidator.js +24 -24
- package/esm/rpc/validation/SafeValidator.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV06.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV06.js +11 -11
- package/esm/rpc/validation/TracerResultParserV06.js.map +1 -1
- package/esm/rpc/validation/TracerResultParserV07.d.ts +2 -2
- package/esm/rpc/validation/TracerResultParserV07.js +13 -13
- package/esm/rpc/validation/TracerResultParserV07.js.map +1 -1
- package/esm/rpc/validation/UnsafeValidator.d.ts +18 -14
- package/esm/rpc/validation/UnsafeValidator.js +76 -41
- package/esm/rpc/validation/UnsafeValidator.js.map +1 -1
- package/esm/store/createMempoolStore.d.ts +1 -1
- package/esm/store/createMempoolStore.js +79 -140
- package/esm/store/createMempoolStore.js.map +1 -1
- package/esm/store/index.d.ts +4 -75
- package/esm/store/index.js +4 -1
- package/esm/store/index.js.map +1 -1
- package/esm/store/outstanding/index.d.ts +13 -0
- package/esm/store/outstanding/index.js +16 -0
- package/esm/store/outstanding/index.js.map +1 -0
- package/esm/store/{createMemoryOutstandingStore.d.ts → outstanding/memory.d.ts} +14 -13
- package/esm/store/outstanding/memory.js +263 -0
- package/esm/store/outstanding/memory.js.map +1 -0
- package/esm/store/outstanding/redis.d.ts +11 -0
- package/esm/store/outstanding/redis.js +229 -0
- package/esm/store/outstanding/redis.js.map +1 -0
- package/esm/store/outstanding/types.d.ts +19 -0
- package/esm/store/outstanding/types.js +2 -0
- package/esm/store/outstanding/types.js.map +1 -0
- package/esm/store/processing/index.d.ts +11 -0
- package/esm/store/processing/index.js +17 -0
- package/esm/store/processing/index.js.map +1 -0
- package/esm/store/processing/memory.d.ts +19 -0
- package/esm/store/processing/memory.js +83 -0
- package/esm/store/processing/memory.js.map +1 -0
- package/esm/store/processing/redis.d.ts +26 -0
- package/esm/store/processing/redis.js +123 -0
- package/esm/store/processing/redis.js.map +1 -0
- package/esm/store/processing/types.d.ts +12 -0
- package/esm/store/processing/types.js +2 -0
- package/esm/store/processing/types.js.map +1 -0
- package/esm/store/types.d.ts +52 -0
- package/esm/store/types.js +2 -0
- package/esm/store/types.js.map +1 -0
- package/esm/types/contracts/Multicall3.d.ts +34 -0
- package/esm/types/contracts/Multicall3.js +31 -0
- package/esm/types/contracts/Multicall3.js.map +1 -0
- package/esm/types/contracts/PimlicoSimulations.d.ts +81 -0
- package/esm/types/contracts/PimlicoSimulations.js +105 -0
- package/esm/types/contracts/PimlicoSimulations.js.map +1 -1
- package/esm/types/contracts/index.d.ts +1 -1
- package/esm/types/contracts/index.js +1 -1
- package/esm/types/contracts/index.js.map +1 -1
- package/esm/types/gasPrice.js +0 -18
- package/esm/types/gasPrice.js.map +1 -1
- package/esm/types/interfaces.d.ts +15 -10
- package/esm/types/mempool.d.ts +3 -0
- package/esm/types/schemas.d.ts +13184 -4741
- package/esm/types/schemas.js +116 -27
- package/esm/types/schemas.js.map +1 -1
- package/esm/types/utils.d.ts +2 -5
- package/esm/types/utils.js +16 -18
- package/esm/types/utils.js.map +1 -1
- package/esm/types/validation.d.ts +7646 -6912
- package/esm/types/validation.js +122 -152
- package/esm/types/validation.js.map +1 -1
- package/esm/utils/eip7702.d.ts +2 -1
- package/esm/utils/eip7702.js +14 -8
- package/esm/utils/eip7702.js.map +1 -1
- package/esm/utils/entryPointOverrides.js +18 -4
- package/esm/utils/entryPointOverrides.js.map +1 -1
- package/esm/utils/helpers.d.ts +7 -1
- package/esm/utils/helpers.js +36 -11
- package/esm/utils/helpers.js.map +1 -1
- package/esm/utils/index.d.ts +0 -1
- package/esm/utils/index.js +0 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/metrics.d.ts +4 -1
- package/esm/utils/metrics.js +34 -7
- package/esm/utils/metrics.js.map +1 -1
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js +8 -9
- package/esm/utils/minMaxQueue/createMemoryMinMaxQueue.js.map +1 -1
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.d.ts +24 -2
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js +85 -64
- package/esm/utils/minMaxQueue/createRedisMinMaxQueue.js.map +1 -1
- package/esm/utils/minMaxQueue/index.d.ts +2 -2
- package/esm/utils/minMaxQueue/index.js +4 -3
- package/esm/utils/minMaxQueue/index.js.map +1 -1
- package/esm/utils/rpc-reply.d.ts +3 -3
- package/esm/utils/rpc-reply.js.map +1 -1
- package/esm/utils/toViemStateOverrides.js +7 -7
- package/esm/utils/toViemStateOverrides.js.map +1 -1
- package/esm/utils/userop.d.ts +110 -56
- package/esm/utils/userop.js +161 -249
- package/esm/utils/userop.js.map +1 -1
- package/package.json +4 -2
- package/contracts/build-info/7710b5a048396e70.json +0 -1
- package/esm/executor/userOpMonitor.js +0 -326
- package/esm/executor/userOpMonitor.js.map +0 -1
- package/esm/executor/utilityWalletMonitor.d.ts +0 -19
- package/esm/executor/utilityWalletMonitor.js +0 -38
- package/esm/executor/utilityWalletMonitor.js.map +0 -1
- package/esm/mempool/monitoring.d.ts +0 -15
- package/esm/mempool/monitoring.js +0 -118
- package/esm/mempool/monitoring.js.map +0 -1
- package/esm/store/createMemoryOutstandingStore.js +0 -240
- package/esm/store/createMemoryOutstandingStore.js.map +0 -1
- package/esm/store/createRedisOutstandingStore.d.ts +0 -27
- package/esm/store/createRedisOutstandingStore.js +0 -344
- package/esm/store/createRedisOutstandingStore.js.map +0 -1
- package/esm/store/createRedisStore.d.ts +0 -9
- package/esm/store/createRedisStore.js +0 -131
- package/esm/store/createRedisStore.js.map +0 -1
- package/esm/store/createStore.d.ts +0 -6
- package/esm/store/createStore.js +0 -66
- package/esm/store/createStore.js.map +0 -1
- package/esm/types/contracts/CallEngine.d.ts +0 -28
- package/esm/types/contracts/CallEngine.js +0 -37
- package/esm/types/contracts/CallEngine.js.map +0 -1
- package/esm/utils/preVerificationGasCalulator.js.map +0 -1
|
@@ -5,6 +5,9 @@ import entrypointSimulationsJsonV7 from "../contracts/EntryPointSimulations.sol/
|
|
|
5
5
|
import entrypointSimulationsJsonV8 from "../contracts/EntryPointSimulations.sol/EntryPointSimulations08.json" with {
|
|
6
6
|
type: "json"
|
|
7
7
|
};
|
|
8
|
+
import entrypointSimulationsJsonV9 from "../contracts/EntryPointSimulations.sol/EntryPointSimulations09.json" with {
|
|
9
|
+
type: "json"
|
|
10
|
+
};
|
|
8
11
|
import pimlicoSimulationsJson from "../contracts/PimlicoSimulations.sol/PimlicoSimulations.json" with {
|
|
9
12
|
type: "json"
|
|
10
13
|
};
|
|
@@ -39,10 +42,17 @@ export const deploySimulationsContract = async ({ logger, args, publicClient })
|
|
|
39
42
|
salt,
|
|
40
43
|
from: args.deterministicDeployerAddress
|
|
41
44
|
});
|
|
42
|
-
const
|
|
45
|
+
const epSimulationsV9 = getContractAddress({
|
|
46
|
+
opcode: "CREATE2",
|
|
47
|
+
bytecode: entrypointSimulationsJsonV9.bytecode.object,
|
|
48
|
+
salt,
|
|
49
|
+
from: args.deterministicDeployerAddress
|
|
50
|
+
});
|
|
51
|
+
const [isPimlicoDeployed, isDeployedV7, isDeployedV8, isDeployedV9, isDeterministicDeployerDeployed] = await Promise.all([
|
|
43
52
|
isContractDeployed({ publicClient, address: pimlicoSimulations }),
|
|
44
53
|
isContractDeployed({ publicClient, address: epSimulationsV7 }),
|
|
45
54
|
isContractDeployed({ publicClient, address: epSimulationsV8 }),
|
|
55
|
+
isContractDeployed({ publicClient, address: epSimulationsV9 }),
|
|
46
56
|
isContractDeployed({
|
|
47
57
|
publicClient,
|
|
48
58
|
address: args.deterministicDeployerAddress
|
|
@@ -50,12 +60,14 @@ export const deploySimulationsContract = async ({ logger, args, publicClient })
|
|
|
50
60
|
]);
|
|
51
61
|
if (isDeployedV7 &&
|
|
52
62
|
isDeployedV8 &&
|
|
63
|
+
isDeployedV9 &&
|
|
53
64
|
isPimlicoDeployed &&
|
|
54
65
|
isDeterministicDeployerDeployed) {
|
|
55
66
|
return {
|
|
56
67
|
pimlicoSimulationContract: pimlicoSimulations,
|
|
57
68
|
entrypointSimulationContractV7: epSimulationsV7,
|
|
58
|
-
entrypointSimulationContractV8: epSimulationsV8
|
|
69
|
+
entrypointSimulationContractV8: epSimulationsV8,
|
|
70
|
+
entrypointSimulationContractV9: epSimulationsV9
|
|
59
71
|
};
|
|
60
72
|
}
|
|
61
73
|
const walletClient = createWalletClient({
|
|
@@ -119,19 +131,43 @@ export const deploySimulationsContract = async ({ logger, args, publicClient })
|
|
|
119
131
|
logger.error("Failed to deploy simulationsContract V8");
|
|
120
132
|
}
|
|
121
133
|
}
|
|
134
|
+
if (!isDeployedV9) {
|
|
135
|
+
try {
|
|
136
|
+
const deployHash = await walletClient.sendTransaction({
|
|
137
|
+
chain: publicClient.chain,
|
|
138
|
+
to: args.deterministicDeployerAddress,
|
|
139
|
+
data: concat([
|
|
140
|
+
salt,
|
|
141
|
+
entrypointSimulationsJsonV9.bytecode.object
|
|
142
|
+
])
|
|
143
|
+
});
|
|
144
|
+
await publicClient.waitForTransactionReceipt({
|
|
145
|
+
hash: deployHash
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
logger.error("Failed to deploy simulationsContract V9");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
122
152
|
const deployStatus = await Promise.all([
|
|
123
153
|
isContractDeployed({ publicClient, address: pimlicoSimulations }),
|
|
124
154
|
isContractDeployed({ publicClient, address: epSimulationsV7 }),
|
|
125
|
-
isContractDeployed({ publicClient, address: epSimulationsV8 })
|
|
155
|
+
isContractDeployed({ publicClient, address: epSimulationsV8 }),
|
|
156
|
+
isContractDeployed({ publicClient, address: epSimulationsV9 })
|
|
126
157
|
]);
|
|
127
158
|
// EntryPointSimulationsV8 is optional as not all chains support cancun.
|
|
128
|
-
if (!deployStatus[
|
|
129
|
-
logger.error("Failed to deploy simulationsContract
|
|
159
|
+
if (!deployStatus[2]) {
|
|
160
|
+
logger.error("Failed to deploy simulationsContract 0.7");
|
|
161
|
+
}
|
|
162
|
+
// EntryPointSimulationsV8 is optional as not all chains support cancun.
|
|
163
|
+
if (!deployStatus[3]) {
|
|
164
|
+
logger.error("Failed to deploy simulationsContract 0.9");
|
|
130
165
|
}
|
|
131
166
|
if (deployStatus[0]) {
|
|
132
167
|
return {
|
|
133
168
|
entrypointSimulationContractV7: epSimulationsV7,
|
|
134
169
|
entrypointSimulationContractV8: epSimulationsV8,
|
|
170
|
+
entrypointSimulationContractV9: epSimulationsV9,
|
|
135
171
|
pimlicoSimulationContract: pimlicoSimulations
|
|
136
172
|
};
|
|
137
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploySimulationsContract.js","sourceRoot":"","sources":["../../cli/deploySimulationsContract.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,IAAI,EAKJ,MAAM,EACN,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACZ,MAAM,MAAM,CAAA;AACb,OAAO,2BAA2B,MAAM,qEAAqE,CAAC;IAC1G,IAAI,EAAE,MAAM;CACf,CAAA;AACD,OAAO,2BAA2B,MAAM,qEAAqE,CAAC;IAC1G,IAAI,EAAE,MAAM;CACf,CAAA;AACD,OAAO,sBAAsB,MAAM,6DAA6D,CAAC;IAC7F,IAAI,EAAE,MAAM;CACf,CAAA;AAGD,MAAM,CAAC,MAAM,kCAAkC,GAC3C,kVAAkV,CAAA;AAEtV,MAAM,kBAAkB,GAAG,KAAK,EAAE,EAC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,IAAI,EAAE,UAAU;aACnB,CAAC,CAAA;QACN,CAAC;QAAC,MAAM,CAAC;YACL,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;QAC3D,CAAC;IACL,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnC,kBAAkB,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QACjE,kBAAkB,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAC9D,kBAAkB,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QAC9D,kBAAkB,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;KACjE,CAAC,CAAA;IAEF,wEAAwE;IACxE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC5D,CAAC;IAED,wEAAwE;IACxE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC5D,CAAC;IAED,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QAClB,OAAO;YACH,8BAA8B,EAAE,eAAe;YAC/C,8BAA8B,EAAE,eAAe;YAC/C,8BAA8B,EAAE,eAAe;YAC/C,yBAAyB,EAAE,kBAAkB;SAChD,CAAA;IACL,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;AAC3D,CAAC,CAAA"}
|
package/esm/cli/handler.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { GasPriceManager } from "../handlers/index.js";
|
|
2
|
-
import { createMetrics, initDebugLogger, initProductionLogger } from "../utils/index.js";
|
|
2
|
+
import { createMetrics, formatNativeBalance, initDebugLogger, initProductionLogger } from "../utils/index.js";
|
|
3
3
|
import { Registry } from "prom-client";
|
|
4
|
-
import { createPublicClient, createWalletClient, fallback,
|
|
4
|
+
import { createPublicClient, createWalletClient, fallback, publicActions } from "viem";
|
|
5
5
|
import * as chains from "viem/chains";
|
|
6
6
|
import { createConfig } from "../createConfig.js";
|
|
7
7
|
import { getSenderManager } from "../executor/senderManager/index.js";
|
|
8
|
-
import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor.js";
|
|
9
8
|
import { customTransport } from "./customTransport.js";
|
|
10
9
|
import { deploySimulationsContract } from "./deploySimulationsContract.js";
|
|
10
|
+
import { multiRpcTransport } from "./multiRpcTransport.js";
|
|
11
11
|
import { parseArgs } from "./parseArgs.js";
|
|
12
12
|
import { setupServer } from "./setupServer.js";
|
|
13
13
|
const preFlightChecks = async (config) => {
|
|
14
|
+
// Check horizontal scaling configuration
|
|
15
|
+
if (config.enableHorizontalScaling && !config.redisEndpoint) {
|
|
16
|
+
throw new Error("Horizontal scaling is enabled but redis-endpoint is not configured.");
|
|
17
|
+
}
|
|
18
|
+
// Check Redis receipt cache configuration
|
|
19
|
+
if (config.enableRedisReceiptCache && !config.redisEndpoint) {
|
|
20
|
+
throw new Error("Redis receipt cache is enabled but redis-endpoint is not configured.");
|
|
21
|
+
}
|
|
14
22
|
for (const entrypoint of config.entrypoints) {
|
|
15
23
|
const entryPointCode = await config.publicClient.getCode({
|
|
16
24
|
address: entrypoint
|
|
@@ -48,15 +56,17 @@ const preFlightChecks = async (config) => {
|
|
|
48
56
|
// )
|
|
49
57
|
// }
|
|
50
58
|
// }
|
|
51
|
-
if (config.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
// if (config.entrypointSimulationContractV9) {
|
|
60
|
+
// const simulations = config.entrypointSimulationContractV9
|
|
61
|
+
// const simulationsCode = await config.publicClient.getCode({
|
|
62
|
+
// address: simulations
|
|
63
|
+
// })
|
|
64
|
+
// if (simulationsCode === undefined || simulationsCode === "0x") {
|
|
65
|
+
// throw new Error(
|
|
66
|
+
// `EntryPointSimulationsV9 contract ${simulations} does not exist`
|
|
67
|
+
// )
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
60
70
|
};
|
|
61
71
|
const getViemChain = ({ chainId, args }) => {
|
|
62
72
|
for (const chain of Object.values(chains)) {
|
|
@@ -75,6 +85,7 @@ const getViemChain = ({ chainId, args }) => {
|
|
|
75
85
|
};
|
|
76
86
|
export async function bundlerHandler(args_) {
|
|
77
87
|
const args = parseArgs(args_);
|
|
88
|
+
const enableCors = args.enableCors;
|
|
78
89
|
const logger = args.json
|
|
79
90
|
? initProductionLogger(args.logLevel)
|
|
80
91
|
: initDebugLogger(args.logLevel);
|
|
@@ -103,7 +114,8 @@ export async function bundlerHandler(args_) {
|
|
|
103
114
|
rpcUrls: {
|
|
104
115
|
default: { http: [args.rpcUrl] },
|
|
105
116
|
public: { http: [args.rpcUrl] }
|
|
106
|
-
}
|
|
117
|
+
},
|
|
118
|
+
experimental_preconfirmationTime: args.flashblocksPreconfirmationTime
|
|
107
119
|
};
|
|
108
120
|
let publicClient = createPublicClient({
|
|
109
121
|
transport: customTransport(args.rpcUrl, {
|
|
@@ -111,74 +123,50 @@ export async function bundlerHandler(args_) {
|
|
|
111
123
|
level: args.publicClientLogLevel || args.logLevel
|
|
112
124
|
})
|
|
113
125
|
}),
|
|
114
|
-
pollingInterval: args.blockTime / 2,
|
|
126
|
+
pollingInterval: args.blockPollingInterval ?? args.blockTime / 2,
|
|
115
127
|
chain
|
|
116
128
|
});
|
|
117
|
-
// When Flashblocks support is enabled, override the relevant public actions
|
|
118
|
-
// to always query against the "pending" block tag as per
|
|
119
|
-
// https://docs.base.org/chain/flashblocks/apps
|
|
120
|
-
if (args.flashblocksEnabled) {
|
|
121
|
-
publicClient = publicClient
|
|
122
|
-
.extend((client) => ({
|
|
123
|
-
// @ts-ignore
|
|
124
|
-
async getBlock(args) {
|
|
125
|
-
if (args?.blockHash !== undefined ||
|
|
126
|
-
args?.blockNumber !== undefined) {
|
|
127
|
-
return await client.getBlock(args);
|
|
128
|
-
}
|
|
129
|
-
return await client.getBlock({
|
|
130
|
-
blockTag: "pending"
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
async getBalance(args) {
|
|
134
|
-
if (args.blockNumber !== undefined) {
|
|
135
|
-
return await client.getBalance(args);
|
|
136
|
-
}
|
|
137
|
-
return await client.getBalance({
|
|
138
|
-
address: args.address,
|
|
139
|
-
blockNumber: undefined,
|
|
140
|
-
blockTag: "pending"
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
async getTransactionCount(args) {
|
|
144
|
-
if (args.blockNumber !== undefined) {
|
|
145
|
-
return await client.getTransactionCount(args);
|
|
146
|
-
}
|
|
147
|
-
return await client.getTransactionCount({
|
|
148
|
-
address: args.address,
|
|
149
|
-
blockNumber: undefined,
|
|
150
|
-
blockTag: "pending"
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}))
|
|
154
|
-
// @ts-ignore
|
|
155
|
-
.extend(publicActions);
|
|
156
|
-
}
|
|
157
129
|
// Some permissioned chains require a whitelisted address to make deployments.
|
|
158
130
|
// In order for simulations to work, we need to make our eth_call's from a whitelisted address.
|
|
159
131
|
if (args.ethCallSenderAddress) {
|
|
160
132
|
const whitelistedSender = args.ethCallSenderAddress;
|
|
161
|
-
|
|
162
|
-
.extend((client) => ({
|
|
133
|
+
const withEthCallSender = (client) => ({
|
|
163
134
|
async call(args) {
|
|
164
|
-
|
|
165
|
-
|
|
135
|
+
return await client.call({
|
|
136
|
+
...args,
|
|
137
|
+
account: whitelistedSender
|
|
138
|
+
});
|
|
166
139
|
}
|
|
167
|
-
})
|
|
168
|
-
|
|
140
|
+
});
|
|
141
|
+
publicClient = publicClient
|
|
142
|
+
.extend(withEthCallSender)
|
|
143
|
+
.extend(publicActions)
|
|
144
|
+
.extend(withEthCallSender);
|
|
169
145
|
}
|
|
170
146
|
const createWalletTransport = (url) => customTransport(url, {
|
|
171
147
|
logger: logger.child({ module: "wallet_client" }, { level: args.walletClientLogLevel || args.logLevel })
|
|
172
148
|
});
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
?
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
149
|
+
const walletClients = {
|
|
150
|
+
private: args.sendTransactionRpcUrl
|
|
151
|
+
? createWalletClient({
|
|
152
|
+
transport: fallback([
|
|
153
|
+
multiRpcTransport(args.sendTransactionRpcUrl, {
|
|
154
|
+
chainId,
|
|
155
|
+
logger: logger.child({ module: "wallet_client" }, {
|
|
156
|
+
level: args.walletClientLogLevel ||
|
|
157
|
+
args.logLevel
|
|
158
|
+
})
|
|
159
|
+
}),
|
|
160
|
+
createWalletTransport(args.rpcUrl)
|
|
161
|
+
], { rank: false }),
|
|
162
|
+
chain
|
|
163
|
+
})
|
|
164
|
+
: undefined,
|
|
165
|
+
public: createWalletClient({
|
|
166
|
+
transport: createWalletTransport(args.rpcUrl),
|
|
167
|
+
chain
|
|
168
|
+
})
|
|
169
|
+
};
|
|
182
170
|
// if flag is set, use utility wallet to deploy the simulations contract
|
|
183
171
|
if (args.deploySimulationsContract) {
|
|
184
172
|
const deployedContracts = await deploySimulationsContract({
|
|
@@ -190,15 +178,24 @@ export async function bundlerHandler(args_) {
|
|
|
190
178
|
deployedContracts.entrypointSimulationContractV7;
|
|
191
179
|
args.entrypointSimulationContractV8 =
|
|
192
180
|
deployedContracts.entrypointSimulationContractV8;
|
|
181
|
+
args.entrypointSimulationContractV9 =
|
|
182
|
+
deployedContracts.entrypointSimulationContractV9;
|
|
193
183
|
args.pimlicoSimulationContract =
|
|
194
184
|
deployedContracts.pimlicoSimulationContract;
|
|
195
185
|
logger.info({
|
|
196
186
|
entrypointSimulationContractV7: deployedContracts.entrypointSimulationContractV7,
|
|
197
187
|
entrypointSimulationContractV8: deployedContracts.entrypointSimulationContractV8,
|
|
188
|
+
entrypointSimulationContractV9: deployedContracts.entrypointSimulationContractV9,
|
|
198
189
|
pimlicoSimulationContract: deployedContracts.pimlicoSimulationContract
|
|
199
190
|
}, "Contracts used for simulation");
|
|
200
191
|
}
|
|
201
|
-
const config = createConfig({
|
|
192
|
+
const config = createConfig({
|
|
193
|
+
...args,
|
|
194
|
+
logger,
|
|
195
|
+
publicClient,
|
|
196
|
+
walletClients,
|
|
197
|
+
enableCors
|
|
198
|
+
});
|
|
202
199
|
const gasPriceManager = new GasPriceManager(config);
|
|
203
200
|
await gasPriceManager.init();
|
|
204
201
|
const registry = new Registry();
|
|
@@ -208,16 +205,15 @@ export async function bundlerHandler(args_) {
|
|
|
208
205
|
config,
|
|
209
206
|
metrics
|
|
210
207
|
});
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
metrics.executorWalletsMinBalance.set(Number.parseFloat(formatEther(config.minExecutorBalance || 0n)));
|
|
208
|
+
metrics.executorWalletsMinBalance.set(formatNativeBalance({
|
|
209
|
+
value: config.minExecutorBalance || 0n,
|
|
210
|
+
config
|
|
211
|
+
}));
|
|
212
|
+
const numExecutors = senderManager.getAllWallets().length;
|
|
213
|
+
metrics.executorWalletsRequiredBalance.set(formatNativeBalance({
|
|
214
|
+
value: (config.minExecutorBalance || 0n) * BigInt(numExecutors),
|
|
215
|
+
config
|
|
216
|
+
}));
|
|
221
217
|
await setupServer({
|
|
222
218
|
config,
|
|
223
219
|
registry,
|
package/esm/cli/handler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../cli/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EACH,aAAa,EACb,eAAe,EACf,oBAAoB,EACvB,MAAM,aAAa,CAAA;A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AA;IACzD,OAAO,CAAC,8BAA8B,CAAC,GAAG,CACtC,mBAAmB,CAAC;QAChB,KAAK,EAAE,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC;QAC/D,MAAM;KACT,CAAC,CACL,CAAA;IAED,MAAM,WAAW,CAAC;QACd,MAAM;QACN,QAAQ;QACR,OAAO;QACP,aAAa;QACb,eAAe;KAClB,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Logger } from "../utils/index.js";
|
|
2
|
+
import { type HttpTransportConfig, type Transport } from "viem";
|
|
3
|
+
export declare function multiRpcTransport(urls: string[], config: HttpTransportConfig & {
|
|
4
|
+
logger: Logger;
|
|
5
|
+
chainId: number;
|
|
6
|
+
}): Transport;
|
|
7
|
+
//# sourceMappingURL=multiRpcTransport.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createTransport, numberToHex } from "viem";
|
|
2
|
+
import { customTransport } from "./customTransport.js";
|
|
3
|
+
// Fans out every request to all urls in parallel, resolving with the first
|
|
4
|
+
// successful response and rejecting only if every endpoint fails. Fanning out
|
|
5
|
+
// non-send methods too keeps a lagging or method-restricted endpoint (e.g. a
|
|
6
|
+
// sequencer that only accepts eth_sendRawTransaction) from stalling requests.
|
|
7
|
+
// eth_chainId is answered locally: viem calls it before every sendTransaction
|
|
8
|
+
// and some endpoints don't allow it.
|
|
9
|
+
export function multiRpcTransport(urls, config) {
|
|
10
|
+
const { key = "multiRpc", name = "Multi RPC JSON-RPC", logger, chainId } = config;
|
|
11
|
+
return ({ chain, retryCount, timeout }) => {
|
|
12
|
+
const transports = urls.map((url) => customTransport(url, {
|
|
13
|
+
...config,
|
|
14
|
+
logger: logger.child({ sendTransactionRpcUrl: url })
|
|
15
|
+
})({ chain, retryCount: 0, timeout }));
|
|
16
|
+
return createTransport({
|
|
17
|
+
key,
|
|
18
|
+
name,
|
|
19
|
+
request: (async ({ method, params }) => {
|
|
20
|
+
if (method === "eth_chainId") {
|
|
21
|
+
return numberToHex(chainId);
|
|
22
|
+
}
|
|
23
|
+
const sends = transports.map((transport, index) => {
|
|
24
|
+
const send = transport.request({ method, params });
|
|
25
|
+
// Handle every rejection eagerly so an endpoint failing
|
|
26
|
+
// after another already succeeded can never become an
|
|
27
|
+
// unhandled rejection.
|
|
28
|
+
send.catch((err) => {
|
|
29
|
+
logger.warn({ err, url: urls[index], method }, "multi rpc endpoint request failed");
|
|
30
|
+
});
|
|
31
|
+
return send;
|
|
32
|
+
});
|
|
33
|
+
try {
|
|
34
|
+
return await Promise.any(sends);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
// Rethrow the first endpoint's error instead of the
|
|
38
|
+
// AggregateError so viem's error classification (nonce
|
|
39
|
+
// too low, underpriced, ...) keeps working.
|
|
40
|
+
if (err instanceof AggregateError) {
|
|
41
|
+
throw err.errors[0];
|
|
42
|
+
}
|
|
43
|
+
throw err;
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
retryCount: config.retryCount ?? retryCount,
|
|
47
|
+
timeout,
|
|
48
|
+
type: "http"
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=multiRpcTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiRpcTransport.js","sourceRoot":"","sources":["../../cli/multiRpcTransport.ts"],"names":[],"mappings":"AACA,OAAO,EAIH,eAAe,EACf,WAAW,EACd,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,2EAA2E;AAC3E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,qCAAqC;AACrC,MAAM,UAAU,iBAAiB,CAC7B,IAAc,EACd,MAAiE;IAEjE,MAAM,EACF,GAAG,GAAG,UAAU,EAChB,IAAI,GAAG,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