Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/check-derived-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check derived files

# Fails when docs/llms-full*.txt or docs/AGENTS.txt were not regenerated
# after a source change. Fix: run `python3 scripts/gen_llms_full.py` and commit.

on:
push:
branches:
- main
paths:
- "docs/**"
- "AGENTS.md"
- "scripts/gen_llms_full.py"
- ".github/workflows/check-derived-files.yml"
pull_request:
paths:
- "docs/**"
- "AGENTS.md"
- "scripts/gen_llms_full.py"
- ".github/workflows/check-derived-files.yml"
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Check llms-full bundles and AGENTS.txt are up to date
run: python3 scripts/gen_llms_full.py --check
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ If you need to change runtime behavior (tool schemas, error codes, transaction l
python3 scripts/gen_llms_full.py
```

This regenerates `docs/llms-full.txt` with a fresh commit SHA, timestamp, and token estimate. Run it after any change under `docs/`.
This regenerates `docs/llms-full.txt` with a fresh commit SHA, timestamp, and token estimate, and rebuilds the published `docs/AGENTS.txt` from this file with site-absolute links. Run it after any change under `docs/` or to this file; do not edit `docs/AGENTS.txt` by hand. CI (`check-derived-files.yml`) runs `python3 scripts/gen_llms_full.py --check` and fails if these files are stale.
28 changes: 14 additions & 14 deletions docs/AGENTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ If you are an AI coding agent or an autonomous tool reading this for orientation

## Entry points for AI agents

- **Curated index:** [docs/llms.txt](docs/llms.txt) — short, link-only map of the documentation, following [llmstxt.org](https://llmstxt.org/). Use this first.
- **Single-fetch full text:** [docs/llms-full.txt](docs/llms-full.txt) — every English page concatenated for one-shot ingestion. The header records the generating commit SHA, UTC timestamp, page count, and a rough token estimate; check those before relying on the content.
- **Curated index:** [docs.tronlink.org/llms.txt](https://docs.tronlink.org/llms.txt) — short, link-only map of the documentation, following [llmstxt.org](https://llmstxt.org/). Use this first.
- **Single-fetch full text:** [docs.tronlink.org/llms-full.txt](https://docs.tronlink.org/llms-full.txt) — every English page concatenated for one-shot ingestion. The header records the generating commit SHA, UTC timestamp, page count, and a rough token estimate; check those before relying on the content.
- **Human-readable site:** [https://docs.tronlink.org/](https://docs.tronlink.org/)

## Topic map

| Surface | Doc |
| --- | --- |
| DApp integration in the browser (TIP-6963 / `eth_requestAccounts` / `tronWeb`) | [docs/dapp/getting-started.en.md](docs/dapp/getting-started.en.md) + [docs/plugin-wallet/*](docs/plugin-wallet/) |
| Mobile DeepLink (`tronlinkoutside://`) | [docs/mobile/deeplink.en.md](docs/mobile/deeplink.en.md) |
| AI-agent tooling overview | [docs/ai-support/ai-llms.en.md](docs/ai-support/ai-llms.en.md) |
| MCP server (production) | [docs/ai-support/mcp-server-tronlink.en.md](docs/ai-support/mcp-server-tronlink.en.md) |
| MCP framework / SSOT error codes | [docs/ai-support/tronlink-mcp-core.en.md](docs/ai-support/tronlink-mcp-core.en.md) |
| MCP signer wrapper (HITL signing) | [docs/ai-support/mcp-tronlink-signer.en.md](docs/ai-support/mcp-tronlink-signer.en.md) |
| Signer SDK (browser-approval signing) | [docs/ai-support/tronlink-signer.en.md](docs/ai-support/tronlink-signer.en.md) |
| Read-only Skills package | [docs/ai-support/tronlink-skills.en.md](docs/ai-support/tronlink-skills.en.md) |
| CLI (transactions via browser approval) | [docs/ai-support/tronlink-cli.en.md](docs/ai-support/tronlink-cli.en.md) |
| Networks, addresses, glossary, FAQ | [docs/reference/](docs/reference/) |
| DApp integration in the browser (TIP-6963 / `eth_requestAccounts` / `tronWeb`) | [docs.tronlink.org/dapp/getting-started/](https://docs.tronlink.org/dapp/getting-started/) + [docs.tronlink.org/plugin-wallet/*](https://docs.tronlink.org/plugin-wallet/active-requests/) |
| Mobile DeepLink (`tronlinkoutside://`) | [docs.tronlink.org/mobile/deeplink/](https://docs.tronlink.org/mobile/deeplink/) |
| AI-agent tooling overview | [docs.tronlink.org/ai-support/ai-llms/](https://docs.tronlink.org/ai-support/ai-llms/) |
| MCP server (production) | [docs.tronlink.org/ai-support/mcp-server-tronlink/](https://docs.tronlink.org/ai-support/mcp-server-tronlink/) |
| MCP framework / SSOT error codes | [docs.tronlink.org/ai-support/tronlink-mcp-core/](https://docs.tronlink.org/ai-support/tronlink-mcp-core/) |
| MCP signer wrapper (HITL signing) | [docs.tronlink.org/ai-support/mcp-tronlink-signer/](https://docs.tronlink.org/ai-support/mcp-tronlink-signer/) |
| Signer SDK (browser-approval signing) | [docs.tronlink.org/ai-support/tronlink-signer/](https://docs.tronlink.org/ai-support/tronlink-signer/) |
| Read-only Skills package | [docs.tronlink.org/ai-support/tronlink-skills/](https://docs.tronlink.org/ai-support/tronlink-skills/) |
| CLI (transactions via browser approval) | [docs.tronlink.org/ai-support/tronlink-cli/](https://docs.tronlink.org/ai-support/tronlink-cli/) |
| Networks, addresses, glossary, FAQ | [docs.tronlink.org/reference/*](https://docs.tronlink.org/reference/networks/) |

## Source-of-truth boundaries

- **Error codes & retry semantics:** the SSOT is [docs/ai-support/tronlink-mcp-core.en.md#error-codes](docs/ai-support/tronlink-mcp-core.en.md#error-codes). Downstream docs link into it; do not duplicate the table.
- **Error codes & retry semantics:** the SSOT is [docs.tronlink.org/ai-support/tronlink-mcp-core/#error-codes](https://docs.tronlink.org/ai-support/tronlink-mcp-core/#error-codes). Downstream docs link into it; do not duplicate the table.
- **Per-tool input schemas:** the SSOT is the running MCP server's `list_tools` (returns `inputSchema` per tool). Doc tables are a summary, not a contract.
- **Versions:** each AI-support page ends with `Version & License` keyed to the corresponding upstream `package.json`.

Expand All @@ -47,4 +47,4 @@ If you need to change runtime behavior (tool schemas, error codes, transaction l
python3 scripts/gen_llms_full.py
```

This regenerates `docs/llms-full.txt` with a fresh commit SHA, timestamp, and token estimate. Run it after any change under `docs/`.
This regenerates `docs/llms-full.txt` with a fresh commit SHA, timestamp, and token estimate, and rebuilds the published `docs/AGENTS.txt` from this file with site-absolute links. Run it after any change under `docs/` or to this file; do not edit `docs/AGENTS.txt` by hand. CI (`check-derived-files.yml`) runs `python3 scripts/gen_llms_full.py --check` and fails if these files are stale.
2 changes: 1 addition & 1 deletion docs/ai-support/mcp-server-tronlink.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Pinned to the `package.json` of `mcp-server-tronlink@0.1.1`. Re-verify when bump

These are **docs-side mirrors** of the most critical tool inputs — useful when an agent is writing a tool-call call site without an MCP session open. Runtime `list_tools` remains the authoritative source: the schemas there carry full Zod metadata (descriptions, `default`, etc.) plus `meta.schemaVersion`. Fields below are derived from `@tronlink/tronlink-mcp-core` `src/mcp-server/schemas.ts` and follow JSON Schema Draft 7. The full set of 52 tool schemas is **not** reproduced here — see core for the SSOT.

> **Parity is enforced.** `scripts/check_doc_schema_parity.py` (run on push, PR, and daily via [`check-doc-schema-parity.yml`](https://github.com/xueyuanying/docs/blob/main/.github/workflows/check-doc-schema-parity.yml)) diffs the top-level field set + required-flag set of every block below against the live `schemas.ts`. Upstream rename or required→optional drift fails CI.
> Docs CI checks the field names and required flags of every block below against upstream `schemas.ts`; if they ever disagree, `list_tools` wins.

#### `tl_chain_send` — **Remote Write**

Expand Down
2 changes: 1 addition & 1 deletion docs/ai-support/mcp-server-tronlink.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ mcp-server-tronlink/

以下是最关键工具输入的**文档侧镜像**——当 agent 需要在没有打开 MCP 会话的情况下写工具调用站点时使用。运行时 `list_tools` 仍是权威源:那里有完整的 Zod 元信息(描述、`default` 等)以及 `meta.schemaVersion`。下方字段抄自 `@tronlink/tronlink-mcp-core` `src/mcp-server/schemas.ts`,遵循 JSON Schema Draft 7。**未**镜像全部 52 个工具——以 core 仓库为 SSOT。

> **平价由 CI 强制。** `scripts/check_doc_schema_parity.py`(在 push、PR 及每日定时通过 [`check-doc-schema-parity.yml`](https://github.com/xueyuanying/docs/blob/main/.github/workflows/check-doc-schema-parity.yml) 触发)会对下方每个块的顶层字段集 + required 标记与上游 `schemas.ts` 做 diff——上游改名或 required ↔ optional 漂移都会让 CI 失败。
> 下方各块的字段名和 required 标记由文档 CI 与上游 `schemas.ts` 自动比对;如有不一致,以 `list_tools` 为准。

#### `tl_chain_send` —— **Remote Write**

Expand Down
13 changes: 9 additions & 4 deletions docs/ai-support/tronlink-skills.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

**GitHub**: [https://github.com/TronLink/tronlink-skills](https://github.com/TronLink/tronlink-skills)

> **Version scope.** The command reference on this page (6 skills, 33 commands) was written for **v1.0.x**. The default branch — what `git clone` and `install.sh` install — is now **v1.1.0** (commit `7d2d58cb`): it adds 7 read-only commands (40 in total) and requires exactly **Node.js 24.22.1**. See [Version & License](#version-license); treat `tron_api.mjs --help` / MCP `tools/list` from your installed copy as authoritative.

**TronLink Wallet Skills** is an AI Agent skill set that provides complete TRON blockchain wallet and DeFi functionality through natural language. Designed for Claude Code, Cursor, OpenCode, Codex CLI, and other AI agents.

**Key Highlights:**
- **6 skills, 33 commands** covering wallet, token research, market data, swaps, resources, and staking
- **Zero npm dependencies** — uses native Node.js 18+ `fetch` and `crypto`, no `npm install` needed
- **Zero npm dependencies** — uses native Node.js `fetch` and `crypto` (requires exactly Node.js 24.22.1 — see [Dependencies](#dependencies)), no `npm install` needed
- **TRON-specific domain knowledge** — dedicated handling of Energy + Bandwidth resource model
- **Multi-platform support** — Claude Code, Cursor, OpenCode, Codex CLI, LangChain/CrewAI
- **Read-only & safe** — all commands are query-only, no private keys or signing involved
Expand Down Expand Up @@ -39,7 +41,7 @@ Natural Language Input
AI Agent (Claude Code / Cursor / OpenCode / Custom)
|
v
tron_api.mjs (Node.js 18+, native fetch, zero dependencies)
tron_api.mjs (Node.js 24.22.1, native fetch, zero dependencies)
├── Zero npm dependencies
├── TronGrid HTTP API (public or with API key)
└── Tronscan API for token metadata
Expand Down Expand Up @@ -481,7 +483,7 @@ tronlink-skills/

| Dependency | Required? | Purpose |
|------------|-----------|---------|
| Node.js >= 18 | Yes | Runtime (native fetch, crypto) |
| Node.js 24.22.1 (exact; default branch v1.1.0) | Yes | Runtime (native fetch, crypto). Pinned by `.nvmrc` and `package.json` `engines` on the default branch; `install.sh` exits with an error on any other version. Run `nvm install 24.22.1 && nvm use 24.22.1` before installing. |
| npm install | Not needed | All operations work without any npm dependencies |

---
Expand Down Expand Up @@ -543,7 +545,10 @@ node scripts/tron_api.mjs optimize-cost --address TAddress...

## Version & License

- **Package:** `tronlink-skills` v1.0.1
- **Package:** `tronlink-skills` v1.0.1 — the version the command tables on this page describe.
- **Default branch:** v1.1.0 (commit `7d2d58cb`, `package.json` `version: 1.1.0`), installed by `git clone` / `install.sh`. Differences from v1.0.1 that affect agents:
- 7 additional read-only commands, also exposed as `tron_<command>` MCP tools: `wallet-approvals`, `wallet-overview`, `token-overview`, `bandwidth-price`, `tx-cost`, `chain-params`, `health-check`. 40 commands in total; all remain Network Read.
- Node.js is pinned to exactly 24.22.1 (`.nvmrc`, `engines`); `install.sh` exits on any other version.
- **License:** MIT — `SPDX-License-Identifier: MIT`
- **Changelog / releases:** [https://github.com/TronLink/tronlink-skills/releases](https://github.com/TronLink/tronlink-skills/releases) — no GitHub-tagged releases yet for v1.0.x; track changes by commit until the first tag.

Expand Down
13 changes: 9 additions & 4 deletions docs/ai-support/tronlink-skills.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

**GitHub**: [https://github.com/TronLink/tronlink-skills](https://github.com/TronLink/tronlink-skills)

> **版本范围。** 本页的命令说明(6 大技能、33 个命令)基于 **v1.0.x** 编写。默认分支(即 `git clone` 和 `install.sh` 安装的版本)现为 **v1.1.0**(commit `7d2d58cb`):新增 7 个只读命令(共 40 个),并要求精确版本 **Node.js 24.22.1**。详见文末「版本与许可证」;以你本地安装版本的 `tron_api.mjs --help` / MCP `tools/list` 为准。

**TronLink Wallet Skills** 是一套 AI Agent 技能集,通过自然语言提供完整的 TRON 区块链钱包和 DeFi 功能。专为 Claude Code、Cursor、OpenCode、Codex CLI 及其他 AI 代理设计。

**核心亮点:**
- **6 大技能,33 个命令**,涵盖钱包、代币研究、市场数据、兑换、资源和质押
- **零 npm 依赖**:使用原生 Node.js 18+ `fetch` 和 `crypto`,无需 `npm install`
- **零 npm 依赖**:使用原生 Node.js `fetch` 和 `crypto`(要求精确版本 Node.js 24.22.1,见下方「依赖项」),无需 `npm install`
- **TRON 专属领域知识** — 专门处理能量 + 带宽资源模型
- **多平台支持** — Claude Code、Cursor、OpenCode、Codex CLI、LangChain/CrewAI
- **纯只读安全设计**:所有命令均为查询操作,不涉及私钥或签名
Expand Down Expand Up @@ -39,7 +41,7 @@ TronLink Skills 以深度 TRON 领域知识填补了这一空白。
AI 代理 (Claude Code / Cursor / OpenCode / 自定义)
|
v
tron_api.mjs (Node.js 18+, 原生 fetch, 零依赖)
tron_api.mjs (Node.js 24.22.1, 原生 fetch, 零依赖)
├── 零 npm 依赖
├── TronGrid HTTP API(公共或带 API Key)
└── Tronscan API 用于代币元数据
Expand Down Expand Up @@ -483,7 +485,7 @@ tronlink-skills/

| 依赖 | 是否必需? | 用途 |
|------|-----------|------|
| Node.js >= 18 | 是 | 运行时(原生 fetch、crypto) |
| Node.js 24.22.1(精确版本;默认分支 v1.1.0) | 是 | 运行时(原生 fetch、crypto)。默认分支通过 `.nvmrc` 与 `package.json` 的 `engines` 固定该版本;`install.sh` 检测到其他版本会直接报错退出。安装前先执行 `nvm install 24.22.1 && nvm use 24.22.1`。 |
| npm install | 不需要 | 所有操作均无需安装任何 npm 依赖 |

---
Expand Down Expand Up @@ -545,7 +547,10 @@ node scripts/tron_api.mjs optimize-cost --address T地址...

## 版本与许可证

- **包:** `tronlink-skills` v1.0.1
- **包:** `tronlink-skills` v1.0.1——本页命令表所描述的版本。
- **默认分支:** v1.1.0(commit `7d2d58cb`,`package.json` 中 `version: 1.1.0`),`git clone` / `install.sh` 安装的就是该版本。与 v1.0.1 相比,影响 agent 的差异:
- 新增 7 个只读命令(同时以 `tron_<command>` 形式暴露为 MCP 工具):`wallet-approvals`, `wallet-overview`, `token-overview`, `bandwidth-price`, `tx-cost`, `chain-params`, `health-check`。共 40 个命令,仍全部为 Network Read。
- Node.js 固定为精确版本 24.22.1(`.nvmrc`、`engines`);`install.sh` 检测到其他版本会直接退出。
- **许可证:** MIT —— `SPDX-License-Identifier: MIT`
- **变更记录 / 发布:** [https://github.com/TronLink/tronlink-skills/releases](https://github.com/TronLink/tronlink-skills/releases) —— 截至当前 v1.0.x 尚无 GitHub tag 发布;打 tag 之前请直接看 commit 历史。

Expand Down
20 changes: 15 additions & 5 deletions docs/dapp/multi-sign-transfer.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ Use the resulting `id` as `permissionId` below.
```javascript
const tronweb = window.tron.tronWeb;
const toAddress = "TRKb2nAnCBfwxnLxgoKJro6VbyA6QmsuXq";
const activePermissionId = 2; // obtained via tronWeb.trx.getAccount(...).active_permission
// fromAddress = the account whose active permission controls the funds (the tx owner).
// It is not necessarily the connected signer: if the connected account is only a
// co-signer listed in that permission's keys[], set fromAddress to the controlled account.
const fromAddress = tronweb.defaultAddress.base58;
const activePermissionId = 2; // obtained via tronWeb.trx.getAccount(fromAddress).active_permission
const tx = await tronweb.transactionBuilder.sendTrx(
toAddress, 10,
toAddress, 10, fromAddress,
{ permissionId: activePermissionId }
); // Step 1
try {
const signedTx = await tronweb.trx.multiSign(tx, undefined, activePermissionId); // Step 2
await tronweb.trx.sendRawTransaction(signedTx); // Step 3
const res = await tronweb.trx.sendRawTransaction(signedTx); // Step 3
if (!res.result) {
// Node rejections are returned, not thrown — see Errors below.
console.error(res.code, res.message && tronweb.toUtf8(res.message));
}
} catch (e) {}
```

Expand All @@ -50,8 +58,10 @@ Note that the broadcast only collects one signature in this call — a fully sig
| Code | Meaning | Where it comes from | Retryable? |
| :---: | --- | --- | :---: |
| `'Confirmation declined by user'` (string) | User clicked **Reject** in the signing popup | `tronWeb.trx.multiSign(...)` | No — user declined |
| (thrown) | `permission_id not active` / `permission_id not exist` | `transactionBuilder.sendTrx({permissionId})` — wrong or revoked permission | No — re-query `getAccount(...).active_permission` |
| (thrown) | Signature weight below `threshold` after broadcast | `sendRawTransaction` | No — collect more signatures (one `multiSign` call per co-signer) |
| `code: 'SIGERROR'`, `message` decodes to `Validate signature error: permission isn't exit` | `permissionId` does not exist on `fromAddress` (wrong or revoked). `sendTrx` does **not** validate the permission — the node rejects at broadcast | Return value of `sendRawTransaction(...)` (not thrown) | No — re-query `getAccount(fromAddress).active_permission` and rebuild the transaction |
| `code: 'SIGERROR'`, other `Validate signature error: …` messages | Signatures do not satisfy the permission — e.g. total weight below `threshold`, or a signer that is not in its `keys[]` | Return value of `sendRawTransaction(...)` (not thrown) | No — collect the missing signatures (one `multiSign` call per co-signer) |
| `REVERT` / `OUT_OF_ENERGY` / `FAILED` | Broadcast succeeded but execution failed on-chain | `getTransactionInfo(txid)` | **No — the tx is final; never auto-retry** |

`message` in a `sendRawTransaction` result is hex-encoded; decode it with `tronweb.toUtf8(res.message)`. To check before broadcasting, call `tronweb.trx.getSignWeight(signedTx)`: `result.code` is `PERMISSION_ERROR` when the permission does not exist and `NOT_ENOUGH_PERMISSION` while the signatures are still below `threshold`.

For cross-surface translation see the [Error Code Map](../reference/error-code-map.md).
Loading
Loading