gate-dex-wallet-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGate DEX CLI
Gate DEX CLI
General Rules
通用规则
⚠️ STOP — You MUST read and strictly follow the shared runtime rules before proceeding.
Do NOT select or call any tool until all rules are read. These rules have the highest priority.
→ Read gate-runtime-rules.md
- Only call MCP tools explicitly listed in this skill. Tools not documented here must NOT be called, even if they exist in the MCP server.
- Only use the CLI subcommands explicitly listed in this skill and its references. Commands not documented here must NOT be run for these workflows, even if other interfaces expose them.
gate-dex
Pure Routing Layer — This SKILL.md is a lightweight router. Sub-module details live in.references/
⚠️ 停止 — 你必须先阅读并严格遵守共享运行时规则才能继续。在未读完所有规则前,请勿选择或调用任何工具。这些规则具有最高优先级。
→ 阅读gate-runtime-rules.md
- 仅调用本Skill中明确列出的MCP工具。即使MCP服务器中存在未在此处记录的工具,也不得调用。
- 仅使用本Skill及其参考文档中明确列出的CLI子命令。即使其他接口提供了未在此处记录的命令,也不得在这些工作流中运行。
gate-dex
纯路由层 — 本SKILL.md是一个轻量级路由文件,子模块的详细信息存储在目录下。references/
Overview
概述
gate-dexAuth: login via Gate/Google OAuth, token stored in .
~/.gate-dex/auth.jsonThe CLI also supports an interactive REPL — running with no arguments opens a prompt.
gate-dexgate-dex认证:通过Gate/Google OAuth登录,令牌存储在中。
~/.gate-dex/auth.json该CLI还支持交互式REPL——不带参数运行会打开一个命令提示符。
gate-dexApplicable Scenarios
适用场景
Use this skill when the user wants to:
- Authenticate (login/logout) via Gate OAuth or Google OAuth
- Query token balances, total portfolio value, or wallet addresses
- View transaction history
- Transfer or send tokens to an on-chain address (EVM + Solana)
- Sign raw messages or raw transactions
- Use CLI commands directly
gate-dex
当用户需要以下操作时,可使用本Skill:
- 通过Gate OAuth或Google OAuth进行身份验证(登录/登出)
- 查询代币余额、总持仓价值或钱包地址
- 查看交易历史
- 向链上地址转账或发送代币(支持EVM + Solana链)
- 签名原始消息或原始交易
- 直接使用CLI命令
gate-dex
Capability Boundaries
能力边界
| Supported | Route elsewhere |
|---|---|
| Authentication & session management | Token swap → |
| Balance, address & token list queries | Market data / token info / K-line → |
| Transaction history | DApp interactions → |
| Token transfers (EVM + Solana) | x402 payments → |
| Sign 32-byte hex messages / raw tx | MCP tool calls → |
Prerequisites: A binary on PATH.
gate-dex- GateClaw managed scenario — runs automatically on install and drops a pre-built Linux binary into
skill/setup.sh. Environment variables (/home/node/.openclaw/skills/bin/gate-dex,RUN_ENV) are collected via the GateClaw Web form and injected into*_URLat runtime.process.env - Personal OpenClaw scenario — the frontmatter spec downloads the binary for the host OS automatically (no Node.js required).
install - Local development — build from source:
bash
cd cli && pnpm install pnpm build:binary # production binary (no baked env) pnpm build:binary -- --bake-env # bake root .env into the binary (test env)
| 支持功能 | 路由至其他Skill |
|---|---|
| 身份认证与会话管理 | 代币兑换 → |
| 余额、地址及代币列表查询 | 市场数据/代币信息/K线 → |
| 交易历史 | DApp交互 → |
| 代币转账(EVM + Solana) | x402支付 → |
| 签名32字节十六进制消息/原始交易 | MCP工具调用 → |
前置条件:PATH环境变量中需存在二进制文件。
gate-dex- GateClaw托管场景 — 安装时会自动运行,并将预构建的Linux二进制文件放入
skill/setup.sh。环境变量(/home/node/.openclaw/skills/bin/gate-dex、RUN_ENV)通过GateClaw网页表单收集,并在运行时注入到*_URL中。process.env - 个人OpenClaw场景 — 前端的规范会自动为宿主操作系统下载二进制文件(无需Node.js)。
install - 本地开发 — 从源码构建:
bash
cd cli && pnpm install pnpm build:binary # 生产环境二进制文件(不包含环境变量) pnpm build:binary -- --bake-env # 将根目录的.env文件嵌入二进制文件(测试环境)
Installation
安装
The published binary is a single self-contained executable (no Node.js runtime required).
bash
undefined发布的二进制文件是一个独立的可执行文件(无需Node.js运行时)。
bash
undefinedGateClaw / OpenClaw: auto-installed via setup.sh or frontmatter.install
GateClaw / OpenClaw:通过setup.sh或frontmatter.install自动安装
Manual download (example):
手动下载(示例):
curl -fsSL https://gate-dex-cli.gateweb3.cc/latest/gate-dex-linux-x64
-o /usr/local/bin/gate-dex chmod +x /usr/local/bin/gate-dex
-o /usr/local/bin/gate-dex chmod +x /usr/local/bin/gate-dex
curl -fsSL https://gate-dex-cli.gateweb3.cc/latest/gate-dex-linux-x64
-o /usr/local/bin/gate-dex chmod +x /usr/local/bin/gate-dex
-o /usr/local/bin/gate-dex chmod +x /usr/local/bin/gate-dex
Login
登录
gate-dex login # Gate OAuth (default)
gate-dex login --google # Google OAuth
**Storage**:
- Auth token → `~/.gate-dex/auth.json`
**Environment variables** (all optional; defaults target production):
| Variable | Purpose |
|----------|---------|
| `RUN_ENV` | `dev` / `pre` / `prod` — selects GV API environment and CDN candidates |
| `WALLET_SERVICE_URL` | `web3-wallet-service` endpoint (used by `balance`) |
| `BW_SERVICE_URL` | `web3-business-wallet` endpoint |
| `MARKET_TOKEN_URL` | `gateio_service_web3_trade_token` endpoint (market/token/swap) |
| `DATA_API_URL` | `web3-data-api` endpoint (token info, security audit, ranking) |
| `BIZ_WALLET_URL` | OAuth session management endpoint |
---gate-dex login # 默认使用Gate OAuth登录
gate-dex login --google # 使用Google OAuth登录
**存储**:
- 认证令牌 → `~/.gate-dex/auth.json`
**环境变量**(均为可选;默认指向生产环境):
| 变量名 | 用途 |
|----------|---------|
| `RUN_ENV` | `dev` / `pre` / `prod` — 选择GV API环境和CDN候选地址 |
| `WALLET_SERVICE_URL` | `web3-wallet-service`端点(用于`balance`命令) |
| `BW_SERVICE_URL` | `web3-business-wallet`端点 |
| `MARKET_TOKEN_URL` | `gateio_service_web3_trade_token`端点(市场/代币/兑换) |
| `DATA_API_URL` | `web3-data-api`端点(代币信息、安全审计、排名) |
| `BIZ_WALLET_URL` | OAuth会话管理端点 |
---Global Options
全局选项
| Option | Description |
|---|---|
| Custom auth storage directory (overrides |
| Custom auth.json file path (overrides |
| Print version |
| 选项 | 描述 |
|---|---|
| 自定义认证存储目录(覆盖 |
| 自定义auth.json文件路径(覆盖 |
| 打印版本信息 |
Sub-Modules
子模块
| Sub-module | File | Scope |
|---|---|---|
| Auth | | OAuth login/logout, session status, web3-domain |
| Asset Query | | balance, address, tokens, tx-history, tx-detail |
| Transfer & Sign | | transfer (preview), send (one-shot), sign-msg, sign-tx, sol-tx, gas |
| 子模块 | 文件 | 范围 |
|---|---|---|
| 认证 | | OAuth登录/登出、会话状态、web3-domain |
| 资产查询 | | 余额、地址、代币、交易历史、交易详情 |
| 转账与签名 | | transfer(预览)、send(一键执行)、sign-msg、sign-tx、sol-tx、gas |
Routing Rules
路由规则
| User Intent | Target |
|---|---|
| Login, logout, re-login, session expired, OAuth, "not logged in", switch account, web3-domain | |
| Check balance, total assets, wallet address, account address, token list, tx history, "how much do I have", "show my tokens" | |
| Transfer, send tokens, "send ETH to 0x...", "transfer USDT", "pay someone", "move tokens", sign-msg, sign-tx, sol-tx | |
| Swap, exchange tokens, "swap ETH for USDT", "buy SOL", quote, "convert tokens" | → |
| K-line, token price, market cap, liquidity, trading stats, token security, token rankings, new tokens | → |
| 用户意图 | 目标 |
|---|---|
| 登录、登出、重新登录、会话过期、OAuth、"未登录"、切换账户、web3-domain | |
| 查询余额、总资产、钱包地址、账户地址、代币列表、交易历史、"我有多少资产"、"显示我的代币" | |
| 转账、发送代币、"发送ETH到0x..."、"转账USDT"、"付款给他人"、"转移代币"、sign-msg、sign-tx、sol-tx | |
| 兑换、交换代币、"把ETH换成USDT"、"购买SOL"、报价、"转换代币" | → |
| K线、代币价格、市值、流动性、交易统计、代币安全、代币排名、新代币 | → |
Execution
执行流程
- Detect intent using the Routing Rules table; resolve to exactly one sub-module file or a peer-skill route.
- Read the matched sub-module (,
references/auth.md, orreferences/asset-query.md) and follow its workflow as the authoritative execution contract.references/transfer.md - Apply the safety rules in this SKILL.md (Security Rules section) before any write command (,
send,sign-msg).sign-tx - For write paths (): require explicit user confirmation in chat before invoking the CLI; preview via
sendfirst.transfer - For peer-skill routes (,
gate-dex-trade-cli): hand off without invoking those skills' commands from here.gate-dex-market-cli
- 检测意图:使用路由规则表,确定对应的子模块文件或其他Skill路由。
- 读取匹配的子模块(、
references/auth.md或references/asset-query.md),并遵循其工作流作为权威执行约定。references/transfer.md - 应用本SKILL.md中的安全规则(安全规则章节),再执行任何写入命令(、
send、sign-msg)。sign-tx - 对于写入路径():在调用CLI前需在聊天中获取用户的明确确认;先通过
send进行预览。transfer - 对于其他Skill路由(、
gate-dex-trade-cli):直接转交,无需在此处调用这些Skill的命令。gate-dex-market-cli
Full Command Reference
完整命令参考
Auth & Session
认证与会话
| Command | Description |
|---|---|
| Gate OAuth Device Flow login |
| Google OAuth Device Flow login |
| Print auth URL instead of opening browser |
| Logout and clear |
| Show current session info |
| View / refresh dynamic web3_domain list |
| Force re-fetch domain list |
| 命令 | 描述 |
|---|---|
| Gate OAuth设备流登录 |
| Google OAuth设备流登录 |
| 打印认证URL而非打开浏览器 |
| 登出并清除 |
| 显示当前会话信息 |
| 查看/刷新动态web3_domain列表 |
| 强制重新获取域名列表 |
Wallet Queries
钱包查询
| Command | Description |
|---|---|
| Total portfolio value (USD) across all chains |
| Show EVM + Solana wallet addresses |
| Token list with balances (gateway) |
| Filter by chain |
| Pagination |
| 命令 | 描述 |
|---|---|
| 所有链上的总持仓价值(USD) |
| 显示EVM + Solana钱包地址 |
| 带余额的代币列表(网关) |
| 按链过滤 |
| 分页 |
Transfer & Signing
转账与签名
| Command | Description |
|---|---|
| Preview-only unsigned tx (no broadcast) |
| One-shot: preview → GV checkin → sign → broadcast |
| Build → GV checkin → sign → broadcast (or broadcast pre-signed with |
| Build Solana unsigned tx locally (latest blockhash) |
| Query gas price + gas limit |
| Sign 32-byte hex message (GV checkin built-in) |
| Sign raw hex transaction (GV checkin built-in) |
| 命令 | 描述 |
|---|---|
| 仅预览未签名交易(不广播) |
| 一键执行:预览 → GV签到 → 签名 → 广播 |
| 构建 → GV签到 → 签名 → 广播(或使用 |
| 本地构建Solana未签名交易(使用最新区块哈希) |
| 查询燃气价格 + 燃气限额 |
| 签名32字节十六进制消息(内置GV签到) |
| 签名原始十六进制交易(内置GV签到) |
Swap (out of scope — route to gate-dex-trade-cli
skill)
gate-dex-trade-cli兑换(超出范围 — 路由至gate-dex-trade-cli
Skill)
gate-dex-trade-cliThe , , , , , and commands are documented in the skill. Do not invoke them from this skill.
quoteswapswap-tokensbridge-tokensswap-historyswap-detailgate-dex-trade-cliquoteswapswap-tokensbridge-tokensswap-historyswap-detailgate-dex-trade-cliTransaction History
交易历史
| Command | Description |
|---|---|
| Transfer transaction history |
| Transaction detail by hash |
| 命令 | 描述 |
|---|---|
| 转账交易历史 |
| 通过哈希查询交易详情 |
Market & Token Data (out of scope — route to gate-dex-market-cli
skill)
gate-dex-market-cli市场与代币数据(超出范围 — 路由至gate-dex-market-cli
Skill)
gate-dex-market-cliThe , , , , , , and commands are documented in the skill. Do not invoke them from this skill.
tx-statsklineliquiditytoken-infotoken-risktoken-ranknew-tokensgate-dex-market-clitx-statsklineliquiditytoken-infotoken-risktoken-ranknew-tokensgate-dex-market-cliChain / RPC
链/RPC
| Command | Description |
|---|---|
| Chain config (networkKey, endpoint, chainID) |
| Raw JSON-RPC call |
| 命令 | 描述 |
|---|---|
| 链配置(networkKey、端点、chainID) |
| 原始JSON-RPC调用 |
Maintenance
维护
| Command | Description |
|---|---|
| Delete |
| 命令 | 描述 |
|---|---|
| 删除 |
Key Design Differences from MCP-based Skills
与基于MCP的Skill的核心设计差异
| Aspect | This skill (gate-dex-wallet-cli) | MCP-based skill (gate-dex-wallet) |
|---|---|---|
| Transport | Pure REST (no MCP) | MCP tool calls |
| GV security checkin | Built into CLI | External |
| Auth storage | | MCP session |
| Swap method | | |
| Transfer method | | |
| Agent binary dependency | None | |
CRITICAL: When using this CLI skill, the agent MUST NOT run binary separately. The CLI handles GV checkin internally. Just run the CLI command after user confirmation.
tx-checkin| 方面 | 本Skill(gate-dex-wallet-cli) | 基于MCP的Skill(gate-dex-wallet) |
|---|---|---|
| 传输方式 | 纯REST(无MCP) | MCP工具调用 |
| GV安全签到 | 内置到CLI的 | 需要外部 |
| 认证存储 | | MCP会话 |
| 兑换方式 | | |
| 转账方式 | | |
| Agent二进制依赖 | 无 | |
重要提示:使用本CLI Skill时,Agent绝对不能单独运行二进制文件。CLI会在内部处理GV签到。只需在用户确认后运行CLI命令即可。
tx-checkinAgent Usage Notes
Agent使用注意事项
- Agent runs in a non-interactive shell (no stdin). Commands that ask for confirmation will hang. For and
send, always confirm with the user in chat before running the command.swap - The and
sendcommands are one-shot: they preview, checkin, sign, and broadcast in a single run.swap - All amounts use human-readable values, not smallest chain units (wei/lamports).
- Agent运行在非交互式shell中(无标准输入)。需要确认的命令会挂起。对于和
send命令,必须在聊天中获得用户的明确确认之后再运行命令。swap - 和
send命令是一键式的:它们会在单次运行中完成预览、签到、签名和广播。swap - 所有金额使用人类可读的值,而非链的最小单位(wei/lamports)。
On-Chain Operation Flow
链上操作流程
Transfer operations follow: preview → user confirm in chat → execute one-shot command.
- Pre-check: →
gate-dex addressfor sufficient fundsgate-dex tokens - Preview: (preview-only, no signing)
gate-dex transfer - User confirmation in chat: Display details, wait for explicit approval
- Execute: (GV checkin, sign, broadcast handled internally)
gate-dex send ... - Verify:
gate-dex tx-detail <hash>
NEVER run without explicit user confirmation.
send转账操作遵循:预览 → 聊天中用户确认 → 执行一键命令。
- 预检查:→
gate-dex address确认资金充足gate-dex tokens - 预览:(仅预览,不签名)
gate-dex transfer - 聊天中用户确认:显示详情,等待明确批准
- 执行:(GV签到、签名、广播由内部处理)
gate-dex send ... - 验证:
gate-dex tx-detail <hash>
绝对不要在未获得用户明确确认的情况下运行命令。
sendFollow-up Routing
后续路由
After completing an operation, proactively suggest 2-4 relevant next actions:
| User Intent After Operation | Target |
|---|---|
| Check balance / tokens | |
| Transfer tokens | |
| Swap tokens | |
| Token prices, K-line, token security | |
| Login / session issues | |
完成操作后,主动建议2-4个相关的下一步操作:
| 操作后的用户意图 | 目标 |
|---|---|
| 查询余额/代币 | |
| 转账代币 | |
| 兑换代币 | |
| 代币价格、K线、代币安全 | |
| 登录/会话问题 | |
NOT This Skill (Common Misroutes)
不属于本Skill的场景(常见错误路由)
| User Intent | Correct Skill |
|---|---|
| DApp connect / sign / approve / contract call | |
| x402 payment | |
| On-chain withdraw to Gate Exchange (UID binding) | |
| MCP tool calls directly | |
| 用户意图 | 正确Skill |
|---|---|
| DApp连接/签名/授权/合约调用 | |
| x402支付 | |
| 链上提取至Gate交易所(UID绑定) | |
| 直接调用MCP工具 | |
Supported Chains
支持的链
EVM: , , , (arb), (op), ,
Non-EVM:
ethbscpolygonarbitrumoptimismavaxbasesolChain names are case-insensitive.
EVM链:、、、(arb)、(op)、、
非EVM链:
ethbscpolygonarbitrumoptimismavaxbasesol链名称不区分大小写。
Security Rules
安全规则
- Confirm before fund operations: involves real funds. Always confirm target address, amount, token, and chain with the user in chat before running the command. Without explicit user confirmation in chat, no
sendmay be executed — only read-only queries (send,balance,address,tokens,tx-history,tx-detailpreview) are allowed.transfer - Preview before execute: Use (preview-only) before
transfer.send - No external checkin binary: Do not run binary — it is not needed; CLI handles it internally.
tx-checkin - Token confidentiality: stores credentials. Never display the raw token to users. Never commit this file to Git.
~/.gate-dex/auth.json - Transaction irreversibility: On-chain transfers are generally irreversible. Re-verify recipient address, chain, and token contract with the user before executing .
send
- 资金操作前确认:涉及真实资金。运行命令前,务必在聊天中与用户确认目标地址、金额、代币和链。未获得聊天中用户的明确确认,不得执行任何
send命令——仅允许只读查询(send、balance、address、tokens、tx-history、tx-detail预览)。transfer - 执行前预览:在前使用
send(仅预览)。transfer - 无外部签到二进制文件:不要运行二进制文件——不需要;CLI会在内部处理。
tx-checkin - 令牌保密性:存储凭证。切勿向用户显示原始令牌。切勿将此文件提交到Git。
~/.gate-dex/auth.json - 交易不可逆性:链上转账通常不可逆。执行前,需与用户重新验证接收地址、链和代币合约。
send
Risk Disclosure
风险提示
Digital asset transactions are generally irreversible. Please verify the recipient address before confirming. Outputs from this skill are for informational purposes only and do not constitute investment, financial, tax, or legal advice. AI-assisted outputs are for general information only and do not constitute any representation, warranty, or guarantee by Gate. This skill is intended for users aged 18 or above with full civil capacity; availability may vary by jurisdiction.
数字资产交易通常不可逆。请在确认前验证接收地址。本Skill的输出仅供参考,不构成投资、财务、税务或法律建议。AI辅助输出仅用于一般信息,不构成Gate的任何陈述、保证或担保。本Skill面向年满18周岁且具有完全民事行为能力的用户;可用性可能因司法管辖区而异。