| name | tronclaw-payment |
| description | Use this skill when you need to perform TRON blockchain payment operations: check USDT/USDD/TRX balances, send payments via x402 protocol, create payment request URLs for collecting fees, or check payment status. TRIGGER: "查余额", "转账", "收款", "balance", "send payment", "x402", "USDT", "USDD"
|
| version | 1.0.0 |
TronClaw Payment Skill
Call TronClaw Gateway REST API for all payment operations.
Setup
const GATEWAY = process.env.TRONCLAW_GATEWAY ?? 'http://localhost:3000'
async function tron(path, method = 'GET', body = null) {
const res = await fetch(`${GATEWAY}${path}`, {
method,
headers: { 'Content-Type': 'application/json' },
body: body ? JSON.stringify(body) : undefined,
})
const json = await res.json()
if (!json.success) throw new Error(json.error)
return json.data
}
Check Balance
const balance = await tron(`/api/v1/payment/balance?address=${address}&token=USDT`)
Send Payment (x402 Protocol)
const tx = await tron('/api/v1/payment/send', 'POST', {
to: 'TRecipientAddress',
amount: '1.5',
token: 'USDT',
memo: 'optional memo'
})
Create Payment Request (x402 collect)
const req = await tron('/api/v1/payment/request', 'POST', {
amount: '0.5',
token: 'USDT',
description: 'AI Writing Service fee'
})
Check Payment Status
const status = await tron(`/api/v1/payment/status/${payId}`)
Response Format
All calls return { success, data, error }. Access via json.data.
Demo Scenario
User: "帮我创建一个收取 0.5 USDT 的收款链接,用于 AI 写作服务"
→ Call tron_create_payment_request
→ Return paymentUrl to user