@otonix/cli 2.1.9 → 2.2.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.
@@ -2,7 +2,7 @@ import { confirm } from "@inquirer/prompts";
2
2
  import ora from "ora";
3
3
  import chalk from "chalk";
4
4
  import { loadConfig, OTONIX_TREASURY } from "../lib/config.js";
5
- import { getEthBalance, BASE_RPC, } from "../lib/chain.js";
5
+ import { getEthBalance, BASE_RPC, BASE_MEV_RPC, } from "../lib/chain.js";
6
6
  import { header, row, failure, info, br, warn, } from "../lib/display.js";
7
7
  const WETH_BASE = "0x4200000000000000000000000000000000000006";
8
8
  const OTONIX_TWITTER = "otonix_tech";
@@ -16,8 +16,11 @@ export function launchCommand(program) {
16
16
  .requiredOption("--ticker <ticker>", "Token ticker/symbol (e.g. COOL)")
17
17
  .requiredOption("--image <url>", "Token logo URL (https:// or ipfs://)")
18
18
  .requiredOption("--description <text>", "Token description")
19
- .option("--twitter <handle>", "Your Twitter/X handle (e.g. yourname) — shown in metadata")
19
+ .option("--twitter <handle>", "Project/creator Twitter/X handle (e.g. yourname)")
20
+ .option("--website <url>", "Project website URL (e.g. https://yourproject.com)")
21
+ .option("--github <url>", "Project GitHub URL (e.g. https://github.com/yourproject)")
20
22
  .option("--devbuy <eth>", "Initial dev buy in ETH (default: 0)", "0")
23
+ .option("--mev-protect", "Route deploy tx through Flashbots private mempool (anti-sandwich)")
21
24
  .action(async (opts) => {
22
25
  header("Launch Token");
23
26
  const cfg = loadConfig();
@@ -36,6 +39,8 @@ export function launchCommand(program) {
36
39
  const devBuyEth = parseFloat(opts.devbuy) || 0;
37
40
  const minEthNeeded = 0.001 + devBuyEth;
38
41
  const twitterHandle = opts.twitter?.replace(/^@/, "") ?? "";
42
+ const websiteUrl = opts.website ?? "";
43
+ const githubUrl = opts.github ?? "";
39
44
  const checkSpinner = ora("Checking agent wallet...").start();
40
45
  let agentEth;
41
46
  try {
@@ -62,6 +67,8 @@ export function launchCommand(program) {
62
67
  failure("Pre-flight checks failed. Fix the issues above and try again.");
63
68
  process.exit(1);
64
69
  }
70
+ const useMevProtect = !!opts.mevProtect;
71
+ const activeRpc = useMevProtect ? BASE_MEV_RPC : BASE_RPC;
65
72
  br();
66
73
  console.log(chalk.bold.white("Token to deploy:"));
67
74
  row("Name", opts.name);
@@ -70,6 +77,10 @@ export function launchCommand(program) {
70
77
  row("Logo URL", opts.image.slice(0, 55) + (opts.image.length > 55 ? "..." : ""));
71
78
  if (twitterHandle)
72
79
  row("Twitter", "@" + twitterHandle);
80
+ if (websiteUrl)
81
+ row("Website", websiteUrl);
82
+ if (githubUrl)
83
+ row("GitHub", githubUrl);
73
84
  row("Agent", opts.agent + " (" + agent.address.slice(0, 10) + "...)");
74
85
  row("Chain", "Base Mainnet");
75
86
  row("LP protocol", "Clanker v4 (Uniswap v4)");
@@ -78,6 +89,9 @@ export function launchCommand(program) {
78
89
  row("Dev buy", devBuyEth + " ETH");
79
90
  row("Reward 80%", agent.address + " (WETH → agent wallet)");
80
91
  row("Reward 20%", OTONIX_TREASURY + " ($OTX burn)");
92
+ row("MEV protect", useMevProtect
93
+ ? chalk.green("✓ ON") + chalk.dim(" (Flashbots private mempool)")
94
+ : chalk.dim("off (use --mev-protect to enable)"));
81
95
  row("Verified by", "✓ Otonix (@" + OTONIX_TWITTER + ")");
82
96
  br();
83
97
  const confirmed = await confirm({
@@ -88,7 +102,9 @@ export function launchCommand(program) {
88
102
  info("Cancelled.");
89
103
  return;
90
104
  }
91
- const deploySpinner = ora("Deploying token on Base (Clanker v4 / Uniswap v4)...").start();
105
+ const deploySpinner = ora(useMevProtect
106
+ ? "Deploying token via Flashbots private mempool (MEV protected)..."
107
+ : "Deploying token on Base (Clanker v4 / Uniswap v4)...").start();
92
108
  try {
93
109
  const { createWalletClient, createPublicClient, http } = await import("viem");
94
110
  const { base } = await import("viem/chains");
@@ -98,12 +114,12 @@ export function launchCommand(program) {
98
114
  const agentAccount = privateKeyToAccount(agent.privateKey);
99
115
  const publicClient = createPublicClient({
100
116
  chain: base,
101
- transport: http(BASE_RPC),
117
+ transport: http(activeRpc),
102
118
  });
103
119
  const walletClient = createWalletClient({
104
120
  account: agentAccount,
105
121
  chain: base,
106
- transport: http(BASE_RPC),
122
+ transport: http(activeRpc),
107
123
  });
108
124
  const clanker = new Clanker({
109
125
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -117,6 +133,12 @@ export function launchCommand(program) {
117
133
  if (twitterHandle) {
118
134
  socialUrls.push({ platform: "x", url: `https://x.com/${twitterHandle}` });
119
135
  }
136
+ if (websiteUrl) {
137
+ socialUrls.push({ platform: "website", url: websiteUrl });
138
+ }
139
+ if (githubUrl) {
140
+ socialUrls.push({ platform: "github", url: githubUrl });
141
+ }
120
142
  const tokenConfig = {
121
143
  name: opts.name,
122
144
  symbol: opts.ticker.toUpperCase(),
@@ -1,6 +1,7 @@
1
1
  import { type Address } from "viem";
2
2
  export declare const OTX_ADDRESS: Address;
3
3
  export declare const BASE_RPC = "https://mainnet.base.org";
4
+ export declare const BASE_MEV_RPC = "https://rpc.flashbots.net?chain=8453";
4
5
  export declare const OTX_DECIMALS = 18;
5
6
  export declare const OTX_REQUIRED: bigint;
6
7
  export declare const publicClient: {
package/dist/lib/chain.js CHANGED
@@ -3,6 +3,7 @@ import { base } from "viem/chains";
3
3
  import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
4
4
  export const OTX_ADDRESS = "0xF7E2a6226Ffe0693DD85406AC3A8917cbea5DC40";
5
5
  export const BASE_RPC = "https://mainnet.base.org";
6
+ export const BASE_MEV_RPC = "https://rpc.flashbots.net?chain=8453";
6
7
  export const OTX_DECIMALS = 18;
7
8
  export const OTX_REQUIRED = 200n * 10n ** 18n;
8
9
  export const publicClient = createPublicClient({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otonix/cli",
3
- "version": "2.1.9",
3
+ "version": "2.2.1",
4
4
  "description": "Otonix CLI — deploy autonomous agent tokens on Base via Clanker v4",
5
5
  "type": "module",
6
6
  "bin": {