tronweb

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Skill is based on TronWeb v6.2.0, generated at 2026-02-25.
TronWeb is the official JavaScript/TypeScript SDK for the TRON network. It wraps the TRON HTTP API and provides a consistent API for accounts, blocks, transactions, smart contracts, and events. Use it in Node.js or the browser to build DApps, sign and broadcast transactions, and call contracts.
本Skill基于TronWeb v6.2.0版本生成,生成时间为2026-02-25。
TronWeb是TRON网络官方的JavaScript/TypeScript SDK。它封装了TRON的HTTP API,为账户、区块、交易、智能合约及事件提供统一的调用接口。你可以在Node.js环境或浏览器中使用它来构建DApp,签名并广播交易,以及调用合约。

Core References

核心参考

TopicDescriptionReference
Instance setupfullHost, nodes, headers, privateKey, setPrivateKey/setAddresscore-instance-setup
Address, units, encodinghex/base58/checksum, toSun/fromSun, fromUtf8/toUtf8, sha3core-address-units
TrxBlocks, transactions, accounts, bandwidth, sign, broadcast, getCurrentRefBlockParams, signTypedData, ecRecovercore-trx
UtilsABI, transaction, deserializeTx, accounts, address, validationscore-utils
ProvidersHttpProvider, request, isConnected, timeout, headers, setStatusPagecore-providers
ConstantsADDRESS_PREFIX, SUN/TRX, default feeLimit, BIP44 pathcore-constants
主题描述参考文档
实例配置fullHost、节点、请求头、私钥、setPrivateKey/setAddresscore-instance-setup
地址、单位与编码hex/base58/校验和格式、toSun/fromSun、fromUtf8/toUtf8、sha3core-address-units
TRX相关操作区块、交易、账户、带宽、签名、广播、getCurrentRefBlockParams、signTypedData、ecRecovercore-trx
工具函数ABI、交易、deserializeTx、账户、地址、验证core-utils
提供者HttpProvider、请求、isConnected、超时设置、请求头、setStatusPagecore-providers
常量定义ADDRESS_PREFIX、SUN/TRX、默认feeLimit、BIP44路径core-constants

Features

功能特性

Transactions and contracts

交易与合约

TopicDescriptionReference
TransactionBuildersendTrx, sendToken, freeze/unfreeze, triggerSmartContract, createSmartContract, deployConstantContractfeatures-transaction-builder
Contractcontract(abi, address), methods.call/send, decodeInput, new(), at()features-contract
EventsgetEventsByContractAddress, getEventsByTransactionID, getEventsByBlockNumber, setServerfeatures-events
Pluginregister(PluginClass), pluginInterface (requires, components, fullClass)features-plugin
Message and typed datasignMessage/verifyMessage, signTypedData/verifyTypedData, EIP-712 TypedDataEncoderfeatures-message-typed-data
Connection and versionisConnected(), fullnodeSatisfies(version), getFullnodeVersion()features-connection-version
Trx tokens and chaingetTokenFromID, getTokensIssuedByAddress, getAccountResources, getChainParametersfeatures-trx-tokens-resources
主题描述参考文档
交易构建器sendTrx、sendToken、冻结/解冻、triggerSmartContract、创建智能合约、部署常量合约features-transaction-builder
合约操作contract(abi, address)、methods.call/send、decodeInput、new()、at()features-contract
事件查询getEventsByContractAddress、getEventsByTransactionID、getEventsByBlockNumber、setServerfeatures-events
插件系统register(PluginClass)、pluginInterface(requires、components、fullClass)features-plugin
消息与结构化数据signMessage/verifyMessage、signTypedData/verifyTypedData、EIP-712 TypedDataEncoderfeatures-message-typed-data
连接与版本isConnected()、fullnodeSatisfies(version)、getFullnodeVersion()features-connection-version
TRX代币与链资源getTokenFromID、getTokensIssuedByAddress、getAccountResources、getChainParametersfeatures-trx-tokens-resources

Best practices

最佳实践

TopicDescriptionReference
Errors and typingError instances (e.message), ABI as const for contract inferencebest-practices-errors-typing
Param validationValidator, notValid(params), param types (address, integer, resource, url, hex, etc.)best-practices-param-validation
Multi-signaturegetSignWeight, getApprovedList, multiSign, permissionIdbest-practices-multisig
Transaction lifecycleSign → broadcast → getTransactionInfo, handling receipt and FAILEDbest-practices-transaction-lifecycle
主题描述参考文档
错误处理与类型错误实例(e.message)、使用const定义ABI以实现合约类型推断best-practices-errors-typing
参数验证验证器、notValid(params)、参数类型(地址、整数、资源、URL、十六进制等)best-practices-param-validation
多签操作getSignWeight、getApprovedList、multiSign、permissionIdbest-practices-multisig
交易生命周期签名 → 广播 → 获取交易信息、处理回执与失败情况best-practices-transaction-lifecycle