Pay for x402-enabled Agent endpoints using TRC20 tokens (USDT/USDD) on TRON
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install tron-x402-payment或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install tron-x402-payment⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/tron-x402-payment/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: tron-x402-payment description: "Pay for x402-enabled Agent endpoints using TRC20 tokens (USDT/USDD) on TRON" version: 1.1.0 author: open-aibank homepage: https://x402.org metadata: {"clawdbot":{"emoji":"💳","env":["TRON_PRIVATE_KEY"]}} tags: [crypto, payments, x402, agents, api, usdt, usdd, tron] requires_tools: [x402_tron_invoke]
arguments: url: description: "Base URL of the agent (v2) or full URL (v1/Discovery)" required: true entrypoint: description: "Entrypoint name to invoke (e.g., 'chat', 'search')" required: false input: description: "Input object to send to the entrypoint (will be wrapped in {\"input\": ...} for v2)" required: false ---
Invoke x402-enabled AI agent endpoints with automatic TRC20 token payments on TRON. Currently recommended tokens: USDT, USDD.
The tool x402_tron_invoke is implemented by the compiled script dist/x402_tron_invoke.js.
The script is pre-built and ready to run. You can execute it directly from the command line:
# v2 Invoke
node dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{"prompt": "hi"}'
# Direct/Discovery
node dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json
---
The x402_tron_invoke tool:
- If entrypoint is provided: {url}/entrypoints/{entrypoint}/invoke (v2) - Otherwise: Uses {url} as-is (v1 / Discovery)
- Parses payment requirements - Checks wallet balance and allowance - Performs an infinite approval if allowance is insufficient - Signs the payment permit (EIP-712 / TRON Typed Data) - Retries the request with X-PAYMENT header
1. TRON_PRIVATE_KEY environment variable. 2. ~/.mcporter/mcporter.json (AIBank standard). 3. x402-config.json in the current/home directory.
TRON_GRID_API_KEY).---
Invokes an HTTP endpoint with automatic payment handling.
Modes:
url (Base URL) + entrypoint. * Constructs: {url}/entrypoints/{entrypoint}/invoke * Wraps input: {"input": } * Method: POST
url (Full URL) without entrypoint. * Uses the URL as-is. * Method: GET (default) or specified via method. * Agent Advice: Use this mode for discovery. If url returns 404, try appending /.well-known/agent.json or /entrypoints.
--check or --status. * Verifies if TRON_PRIVATE_KEY is correctly configured and outputs the associated wallet address. * Checks if TRON_GRID_API_KEY is present (Required for Mainnet). * Agent Advice: ALWAYS use this instead of env or echo $TRON_PRIVATE_KEY.
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | url | string | Yes | Base URL (v2) or Full URL (v1/Discovery). Not required for --check. | | entrypoint | string | No | Entrypoint name. Required for v2 Invoke. | | input | object | No | Input data. | | method | string | No | HTTP method. Default: POST (v2), GET (Direct). | | network | string | No | mainnet, nile, shasta (Default: nile). | | check | boolean | No | Verify wallet configuration and output address. |
node dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{"prompt": "Tell me a joke"}'
(Sends POST https://api.example.com/entrypoints/chat/invoke)
```bash node dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json ```
```bash node dist/x402_tron_invoke.js --url https://api.example.com/entrypoints ``` Each entrypoint typically returns: - Path: /entrypoints/{name}/invoke - Pricing: Cost in tokens (e.g., 1000 units) - Network: Usually nile or mainnet - Input Schema: Expected JSON format for the input parameter
node dist/x402_tron_invoke.js --url https://api.example.com/chat --method POST --input '{"prompt": "Tell me a joke"}'
---
| Token | Network | Contract Address | Decimals | |-------|---------|------------------|----------| | USDT | Mainnet | TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t | 6 | | USDT | Nile | TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf | 6 | | USDT | Shasta | TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs | 6 | | USDD | Mainnet | TXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9Hz | 18 | | USDD | Nile | TGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK | 18 |
| Amount (raw) | Value (USDT, 6 dec) | Typical Use | |--------------|---------------------|-------------| | 1000 | $0.001 | Single API call | | 5000 | $0.005 | Multiple results | | 10000 | $0.01 | Premium request | | 1000000 | $1.00 | Large batch |
---
When payment is required, agents return:
{
"error": "X-PAYMENT header is required",
"accepts": [{
"scheme": "exact",
"network": "nile",
"maxAmountRequired": "1000",
"payTo": "T...",
"asset": "T..."
}],
"x402Version": 1
}
The tool handles this automatically.
---
This tool supports TRC20 tokens compatible with the x402 protocol. Recommended:
TRON_PRIVATE_KEY or any other signing secret to the dialogue context. - Correct: [[ -n $TRON_PRIVATE_KEY ]] && echo "Configured" || echo "Missing" - Forbidden: echo $TRON_PRIVATE_KEY, env, printenv, set, export.
- env / printenv - echo $VARIABLE_NAME - set / export (without arguments)
node dist/x402_tron_invoke.js --check.> "I will check your private key now: echo $TRON_PRIVATE_KEY" -> STOP! This leaks the secret to the logs and UI.
> "I will verify the wallet configuration: node dist/x402_tron_invoke.js --check" -> SAFE. Only the public address is shown.
Ensure the TRON_PRIVATE_KEY environment variable is set or a valid x402-config.json exists in the expected locations.
The tool will attempt to broadcast an infinite approve transaction. This requires TRX for gas. Ensure your wallet has TRX.
Check if you have enough Token balance (USDT/USDD) and TRX for gas.
---
...
安装 tron-x402-payment 后,可以对 AI 说这些话来触发它
Help me get started with tron-x402-payment
Explains what tron-x402-payment does, walks through the setup, and runs a quick demo based on your current project
Use tron-x402-payment to pay for x402-enabled Agent endpoints using TRC20 tokens (USDT/USDD)...
Invokes tron-x402-payment with the right parameters and returns the result directly in the conversation
What can I do with tron-x402-payment in my general tools workflow?
Lists the top use cases for tron-x402-payment, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/tron-x402-payment/ 目录(个人级,所有项目可用),或 .claude/skills/tron-x402-payment/(项目级)。重启 AI 客户端后,用 /tron-x402-payment 主动调用,或让 AI 根据上下文自动发现并使用。
tron-x402-payment 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
tron-x402-payment 可免费安装使用。请查阅仓库了解许可证信息。
Pay for x402-enabled Agent endpoints using TRC20 tokens (USDT/USDD) on TRON
tron-x402-payment 属于「General Tools」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my general tools tasks using tron-x402-payment
Identifies repetitive steps in your workflow and sets up tron-x402-payment to handle them automatically