Files
usdt/docs/tron-chain-data.md
T

27 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TRON HTTP 数据源配置
TronGrid 和 TronScan 使用独立 API Key,即使请求头名称相同也不能混用。
```sh
export TRON_GRID_API_KEY='你的TronGrid密钥'
export TRONSCAN_API_KEY='你的TronScan密钥'
```
重启后端生效。原有 `tron.chain-data.api-key` 仍仅代表 TronGrid,
新增 `tron.chain-data.tronscan-api-key` 代表 TronScan。
交易查询按现有端点列表顺序切换,TronGrid 使用
`/v1/accounts/{address}/transactions/trc20`,TronScan 使用
`/api/token_trc20/transfers`,映射为统一的地址、毫秒时间、交易哈希和原始最小单位金额。
TronScan 仅接受 `confirmed=true`、`contractRet=SUCCESS` 且合约匹配的记录。
单次 TronScan 查询最多50条,当前实现不提供历史全量分页,适用于现有近期待支付订单扫描。
自定义代理地址可使用 `tronscan|https://proxy.example` 或
`trongrid|https://proxy.example` 显式指定交易接口类型;未指定时按域名识别,其他域名默认为TronGrid。
账户端点列表仅配置兼容 `/api/accountv2` 的 TronScan 服务。
账户汇总使用 TronScan Key,Trident RPC 使用 TronGrid Key。
连接和读取超时各60秒,全部交易源失败时保留订单待支付状态,下一轮继续查询。
账户汇总全部失败时沿用现有零值降级;不代表链上真实资源为0。
未使用真实生产凭证进行端到端验证,需部署环境验证两平台权限及配额。