Gate DEX Wallet
Pure Routing Layer — This SKILL.md is a lightweight router. All sub-module details live in references/.
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
Signing gate — terminal tx-checkin (mandatory)
Before any MCP call to dex_wallet_sign_transaction, dex_wallet_sign_message, or dex_tx_x402_fetch:
- 1. User must pass the existing confirmation gates (preview / message text / payment intent) for that operation.
- Agent MUST run the terminal
tx-checkin flow in references/tx-checkin.md and treat success as a hard prerequisite. Do not skip because a prior operation did not require it or no error was returned. Use the prebuilt check-in binaries under tools/tx-checkin/bin/ — end users do not compile (go build / go run not required). Resolve the CLI from this skill’s skill_root: Linux → tx-checkin-linux-amd64, macOS → tx-checkin-darwin-universal, Windows → tx-checkin-windows-amd64.exe — users need not set TX_CHECKIN (optional override only); see references/tx-checkin.md. - After
dex_tx_transfer_preview, check-in must use the preview field txBundle only: write that string to a file and run tx-checkin -tx-bundle-file — do not assemble txbundle JSON from unsigned_tx_hex or other fields (see references/tx-checkin.md). - x402 (
dex_tx_x402_fetch): Always complete terminal check-in before the first dex_tx_x402_fetch call in that payment flow. Do not call dex_tx_x402_fetch first to probe 402 or “see if GV needs check-in.” After successful check-in, pass checkin_token from stdout JSON into dex_tx_x402_fetch when the tool exposes that parameter; use -intent / -message (or documented body) for check-in per references/x402.md and references/tx-checkin.md. - Other single-step MCP tools that sign internally: same terminal check-in immediately before the tool when the gateway requires it; follow backend docs for
checkin_token / intent payload.
Applicable Scenarios
Use this skill when the user wants to manage their on-chain wallet account, identity, or assets:
- - Authenticate or manage sessions (login via Google or Gate OAuth, logout)
- Query token balances, total portfolio value, or wallet addresses
- View transaction history or past swap records
- Transfer or send tokens to an address (single or batch); mandatory terminal tx-checkin before any signing (references/tx-checkin.md)
- Withdraw or cash out on-chain to their Gate Exchange account (deposit address resolved for their UID; not CEX-internal balance moves from this skill)
- Pay for HTTP 402 resources via x402 protocol (EVM exact/upto, Solana exact/upto); terminal tx-checkin before
dex_tx_x402_fetch (references/x402.md, references/tx-checkin.md) - Interact with DApps (connect wallet, sign messages, approve tokens, call contracts)
- Use the gate-wallet CLI tool for any of the above
- Detect or configure MCP Server connectivity
Capability Boundaries
| Supported | Not Supported (route elsewhere) |
|---|
| Authentication & session management | Token price / K-line queries -> INLINECODE26 |
| Balance & address queries |
Token swap execution ->
gate-dex-trade |
| Transaction & swap history | Token security audits ->
gate-dex-market |
| Token transfers (EVM + Solana); on-chain withdraw to Gate Exchange (deposit address flow) | |
| x402 payment (EVM exact/upto + Solana exact/upto) | |
| DApp interactions & approvals | |
| CLI dual-channel operations | |
Module Routing
Route to the corresponding sub-module based on user intent:
| User Intent | Target |
|---|
| Login, logout, sign in, sign out, token expired, session expired, OAuth, Google login, Gate login, authenticate, re-login, switch account, "I can't access my wallet", "not logged in" | references/auth.md |
| Check balance, total assets, portfolio value, wallet address, my address, how much do I have, show my tokens, tx history, transaction history, swap history, past transactions, "what do I own", "how many ETH", "list my coins", "show holdings" |
references/asset-query.md |
| Withdraw to Gate Exchange, cash out to my Gate account, send funds to the exchange deposit address, move coins from wallet to Gate (on-chain deposit), bind or rebind Gate UID for withdraw |
references/withdraw.md |
| Transfer, send tokens, send to address, batch transfer, "send 1 ETH to 0x...", "transfer USDT", "move tokens", "pay someone", "send crypto to a friend" (arbitrary or known on-chain address — not exchange deposit resolution) |
references/transfer.md +
references/tx-checkin.md before sign |
| Any signing: before
dex_wallet_sign_transaction /
dex_wallet_sign_message; checkin
token; "run check-in"; terminal tx-checkin | references/tx-checkin.md (read before signing) |
| 402 payment, x402 pay, payment required, pay for API, pay for URL, "fetch and pay", "call this URL and pay", "paid endpoint", "pay for access", "HTTP 402", Permit2 payment, upto payment | references/tx-checkin.md then references/x402.md (check-in before dex_tx_x402_fetch) |
| DApp connect, connect wallet, sign message, approve, revoke approval, contract call, EIP-712, Permit, personalsign, "interact with Uniswap", "add liquidity", "stake on Lido", "mint NFT", "sign for DApp login", authorize contract | references/dapp.md + references/tx-checkin.md before every sign |
| gate-wallet CLI, command line, terminal, openapi-swap, hybrid swap, "use CLI", "run command", "gate-wallet balance", script automation, npm gate-wallet | references/cli.md |
MCP Server Connection Detection
Before the first MCP tool call in a session, perform one connection probe:
- 1. Discover: Scan configured MCP servers for tools
dex_wallet_get_token_list, dex_tx_quote, and dex_tx_swap. - Identify: Accept flexible server names (gate-wallet, gate-dex, dex, wallet, user-gate-wallet, or any custom name).
- Verify:
CallMcpTool(server="<id>", toolName="dex_chain_config", arguments={chain: "eth"}).
| Result | Action |
|---|
| Success | Record server identifier; use for all subsequent calls this session |
| Failure |
Display setup guide below (at most once per session); re-detect next session |
OpenClaw Platform Detection
When the OpenClaw/mcporter platform is detected, route MCP calls through mcporter:
CODEBLOCK0
Setup Guide (shown once on detection failure)
CODEBLOCK1
Runtime Error Handling
| Error Type | Keywords | Action |
|---|
| MCP Server not configured | INLINECODE37 , INLINECODE38 | Show setup guide |
| Remote service unreachable |
connection refused, timeout, DNS error | Prompt to check server status and network |
| Authentication failure | 400, 401, unauthorized | Follow §3 of gate-runtime-rules.md |
Follow-up Routing
After completing an operation, proactively suggest 2-4 relevant next actions to the user (see each module's "Post-XXX Suggestions" section for templates). Then route based on the user's response:
| User Intent After Operation | Target |
|---|
| View token prices, K-line charts, market cap, trading volume | INLINECODE45 |
| Run a token security audit, check if token is safe |
gate-dex-market |
| Transfer or send tokens to an arbitrary on-chain address | references/transfer.md |
| Withdraw or cash out on-chain to Gate Exchange | references/withdraw.md |
| Swap, exchange, buy, sell, convert tokens on DEX | gate-dex-trade |
| Pay for a 402 resource, x402 payment | references/tx-checkin.md then references/x402.md |
| Interact with a DApp, connect wallet, sign, approve | references/dapp.md |
| Mandatory tx-checkin in terminal before any signing, checkintoken | references/tx-checkin.md |
| Login, re-login, fix expired auth, switch account | references/auth.md |
| Use CLI commands, gate-wallet terminal operations | references/cli.md |
| Check balance, view assets, transaction history | references/asset-query.md |
NOT This Skill (Common Misroutes)
These intents should NOT trigger this skill:
| User Intent | Correct Skill |
|---|
| "What is the price of ETH?" / "Show BTC chart" / "Token rankings" | INLINECODE48 |
| "Swap ETH for USDT" / "Buy SOL" / "Exchange tokens" / "DEX trade" |
gate-dex-trade |
| "Is this token safe?" / "Audit contract 0x..." / "Honeypot check" | gate-dex-market |
| "Show top gainers" / "New token listings" / "Market overview" | gate-dex-market |
Supported Chains
EVM: eth, bsc, polygon, arbitrum, optimism, avax, base | Non-EVM: sol
Security Rules
- 1. Authentication first: Verify
mcp_token validity before all operations; on failure follow §3 of gate-runtime-rules.md. - Token confidentiality: Never display
mcp_token in plaintext; use placeholders like <mcp_token>. - MCP Server errors: Display all MCP Server error messages to users transparently — never hide or modify them.
Gate DEX 钱包
纯路由层 — 本 SKILL.md 是一个轻量级路由器。所有子模块详情位于 references/ 中。
通用规则
⚠️ 停止 — 在继续操作前,您必须阅读并严格遵守共享运行时规则。
在阅读所有规则之前,请勿选择或调用任何工具。这些规则具有最高优先级。
→ 阅读 gate-runtime-rules.md
签名门禁 — 终端 tx-checkin(强制)
在任何对 dexwalletsigntransaction、dexwalletsignmessage 或 dextxx402_fetch 的 MCP 调用之前:
- 1. 用户必须通过该操作的现有确认门禁(预览/消息文本/支付意图)。
- 代理必须运行 references/tx-checkin.md 中的终端 tx-checkin 流程,并将成功视为硬性前提条件。不要因为之前的操作不需要或未返回错误而跳过。使用 tools/tx-checkin/bin/ 下的预构建 check-in 二进制文件 — 最终用户无需编译(不需要 go build / go run)。从本技能的 skillroot 解析 CLI:Linux → tx-checkin-linux-amd64、macOS → tx-checkin-darwin-universal、Windows → tx-checkin-windows-amd64.exe — 用户无需设置 TXCHECKIN(仅可选覆盖);详见 references/tx-checkin.md。
- 在 dextxtransferpreview 之后,check-in 必须仅使用预览字段 txBundle:将该字符串写入文件并运行 tx-checkin -tx-bundle-file — 不要从 unsignedtxhex 或其他字段组装 txbundle JSON(详见 references/tx-checkin.md)。
- x402(dextxx402fetch):始终在该支付流程中首次调用 dextxx402fetch 之前完成终端 check-in。不要先调用 dextxx402fetch 来探测 402 或查看 GV 是否需要 check-in。成功 check-in 后,将 stdout JSON 中的 checkintoken 传递给 dextxx402fetch(当该工具暴露该参数时);按照 references/x402.md 和 references/tx-checkin.md 使用 -intent / -message(或文档化的 body)进行 check-in。
- 其他内部签名的单步 MCP 工具:当网关要求时,在工具之前立即进行相同的终端 check-in;按照后端文档处理 checkintoken / intent 负载。
适用场景
当用户想要管理其链上钱包账户、身份或资产时使用此技能:
- - 认证或管理会话(通过 Google 或 Gate OAuth 登录、登出)
- 查询代币余额、总资产组合价值或钱包地址
- 查看交易历史或过去的兑换记录
- 向地址转账或发送代币(单笔或批量);在任何签名之前必须进行终端 tx-checkin(references/tx-checkin.md)
- 将链上资产提现到其 Gate 交易所账户(为其 UID 解析充值地址;此技能不处理 CEX 内部余额转移)
- 通过 x402 协议支付 HTTP 402 资源(EVM exact/upto、Solana exact/upto);在 dextxx402fetch 之前进行终端 tx-checkin(references/x402.md、references/tx-checkin.md)
- 与 DApp 交互(连接钱包、签名消息、批准代币、调用合约)
- 使用 gate-wallet CLI 工具执行上述任何操作
- 检测或配置 MCP 服务器连接
能力边界
| 支持 | 不支持(路由到其他地方) |
|---|
| 认证与会话管理 | 代币价格/K线查询 -> gate-dex-market |
| 余额与地址查询 |
代币兑换执行 -> gate-dex-trade |
| 交易与兑换历史 | 代币安全审计 -> gate-dex-market |
| 代币转账(EVM + Solana);链上提现到 Gate 交易所(充值地址流程) | |
| x402 支付(EVM exact/upto + Solana exact/upto) | |
| DApp 交互与授权 | |
| CLI 双通道操作 | |
模块路由
根据用户意图路由到相应的子模块:
| 用户意图 | 目标 |
|---|
| 登录、登出、登录、登出、代币过期、会话过期、OAuth、Google 登录、Gate 登录、认证、重新登录、切换账户、我无法访问我的钱包、未登录 | references/auth.md |
| 查询余额、总资产、资产组合价值、钱包地址、我的地址、我有多少、显示我的代币、交易历史、交易记录、兑换历史、过去的交易、我拥有什么、有多少 ETH、列出我的币种、显示持仓 |
references/asset-query.md |
| 提现到 Gate 交易所、提现到我的 Gate 账户、发送资金到交易所充值地址、将币从钱包转移到 Gate(链上充值)、绑定或重新绑定用于提现的 Gate UID |
references/withdraw.md |
| 转账、发送代币、发送到地址、批量转账、发送 1 ETH 到 0x...、转账 USDT、移动代币、支付某人、向朋友发送加密货币(任意或已知的链上地址 — 非交易所充值解析) |
references/transfer.md + 签名前
references/tx-checkin.md |
| 任何签名:在 dex
walletsign
transaction / dexwallet
signmessage 之前;checkin
token;运行 check-in;终端 tx-checkin | references/tx-checkin.md(在签名之前阅读) |
| 402 支付、x402 支付、需要支付、支付 API、支付 URL、获取并支付、调用此 URL 并支付、付费端点、付费访问、HTTP 402、Permit2 支付、upto 支付 | references/tx-checkin.md 然后 references/x402.md(在 dextxx402_fetch 之前 check-in) |
| DApp 连接、连接钱包、签名消息、批准、撤销批准、合约调用、EIP-712、Permit、personalsign、与 Uniswap 交互、添加流动性、在 Lido 上质押、铸造 NFT、为 DApp 登录签名、授权合约 | references/dapp.md + 每次签名前 references/tx-checkin.md |
| gate-wallet CLI、命令行、终端、openapi-swap、混合兑换、使用 CLI、运行命令、gate-wallet 余额、脚本自动化、npm gate-wallet | references/cli.md |
MCP 服务器连接检测
在会话中首次 MCP 工具调用之前,执行一次连接探测:
- 1. 发现:扫描已配置的 MCP 服务器,查找工具 dexwalletgettokenlist、dextxquote 和 dextxswap。
- 识别:接受灵活的服务器名称(gate-wallet、gate-dex、dex、wallet、user-gate-wallet 或任何自定义名称)。
- 验证:CallMcpTool(server=, toolName=dexchainconfig, arguments={chain: eth})。
| 结果 | 操作 |
|---|
| 成功 | 记录服务器标识符;本会话中所有后续调用使用该标识符 |
| 失败 |
显示下方设置指南(每个会话最多一次);下次会话重新检测 |
OpenClaw 平台检测
当检测到 OpenClaw/mcporter 平台时,通过 mcporter 路由 MCP 调用:
text
CallMcpTool(server=mcporter, toolName=call_tool, arguments={
server: ,
tool: