# ArcBlast Launch CLI 接入文档

`arcblast-launch` 是面向智能体的 ArcBlast 发射 CLI，Python 3.9+、标准库运行。当前版本 `0.3.0` 支持 Arc Testnet 本地生成交易，也支持 Arc Mainnet API 准备交易。

## 安全边界

- 默认只生成 unsigned transaction，不读取私钥、不签名、不广播。
- 智能体必须把 `to`、`data`、`value` 和 `risk` 展示给用户确认，再交给钱包或外部 signer。
- `tokens prepare --network testnet` 不需要 SIWE 登录。
- Mainnet 的 `tokens prepare` 和媒体上传需要 SIWE 会话。

## 安装

```bash
curl -fsSLO https://boooooom.shop/cli/arcblast_launch_cli.py
python arcblast_launch_cli.py --version
```

只有 `auth login` 需要可选依赖：`pip install eth-account`。所有命令支持在任意位置添加 `--json`。

## Arc Testnet 发射

测试网参数：Chain ID `5042002`，RPC `https://rpc.testnet.arc.io`，Factory `0xae4592D1E85AE907354292346DD3e35f614F85d7`，USDC `0x3600000000000000000000000000000000000000`。

```bash
python arcblast_launch_cli.py --json tokens prepare --network testnet \
  --name AgentSmoke --symbol ASMK \
  --description "Agent CLI smoke test" \
  --launch-mode bonding --initial-liquidity 1.25 \
  --user-salt 0x0000000000000000000000000000000000000000000000000000000000000001
```

初始流动性大于零时，返回两笔交易，必须按顺序发送：

1. `approve`：USDC 授权给 Factory。
2. `createToken`：发射代币。

初始流动性为零时只返回 `createToken`。测试网 Factory 当前使用兼容旧部署的 10 参数 ABI，CLI 已输出正确的 selector `0x4ba21e19`。

## 查看链参数

```bash
python arcblast_launch_cli.py --json chains
python arcblast_launch_cli.py --json health
```

## Mainnet 发射准备

```bash
python arcblast_launch_cli.py auth message --address 0x<address> --json
python arcblast_launch_cli.py auth verify --message "<exact message>" --signature 0x<signature>
python arcblast_launch_cli.py --json tokens prepare \
  --name "My Token" --symbol MTK --description "One-liner" \
  --launch-mode bonding --initial-liquidity 100
```

Mainnet prepare 只返回 unsigned transaction；CLI 不会广播。

## 参数和校验

- `--name`：1 至 64 个字符。
- `--symbol`：1 至 12 个 ASCII 字母或数字。
- `--description`：1 至 280 个字符。
- `--initial-liquidity`：USDC 十进制金额，最多 6 位小数。
- `--creator-fee --fee-recipient 0x...`：启用创建者费用。
- `--user-salt`：测试网必须是 32 字节十六进制值；省略时随机生成。

地址后缀不能使用 `o` 等非十六进制字符。若需要 vanity 地址，目标必须由 `0-9a-f` 组成；`b000000` 平均需要约 2.68 亿次 salt 尝试，当前 CLI 不默认执行长时间搜索。

## JSON 输出

成功响应格式：

```json
{"ok":true,"schema":"arcblast.launch-cli/v1","version":"0.3.0","data":{}}
```

失败时退出码为 `1`，并返回 `ok: false` 与错误信息。
