@hyperlane-xyz/cli 11.0.0 → 12.1.0-cli-bundle.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/cli-bundle/338.index.js +214 -0
- package/cli-bundle/file.js +12 -0
- package/cli-bundle/index.js +555413 -0
- package/cli-bundle/package.json +3 -0
- package/cli-bundle/worker-pipeline.js +38 -0
- package/cli-bundle/worker.js +54 -0
- package/cli-bundle/worker1.js +169 -0
- package/package.json +30 -33
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -68
- package/dist/cli.js.map +0 -1
- package/dist/env.d.ts +0 -2
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js +0 -14
- package/dist/env.js.map +0 -1
- package/dist/src/avs/check.d.ts +0 -3
- package/dist/src/avs/check.d.ts.map +0 -1
- package/dist/src/avs/check.js +0 -234
- package/dist/src/avs/check.js.map +0 -1
- package/dist/src/avs/config.d.ts +0 -12
- package/dist/src/avs/config.d.ts.map +0 -1
- package/dist/src/avs/config.js +0 -18
- package/dist/src/avs/config.js.map +0 -1
- package/dist/src/avs/stakeRegistry.d.ts +0 -22
- package/dist/src/avs/stakeRegistry.d.ts.map +0 -1
- package/dist/src/avs/stakeRegistry.js +0 -64
- package/dist/src/avs/stakeRegistry.js.map +0 -1
- package/dist/src/check/warp.d.ts +0 -6
- package/dist/src/check/warp.d.ts.map +0 -1
- package/dist/src/check/warp.js +0 -22
- package/dist/src/check/warp.js.map +0 -1
- package/dist/src/commands/avs.d.ts +0 -12
- package/dist/src/commands/avs.d.ts.map +0 -1
- package/dist/src/commands/avs.js +0 -86
- package/dist/src/commands/avs.js.map +0 -1
- package/dist/src/commands/config.d.ts +0 -6
- package/dist/src/commands/config.d.ts.map +0 -1
- package/dist/src/commands/config.js +0 -93
- package/dist/src/commands/config.js.map +0 -1
- package/dist/src/commands/core.d.ts +0 -38
- package/dist/src/commands/core.d.ts.map +0 -1
- package/dist/src/commands/core.js +0 -166
- package/dist/src/commands/core.js.map +0 -1
- package/dist/src/commands/deploy.d.ts +0 -6
- package/dist/src/commands/deploy.d.ts.map +0 -1
- package/dist/src/commands/deploy.js +0 -36
- package/dist/src/commands/deploy.js.map +0 -1
- package/dist/src/commands/hook.d.ts +0 -12
- package/dist/src/commands/hook.d.ts.map +0 -1
- package/dist/src/commands/hook.js +0 -36
- package/dist/src/commands/hook.js.map +0 -1
- package/dist/src/commands/ism.d.ts +0 -12
- package/dist/src/commands/ism.d.ts.map +0 -1
- package/dist/src/commands/ism.js +0 -38
- package/dist/src/commands/ism.js.map +0 -1
- package/dist/src/commands/options.d.ts +0 -44
- package/dist/src/commands/options.d.ts.map +0 -1
- package/dist/src/commands/options.js +0 -188
- package/dist/src/commands/options.js.map +0 -1
- package/dist/src/commands/registry.d.ts +0 -6
- package/dist/src/commands/registry.d.ts.map +0 -1
- package/dist/src/commands/registry.js +0 -168
- package/dist/src/commands/registry.js.map +0 -1
- package/dist/src/commands/relayer.d.ts +0 -9
- package/dist/src/commands/relayer.d.ts.map +0 -1
- package/dist/src/commands/relayer.js +0 -56
- package/dist/src/commands/relayer.js.map +0 -1
- package/dist/src/commands/send.d.ts +0 -25
- package/dist/src/commands/send.d.ts.map +0 -1
- package/dist/src/commands/send.js +0 -75
- package/dist/src/commands/send.js.map +0 -1
- package/dist/src/commands/signCommands.d.ts +0 -14
- package/dist/src/commands/signCommands.d.ts.map +0 -1
- package/dist/src/commands/signCommands.js +0 -28
- package/dist/src/commands/signCommands.js.map +0 -1
- package/dist/src/commands/status.d.ts +0 -8
- package/dist/src/commands/status.d.ts.map +0 -1
- package/dist/src/commands/status.js +0 -28
- package/dist/src/commands/status.js.map +0 -1
- package/dist/src/commands/strategy.d.ts +0 -13
- package/dist/src/commands/strategy.d.ts.map +0 -1
- package/dist/src/commands/strategy.js +0 -49
- package/dist/src/commands/strategy.js.map +0 -1
- package/dist/src/commands/submit.d.ts +0 -18
- package/dist/src/commands/submit.d.ts.map +0 -1
- package/dist/src/commands/submit.js +0 -41
- package/dist/src/commands/submit.js.map +0 -1
- package/dist/src/commands/types.d.ts +0 -3
- package/dist/src/commands/types.d.ts.map +0 -1
- package/dist/src/commands/types.js +0 -2
- package/dist/src/commands/types.js.map +0 -1
- package/dist/src/commands/validator.d.ts +0 -3
- package/dist/src/commands/validator.d.ts.map +0 -1
- package/dist/src/commands/validator.js +0 -78
- package/dist/src/commands/validator.js.map +0 -1
- package/dist/src/commands/warp.d.ts +0 -37
- package/dist/src/commands/warp.d.ts.map +0 -1
- package/dist/src/commands/warp.js +0 -272
- package/dist/src/commands/warp.js.map +0 -1
- package/dist/src/config/agent.d.ts +0 -7
- package/dist/src/config/agent.d.ts.map +0 -1
- package/dist/src/config/agent.js +0 -82
- package/dist/src/config/agent.js.map +0 -1
- package/dist/src/config/chain.d.ts +0 -7
- package/dist/src/config/chain.d.ts.map +0 -1
- package/dist/src/config/chain.js +0 -224
- package/dist/src/config/chain.js.map +0 -1
- package/dist/src/config/chain.test.d.ts +0 -2
- package/dist/src/config/chain.test.d.ts.map +0 -1
- package/dist/src/config/chain.test.js +0 -9
- package/dist/src/config/chain.test.js.map +0 -1
- package/dist/src/config/core.d.ts +0 -9
- package/dist/src/config/core.d.ts.map +0 -1
- package/dist/src/config/core.js +0 -62
- package/dist/src/config/core.js.map +0 -1
- package/dist/src/config/hooks.d.ts +0 -28
- package/dist/src/config/hooks.d.ts.map +0 -1
- package/dist/src/config/hooks.js +0 -260
- package/dist/src/config/hooks.js.map +0 -1
- package/dist/src/config/ism.d.ts +0 -220
- package/dist/src/config/ism.d.ts.map +0 -1
- package/dist/src/config/ism.js +0 -186
- package/dist/src/config/ism.js.map +0 -1
- package/dist/src/config/multisig.d.ts +0 -45
- package/dist/src/config/multisig.d.ts.map +0 -1
- package/dist/src/config/multisig.js +0 -95
- package/dist/src/config/multisig.js.map +0 -1
- package/dist/src/config/prompts.d.ts +0 -2
- package/dist/src/config/prompts.d.ts.map +0 -1
- package/dist/src/config/prompts.js +0 -9
- package/dist/src/config/prompts.js.map +0 -1
- package/dist/src/config/strategy.d.ts +0 -11
- package/dist/src/config/strategy.d.ts.map +0 -1
- package/dist/src/config/strategy.js +0 -106
- package/dist/src/config/strategy.js.map +0 -1
- package/dist/src/config/submit.d.ts +0 -9
- package/dist/src/config/submit.d.ts.map +0 -1
- package/dist/src/config/submit.js +0 -29
- package/dist/src/config/submit.js.map +0 -1
- package/dist/src/config/utils.d.ts +0 -3
- package/dist/src/config/utils.d.ts.map +0 -1
- package/dist/src/config/utils.js +0 -14
- package/dist/src/config/utils.js.map +0 -1
- package/dist/src/config/warp.d.ts +0 -11
- package/dist/src/config/warp.d.ts.map +0 -1
- package/dist/src/config/warp.js +0 -230
- package/dist/src/config/warp.js.map +0 -1
- package/dist/src/consts.d.ts +0 -7
- package/dist/src/consts.d.ts.map +0 -1
- package/dist/src/consts.js +0 -7
- package/dist/src/consts.js.map +0 -1
- package/dist/src/context/context.d.ts +0 -25
- package/dist/src/context/context.d.ts.map +0 -1
- package/dist/src/context/context.js +0 -180
- package/dist/src/context/context.js.map +0 -1
- package/dist/src/context/strategies/chain/ChainResolverFactory.d.ts +0 -14
- package/dist/src/context/strategies/chain/ChainResolverFactory.d.ts.map +0 -1
- package/dist/src/context/strategies/chain/ChainResolverFactory.js +0 -32
- package/dist/src/context/strategies/chain/ChainResolverFactory.js.map +0 -1
- package/dist/src/context/strategies/chain/MultiChainResolver.d.ts +0 -36
- package/dist/src/context/strategies/chain/MultiChainResolver.d.ts.map +0 -1
- package/dist/src/context/strategies/chain/MultiChainResolver.js +0 -172
- package/dist/src/context/strategies/chain/MultiChainResolver.js.map +0 -1
- package/dist/src/context/strategies/chain/types.d.ts +0 -10
- package/dist/src/context/strategies/chain/types.d.ts.map +0 -1
- package/dist/src/context/strategies/chain/types.js +0 -2
- package/dist/src/context/strategies/chain/types.js.map +0 -1
- package/dist/src/context/strategies/signer/BaseMultiProtocolSigner.d.ts +0 -19
- package/dist/src/context/strategies/signer/BaseMultiProtocolSigner.d.ts.map +0 -1
- package/dist/src/context/strategies/signer/BaseMultiProtocolSigner.js +0 -7
- package/dist/src/context/strategies/signer/BaseMultiProtocolSigner.js.map +0 -1
- package/dist/src/context/strategies/signer/MultiProtocolSignerFactory.d.ts +0 -6
- package/dist/src/context/strategies/signer/MultiProtocolSignerFactory.d.ts.map +0 -1
- package/dist/src/context/strategies/signer/MultiProtocolSignerFactory.js +0 -47
- package/dist/src/context/strategies/signer/MultiProtocolSignerFactory.js.map +0 -1
- package/dist/src/context/strategies/signer/MultiProtocolSignerManager.d.ts +0 -51
- package/dist/src/context/strategies/signer/MultiProtocolSignerManager.d.ts.map +0 -1
- package/dist/src/context/strategies/signer/MultiProtocolSignerManager.js +0 -115
- package/dist/src/context/strategies/signer/MultiProtocolSignerManager.js.map +0 -1
- package/dist/src/context/types.d.ts +0 -36
- package/dist/src/context/types.d.ts.map +0 -1
- package/dist/src/context/types.js +0 -2
- package/dist/src/context/types.js.map +0 -1
- package/dist/src/deploy/agent.d.ts +0 -8
- package/dist/src/deploy/agent.d.ts.map +0 -1
- package/dist/src/deploy/agent.js +0 -41
- package/dist/src/deploy/agent.js.map +0 -1
- package/dist/src/deploy/core.d.ts +0 -17
- package/dist/src/deploy/core.d.ts.map +0 -1
- package/dist/src/deploy/core.js +0 -84
- package/dist/src/deploy/core.js.map +0 -1
- package/dist/src/deploy/dry-run.d.ts +0 -19
- package/dist/src/deploy/dry-run.d.ts.map +0 -1
- package/dist/src/deploy/dry-run.js +0 -46
- package/dist/src/deploy/dry-run.js.map +0 -1
- package/dist/src/deploy/utils.d.ts +0 -19
- package/dist/src/deploy/utils.d.ts.map +0 -1
- package/dist/src/deploy/utils.js +0 -112
- package/dist/src/deploy/utils.js.map +0 -1
- package/dist/src/deploy/warp.d.ts +0 -34
- package/dist/src/deploy/warp.d.ts.map +0 -1
- package/dist/src/deploy/warp.js +0 -517
- package/dist/src/deploy/warp.js.map +0 -1
- package/dist/src/hook/read.d.ts +0 -13
- package/dist/src/hook/read.d.ts.map +0 -1
- package/dist/src/hook/read.js +0 -25
- package/dist/src/hook/read.js.map +0 -1
- package/dist/src/ism/read.d.ts +0 -13
- package/dist/src/ism/read.d.ts.map +0 -1
- package/dist/src/ism/read.js +0 -25
- package/dist/src/ism/read.js.map +0 -1
- package/dist/src/logger.d.ts +0 -21
- package/dist/src/logger.d.ts.map +0 -1
- package/dist/src/logger.js +0 -40
- package/dist/src/logger.js.map +0 -1
- package/dist/src/read/core.d.ts +0 -9
- package/dist/src/read/core.d.ts.map +0 -1
- package/dist/src/read/core.js +0 -22
- package/dist/src/read/core.js.map +0 -1
- package/dist/src/read/warp.d.ts +0 -10
- package/dist/src/read/warp.d.ts.map +0 -1
- package/dist/src/read/warp.js +0 -60
- package/dist/src/read/warp.js.map +0 -1
- package/dist/src/send/message.d.ts +0 -12
- package/dist/src/send/message.d.ts.map +0 -1
- package/dist/src/send/message.js +0 -75
- package/dist/src/send/message.js.map +0 -1
- package/dist/src/send/transfer.d.ts +0 -16
- package/dist/src/send/transfer.d.ts.map +0 -1
- package/dist/src/send/transfer.js +0 -113
- package/dist/src/send/transfer.js.map +0 -1
- package/dist/src/status/message.d.ts +0 -10
- package/dist/src/status/message.d.ts.map +0 -1
- package/dist/src/status/message.js +0 -70
- package/dist/src/status/message.js.map +0 -1
- package/dist/src/submit/submit.d.ts +0 -5
- package/dist/src/submit/submit.d.ts.map +0 -1
- package/dist/src/submit/submit.js +0 -42
- package/dist/src/submit/submit.js.map +0 -1
- package/dist/src/submit/types.d.ts +0 -6
- package/dist/src/submit/types.d.ts.map +0 -1
- package/dist/src/submit/types.js +0 -2
- package/dist/src/submit/types.js.map +0 -1
- package/dist/src/tests/commands/core.d.ts +0 -32
- package/dist/src/tests/commands/core.d.ts.map +0 -1
- package/dist/src/tests/commands/core.js +0 -116
- package/dist/src/tests/commands/core.js.map +0 -1
- package/dist/src/tests/commands/helpers.d.ts +0 -107
- package/dist/src/tests/commands/helpers.d.ts.map +0 -1
- package/dist/src/tests/commands/helpers.js +0 -291
- package/dist/src/tests/commands/helpers.js.map +0 -1
- package/dist/src/tests/commands/warp.d.ts +0 -54
- package/dist/src/tests/commands/warp.d.ts.map +0 -1
- package/dist/src/tests/commands/warp.js +0 -225
- package/dist/src/tests/commands/warp.js.map +0 -1
- package/dist/src/tests/core/core-apply.e2e-test.d.ts +0 -2
- package/dist/src/tests/core/core-apply.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/core/core-apply.e2e-test.js +0 -155
- package/dist/src/tests/core/core-apply.e2e-test.js.map +0 -1
- package/dist/src/tests/core/core-check.e2e-test.d.ts +0 -2
- package/dist/src/tests/core/core-check.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/core/core-check.e2e-test.js +0 -49
- package/dist/src/tests/core/core-check.e2e-test.js.map +0 -1
- package/dist/src/tests/core/core-deploy.e2e-test.d.ts +0 -2
- package/dist/src/tests/core/core-deploy.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/core/core-deploy.e2e-test.js +0 -165
- package/dist/src/tests/core/core-deploy.e2e-test.js.map +0 -1
- package/dist/src/tests/core/core-init.e2e-test.d.ts +0 -2
- package/dist/src/tests/core/core-init.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/core/core-init.e2e-test.js +0 -124
- package/dist/src/tests/core/core-init.e2e-test.js.map +0 -1
- package/dist/src/tests/core/core-read.e2e-test.d.ts +0 -2
- package/dist/src/tests/core/core-read.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/core/core-read.e2e-test.js +0 -29
- package/dist/src/tests/core/core-read.e2e-test.js.map +0 -1
- package/dist/src/tests/deployTestErc20.d.ts +0 -2
- package/dist/src/tests/deployTestErc20.d.ts.map +0 -1
- package/dist/src/tests/deployTestErc20.js +0 -27
- package/dist/src/tests/deployTestErc20.js.map +0 -1
- package/dist/src/tests/hooks.test.d.ts +0 -2
- package/dist/src/tests/hooks.test.d.ts.map +0 -1
- package/dist/src/tests/hooks.test.js +0 -89
- package/dist/src/tests/hooks.test.js.map +0 -1
- package/dist/src/tests/ism.test.d.ts +0 -2
- package/dist/src/tests/ism.test.d.ts.map +0 -1
- package/dist/src/tests/ism.test.js +0 -76
- package/dist/src/tests/ism.test.js.map +0 -1
- package/dist/src/tests/relay.e2e-test.d.ts +0 -2
- package/dist/src/tests/relay.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/relay.e2e-test.js +0 -44
- package/dist/src/tests/relay.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-apply.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-apply.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-apply.e2e-test.js +0 -91
- package/dist/src/tests/warp/warp-apply.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-bridge-1.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-bridge-1.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-bridge-1.e2e-test.js +0 -21
- package/dist/src/tests/warp/warp-bridge-1.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-bridge-2.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-bridge-2.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-bridge-2.e2e-test.js +0 -21
- package/dist/src/tests/warp/warp-bridge-2.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-bridge-utils.d.ts +0 -30
- package/dist/src/tests/warp/warp-bridge-utils.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-bridge-utils.js +0 -140
- package/dist/src/tests/warp/warp-bridge-utils.js.map +0 -1
- package/dist/src/tests/warp/warp-check.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-check.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-check.e2e-test.js +0 -286
- package/dist/src/tests/warp/warp-check.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-deploy.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-deploy.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-deploy.e2e-test.js +0 -300
- package/dist/src/tests/warp/warp-deploy.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-extend-basic.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-extend-basic.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-extend-basic.e2e-test.js +0 -172
- package/dist/src/tests/warp/warp-extend-basic.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-extend-config.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-extend-config.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-extend-config.e2e-test.js +0 -115
- package/dist/src/tests/warp/warp-extend-config.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-extend-recovery.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-extend-recovery.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-extend-recovery.e2e-test.js +0 -167
- package/dist/src/tests/warp/warp-extend-recovery.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-init.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-init.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-init.e2e-test.js +0 -102
- package/dist/src/tests/warp/warp-init.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-read.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-read.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-read.e2e-test.js +0 -98
- package/dist/src/tests/warp/warp-read.e2e-test.js.map +0 -1
- package/dist/src/tests/warp/warp-send.e2e-test.d.ts +0 -2
- package/dist/src/tests/warp/warp-send.e2e-test.d.ts.map +0 -1
- package/dist/src/tests/warp/warp-send.e2e-test.js +0 -341
- package/dist/src/tests/warp/warp-send.e2e-test.js.map +0 -1
- package/dist/src/utils/balances.d.ts +0 -3
- package/dist/src/utils/balances.d.ts.map +0 -1
- package/dist/src/utils/balances.js +0 -39
- package/dist/src/utils/balances.js.map +0 -1
- package/dist/src/utils/chains.d.ts +0 -41
- package/dist/src/utils/chains.d.ts.map +0 -1
- package/dist/src/utils/chains.js +0 -128
- package/dist/src/utils/chains.js.map +0 -1
- package/dist/src/utils/cli-options.d.ts +0 -9
- package/dist/src/utils/cli-options.d.ts.map +0 -1
- package/dist/src/utils/cli-options.js +0 -14
- package/dist/src/utils/cli-options.js.map +0 -1
- package/dist/src/utils/env.d.ts +0 -9
- package/dist/src/utils/env.d.ts.map +0 -1
- package/dist/src/utils/env.js +0 -12
- package/dist/src/utils/env.js.map +0 -1
- package/dist/src/utils/files.d.ts +0 -34
- package/dist/src/utils/files.d.ts.map +0 -1
- package/dist/src/utils/files.js +0 -178
- package/dist/src/utils/files.js.map +0 -1
- package/dist/src/utils/input.d.ts +0 -54
- package/dist/src/utils/input.d.ts.map +0 -1
- package/dist/src/utils/input.js +0 -339
- package/dist/src/utils/input.js.map +0 -1
- package/dist/src/utils/keys.d.ts +0 -31
- package/dist/src/utils/keys.d.ts.map +0 -1
- package/dist/src/utils/keys.js +0 -77
- package/dist/src/utils/keys.js.map +0 -1
- package/dist/src/utils/output.d.ts +0 -24
- package/dist/src/utils/output.d.ts.map +0 -1
- package/dist/src/utils/output.js +0 -88
- package/dist/src/utils/output.js.map +0 -1
- package/dist/src/utils/relay.d.ts +0 -6
- package/dist/src/utils/relay.d.ts.map +0 -1
- package/dist/src/utils/relay.js +0 -19
- package/dist/src/utils/relay.js.map +0 -1
- package/dist/src/utils/time.d.ts +0 -2
- package/dist/src/utils/time.d.ts.map +0 -1
- package/dist/src/utils/time.js +0 -12
- package/dist/src/utils/time.js.map +0 -1
- package/dist/src/utils/time.test.d.ts +0 -2
- package/dist/src/utils/time.test.d.ts.map +0 -1
- package/dist/src/utils/time.test.js +0 -9
- package/dist/src/utils/time.test.js.map +0 -1
- package/dist/src/utils/tokens.d.ts +0 -5
- package/dist/src/utils/tokens.d.ts.map +0 -1
- package/dist/src/utils/tokens.js +0 -40
- package/dist/src/utils/tokens.js.map +0 -1
- package/dist/src/utils/version-check.d.ts +0 -2
- package/dist/src/utils/version-check.d.ts.map +0 -1
- package/dist/src/utils/version-check.js +0 -15
- package/dist/src/utils/version-check.js.map +0 -1
- package/dist/src/utils/warp.d.ts +0 -14
- package/dist/src/utils/warp.d.ts.map +0 -1
- package/dist/src/utils/warp.js +0 -24
- package/dist/src/utils/warp.js.map +0 -1
- package/dist/src/validator/address.d.ts +0 -10
- package/dist/src/validator/address.d.ts.map +0 -1
- package/dist/src/validator/address.js +0 -107
- package/dist/src/validator/address.js.map +0 -1
- package/dist/src/validator/preFlightCheck.d.ts +0 -4
- package/dist/src/validator/preFlightCheck.d.ts.map +0 -1
- package/dist/src/validator/preFlightCheck.js +0 -74
- package/dist/src/validator/preFlightCheck.js.map +0 -1
- package/dist/src/validator/utils.d.ts +0 -9
- package/dist/src/validator/utils.d.ts.map +0 -1
- package/dist/src/validator/utils.js +0 -46
- package/dist/src/validator/utils.js.map +0 -1
- package/dist/src/verify/warp.d.ts +0 -7
- package/dist/src/verify/warp.d.ts.map +0 -1
- package/dist/src/verify/warp.js +0 -61
- package/dist/src/verify/warp.js.map +0 -1
- package/dist/src/version.d.ts +0 -2
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -2
- package/dist/src/version.js.map +0 -1
package/dist/src/utils/env.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const ENV: {
|
|
2
|
-
HYP_KEY?: string | undefined;
|
|
3
|
-
ANVIL_IP_ADDR?: string | undefined;
|
|
4
|
-
ANVIL_PORT?: number | undefined;
|
|
5
|
-
AWS_ACCESS_KEY_ID?: string | undefined;
|
|
6
|
-
AWS_SECRET_ACCESS_KEY?: string | undefined;
|
|
7
|
-
AWS_REGION?: string | undefined;
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=env.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/utils/env.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,GAAG;;;;;;;CAA0C,CAAC"}
|
package/dist/src/utils/env.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
const envScheme = z.object({
|
|
3
|
-
HYP_KEY: z.string().optional(),
|
|
4
|
-
ANVIL_IP_ADDR: z.string().optional(),
|
|
5
|
-
ANVIL_PORT: z.number().optional(),
|
|
6
|
-
AWS_ACCESS_KEY_ID: z.string().optional(),
|
|
7
|
-
AWS_SECRET_ACCESS_KEY: z.string().optional(),
|
|
8
|
-
AWS_REGION: z.string().optional(),
|
|
9
|
-
});
|
|
10
|
-
const parsedEnv = envScheme.safeParse(process.env);
|
|
11
|
-
export const ENV = parsedEnv.success ? parsedEnv.data : {};
|
|
12
|
-
//# sourceMappingURL=env.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/utils/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const MAX_READ_LINE_OUTPUT = 250;
|
|
2
|
-
export type FileFormat = 'yaml' | 'json';
|
|
3
|
-
export type ArtifactsFile = {
|
|
4
|
-
filename: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function removeEndingSlash(dirPath: string): string;
|
|
8
|
-
export declare function resolvePath(filePath: string): string;
|
|
9
|
-
export declare function isFile(filepath: string): boolean;
|
|
10
|
-
export declare function readFileAtPath(filepath: string): string;
|
|
11
|
-
export declare function writeFileAtPath(filepath: string, value: string): void;
|
|
12
|
-
export declare function readJson<T>(filepath: string): T;
|
|
13
|
-
export declare function tryReadJson<T>(filepath: string): T | null;
|
|
14
|
-
export declare function writeJson(filepath: string, obj: any): void;
|
|
15
|
-
export declare function mergeJson<T extends Record<string, any>>(filepath: string, obj: T): void;
|
|
16
|
-
export declare function readYaml<T>(filepath: string): T;
|
|
17
|
-
export declare function tryReadYamlAtPath<T>(filepath: string): T | null;
|
|
18
|
-
export declare function writeYaml(filepath: string, obj: any): void;
|
|
19
|
-
export declare function mergeYaml<T extends Record<string, any>>(filepath: string, obj: T): void;
|
|
20
|
-
export declare function readYamlOrJson<T>(filepath: string, format?: FileFormat): T;
|
|
21
|
-
export declare function writeYamlOrJson(filepath: string, obj: Record<string, any>, format?: FileFormat): any;
|
|
22
|
-
export declare function mergeYamlOrJson(filepath: string, obj: Record<string, any>, format?: FileFormat): any;
|
|
23
|
-
export declare function resolveFileFormat(filepath?: string, format?: FileFormat): FileFormat | undefined;
|
|
24
|
-
export declare function runFileSelectionStep(folderPath: string, description: string, pattern?: string): Promise<string>;
|
|
25
|
-
export declare function indentYamlOrJson(str: string, indentLevel: number): string;
|
|
26
|
-
/**
|
|
27
|
-
* Logs the YAML representation of an object if the number of lines is less than the specified maximum.
|
|
28
|
-
*
|
|
29
|
-
* @param obj - The object to be converted to YAML.
|
|
30
|
-
* @param maxLines - The maximum number of lines allowed for the YAML representation.
|
|
31
|
-
* @param margin - The number of spaces to use for indentation (default is 2).
|
|
32
|
-
*/
|
|
33
|
-
export declare function logYamlIfUnderMaxLines(obj: any, maxLines?: number, margin?: number): void;
|
|
34
|
-
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/utils/files.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,WAQtC;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,UAK9C;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAM9D;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,CAE/C;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAMzD;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,QAEnD;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC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ACjB,IAAI,CAMN"}
|
package/dist/src/utils/files.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { input } from '@inquirer/prompts';
|
|
2
|
-
import select from '@inquirer/select';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import os from 'os';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { LineCounter, parse, stringify as yamlStringify, } from 'yaml';
|
|
7
|
-
import { objMerge } from '@hyperlane-xyz/utils';
|
|
8
|
-
import { log } from '../logger.js';
|
|
9
|
-
const yamlParse = (content, options) =>
|
|
10
|
-
// See stackoverflow.com/questions/63075256/why-does-the-npm-yaml-library-have-a-max-alias-number
|
|
11
|
-
parse(content, { maxAliasCount: -1, ...options });
|
|
12
|
-
export const MAX_READ_LINE_OUTPUT = 250;
|
|
13
|
-
export function removeEndingSlash(dirPath) {
|
|
14
|
-
if (dirPath.endsWith('/')) {
|
|
15
|
-
return dirPath.slice(0, -1);
|
|
16
|
-
}
|
|
17
|
-
return dirPath;
|
|
18
|
-
}
|
|
19
|
-
export function resolvePath(filePath) {
|
|
20
|
-
if (filePath.startsWith('~')) {
|
|
21
|
-
const homedir = os.homedir();
|
|
22
|
-
return path.join(homedir, filePath.slice(1));
|
|
23
|
-
}
|
|
24
|
-
return filePath;
|
|
25
|
-
}
|
|
26
|
-
export function isFile(filepath) {
|
|
27
|
-
if (!filepath)
|
|
28
|
-
return false;
|
|
29
|
-
try {
|
|
30
|
-
return fs.existsSync(filepath) && fs.lstatSync(filepath).isFile();
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
log(`Error checking for file: ${filepath}`);
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export function readFileAtPath(filepath) {
|
|
38
|
-
if (!isFile(filepath)) {
|
|
39
|
-
throw Error(`File doesn't exist at ${filepath}`);
|
|
40
|
-
}
|
|
41
|
-
return fs.readFileSync(filepath, 'utf8');
|
|
42
|
-
}
|
|
43
|
-
export function writeFileAtPath(filepath, value) {
|
|
44
|
-
const dirname = path.dirname(filepath);
|
|
45
|
-
if (!isFile(dirname)) {
|
|
46
|
-
fs.mkdirSync(dirname, { recursive: true });
|
|
47
|
-
}
|
|
48
|
-
fs.writeFileSync(filepath, value);
|
|
49
|
-
}
|
|
50
|
-
export function readJson(filepath) {
|
|
51
|
-
return JSON.parse(readFileAtPath(filepath));
|
|
52
|
-
}
|
|
53
|
-
export function tryReadJson(filepath) {
|
|
54
|
-
try {
|
|
55
|
-
return readJson(filepath);
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export function writeJson(filepath, obj) {
|
|
62
|
-
writeFileAtPath(filepath, JSON.stringify(obj, null, 2) + '\n');
|
|
63
|
-
}
|
|
64
|
-
export function mergeJson(filepath, obj) {
|
|
65
|
-
if (isFile(filepath)) {
|
|
66
|
-
const previous = readJson(filepath);
|
|
67
|
-
writeJson(filepath, objMerge(previous, obj));
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
writeJson(filepath, obj);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export function readYaml(filepath) {
|
|
74
|
-
return yamlParse(readFileAtPath(filepath));
|
|
75
|
-
}
|
|
76
|
-
export function tryReadYamlAtPath(filepath) {
|
|
77
|
-
try {
|
|
78
|
-
return readYaml(filepath);
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export function writeYaml(filepath, obj) {
|
|
85
|
-
writeFileAtPath(filepath, yamlStringify(obj, { indent: 2, sortMapEntries: true }) + '\n');
|
|
86
|
-
}
|
|
87
|
-
export function mergeYaml(filepath, obj) {
|
|
88
|
-
if (isFile(filepath)) {
|
|
89
|
-
const previous = readYaml(filepath);
|
|
90
|
-
writeYaml(filepath, objMerge(previous, obj));
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
writeYaml(filepath, obj);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
export function readYamlOrJson(filepath, format) {
|
|
97
|
-
return resolveYamlOrJsonFn(filepath, readJson, readYaml, format);
|
|
98
|
-
}
|
|
99
|
-
export function writeYamlOrJson(filepath, obj, format) {
|
|
100
|
-
return resolveYamlOrJsonFn(filepath, (f) => writeJson(f, obj), (f) => writeYaml(f, obj), format);
|
|
101
|
-
}
|
|
102
|
-
export function mergeYamlOrJson(filepath, obj, format = 'yaml') {
|
|
103
|
-
return resolveYamlOrJsonFn(filepath, (f) => mergeJson(f, obj), (f) => mergeYaml(f, obj), format);
|
|
104
|
-
}
|
|
105
|
-
function resolveYamlOrJsonFn(filepath, jsonFn, yamlFn, format) {
|
|
106
|
-
const fileFormat = resolveFileFormat(filepath, format);
|
|
107
|
-
if (!fileFormat) {
|
|
108
|
-
throw new Error(`Invalid file format for ${filepath}`);
|
|
109
|
-
}
|
|
110
|
-
if (fileFormat === 'json') {
|
|
111
|
-
return jsonFn(filepath);
|
|
112
|
-
}
|
|
113
|
-
return yamlFn(filepath);
|
|
114
|
-
}
|
|
115
|
-
export function resolveFileFormat(filepath, format) {
|
|
116
|
-
// early out if filepath is undefined
|
|
117
|
-
if (!filepath) {
|
|
118
|
-
return format;
|
|
119
|
-
}
|
|
120
|
-
if (format === 'json' || filepath?.endsWith('.json')) {
|
|
121
|
-
return 'json';
|
|
122
|
-
}
|
|
123
|
-
if (format === 'yaml' ||
|
|
124
|
-
filepath?.endsWith('.yaml') ||
|
|
125
|
-
filepath?.endsWith('.yml')) {
|
|
126
|
-
return 'yaml';
|
|
127
|
-
}
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
export async function runFileSelectionStep(folderPath, description, pattern) {
|
|
131
|
-
const noFilesErrorMessage = `No "${description}" found in ${folderPath}. Please confirm the path for "${description}". By default, the CLI writes to folders relative to where its run.`;
|
|
132
|
-
if (!fs.existsSync(folderPath))
|
|
133
|
-
throw new Error(noFilesErrorMessage);
|
|
134
|
-
let filenames = fs.readdirSync(folderPath);
|
|
135
|
-
if (pattern) {
|
|
136
|
-
filenames = filenames.filter((f) => f.includes(pattern));
|
|
137
|
-
}
|
|
138
|
-
if (filenames.length === 0)
|
|
139
|
-
throw new Error(noFilesErrorMessage);
|
|
140
|
-
let filename = (await select({
|
|
141
|
-
message: `Select ${description} file`,
|
|
142
|
-
choices: [
|
|
143
|
-
...filenames.map((f) => ({ name: f, value: f })),
|
|
144
|
-
{ name: '(Other file)', value: null },
|
|
145
|
-
],
|
|
146
|
-
pageSize: 20,
|
|
147
|
-
}));
|
|
148
|
-
if (filename)
|
|
149
|
-
return path.join(folderPath, filename);
|
|
150
|
-
filename = await input({
|
|
151
|
-
message: `Enter ${description} filepath`,
|
|
152
|
-
});
|
|
153
|
-
if (filename)
|
|
154
|
-
return filename;
|
|
155
|
-
else
|
|
156
|
-
throw new Error(`No filepath entered ${description}`);
|
|
157
|
-
}
|
|
158
|
-
export function indentYamlOrJson(str, indentLevel) {
|
|
159
|
-
const indent = ' '.repeat(indentLevel);
|
|
160
|
-
return str
|
|
161
|
-
.split('\n')
|
|
162
|
-
.map((line) => indent + line)
|
|
163
|
-
.join('\n');
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Logs the YAML representation of an object if the number of lines is less than the specified maximum.
|
|
167
|
-
*
|
|
168
|
-
* @param obj - The object to be converted to YAML.
|
|
169
|
-
* @param maxLines - The maximum number of lines allowed for the YAML representation.
|
|
170
|
-
* @param margin - The number of spaces to use for indentation (default is 2).
|
|
171
|
-
*/
|
|
172
|
-
export function logYamlIfUnderMaxLines(obj, maxLines = MAX_READ_LINE_OUTPUT, margin = 2) {
|
|
173
|
-
const asYamlString = yamlStringify(obj, null, margin);
|
|
174
|
-
const lineCounter = new LineCounter();
|
|
175
|
-
yamlParse(asYamlString, { lineCounter });
|
|
176
|
-
log(lineCounter.lineStarts.length < maxLines ? asYamlString : '');
|
|
177
|
-
}
|
|
178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quirer/core';
|
|
2
|
-
import type { PartialDeep, Prompt } from '@inquirer/type';
|
|
3
|
-
import { ChainName, DeployedOwnableConfig } from '@hyperlane-xyz/sdk';
|
|
4
|
-
import { CommandContext } from '../context/types.js';
|
|
5
|
-
export declare function detectAndConfirmOrPrompt(detect: () => Promise<string | undefined>, prompt: string, label: string, source?: string): Promise<string>;
|
|
6
|
-
export declare function inputWithInfo({ message, info, defaultAnswer, }: {
|
|
7
|
-
message: string;
|
|
8
|
-
info?: string;
|
|
9
|
-
defaultAnswer?: string;
|
|
10
|
-
}): Promise<string>;
|
|
11
|
-
/**
|
|
12
|
-
* Prompts the user to optionally set an existing ProxyAdmin contract address to be used in a WarpToken deployment.
|
|
13
|
-
*/
|
|
14
|
-
export declare function setProxyAdminConfig(context: CommandContext, chain: ChainName): Promise<DeployedOwnableConfig | undefined>;
|
|
15
|
-
type SearchableCheckboxTheme = {
|
|
16
|
-
icon: {
|
|
17
|
-
checked: string;
|
|
18
|
-
unchecked: string;
|
|
19
|
-
cursor: string;
|
|
20
|
-
};
|
|
21
|
-
style: {
|
|
22
|
-
disabledChoice: (text: string) => string;
|
|
23
|
-
renderSelectedChoices: <T>(selectedChoices: ReadonlyArray<NormalizedChoice<T>>, allChoices: ReadonlyArray<NormalizedChoice<T> | Separator>) => string;
|
|
24
|
-
description: (text: string) => string;
|
|
25
|
-
helpTip: (text: string) => string;
|
|
26
|
-
};
|
|
27
|
-
helpMode: 'always' | 'never' | 'auto';
|
|
28
|
-
};
|
|
29
|
-
export type SearchableCheckboxChoice<Value> = {
|
|
30
|
-
value: Value;
|
|
31
|
-
name?: string;
|
|
32
|
-
description?: string;
|
|
33
|
-
short?: string;
|
|
34
|
-
disabled?: boolean | string;
|
|
35
|
-
checked?: boolean;
|
|
36
|
-
};
|
|
37
|
-
type NormalizedChoice<Value> = Required<Omit<SearchableCheckboxChoice<Value>, 'description'>> & {
|
|
38
|
-
description?: string;
|
|
39
|
-
};
|
|
40
|
-
type SearchableCheckboxConfig<Value> = {
|
|
41
|
-
message: string;
|
|
42
|
-
prefix?: string;
|
|
43
|
-
pageSize?: number;
|
|
44
|
-
instructions?: string;
|
|
45
|
-
choices: ReadonlyArray<SearchableCheckboxChoice<Value>>;
|
|
46
|
-
loop?: boolean;
|
|
47
|
-
required?: boolean;
|
|
48
|
-
selectableOptionsSeparator?: Separator;
|
|
49
|
-
validate?: (choices: ReadonlyArray<SearchableCheckboxChoice<Value>>) => boolean | string | Promise<string | boolean>;
|
|
50
|
-
theme?: PartialDeep<Theme<SearchableCheckboxTheme>>;
|
|
51
|
-
};
|
|
52
|
-
export declare const searchableCheckBox: Prompt<any, SearchableCheckboxConfig<any>>;
|
|
53
|
-
export {};
|
|
54
|
-
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/utils/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,KAAK,EAWX,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAK1D,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,EACzC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAMD,wBAAsB,aAAa,CAAC,EAClC,OAAO,EACP,IAA6C,EAC7C,aAAa,GACd,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM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,KAAK,IAAI;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0BAA0B,CAAC,EAAE,SAAS,CAAC;IACvC,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,aAAa,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,KACpD,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAClD,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;CACrD,CAAC;AAmQF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,GAAG,EACH,wBAAwB,CAAC,GAAG,CAAC,CA8J9B,CAAC"}
|
package/dist/src/utils/input.js
DELETED
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { Separator, createPrompt, isEnterKey, makeTheme, useEffect, useKeypress, useMemo, usePagination, usePrefix, useRef, useState, } from '@inquirer/core';
|
|
2
|
-
import figures from '@inquirer/figures';
|
|
3
|
-
import { confirm, input, isSpaceKey } from '@inquirer/prompts';
|
|
4
|
-
import ansiEscapes from 'ansi-escapes';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import { ProxyAdmin__factory } from '@hyperlane-xyz/core';
|
|
7
|
-
import { isAddress, rootLogger } from '@hyperlane-xyz/utils';
|
|
8
|
-
import { logGray } from '../logger.js';
|
|
9
|
-
import { indentYamlOrJson } from './files.js';
|
|
10
|
-
export async function detectAndConfirmOrPrompt(detect, prompt, label, source) {
|
|
11
|
-
let detectedValue;
|
|
12
|
-
try {
|
|
13
|
-
detectedValue = await detect();
|
|
14
|
-
if (detectedValue) {
|
|
15
|
-
const confirmed = await confirm({
|
|
16
|
-
message: `Detected ${label} as ${detectedValue}${source ? ` from ${source}` : ''}, is this correct?`,
|
|
17
|
-
});
|
|
18
|
-
if (confirmed) {
|
|
19
|
-
return detectedValue;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
// Fallback to input prompt
|
|
25
|
-
}
|
|
26
|
-
return input({ message: `${prompt} ${label}:`, default: detectedValue });
|
|
27
|
-
}
|
|
28
|
-
const INFO_COMMAND = 'i';
|
|
29
|
-
const DOCS_NOTICE = 'For more information, please visit https://docs.hyperlane.xyz.';
|
|
30
|
-
export async function inputWithInfo({ message, info = 'No additional information available.', defaultAnswer, }) {
|
|
31
|
-
let answer = '';
|
|
32
|
-
do {
|
|
33
|
-
answer = await input({
|
|
34
|
-
message: message.concat(` [enter '${INFO_COMMAND}' for more info]`),
|
|
35
|
-
default: defaultAnswer,
|
|
36
|
-
});
|
|
37
|
-
answer = answer.trim().toLowerCase();
|
|
38
|
-
const indentedInfo = indentYamlOrJson(`${info}\n${DOCS_NOTICE}\n`, 4);
|
|
39
|
-
if (answer === INFO_COMMAND)
|
|
40
|
-
logGray(indentedInfo);
|
|
41
|
-
} while (answer === INFO_COMMAND);
|
|
42
|
-
return answer;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Prompts the user to optionally set an existing ProxyAdmin contract address to be used in a WarpToken deployment.
|
|
46
|
-
*/
|
|
47
|
-
export async function setProxyAdminConfig(context, chain) {
|
|
48
|
-
let defaultAdminConfig;
|
|
49
|
-
// default to deploying a new ProxyAdmin with `warpRouteOwner` as the owner
|
|
50
|
-
// if the user supplied the --yes flag
|
|
51
|
-
if (context.skipConfirmation) {
|
|
52
|
-
return defaultAdminConfig;
|
|
53
|
-
}
|
|
54
|
-
const useExistingProxy = await confirm({
|
|
55
|
-
message: `Use an existing Proxy Admin contract for the warp route deployment on chain "${chain}"?`,
|
|
56
|
-
});
|
|
57
|
-
if (!useExistingProxy) {
|
|
58
|
-
return defaultAdminConfig;
|
|
59
|
-
}
|
|
60
|
-
const proxyAdminAddress = await input({
|
|
61
|
-
message: `Please enter the address of the Proxy Admin contract to be used on chain "${chain}":`,
|
|
62
|
-
validate: isAddress,
|
|
63
|
-
});
|
|
64
|
-
const proxy = ProxyAdmin__factory.connect(proxyAdminAddress, context.multiProvider.getProvider(chain));
|
|
65
|
-
try {
|
|
66
|
-
const ownerAddress = await proxy.owner();
|
|
67
|
-
return {
|
|
68
|
-
address: proxyAdminAddress,
|
|
69
|
-
owner: ownerAddress,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
rootLogger.error(`Failed to read owner address from ProxyAdmin contract at ${proxy.address} on chain ${chain}.`, error);
|
|
74
|
-
throw new Error(`Failed to read owner address from ProxyAdmin contract at ${proxy.address}. Are you sure this is a ProxyAdmin contract?`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const checkboxTheme = {
|
|
78
|
-
icon: {
|
|
79
|
-
checked: chalk.green(figures.circleFilled),
|
|
80
|
-
unchecked: figures.circle,
|
|
81
|
-
cursor: figures.pointer,
|
|
82
|
-
},
|
|
83
|
-
style: {
|
|
84
|
-
disabledChoice: (text) => chalk.dim(`- ${text}`),
|
|
85
|
-
renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(', '),
|
|
86
|
-
description: (text) => chalk.cyan(text),
|
|
87
|
-
helpTip: (text) => ` ${text}`,
|
|
88
|
-
},
|
|
89
|
-
helpMode: 'always',
|
|
90
|
-
};
|
|
91
|
-
function isSelectable(item) {
|
|
92
|
-
return !Separator.isSeparator(item) && !item.disabled;
|
|
93
|
-
}
|
|
94
|
-
function isChecked(item) {
|
|
95
|
-
return isSelectable(item) && Boolean(item.checked);
|
|
96
|
-
}
|
|
97
|
-
function toggle(item) {
|
|
98
|
-
return isSelectable(item) ? { ...item, checked: !item.checked } : item;
|
|
99
|
-
}
|
|
100
|
-
function normalizeChoices(choices) {
|
|
101
|
-
return choices.map((choice) => {
|
|
102
|
-
const name = choice.name ?? String(choice.value);
|
|
103
|
-
return {
|
|
104
|
-
value: choice.value,
|
|
105
|
-
name,
|
|
106
|
-
short: choice.short ?? name,
|
|
107
|
-
description: choice.description,
|
|
108
|
-
disabled: choice.disabled ?? false,
|
|
109
|
-
checked: choice.checked ?? false,
|
|
110
|
-
};
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function sortNormalizedItems(a, b) {
|
|
114
|
-
return a.name.localeCompare(b.name);
|
|
115
|
-
}
|
|
116
|
-
function organizeItems(items, selectableOptionsSeparator) {
|
|
117
|
-
const orderedItems = [];
|
|
118
|
-
const checkedItems = items.filter((item) => !Separator.isSeparator(item) && item.checked);
|
|
119
|
-
if (checkedItems.length !== 0) {
|
|
120
|
-
orderedItems.push(new Separator('--Selected Options--'));
|
|
121
|
-
orderedItems.push(...checkedItems.sort(sortNormalizedItems));
|
|
122
|
-
}
|
|
123
|
-
orderedItems.push(selectableOptionsSeparator ?? new Separator('--Available Options--'));
|
|
124
|
-
const nonCheckedItems = items.filter((item) => !Separator.isSeparator(item) && !item.checked);
|
|
125
|
-
orderedItems.push(...nonCheckedItems.sort(sortNormalizedItems));
|
|
126
|
-
if (orderedItems.length === 1) {
|
|
127
|
-
return [];
|
|
128
|
-
}
|
|
129
|
-
return orderedItems;
|
|
130
|
-
}
|
|
131
|
-
function getErrorMessage({ theme, errorMsg, currentItemCount, status, searchTerm, }) {
|
|
132
|
-
if (errorMsg) {
|
|
133
|
-
return `${theme.style.error(errorMsg)}`;
|
|
134
|
-
}
|
|
135
|
-
else if (currentItemCount === 0 && searchTerm !== '' && status === 'idle') {
|
|
136
|
-
return theme.style.error('No results found');
|
|
137
|
-
}
|
|
138
|
-
return '';
|
|
139
|
-
}
|
|
140
|
-
function getHelpTips({ theme, instructions, currentItemCount, pageSize, firstRender, }) {
|
|
141
|
-
let helpTipTop = '';
|
|
142
|
-
let helpTipBottom = '';
|
|
143
|
-
const defaultTopHelpTip = instructions ??
|
|
144
|
-
`(Press ${theme.style.key('tab')} or ${theme.style.key('space')} to select, and ${theme.style.key('enter')} to proceed`;
|
|
145
|
-
const defaultBottomHelpTip = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`;
|
|
146
|
-
if (theme.helpMode === 'always') {
|
|
147
|
-
helpTipTop = theme.style.helpTip(defaultTopHelpTip);
|
|
148
|
-
helpTipBottom = currentItemCount > pageSize ? defaultBottomHelpTip : '';
|
|
149
|
-
firstRender.current = false;
|
|
150
|
-
}
|
|
151
|
-
else if (theme.helpMode === 'auto' && firstRender.current) {
|
|
152
|
-
helpTipTop = theme.style.helpTip(defaultTopHelpTip);
|
|
153
|
-
helpTipBottom = currentItemCount > pageSize ? defaultBottomHelpTip : '';
|
|
154
|
-
firstRender.current = false;
|
|
155
|
-
}
|
|
156
|
-
return { helpTipBottom, helpTipTop };
|
|
157
|
-
}
|
|
158
|
-
function formatRenderedItem(item, isActive, theme) {
|
|
159
|
-
if (Separator.isSeparator(item)) {
|
|
160
|
-
return ` ${item.separator}`;
|
|
161
|
-
}
|
|
162
|
-
if (item.disabled) {
|
|
163
|
-
const disabledLabel = typeof item.disabled === 'string' ? item.disabled : '(disabled)';
|
|
164
|
-
return theme.style.disabledChoice(`${item.name} ${disabledLabel}`);
|
|
165
|
-
}
|
|
166
|
-
const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked;
|
|
167
|
-
const color = isActive ? theme.style.highlight : (x) => x;
|
|
168
|
-
const cursor = isActive ? theme.icon.cursor : ' ';
|
|
169
|
-
return color(`${cursor}${checkbox} ${item.name}`);
|
|
170
|
-
}
|
|
171
|
-
function getListBounds(items) {
|
|
172
|
-
const first = items.findIndex(isSelectable);
|
|
173
|
-
// findLastIndex replacement as the project must support older ES versions
|
|
174
|
-
let last = -1;
|
|
175
|
-
for (let i = items.length; i >= 0; --i) {
|
|
176
|
-
if (items[i] && isSelectable(items[i])) {
|
|
177
|
-
last = i;
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return { first, last };
|
|
182
|
-
}
|
|
183
|
-
function buildView({ page, prefix, theme, status, message, errorMsg, pageSize, firstRender, searchTerm, description, instructions, currentOptions, }) {
|
|
184
|
-
message = theme.style.message(message);
|
|
185
|
-
if (status === 'done') {
|
|
186
|
-
const selection = currentOptions.filter(isChecked);
|
|
187
|
-
const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, currentOptions));
|
|
188
|
-
return `${prefix} ${message} ${answer}`;
|
|
189
|
-
}
|
|
190
|
-
const currentItemCount = currentOptions.length;
|
|
191
|
-
const { helpTipBottom, helpTipTop } = getHelpTips({
|
|
192
|
-
theme,
|
|
193
|
-
instructions,
|
|
194
|
-
currentItemCount,
|
|
195
|
-
pageSize,
|
|
196
|
-
firstRender,
|
|
197
|
-
});
|
|
198
|
-
const choiceDescription = description
|
|
199
|
-
? `\n${theme.style.description(description)}`
|
|
200
|
-
: ``;
|
|
201
|
-
const error = getErrorMessage({
|
|
202
|
-
theme,
|
|
203
|
-
errorMsg,
|
|
204
|
-
currentItemCount,
|
|
205
|
-
status,
|
|
206
|
-
searchTerm,
|
|
207
|
-
});
|
|
208
|
-
return `${prefix} ${message}${helpTipTop} ${searchTerm}\n${page}${helpTipBottom}${choiceDescription}${error}${ansiEscapes.cursorHide}`;
|
|
209
|
-
}
|
|
210
|
-
// the isUpKey function from the inquirer package is not used
|
|
211
|
-
// because it detects k and p as custom keybindings that cause
|
|
212
|
-
// the option selection to go up instead of writing the letters
|
|
213
|
-
// in the search string
|
|
214
|
-
function isUpKey(key) {
|
|
215
|
-
return key.name === 'up';
|
|
216
|
-
}
|
|
217
|
-
// the isDownKey function from the inquirer package is not used
|
|
218
|
-
// because it detects j and n as custom keybindings that cause
|
|
219
|
-
// the option selection to go down instead of writing the letters
|
|
220
|
-
// in the search string
|
|
221
|
-
function isDownKey(key) {
|
|
222
|
-
return key.name === 'down';
|
|
223
|
-
}
|
|
224
|
-
export const searchableCheckBox = createPrompt((config, done) => {
|
|
225
|
-
const { instructions, pageSize = 7, loop = true, required, validate = () => true, selectableOptionsSeparator, } = config;
|
|
226
|
-
const theme = makeTheme(checkboxTheme, config.theme);
|
|
227
|
-
const firstRender = useRef(true);
|
|
228
|
-
const [status, setStatus] = useState('idle');
|
|
229
|
-
const prefix = usePrefix({ theme });
|
|
230
|
-
const [searchTerm, setSearchTerm] = useState('');
|
|
231
|
-
const [errorMsg, setError] = useState();
|
|
232
|
-
const normalizedChoices = normalizeChoices(config.choices);
|
|
233
|
-
const [optionState, setOptionState] = useState({
|
|
234
|
-
options: normalizedChoices,
|
|
235
|
-
currentOptionState: Object.fromEntries(normalizedChoices.map((item) => [item.name, item])),
|
|
236
|
-
});
|
|
237
|
-
const bounds = useMemo(() => getListBounds(optionState.options), [optionState.options]);
|
|
238
|
-
const [active, setActive] = useState(bounds.first);
|
|
239
|
-
useEffect(() => {
|
|
240
|
-
let filteredItems;
|
|
241
|
-
if (!searchTerm) {
|
|
242
|
-
filteredItems = Object.values(optionState.currentOptionState);
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
filteredItems = Object.values(optionState.currentOptionState).filter((item) => Separator.isSeparator(item) ||
|
|
246
|
-
item.name.includes(searchTerm) ||
|
|
247
|
-
item.checked);
|
|
248
|
-
}
|
|
249
|
-
setActive(0);
|
|
250
|
-
setError(undefined);
|
|
251
|
-
setOptionState({
|
|
252
|
-
currentOptionState: optionState.currentOptionState,
|
|
253
|
-
options: organizeItems(filteredItems, selectableOptionsSeparator),
|
|
254
|
-
});
|
|
255
|
-
}, [searchTerm]);
|
|
256
|
-
useKeypress(async (key, rl) => {
|
|
257
|
-
if (isEnterKey(key)) {
|
|
258
|
-
const selection = optionState.options.filter(isChecked);
|
|
259
|
-
const isValid = await validate(selection);
|
|
260
|
-
if (required && !optionState.options.some(isChecked)) {
|
|
261
|
-
setError('At least one choice must be selected');
|
|
262
|
-
}
|
|
263
|
-
else if (isValid === true) {
|
|
264
|
-
setStatus('done');
|
|
265
|
-
done(selection.map((choice) => choice.value));
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
setError(isValid || 'You must select a valid value');
|
|
269
|
-
setSearchTerm('');
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
else if (isUpKey(key) || isDownKey(key)) {
|
|
273
|
-
if (loop ||
|
|
274
|
-
(isUpKey(key) && active !== bounds.first) ||
|
|
275
|
-
(isDownKey(key) && active !== bounds.last)) {
|
|
276
|
-
const offset = isUpKey(key) ? -1 : 1;
|
|
277
|
-
let next = active;
|
|
278
|
-
do {
|
|
279
|
-
next =
|
|
280
|
-
(next + offset + optionState.options.length) %
|
|
281
|
-
optionState.options.length;
|
|
282
|
-
} while (optionState.options[next] &&
|
|
283
|
-
!isSelectable(optionState.options[next]));
|
|
284
|
-
setActive(next);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
else if ((key.name === 'tab' || isSpaceKey(key)) &&
|
|
288
|
-
optionState.options.length > 0) {
|
|
289
|
-
// Avoid the message header to be printed again in the console
|
|
290
|
-
rl.clearLine(0);
|
|
291
|
-
const currentElement = optionState.options[active];
|
|
292
|
-
if (currentElement &&
|
|
293
|
-
!Separator.isSeparator(currentElement) &&
|
|
294
|
-
optionState.currentOptionState[currentElement.name]) {
|
|
295
|
-
const updatedDataMap = {
|
|
296
|
-
...optionState.currentOptionState,
|
|
297
|
-
[currentElement.name]: toggle(optionState.currentOptionState[currentElement.name]),
|
|
298
|
-
};
|
|
299
|
-
setError(undefined);
|
|
300
|
-
setOptionState({
|
|
301
|
-
options: organizeItems(Object.values(updatedDataMap), selectableOptionsSeparator),
|
|
302
|
-
currentOptionState: updatedDataMap,
|
|
303
|
-
});
|
|
304
|
-
setSearchTerm('');
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
setSearchTerm(rl.line);
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
let description;
|
|
312
|
-
const page = usePagination({
|
|
313
|
-
items: optionState.options,
|
|
314
|
-
active,
|
|
315
|
-
renderItem({ item, isActive }) {
|
|
316
|
-
if (isActive && !Separator.isSeparator(item)) {
|
|
317
|
-
description = item.description;
|
|
318
|
-
}
|
|
319
|
-
return formatRenderedItem(item, isActive, theme);
|
|
320
|
-
},
|
|
321
|
-
pageSize,
|
|
322
|
-
loop,
|
|
323
|
-
});
|
|
324
|
-
return buildView({
|
|
325
|
-
page,
|
|
326
|
-
theme,
|
|
327
|
-
prefix,
|
|
328
|
-
status,
|
|
329
|
-
pageSize,
|
|
330
|
-
errorMsg,
|
|
331
|
-
firstRender,
|
|
332
|
-
searchTerm,
|
|
333
|
-
description,
|
|
334
|
-
instructions,
|
|
335
|
-
currentOptions: optionState.options,
|
|
336
|
-
message: theme.style.message(config.message),
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
//# sourceMappingURL=input.js.map
|