@otonix/cli 2.1.9 → 2.2.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.
@@ -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";
@@ -18,6 +18,7 @@ export function launchCommand(program) {
18
18
  .requiredOption("--description <text>", "Token description")
19
19
  .option("--twitter <handle>", "Your Twitter/X handle (e.g. yourname) — shown in metadata")
20
20
  .option("--devbuy <eth>", "Initial dev buy in ETH (default: 0)", "0")
21
+ .option("--mev-protect", "Route deploy tx through Flashbots private mempool (anti-sandwich)")
21
22
  .action(async (opts) => {
22
23
  header("Launch Token");
23
24
  const cfg = loadConfig();
@@ -62,6 +63,8 @@ export function launchCommand(program) {
62
63
  failure("Pre-flight checks failed. Fix the issues above and try again.");
63
64
  process.exit(1);
64
65
  }
66
+ const useMevProtect = !!opts.mevProtect;
67
+ const activeRpc = useMevProtect ? BASE_MEV_RPC : BASE_RPC;
65
68
  br();
66
69
  console.log(chalk.bold.white("Token to deploy:"));
67
70
  row("Name", opts.name);
@@ -78,6 +81,9 @@ export function launchCommand(program) {
78
81
  row("Dev buy", devBuyEth + " ETH");
79
82
  row("Reward 80%", agent.address + " (WETH → agent wallet)");
80
83
  row("Reward 20%", OTONIX_TREASURY + " ($OTX burn)");
84
+ row("MEV protect", useMevProtect
85
+ ? chalk.green("✓ ON") + chalk.dim(" (Flashbots private mempool)")
86
+ : chalk.dim("off (use --mev-protect to enable)"));
81
87
  row("Verified by", "✓ Otonix (@" + OTONIX_TWITTER + ")");
82
88
  br();
83
89
  const confirmed = await confirm({
@@ -88,7 +94,9 @@ export function launchCommand(program) {
88
94
  info("Cancelled.");
89
95
  return;
90
96
  }
91
- const deploySpinner = ora("Deploying token on Base (Clanker v4 / Uniswap v4)...").start();
97
+ const deploySpinner = ora(useMevProtect
98
+ ? "Deploying token via Flashbots private mempool (MEV protected)..."
99
+ : "Deploying token on Base (Clanker v4 / Uniswap v4)...").start();
92
100
  try {
93
101
  const { createWalletClient, createPublicClient, http } = await import("viem");
94
102
  const { base } = await import("viem/chains");
@@ -98,12 +106,12 @@ export function launchCommand(program) {
98
106
  const agentAccount = privateKeyToAccount(agent.privateKey);
99
107
  const publicClient = createPublicClient({
100
108
  chain: base,
101
- transport: http(BASE_RPC),
109
+ transport: http(activeRpc),
102
110
  });
103
111
  const walletClient = createWalletClient({
104
112
  account: agentAccount,
105
113
  chain: base,
106
- transport: http(BASE_RPC),
114
+ transport: http(activeRpc),
107
115
  });
108
116
  const clanker = new Clanker({
109
117
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -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.0",
4
4
  "description": "Otonix CLI — deploy autonomous agent tokens on Base via Clanker v4",
5
5
  "type": "module",
6
6
  "bin": {