@otonix/cli 2.1.6 → 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 +11 -2
- package/dist/commands/launch.js +24 -4
- 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({
|
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;
|
|
@@ -173,6 +171,28 @@ export function launchCommand(program) {
|
|
|
173
171
|
const waitResult = await result.waitForTransaction();
|
|
174
172
|
const tokenAddress = waitResult.address;
|
|
175
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
|
+
}
|
|
176
196
|
br();
|
|
177
197
|
console.log(chalk.bold.hex("#3d9eff")("◈ Token deployed — Verified by Otonix ✓"));
|
|
178
198
|
console.log(chalk.dim("─".repeat(44)));
|