{
  "schemaVersion": "1.0",
  "item": {
    "slug": "broadcast-signed-transaction",
    "name": "Broadcast Signed Transaction",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/wangchengming666/broadcast-signed-transaction",
    "canonicalUrl": "https://clawhub.ai/wangchengming666/broadcast-signed-transaction",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/broadcast-signed-transaction",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=broadcast-signed-transaction",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/broadcast_signed_tx.py"
    ],
    "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-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-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/broadcast-signed-transaction"
    },
    "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/broadcast-signed-transaction",
    "agentPageUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction/agent",
    "manifestUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction/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": "什么是这个 Skill？",
        "body": "这个 Skill 将已经签名好的交易 hex 直接广播到链上：\n\n用户输入（signedTx hex + chainIndex + address）\n    ↓\n参数校验（格式 / OKX 凭证检查）\n    ↓\n调用 OKX Broadcast API 广播\n    ↓\n返回 orderId、txHash、区块浏览器链接\n\n与 broadcast-sign-transfer 的区别：\n\n能力broadcast-sign-transferbroadcast-signed-transaction构造交易✅ 自动构造❌ 不需要签名交易✅ 需要私钥❌ 不需要私钥广播交易✅✅适用场景从零开始转账已有签名 hex，直接广播"
      },
      {
        "title": "什么时候该用这个 Skill？",
        "body": "满足以下条件时使用：\n\n用户已有签名好的交易 hex（以 0x 开头的十六进制字符串）\n用户想直接广播，不需要重新签名\n用户说了类似的话：\n\n\"我有一笔签名好的交易，帮我广播\"\n\"直接广播这个 signedTx\"\n\"广播已签名交易\"\n\"broadcast signed tx\"\n\"把这个 hex 广播到链上\"\n\n不适用的情况：\n\n用户还没签名，需要从私钥开始 → 使用 broadcast-sign-transfer\n用户只想查询交易状态 → 使用 mev_tx_status_query.py\n用户没有 OKX API Key → 先引导配置环境变量"
      },
      {
        "title": "执行流程（Step by Step）",
        "body": "Step 1: 收集必要参数\n        ├── chainIndex  → 用户指定，或从日志/上下文中提取\n        ├── address     → 发送方地址（0x 开头）\n        ├── signedTx    → 已签名的 hex（0x 开头）\n        └── --mev       → 是否开启 MEV 保护（可选，默认关闭）\n\nStep 2: 验证环境变量\n        └── OKX_ACCESS_KEY / OKX_SECRET_KEY / OKX_PASSPHRASE\n\nStep 3: 调用广播脚本\n        └── python3 scripts/broadcast_signed_tx.py \\\n              --chain <chainIndex> \\\n              --address <address> \\\n              --signed-tx <signedTx> \\\n              [--mev] [--json-only]\n\nStep 4: 解析结果\n        ├── 成功 → 展示 orderId、txHash、区块浏览器链接\n        └── 失败 → 展示具体错误原因并给出解决建议"
      },
      {
        "title": "--chain（必填）",
        "body": "类型：字符串（链 ID）\n\n\n说明：区块链链 ID，传给 OKX API 的 chainIndex 字段\n\n\n常用值：\nchain链名区块浏览器1Ethereumetherscan.io56BSCbscscan.com8453Basebasescan.org42161Arbitrumarbiscan.io196xLayeroklink.com/xlayer501Solanasolscan.io\n\n\n示例：--chain 56\n\n\n注意：不在列表中的链也可以传，OKX API 会进行校验"
      },
      {
        "title": "--address（必填）",
        "body": "类型：字符串\n说明：发送方钱包地址\n格式：0x 开头，42 位十六进制字符\n示例：--address 0xaF3e6407073b2793271dA3d45A393397517ee3d9"
      },
      {
        "title": "--signed-tx（必填）",
        "body": "类型：字符串\n说明：已签名的交易 hex，由客户端签名后得到\n格式：0x 开头的完整 RLP 编码交易\n示例：--signed-tx 0x02f8...（完整 hex）\n获取方式：\n\nweb3.py：signed = w3.eth.account.sign_transaction(tx, pk) → signed.raw_transaction.to_0x_hex()\nethers.js：signer.signTransaction(tx) → 得到 0x..."
      },
      {
        "title": "--mev（选填，flag）",
        "body": "默认：关闭\n说明：开启 MEV 保护，防止三明治攻击\n示例：--mev"
      },
      {
        "title": "--json-only（选填，flag）",
        "body": "说明：仅输出 JSON，适合 AI 解析结果\n示例：--json-only"
      },
      {
        "title": "成功时",
        "body": "==============================================================\n  ✅ BSC 广播成功\n==============================================================\n  Order ID  : 1234567890\n  Tx Hash   : 0xabc123...\n  浏览器    : https://bscscan.com/tx/0xabc123...\n==============================================================\n\n{\n  \"success\": true,\n  \"order_id\": \"1234567890\",\n  \"tx_hash\": \"0xabc123...\",\n  \"chain_index\": \"56\",\n  \"chain_name\": \"BSC\",\n  \"explorer_url\": \"https://bscscan.com/tx/0xabc123...\",\n  \"mev_enabled\": false,\n  \"error\": null\n}"
      },
      {
        "title": "失败时",
        "body": "==============================================================\n  ❌ 广播失败（Chain-56）\n==============================================================\n  错误原因  : 广播失败（code=50001）: Invalid signed transaction\n=============================================================="
      },
      {
        "title": "环境变量（必须配置）",
        "body": "变量名说明OKX_ACCESS_KEYOKX Web3 API KeyOKX_SECRET_KEYOKX Secret KeyOKX_PASSPHRASEOKX Passphrase\n\n⚠️ 必须使用 OKX Web3 API Key，普通交易 API Key 会返回 401 错误。\n⚠️ 此 Skill 不需要 WALLET_PRIVATE_KEY（私钥），交易已在外部签名。\n\n配置方式：\n\nexport OKX_ACCESS_KEY=\"你的Key\"\nexport OKX_SECRET_KEY=\"你的Secret\"\nexport OKX_PASSPHRASE=\"你的Passphrase\"\nsource ~/.zshrc"
      },
      {
        "title": "命令行",
        "body": "# BSC 广播\npython3 scripts/broadcast_signed_tx.py \\\n  --chain 56 \\\n  --address 0xYourAddress \\\n  --signed-tx 0xYourSignedTxHex\n\n# ETH 开启 MEV 保护\npython3 scripts/broadcast_signed_tx.py \\\n  --chain 1 \\\n  --address 0xYourAddress \\\n  --signed-tx 0xYourSignedTxHex \\\n  --mev\n\n# 仅输出 JSON（AI 解析）\npython3 scripts/broadcast_signed_tx.py \\\n  --chain 56 \\\n  --address 0xYourAddress \\\n  --signed-tx 0xYourSignedTxHex \\\n  --json-only"
      },
      {
        "title": "Python 代码调用",
        "body": "from scripts.broadcast_signed_tx import broadcast_signed_transaction\n\nresult = broadcast_signed_transaction(\n    chain_index           = \"56\",\n    address               = \"0xYourAddress\",\n    signed_tx             = \"0xYourSignedTxHex\",\n    enable_mev_protection = False,\n)\n\nif result[\"success\"]:\n    print(f\"✅ 广播成功：{result['tx_hash']}\")\n    print(f\"浏览器：{result['explorer_url']}\")\nelse:\n    print(f\"❌ 失败：{result['error']}\")"
      },
      {
        "title": "错误处理",
        "body": "错误信息原因解决方法缺少 OKX API 凭证环境变量未配置配置三个环境变量后重试address 格式错误地址不以 0x 开头检查地址格式signed_tx 格式错误hex 不以 0x 开头或为空检查签名 hexHTTP 错误 401API Key 类型错误确认使用 OKX Web3 API Key广播失败（code=50001）签名 hex 无效检查 signedTx 是否完整，chainIndex 是否匹配广播失败（code=50002）address 与签名不匹配确认 address 是签名交易的发送方网络请求异常网络问题检查网络连接后重试"
      },
      {
        "title": "安全注意事项",
        "body": "✅ 此 Skill 无需私钥，不存在私钥泄露风险\n⚠️ 广播前确认 signedTx 内容正确：广播后无法撤销\n⚠️ 确认 address 与 signedTx 的发送方地址一致，否则 OKX API 会拒绝\n⚠️ OKX API 凭证请妥善保管，不要提交到版本控制"
      },
      {
        "title": "依赖安装",
        "body": "# 仅依赖 requests，无需 web3\npip3 install requests"
      },
      {
        "title": "文件结构",
        "body": "broadcast-signed-transaction/\n├── SKILL.md                          ← 当前文件，AI 技能说明书\n└── scripts/\n    └── broadcast_signed_tx.py        ← 可执行的 Python 广播工具"
      }
    ],
    "body": "Broadcast Signed Transaction Skill\n什么是这个 Skill？\n\n这个 Skill 将已经签名好的交易 hex 直接广播到链上：\n\n用户输入（signedTx hex + chainIndex + address）\n    ↓\n参数校验（格式 / OKX 凭证检查）\n    ↓\n调用 OKX Broadcast API 广播\n    ↓\n返回 orderId、txHash、区块浏览器链接\n\n\n与 broadcast-sign-transfer 的区别：\n\n能力\tbroadcast-sign-transfer\tbroadcast-signed-transaction\n构造交易\t✅ 自动构造\t❌ 不需要\n签名交易\t✅ 需要私钥\t❌ 不需要私钥\n广播交易\t✅\t✅\n适用场景\t从零开始转账\t已有签名 hex，直接广播\n什么时候该用这个 Skill？\n\n满足以下条件时使用：\n\n用户已有签名好的交易 hex（以 0x 开头的十六进制字符串）\n用户想直接广播，不需要重新签名\n用户说了类似的话：\n\"我有一笔签名好的交易，帮我广播\"\n\"直接广播这个 signedTx\"\n\"广播已签名交易\"\n\"broadcast signed tx\"\n\"把这个 hex 广播到链上\"\n\n不适用的情况：\n\n用户还没签名，需要从私钥开始 → 使用 broadcast-sign-transfer\n用户只想查询交易状态 → 使用 mev_tx_status_query.py\n用户没有 OKX API Key → 先引导配置环境变量\n执行流程（Step by Step）\nStep 1: 收集必要参数\n        ├── chainIndex  → 用户指定，或从日志/上下文中提取\n        ├── address     → 发送方地址（0x 开头）\n        ├── signedTx    → 已签名的 hex（0x 开头）\n        └── --mev       → 是否开启 MEV 保护（可选，默认关闭）\n\nStep 2: 验证环境变量\n        └── OKX_ACCESS_KEY / OKX_SECRET_KEY / OKX_PASSPHRASE\n\nStep 3: 调用广播脚本\n        └── python3 scripts/broadcast_signed_tx.py \\\n              --chain <chainIndex> \\\n              --address <address> \\\n              --signed-tx <signedTx> \\\n              [--mev] [--json-only]\n\nStep 4: 解析结果\n        ├── 成功 → 展示 orderId、txHash、区块浏览器链接\n        └── 失败 → 展示具体错误原因并给出解决建议\n\n输入参数\n--chain（必填）\n\n类型：字符串（链 ID）\n\n说明：区块链链 ID，传给 OKX API 的 chainIndex 字段\n\n常用值：\n\nchain\t链名\t区块浏览器\n1\tEthereum\tetherscan.io\n56\tBSC\tbscscan.com\n8453\tBase\tbasescan.org\n42161\tArbitrum\tarbiscan.io\n196\txLayer\toklink.com/xlayer\n501\tSolana\tsolscan.io\n\n示例：--chain 56\n\n注意：不在列表中的链也可以传，OKX API 会进行校验\n\n--address（必填）\n类型：字符串\n说明：发送方钱包地址\n格式：0x 开头，42 位十六进制字符\n示例：--address 0xaF3e6407073b2793271dA3d45A393397517ee3d9\n--signed-tx（必填）\n类型：字符串\n说明：已签名的交易 hex，由客户端签名后得到\n格式：0x 开头的完整 RLP 编码交易\n示例：--signed-tx 0x02f8...（完整 hex）\n获取方式：\nweb3.py：signed = w3.eth.account.sign_transaction(tx, pk) → signed.raw_transaction.to_0x_hex()\nethers.js：signer.signTransaction(tx) → 得到 0x...\n--mev（选填，flag）\n默认：关闭\n说明：开启 MEV 保护，防止三明治攻击\n示例：--mev\n--json-only（选填，flag）\n说明：仅输出 JSON，适合 AI 解析结果\n示例：--json-only\n输出结果\n成功时\n==============================================================\n  ✅ BSC 广播成功\n==============================================================\n  Order ID  : 1234567890\n  Tx Hash   : 0xabc123...\n  浏览器    : https://bscscan.com/tx/0xabc123...\n==============================================================\n\n{\n  \"success\": true,\n  \"order_id\": \"1234567890\",\n  \"tx_hash\": \"0xabc123...\",\n  \"chain_index\": \"56\",\n  \"chain_name\": \"BSC\",\n  \"explorer_url\": \"https://bscscan.com/tx/0xabc123...\",\n  \"mev_enabled\": false,\n  \"error\": null\n}\n\n失败时\n==============================================================\n  ❌ 广播失败（Chain-56）\n==============================================================\n  错误原因  : 广播失败（code=50001）: Invalid signed transaction\n==============================================================\n\n环境变量（必须配置）\n变量名\t说明\nOKX_ACCESS_KEY\tOKX Web3 API Key\nOKX_SECRET_KEY\tOKX Secret Key\nOKX_PASSPHRASE\tOKX Passphrase\n\n⚠️ 必须使用 OKX Web3 API Key，普通交易 API Key 会返回 401 错误。 ⚠️ 此 Skill 不需要 WALLET_PRIVATE_KEY（私钥），交易已在外部签名。\n\n配置方式：\n\nexport OKX_ACCESS_KEY=\"你的Key\"\nexport OKX_SECRET_KEY=\"你的Secret\"\nexport OKX_PASSPHRASE=\"你的Passphrase\"\nsource ~/.zshrc\n\n调用示例\n命令行\n# BSC 广播\npython3 scripts/broadcast_signed_tx.py \\\n  --chain 56 \\\n  --address 0xYourAddress \\\n  --signed-tx 0xYourSignedTxHex\n\n# ETH 开启 MEV 保护\npython3 scripts/broadcast_signed_tx.py \\\n  --chain 1 \\\n  --address 0xYourAddress \\\n  --signed-tx 0xYourSignedTxHex \\\n  --mev\n\n# 仅输出 JSON（AI 解析）\npython3 scripts/broadcast_signed_tx.py \\\n  --chain 56 \\\n  --address 0xYourAddress \\\n  --signed-tx 0xYourSignedTxHex \\\n  --json-only\n\nPython 代码调用\nfrom scripts.broadcast_signed_tx import broadcast_signed_transaction\n\nresult = broadcast_signed_transaction(\n    chain_index           = \"56\",\n    address               = \"0xYourAddress\",\n    signed_tx             = \"0xYourSignedTxHex\",\n    enable_mev_protection = False,\n)\n\nif result[\"success\"]:\n    print(f\"✅ 广播成功：{result['tx_hash']}\")\n    print(f\"浏览器：{result['explorer_url']}\")\nelse:\n    print(f\"❌ 失败：{result['error']}\")\n\n错误处理\n错误信息\t原因\t解决方法\n缺少 OKX API 凭证\t环境变量未配置\t配置三个环境变量后重试\naddress 格式错误\t地址不以 0x 开头\t检查地址格式\nsigned_tx 格式错误\thex 不以 0x 开头或为空\t检查签名 hex\nHTTP 错误 401\tAPI Key 类型错误\t确认使用 OKX Web3 API Key\n广播失败（code=50001）\t签名 hex 无效\t检查 signedTx 是否完整，chainIndex 是否匹配\n广播失败（code=50002）\taddress 与签名不匹配\t确认 address 是签名交易的发送方\n网络请求异常\t网络问题\t检查网络连接后重试\n安全注意事项\n✅ 此 Skill 无需私钥，不存在私钥泄露风险\n⚠️ 广播前确认 signedTx 内容正确：广播后无法撤销\n⚠️ 确认 address 与 signedTx 的发送方地址一致，否则 OKX API 会拒绝\n⚠️ OKX API 凭证请妥善保管，不要提交到版本控制\n依赖安装\n# 仅依赖 requests，无需 web3\npip3 install requests\n\n文件结构\nbroadcast-signed-transaction/\n├── SKILL.md                          ← 当前文件，AI 技能说明书\n└── scripts/\n    └── broadcast_signed_tx.py        ← 可执行的 Python 广播工具"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/wangchengming666/broadcast-signed-transaction",
    "publisherUrl": "https://clawhub.ai/wangchengming666/broadcast-signed-transaction",
    "owner": "wangchengming666",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction",
    "downloadUrl": "https://openagent3.xyz/downloads/broadcast-signed-transaction",
    "agentUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction/agent",
    "manifestUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/broadcast-signed-transaction/agent.md"
  }
}