@elytro/cli 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2560,10 +2560,7 @@ import ora2 from "ora";
|
|
|
2560
2560
|
import { formatEther as formatEther2, padHex as padHex2 } from "viem";
|
|
2561
2561
|
|
|
2562
2562
|
// src/utils/prompt.ts
|
|
2563
|
-
import { password,
|
|
2564
|
-
async function askConfirm(message, defaultValue = false) {
|
|
2565
|
-
return confirm({ message, default: defaultValue });
|
|
2566
|
-
}
|
|
2563
|
+
import { password, select, input } from "@inquirer/prompts";
|
|
2567
2564
|
async function askSelect(message, choices) {
|
|
2568
2565
|
return select({ message, choices });
|
|
2569
2566
|
}
|
|
@@ -3272,11 +3269,6 @@ function registerTxCommand(program2, ctx) {
|
|
|
3272
3269
|
estimatedGas: estimatedGas.toString()
|
|
3273
3270
|
}
|
|
3274
3271
|
}, null, 2));
|
|
3275
|
-
const confirmed = await askConfirm("Sign and send this transaction?");
|
|
3276
|
-
if (!confirmed) {
|
|
3277
|
-
outputResult({ status: "cancelled" });
|
|
3278
|
-
return;
|
|
3279
|
-
}
|
|
3280
3272
|
const spinner = ora3("Signing UserOperation...").start();
|
|
3281
3273
|
let opHash;
|
|
3282
3274
|
try {
|
|
@@ -4175,13 +4167,6 @@ function registerSecurityCommand(program2, ctx) {
|
|
|
4175
4167
|
if (![1, 2, 3].includes(capabilityFlags)) {
|
|
4176
4168
|
throw new SecurityError(ERR_INTERNAL3, "Invalid capability flags. Use 1, 2, or 3.");
|
|
4177
4169
|
}
|
|
4178
|
-
const confirmed = await askConfirm(
|
|
4179
|
-
`Install SecurityHook on ${account.alias} (${address(account.address)})? Capability: ${CAPABILITY_LABELS[capabilityFlags]}, Safety Delay: ${DEFAULT_SAFETY_DELAY}s`
|
|
4180
|
-
);
|
|
4181
|
-
if (!confirmed) {
|
|
4182
|
-
outputResult({ status: "cancelled" });
|
|
4183
|
-
return;
|
|
4184
|
-
}
|
|
4185
4170
|
const installTx = encodeInstallHook(account.address, hookAddress, DEFAULT_SAFETY_DELAY, capabilityFlags);
|
|
4186
4171
|
const buildSpinner = ora5("Building UserOp...").start();
|
|
4187
4172
|
try {
|
|
@@ -4312,11 +4297,6 @@ async function handleForceExecute(ctx, chainConfig, account, currentStatus) {
|
|
|
4312
4297
|
`Safety delay not elapsed. Available after ${currentStatus.forceUninstall.availableAfter}.`
|
|
4313
4298
|
);
|
|
4314
4299
|
}
|
|
4315
|
-
const confirmed = await askConfirm(`Execute force uninstall on ${account.alias} (${address(account.address)})? This will remove the SecurityHook.`);
|
|
4316
|
-
if (!confirmed) {
|
|
4317
|
-
outputResult({ status: "cancelled" });
|
|
4318
|
-
return;
|
|
4319
|
-
}
|
|
4320
4300
|
const uninstallTx = encodeUninstallHook(account.address, currentStatus.hookAddress);
|
|
4321
4301
|
const spinner = ora5("Executing force uninstall...").start();
|
|
4322
4302
|
try {
|
|
@@ -4338,13 +4318,6 @@ async function handleForceStart(ctx, chainConfig, account, currentStatus, hookAd
|
|
|
4338
4318
|
});
|
|
4339
4319
|
return;
|
|
4340
4320
|
}
|
|
4341
|
-
const confirmed = await askConfirm(
|
|
4342
|
-
`Start force-uninstall countdown on ${account.alias} (${address(account.address)})? You must wait ${DEFAULT_SAFETY_DELAY}s before executing.`
|
|
4343
|
-
);
|
|
4344
|
-
if (!confirmed) {
|
|
4345
|
-
outputResult({ status: "cancelled" });
|
|
4346
|
-
return;
|
|
4347
|
-
}
|
|
4348
4321
|
const preUninstallTx = encodeForcePreUninstall(hookAddress);
|
|
4349
4322
|
const spinner = ora5("Starting force-uninstall countdown...").start();
|
|
4350
4323
|
try {
|
|
@@ -4362,11 +4335,6 @@ async function handleForceStart(ctx, chainConfig, account, currentStatus, hookAd
|
|
|
4362
4335
|
}
|
|
4363
4336
|
}
|
|
4364
4337
|
async function handleNormalUninstall(ctx, chainConfig, account, hookService, hookAddress) {
|
|
4365
|
-
const confirmed = await askConfirm(`Uninstall SecurityHook from ${account.alias} (${address(account.address)})? (requires 2FA approval)`);
|
|
4366
|
-
if (!confirmed) {
|
|
4367
|
-
outputResult({ status: "cancelled" });
|
|
4368
|
-
return;
|
|
4369
|
-
}
|
|
4370
4338
|
const uninstallTx = encodeUninstallHook(account.address, hookAddress);
|
|
4371
4339
|
const spinner = ora5("Building UserOp...").start();
|
|
4372
4340
|
try {
|
|
@@ -4716,7 +4684,7 @@ import { execSync } from "child_process";
|
|
|
4716
4684
|
import { createRequire } from "module";
|
|
4717
4685
|
function resolveVersion() {
|
|
4718
4686
|
if (true) {
|
|
4719
|
-
return "0.6.
|
|
4687
|
+
return "0.6.1";
|
|
4720
4688
|
}
|
|
4721
4689
|
try {
|
|
4722
4690
|
const require2 = createRequire(import.meta.url);
|