{
  "schemaVersion": "1.0",
  "item": {
    "slug": "tron-x402-payment",
    "name": "tron-x402-payment",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/wzc1206/tron-x402-payment",
    "canonicalUrl": "https://clawhub.ai/wzc1206/tron-x402-payment",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/tron-x402-payment",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tron-x402-payment",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "package.json",
      "SKILL.md",
      "tsconfig.json",
      "src/x402_tron_invoke.ts",
      "dist/x402_tron_invoke.js",
      "dist/package.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/tron-x402-payment"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/tron-x402-payment",
    "agentPageUrl": "https://openagent3.xyz/skills/tron-x402-payment/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tron-x402-payment/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tron-x402-payment/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "x402 Payment Protocol for TRON Agents",
        "body": "Invoke x402-enabled AI agent endpoints with automatic TRC20 token payments on TRON.\nCurrently recommended tokens: USDT, USDD."
      },
      {
        "title": "Quick Start",
        "body": "The tool x402_tron_invoke is implemented by the compiled script dist/x402_tron_invoke.js.\n\nThe script is pre-built and ready to run. You can execute it directly from the command line:\n\n# v2 Invoke\nnode dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{\"prompt\": \"hi\"}'\n\n# Direct/Discovery\nnode dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json"
      },
      {
        "title": "How It Works",
        "body": "The x402_tron_invoke tool:\n\nConstructs the endpoint URL:\n\nIf entrypoint is provided: {url}/entrypoints/{entrypoint}/invoke (v2)\nOtherwise: Uses {url} as-is (v1 / Discovery)\n\n\nMakes a request (POST for v2, GET default for v1)\nIf 402 Payment Required is returned:\n\nParses payment requirements\nChecks wallet balance and allowance\nPerforms an infinite approval if allowance is insufficient\nSigns the payment permit (EIP-712 / TRON Typed Data)\nRetries the request with X-PAYMENT header\n\n\nReturns the response"
      },
      {
        "title": "Prerequisites",
        "body": "Wallet: A TRON private key must be available. The skill automatically looks for it in:\n\nTRON_PRIVATE_KEY environment variable.\n~/.mcporter/mcporter.json (AIBank standard).\nx402-config.json in the current/home directory.\n\n\nTokens: Wallet needs USDT/USDD and some TRX for gas.\nTronGrid API Key: Required for Mainnet to avoid rate limits (TRON_GRID_API_KEY)."
      },
      {
        "title": "x402_tron_invoke",
        "body": "Invokes an HTTP endpoint with automatic payment handling.\n\nModes:\n\nv2 Agent Invoke (Recommended): Provide url (Base URL) + entrypoint.\n\nConstructs: {url}/entrypoints/{entrypoint}/invoke\nWraps input: {\"input\": <input>}\nMethod: POST\n\n\nv1 / Direct / Discovery: Provide url (Full URL) without entrypoint.\n\nUses the URL as-is.\nMethod: GET (default) or specified via method.\nAgent Advice: Use this mode for discovery. If url returns 404, try appending /.well-known/agent.json or /entrypoints.\n\n\nStatus Check: Provide --check or --status.\n\nVerifies if TRON_PRIVATE_KEY is correctly configured and outputs the associated wallet address.\nChecks if TRON_GRID_API_KEY is present (Required for Mainnet).\nAgent Advice: ALWAYS use this instead of env or echo $TRON_PRIVATE_KEY.\n\nParameterTypeRequiredDescriptionurlstringYes*Base URL (v2) or Full URL (v1/Discovery). *Not required for --check.entrypointstringNoEntrypoint name. Required for v2 Invoke.inputobjectNoInput data.methodstringNoHTTP method. Default: POST (v2), GET (Direct).networkstringNomainnet, nile, shasta (Default: nile).checkbooleanNoVerify wallet configuration and output address."
      },
      {
        "title": "Example: Chat with Agent (v2 Invoke)",
        "body": "node dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{\"prompt\": \"Tell me a joke\"}'\n\n(Sends POST https://api.example.com/entrypoints/chat/invoke)"
      },
      {
        "title": "Example: Agent Discovery (Direct)",
        "body": "Manifest: Fetch agent metadata.\nnode dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json\n\n\n\nList Entrypoints: List available functions.\nnode dist/x402_tron_invoke.js --url https://api.example.com/entrypoints\n\nEach entrypoint typically returns:\n\nPath: /entrypoints/{name}/invoke\nPricing: Cost in tokens (e.g., 1000 units)\nNetwork: Usually nile or mainnet\nInput Schema: Expected JSON format for the input parameter"
      },
      {
        "title": "Example: Raw URL (Legacy)",
        "body": "node dist/x402_tron_invoke.js --url https://api.example.com/chat --method POST --input '{\"prompt\": \"Tell me a joke\"}'"
      },
      {
        "title": "Cost Reference (USDT/USDD)",
        "body": "TokenNetworkContract AddressDecimalsUSDTMainnetTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t6USDTNileTXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf6USDTShastaTG3XXyExBkPp9nzdajDZsozEu4BkaSJozs6USDDMainnetTXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9Hz18USDDNileTGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK18\n\nAmount (raw)Value (USDT, 6 dec)Typical Use1000$0.001Single API call5000$0.005Multiple results10000$0.01Premium request1000000$1.00Large batch"
      },
      {
        "title": "Understanding 402 Responses",
        "body": "When payment is required, agents return:\n\n{\n  \"error\": \"X-PAYMENT header is required\",\n  \"accepts\": [{\n    \"scheme\": \"exact\",\n    \"network\": \"nile\",\n    \"maxAmountRequired\": \"1000\",\n    \"payTo\": \"T...\",\n    \"asset\": \"T...\"\n  }],\n  \"x402Version\": 1\n}\n\nThe tool handles this automatically."
      },
      {
        "title": "Supported Tokens",
        "body": "This tool supports TRC20 tokens compatible with the x402 protocol.\nRecommended:\n\nUSDT (Tether)\nUSDD (Decentralized USD)"
      },
      {
        "title": "Security Rules for Agents",
        "body": "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.\nInternal Loading Only: The Agent should rely on the skill or underlying scripts to load the key internally.\nNo Export Commands: The Agent MUST NOT execute shell commands that contain the private key as a literal string.\nSanitized Logs: Ensure that logs or error messages do not leak the key.\nSilent Environment Checks: If you need to verify if an environment variable is set, use a \"Silent Check\".\n\nCorrect: [[ -n $TRON_PRIVATE_KEY ]] && echo \"Configured\" || echo \"Missing\"\nForbidden: echo $TRON_PRIVATE_KEY, env, printenv, set, export.\n\n\nDisabled Commands List: Do NOT use the following commands in any environment containing sensitive keys:\n\nenv / printenv\necho $VARIABLE_NAME\nset / export (without arguments)\n\n\nUse the Check Tool: To safely verify wallet status, use node dist/x402_tron_invoke.js --check."
      },
      {
        "title": "❌ Negative Example (CRITICAL FAILURE)",
        "body": "\"I will check your private key now: echo $TRON_PRIVATE_KEY\" -> STOP! This leaks the secret to the logs and UI."
      },
      {
        "title": "✅ Positive Example",
        "body": "\"I will verify the wallet configuration: node dist/x402_tron_invoke.js --check\" -> SAFE. Only the public address is shown."
      },
      {
        "title": "\"Private key not found\"",
        "body": "Ensure the TRON_PRIVATE_KEY environment variable is set or a valid x402-config.json exists in the expected locations."
      },
      {
        "title": "\"Insufficient Allowance\"",
        "body": "The tool will attempt to broadcast an infinite approve transaction. This requires TRX for gas. Ensure your wallet has TRX."
      },
      {
        "title": "\"Transaction Failed\"",
        "body": "Check if you have enough Token balance (USDT/USDD) and TRX for gas."
      },
      {
        "title": "Binary and Image Handling",
        "body": "If the endpoint returns an image (Content-Type: image/*) or binary data (application/octet-stream):\n\nThe data is automatically saved to a temporary file (e.g., /tmp/x402_image_...).\nThe tool returns a JSON object with:\n\nfile_path: Path to the temporary file.\ncontent_type: The MIME type of the content.\nbytes: File size in bytes.\n\n\nImportant: The Agent is responsible for deleting the temporary file after it has been used."
      },
      {
        "title": "Network Reference",
        "body": "NetworkChain IDCAIP-2USDT ContractUSDD ContractTRON Mainnet0x2b6653dceip155:728126428, tron:mainnetTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6tTXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9HzTRON Nile0xcd8690dceip155:3448148188, tron:nileTXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBfTGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaKTRON Shasta0x94a9059eeip155:2494104990, tron:shastaTG3XXyExBkPp9nzdajDZsozEu4BkaSJozs-"
      }
    ],
    "body": "x402 Payment Protocol for TRON Agents\n\nInvoke x402-enabled AI agent endpoints with automatic TRC20 token payments on TRON. Currently recommended tokens: USDT, USDD.\n\nQuick Start\n\nThe tool x402_tron_invoke is implemented by the compiled script dist/x402_tron_invoke.js.\n\nThe script is pre-built and ready to run. You can execute it directly from the command line:\n\n# v2 Invoke\nnode dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{\"prompt\": \"hi\"}'\n\n# Direct/Discovery\nnode dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json\n\nHow It Works\n\nThe x402_tron_invoke tool:\n\nConstructs the endpoint URL:\nIf entrypoint is provided: {url}/entrypoints/{entrypoint}/invoke (v2)\nOtherwise: Uses {url} as-is (v1 / Discovery)\nMakes a request (POST for v2, GET default for v1)\nIf 402 Payment Required is returned:\nParses payment requirements\nChecks wallet balance and allowance\nPerforms an infinite approval if allowance is insufficient\nSigns the payment permit (EIP-712 / TRON Typed Data)\nRetries the request with X-PAYMENT header\nReturns the response\nPrerequisites\nWallet: A TRON private key must be available. The skill automatically looks for it in:\nTRON_PRIVATE_KEY environment variable.\n~/.mcporter/mcporter.json (AIBank standard).\nx402-config.json in the current/home directory.\nTokens: Wallet needs USDT/USDD and some TRX for gas.\nTronGrid API Key: Required for Mainnet to avoid rate limits (TRON_GRID_API_KEY).\nTool Reference\nx402_tron_invoke\n\nInvokes an HTTP endpoint with automatic payment handling.\n\nModes:\n\nv2 Agent Invoke (Recommended): Provide url (Base URL) + entrypoint.\nConstructs: {url}/entrypoints/{entrypoint}/invoke\nWraps input: {\"input\": <input>}\nMethod: POST\nv1 / Direct / Discovery: Provide url (Full URL) without entrypoint.\nUses the URL as-is.\nMethod: GET (default) or specified via method.\nAgent Advice: Use this mode for discovery. If url returns 404, try appending /.well-known/agent.json or /entrypoints.\nStatus Check: Provide --check or --status.\nVerifies if TRON_PRIVATE_KEY is correctly configured and outputs the associated wallet address.\nChecks if TRON_GRID_API_KEY is present (Required for Mainnet).\nAgent Advice: ALWAYS use this instead of env or echo $TRON_PRIVATE_KEY.\nParameter\tType\tRequired\tDescription\nurl\tstring\tYes*\tBase URL (v2) or Full URL (v1/Discovery). *Not required for --check.\nentrypoint\tstring\tNo\tEntrypoint name. Required for v2 Invoke.\ninput\tobject\tNo\tInput data.\nmethod\tstring\tNo\tHTTP method. Default: POST (v2), GET (Direct).\nnetwork\tstring\tNo\tmainnet, nile, shasta (Default: nile).\ncheck\tboolean\tNo\tVerify wallet configuration and output address.\nExample: Chat with Agent (v2 Invoke)\nnode dist/x402_tron_invoke.js --url https://api.example.com --entrypoint chat --input '{\"prompt\": \"Tell me a joke\"}'\n\n\n(Sends POST https://api.example.com/entrypoints/chat/invoke)\n\nExample: Agent Discovery (Direct)\n\nManifest: Fetch agent metadata.\n\nnode dist/x402_tron_invoke.js --url https://api.example.com/.well-known/agent.json\n\n\nList Entrypoints: List available functions.\n\nnode dist/x402_tron_invoke.js --url https://api.example.com/entrypoints\n\n\nEach entrypoint typically returns:\n\nPath: /entrypoints/{name}/invoke\nPricing: Cost in tokens (e.g., 1000 units)\nNetwork: Usually nile or mainnet\nInput Schema: Expected JSON format for the input parameter\nExample: Raw URL (Legacy)\nnode dist/x402_tron_invoke.js --url https://api.example.com/chat --method POST --input '{\"prompt\": \"Tell me a joke\"}'\n\nCost Reference (USDT/USDD)\nToken\tNetwork\tContract Address\tDecimals\nUSDT\tMainnet\tTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\t6\nUSDT\tNile\tTXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf\t6\nUSDT\tShasta\tTG3XXyExBkPp9nzdajDZsozEu4BkaSJozs\t6\nUSDD\tMainnet\tTXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9Hz\t18\nUSDD\tNile\tTGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK\t18\nAmount (raw)\tValue (USDT, 6 dec)\tTypical Use\n1000\t$0.001\tSingle API call\n5000\t$0.005\tMultiple results\n10000\t$0.01\tPremium request\n1000000\t$1.00\tLarge batch\nUnderstanding 402 Responses\n\nWhen payment is required, agents return:\n\n{\n  \"error\": \"X-PAYMENT header is required\",\n  \"accepts\": [{\n    \"scheme\": \"exact\",\n    \"network\": \"nile\",\n    \"maxAmountRequired\": \"1000\",\n    \"payTo\": \"T...\",\n    \"asset\": \"T...\"\n  }],\n  \"x402Version\": 1\n}\n\n\nThe tool handles this automatically.\n\nSupported Tokens\n\nThis tool supports TRC20 tokens compatible with the x402 protocol. Recommended:\n\nUSDT (Tether)\nUSDD (Decentralized USD)\nSecurity Rules for Agents\nNo Private Key Output: The Agent MUST NOT print, echo, or output the TRON_PRIVATE_KEY or any other signing secret to the dialogue context.\nInternal Loading Only: The Agent should rely on the skill or underlying scripts to load the key internally.\nNo Export Commands: The Agent MUST NOT execute shell commands that contain the private key as a literal string.\nSanitized Logs: Ensure that logs or error messages do not leak the key.\nSilent Environment Checks: If you need to verify if an environment variable is set, use a \"Silent Check\".\nCorrect: [[ -n $TRON_PRIVATE_KEY ]] && echo \"Configured\" || echo \"Missing\"\nForbidden: echo $TRON_PRIVATE_KEY, env, printenv, set, export.\nDisabled Commands List: Do NOT use the following commands in any environment containing sensitive keys:\nenv / printenv\necho $VARIABLE_NAME\nset / export (without arguments)\nUse the Check Tool: To safely verify wallet status, use node dist/x402_tron_invoke.js --check.\n❌ Negative Example (CRITICAL FAILURE)\n\n\"I will check your private key now: echo $TRON_PRIVATE_KEY\" -> STOP! This leaks the secret to the logs and UI.\n\n✅ Positive Example\n\n\"I will verify the wallet configuration: node dist/x402_tron_invoke.js --check\" -> SAFE. Only the public address is shown.\n\nTroubleshooting\n\"Private key not found\"\n\nEnsure the TRON_PRIVATE_KEY environment variable is set or a valid x402-config.json exists in the expected locations.\n\n\"Insufficient Allowance\"\n\nThe tool will attempt to broadcast an infinite approve transaction. This requires TRX for gas. Ensure your wallet has TRX.\n\n\"Transaction Failed\"\n\nCheck if you have enough Token balance (USDT/USDD) and TRX for gas.\n\nBinary and Image Handling\n\nIf the endpoint returns an image (Content-Type: image/*) or binary data (application/octet-stream):\n\nThe data is automatically saved to a temporary file (e.g., /tmp/x402_image_...).\nThe tool returns a JSON object with:\nfile_path: Path to the temporary file.\ncontent_type: The MIME type of the content.\nbytes: File size in bytes.\nImportant: The Agent is responsible for deleting the temporary file after it has been used.\nNetwork Reference\nNetwork\tChain ID\tCAIP-2\tUSDT Contract\tUSDD Contract\nTRON Mainnet\t0x2b6653dc\teip155:728126428, tron:mainnet\tTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\tTXDk8mbtRbXeYuMNS83CfKPaYYT8XWv9Hz\nTRON Nile\t0xcd8690dc\teip155:3448148188, tron:nile\tTXYZopYRdj2D9XRtbG411XZZ3kM5VkAeBf\tTGjgvdTWWrybVLaVeFqSyVqJQWjxqRYbaK\nTRON Shasta\t0x94a9059e\teip155:2494104990, tron:shasta\tTG3XXyExBkPp9nzdajDZsozEu4BkaSJozs\t-"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wzc1206/tron-x402-payment",
    "publisherUrl": "https://clawhub.ai/wzc1206/tron-x402-payment",
    "owner": "wzc1206",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/tron-x402-payment",
    "downloadUrl": "https://openagent3.xyz/downloads/tron-x402-payment",
    "agentUrl": "https://openagent3.xyz/skills/tron-x402-payment/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tron-x402-payment/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tron-x402-payment/agent.md"
  }
}