open-aibank

x402-payment-tron

专业领域v0.0.4
作者:open-aibank更新于 2026-05-18共 4 个版本 · 最新版本发布于 2026-02-03
#Tron#X402#Usdt#Payment#Crypto

据 AlphaMoat 统计,截至 2026-09,x402-payment-tron 累计下载 4,715 次、获 2 个星标,在全部 5,078 个 AI 技能中排名第 2,012 位,在「专业领域」分类(465 个)中排名第 172 位。

累计安装
157
累计下载
4,715
星标
2
全站排名
#2,012
全站前 40% · 「专业领域」前 37%
平台累计安装累计下载星标评论
ClawHub ↗1574,7152-

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

调用 HTTP 端点并处理支付要求;需 TRON 私钥和钱包资金。额度不足时可能自动执行无限授权(MAX_UINT256)。仅调用可信端点,优先使用专用低余额钱包,并在主网使用前审核支付要求。 预构建路径需 Node。核对网络,文档默认 nile,钱包除 USDT 还需 TRX 支付 gas。调用支付工具会自动签名或授权,离线审阅不得调用它。密钥仅经获准配置内部加载,不打印或自行搜索;敏感使用前移除广泛共享配置探测。精确或封顶授权需审查或修改现有无限授权实现;使用后清理临时二进制响应文件。

资料发布于 2026-10-27

可以用来做什么

  • 规划 x402 付费 API 调用
  • 审查钱包及授权风险

什么时候用

  • 端点与付款条件已核实,且交易获明确授权时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

离线审阅这份已提供的代理 manifest,列出付款与授权风险,不调用支付工具。
不交易,说明专用低余额钱包的作用。

月度数据趋势

累计下载4,715
3,9964,3824,7682026-05 · 累计下载 4,0492026-06 · 累计下载 4,1762026-07 · 累计下载 4,4232026-08 · 累计下载 4,5402026-09 · 累计下载 4,71526-0526-09
星标2
1232026-05 · 星标 22026-06 · 星标 22026-07 · 星标 22026-08 · 星标 22026-09 · 星标 226-0526-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,715—2
2026-084,540+2.6%2
2026-074,423+5.9%2
2026-064,176+3.1%2
2026-054,049—2

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.3 KB · ClawHub v0.0.4
---
name: x402_payment_tron
description: "Pay for x402-enabled Agent endpoints using USDT on TRON"
version: 1.0.0
author: x402-protocol
homepage: https://x402.org
metadata: {"clawdbot":{"emoji":"💳","env":["TRON_PRIVATE_KEY"]}}
tags: [crypto, payments, x402, agents, api, usdt, tron]
requires_tools: [x402_tron_invoke]
arguments:
展开全部(共 128 行)
  agent_url:
    description: "Base URL of the x402 agent"
    required: false
  endpoint:
    description: "Entrypoint name to invoke (e.g., 'chat', 'search')"
    required: false
---

# x402 Payment Protocol for TRON Agents

Invoke x402-enabled AI agent endpoints with automatic USDT micropayments on TRON.

## Quick Start

### Option 1: Run Pre-built (Recommended for Agents)
The skill is pre-bundled into a single file. No installation required.
```bash
node dist/index.js --url <URL> [options]
```

### Option 2: Development
```bash
npm install
npm start -- --url <URL>
```

## Tool Reference

- **Wallet**: A TRON private key must be available. The skill automatically looks for it in:
  1. `TRON_PRIVATE_KEY` environment variable.
  2. `~/.mcporter/mcporter.json` (AIBank standard configuration).
  3. `x402-config.json` in the current directory.
  4. `~/.x402-config.json` in the home directory.
- **USDT on TRON**: Wallet needs USDT and some TRX for gas.

---

## Tool Reference

### x402_tron_invoke

Invokes an HTTP endpoint. If payment is required (402), it automatically:
1. Negotiates payment requirements.
2. Checks USDT allowance. If insufficient, it performs an **infinite approval** (MAX_UINT256) to minimize future transactions.
3. Signs the payment permit (EIP-712).
4. Retries the request with the payment signature.

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | Full URL to invoke |
| `method` | string | No | HTTP method (GET, POST, etc.) Default: GET |
| `body` | object | No | JSON body for the request |
| `network` | string | No | `mainnet`, `nile`, `shasta` (Default: `nile`) |

### Example: Chat with Agent

```tool:x402_tron_invoke
url: https://api.example.com/chat
method: POST
body: {"prompt": "Tell me a joke"}
```

---

## Agent Discovery

You can discover available endpoints and their pricing by checking the agent's manifest.

### Fetch Agent Manifest

```tool:x402_tron_invoke
url: https://api.example.com/.well-known/agent.json
method: GET
```

---

## Security Rules for Agents

- **No Private Key Output**: The Agent MUST NOT print, echo, or output the `TRON_PRIVATE_KEY` or any other signing secret to the dialogue context.
- **Internal Loading Only**: The Agent should rely on the skill or underlying scripts to load the key internally.
- **No Export Commands**: The Agent MUST NOT execute shell commands that contain the private key as a literal string (e.g., `export TRON_PRIVATE_KEY=...`).
- **Sanitized Logs**: Ensure that logs or error messages do not leak the key.

## Troubleshooting

### "Private key not found"
Ensure the `TRON_PRIVATE_KEY` environment variable is set or a valid `x402-config.json` exists in the expected locations. 
**Agent Note**: If this error occurs, simply inform the user that the environment is not configured. DO NOT attempt to search for or read private keys from files yourself.

### "Insufficient Allowance"
The tool will attempt to broadcast an **infinite approve** transaction. This requires TRX for gas. Ensure your wallet has TRX.

### "Transaction Failed"
Check if you have enough USDT and TRX.

---

## Binary and Image Handling

If the endpoint returns an image (Content-Type: `image/*`) or binary data (`application/octet-stream`):
1. The data is automatically saved to a temporary file (e.g., `/tmp/x402_image_...` or `/tmp/x402_binary_...`).
2. The tool returns a JSON object with:
    - `file_path`: Path to the temporary file.
    - `content_type`: The MIME type of the content.
    - `bytes`: File size in bytes.
3. **Important**: The Agent is responsible for deleting the temporary file after it has been used or processed.

---

## Network Reference

| Network | Chain ID | CAIP-2 | USDT Contract |
|---------|----------|--------|---------------|
| TRON Mainnet | 0x2b6653dc | `eip155:728126428`, `tron:mainnet` | `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t` |
| TRON Nile | 0xcd8690dc | `eip155:3448148188`, `tron:nile` | `TXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf` |
| TRON Shasta | 0x94a9059e | `eip155:2494104990`, `tron:shasta` | - |

「专业领域」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。