@otonix/cli 2.1.5 → 2.1.7
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/commands/agent.js +47 -2
- package/dist/commands/launch.js +26 -5
- package/package.json +1 -1
package/dist/commands/agent.js
CHANGED
|
@@ -18,8 +18,17 @@ export function agentCommand(program) {
|
|
|
18
18
|
}
|
|
19
19
|
const cfg = loadConfig();
|
|
20
20
|
if (!cfg.wallet) {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const autoSpinner = ora("No creator wallet found — generating one automatically...").start();
|
|
22
|
+
await new Promise(r => setTimeout(r, 400));
|
|
23
|
+
const creator = generateWallet();
|
|
24
|
+
autoSpinner.stop();
|
|
25
|
+
cfg.wallet = { address: creator.address, privateKey: creator.privateKey };
|
|
26
|
+
saveConfig(cfg);
|
|
27
|
+
success("Creator wallet generated!");
|
|
28
|
+
br();
|
|
29
|
+
console.log(chalk.dim(" Creator wallet address: ") + chalk.bold.white(creator.address));
|
|
30
|
+
console.log(chalk.dim(" Fund this address with ≥ 200 $OTX + ≥ 0.005 ETH (Base)"));
|
|
31
|
+
br();
|
|
23
32
|
}
|
|
24
33
|
if (cfg.agents[name]) {
|
|
25
34
|
const overwrite = await confirm({
|
|
@@ -289,4 +298,40 @@ export function agentCommand(program) {
|
|
|
289
298
|
saveConfig(cfg);
|
|
290
299
|
success(`Agent "${name}" removed from local config.`);
|
|
291
300
|
});
|
|
301
|
+
program
|
|
302
|
+
.command("agent:export")
|
|
303
|
+
.description("Show private key of an agent wallet (use with caution)")
|
|
304
|
+
.argument("<name>", "Agent name")
|
|
305
|
+
.action(async (name) => {
|
|
306
|
+
header(`Export Agent Key: ${name}`);
|
|
307
|
+
const cfg = loadConfig();
|
|
308
|
+
const agent = cfg.agents[name];
|
|
309
|
+
if (!agent) {
|
|
310
|
+
failure(`Agent "${name}" not found.`);
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
br();
|
|
314
|
+
console.log(chalk.bold.red("⚠ SECURITY WARNING"));
|
|
315
|
+
console.log(chalk.dim(" Your private key gives full access to this agent wallet."));
|
|
316
|
+
console.log(chalk.dim(" Never share it. Never paste it into websites or chats."));
|
|
317
|
+
console.log(chalk.dim(" Store it offline or in a hardware wallet."));
|
|
318
|
+
br();
|
|
319
|
+
const ok = await confirm({
|
|
320
|
+
message: `Show private key for agent "${name}" (${agent.address})?`,
|
|
321
|
+
default: false,
|
|
322
|
+
});
|
|
323
|
+
if (!ok) {
|
|
324
|
+
info("Cancelled.");
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
br();
|
|
328
|
+
row("Agent name", name);
|
|
329
|
+
row("Agent address", agent.address);
|
|
330
|
+
br();
|
|
331
|
+
console.log(chalk.bold("Private key:"));
|
|
332
|
+
console.log(chalk.bold.yellow(agent.privateKey));
|
|
333
|
+
br();
|
|
334
|
+
console.log(chalk.dim("Import into MetaMask: Settings → Import Account → paste key above."));
|
|
335
|
+
console.log(chalk.dim("LP fee rewards (80% WETH) flow to your creator wallet, not this agent wallet."));
|
|
336
|
+
});
|
|
292
337
|
}
|
package/dist/commands/launch.js
CHANGED
|
@@ -33,10 +33,8 @@ export function launchCommand(program) {
|
|
|
33
33
|
if (!agent.registered) {
|
|
34
34
|
br();
|
|
35
35
|
failure(`Agent "${opts.agent}" is not registered.`);
|
|
36
|
-
console.log(chalk.dim("
|
|
37
|
-
console.log(" " + chalk.
|
|
38
|
-
console.log(chalk.dim(" Then submit the tx hash to activate:"));
|
|
39
|
-
console.log(" " + chalk.cyan(`otonix agent:register --name ${opts.agent} --tx <txhash>`));
|
|
36
|
+
console.log(chalk.dim(" Activate it first:"));
|
|
37
|
+
console.log(" " + chalk.cyan(`otonix agent:register --name ${opts.agent}`));
|
|
40
38
|
process.exit(1);
|
|
41
39
|
}
|
|
42
40
|
const devBuyEth = parseFloat(opts.devbuy) || 0;
|
|
@@ -82,7 +80,8 @@ export function launchCommand(program) {
|
|
|
82
80
|
row("Paired token", "WETH");
|
|
83
81
|
if (devBuyEth > 0)
|
|
84
82
|
row("Dev buy", devBuyEth + " ETH");
|
|
85
|
-
row("
|
|
83
|
+
row("Reward 80%", cfg.wallet.address + " (WETH → creator wallet)");
|
|
84
|
+
row("Reward 20%", OTONIX_TREASURY + " ($OTX burn)");
|
|
86
85
|
row("Verified by", "✓ Otonix (@" + OTONIX_TWITTER + ")");
|
|
87
86
|
br();
|
|
88
87
|
const confirmed = await confirm({
|
|
@@ -172,6 +171,28 @@ export function launchCommand(program) {
|
|
|
172
171
|
const waitResult = await result.waitForTransaction();
|
|
173
172
|
const tokenAddress = waitResult.address;
|
|
174
173
|
deploySpinner.stop();
|
|
174
|
+
if (tokenAddress) {
|
|
175
|
+
try {
|
|
176
|
+
await fetch("https://otonix.tech/api/launch/register", {
|
|
177
|
+
method: "POST",
|
|
178
|
+
headers: { "Content-Type": "application/json" },
|
|
179
|
+
body: JSON.stringify({
|
|
180
|
+
name: opts.name,
|
|
181
|
+
symbol: opts.ticker.toUpperCase(),
|
|
182
|
+
ca: tokenAddress,
|
|
183
|
+
txHash,
|
|
184
|
+
agentName: opts.agent,
|
|
185
|
+
agentAddress: agent.address,
|
|
186
|
+
creatorAddress: cfg.wallet.address,
|
|
187
|
+
imgUrl: opts.image ?? null,
|
|
188
|
+
description: opts.description ?? null,
|
|
189
|
+
}),
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
/* non-fatal — token still deployed */
|
|
194
|
+
}
|
|
195
|
+
}
|
|
175
196
|
br();
|
|
176
197
|
console.log(chalk.bold.hex("#3d9eff")("◈ Token deployed — Verified by Otonix ✓"));
|
|
177
198
|
console.log(chalk.dim("─".repeat(44)));
|