TRON
TRON API is available on Web3 API platform.
TRON is an open source public blockchain platform that supports smart contracts. TRON is compatible with Ethereum, which means that you can migrate smart contracts on Ethereum to TRON directly or with minor modifications. TRON relies on a unique consensus mechanism to realize the high TPS of the TRON network that is far beyond Ethereum, bringing developers a good experience of a faster transaction.
In order for your Web3 application to interact with TRON — either by reading blockchain data or sending transactions to the network — it must connect to a TRON node. Developers interact with the blockchain using the methods provided by the API.
We provide two interfaces to query TRON API:
Responses for both of them come in JSON format.
JSON-RPC methods
JSON-RPC is a stateless, lightweight remote procedure call (RPC) protocol. The JSON-RPC interface supported by the TRON network is compatible with Ethereum's. However, due to the difference in chain mechanism and design, TRON cannot support some interfaces on Ethereum. At the same time, TRON also provides dedicated APIs to create different types of transactions.
web3_clientVersion— returns the current client version.web3_sha3— returns Keccak-256 (not the standardized SHA3-256) of the given data.net_version— returns the current network ID.net_listening— returns true if client is actively listening for network connections.eth_syncing— returns data on the sync status or false.eth_gasPrice— returns the current price per gas in wei.eth_accounts— returns a list of addresses owned by client.eth_blockNumber— returns the number of most recent block.eth_getBalance— returns the balance of the account specified by address.eth_getStorageAt— returns the value from a storage position at an address specified.eth_getBlockTransactionCountByHash— returns the number of transactions in a block specified by block hash.eth_getBlockTransactionCountByNumber— returns the number of transactions in the block specified by number.eth_getUncleCountByBlockHash— returns the number of uncles in a block specified by block hash.eth_getUncleCountByBlockNumber— returns the number of uncles in a block specified by block number.eth_getCode— returns code at an address specified.eth_call— executes a new message call immediately without creating a transaction on the blockchain.eth_estimateGas— generates and returns an estimate of how much gas is necessary to allow the transaction to complete.eth_getBlockByHash— returns information for the block specified by block hash.eth_getBlockByNumber— returns information for the block specified by block number.eth_getTransactionByHash— returns information on a transaction specified by transaction hash.eth_getTransactionByBlockHashAndIndex— returns information on a transaction specified by block hash and transaction index position.eth_getTransactionByBlockNumberAndIndex— returns information on a transaction by block number and transaction index position.eth_getTransactionReceipt— returns the receipt of a transaction by transaction hash.eth_getUncleByBlockHashAndIndex— returns information about an uncle of a block by hash and uncle index position.eth_getUncleByBlockNumberAndIndex— returns information about an uncle of a block by number and uncle index position.eth_getLogs— returns logs matching the parameters specified.
REST methods
SolidityNode API:
/walletsolidity/getaccount— retrieves account information./walletsolidity/listwitnesses— retrieves the list of witnesses./walletsolidity/getassetissuelist— retrieves the list of all the tokens./walletsolidity/getpaginatedassetissuelist— retrieves the list of all the tokens by pagination./walletsolidity/getassetissuebyname— retrieves a token by token name./walletsolidity/getassetissuelistbyname— retrieves the list of tokens by name./walletsolidity/getassetissuebyid— retrieves a token by token ID./walletsolidity/getnowblock— retrieves the latest block information./walletsolidity/getblockbynum— retrieves a block information by block height./walletsolidity/gettransactionbyid— retrieves a transaction information by transaction ID./walletsolidity/gettransactioncountbyblocknum— retrieves the number of transactions in a specific block./walletsolidity/gettransactioninfobyblocknum— retrieves the list of transaction information in a specific block./walletsolidity/gettransactioninfobyid— retrieves the transaction fee and block height by transaction ID./walletsolidity/getdelegatedresource— retrieves the energy delegation information./walletsolidity/getdelegatedresourceaccountindex— retrieves the energy delegation index by an account./walletsolidity/getexchangebyid— retrieves an exchange pair by exchange pair ID./walletsolidity/listexchanges— retrieves the list of all the exchange pairs./walletsolidity/getaccountbyid— retrieves an account information by account ID./walletsolidity/getblockbyid— retrieves a block information by block ID./walletsolidity/getblockbylimitnext— retrieves a list of blocks by range./walletsolidity/getblockbylatestnum— retrieves several latest blocks.
FullNode API:
wallet/createtransaction— creates a transfer transaction; ifto_addressdoesn't exist, creates an account on the blockchain.wallet/broadcasttransaction— broadcasts a transaction after signing.wallet/broadcasthex— broadcasts a transaction hex string after signing.wallet/updateaccount— updates the name of an account.wallet/votewitnessaccount— votes for witnesses.wallet/getBrokerage— retrieves the ratio of brokerage of the witness.wallet/getReward— retrieves unclaimed reward.wallet/updateBrokerage— updates the ratio of brokerage.wallet/getaccountbalance— retrieves the account balance in a specific block.wallet/createassetissue— issues a token.wallet/updatewitness— updates the witness's website URL.wallet/createaccount— creates an account.wallet/createwitness— applies to become a witness.wallet/transferasset— transfers a token.wallet/participateassetissue— participates a token.wallet/freezebalance— stakes TRX.wallet/unfreezebalance— unstakes the staked TRX that is due.wallet/unfreezeasset— unstakes the staked token that is due.wallet/withdrawbalance— withdraws a reward to an account balance for witnesses.wallet/updateasset— updates token information.wallet/getassetissuebyaccount— retrieves the token issue information of an account.wallet/getaccountnet— retrieves the bandwidth information of an account.wallet/getassetissuebyname— retrieves a token by token name.wallet/getassetissuelistbyname— retrieves the list of tokens by name.wallet/getassetissuebyid— retrieves a token by token ID.wallet/getnowblock— retrieves the latest block information.wallet/getblockbynum— retrieves a block information by block height.wallet/getblockbyid— retrieves a block information by block ID.wallet/getblockbylimitnext— retrieves a list of blocks by range.wallet/getblockbylatestnum— retrieves several latest blocks.wallet/getblockbalance— retrieves all balance change operations in a block.wallet/gettransactionbyid— retrieves transaction information by transaction ID.wallet/gettransactioninfobyid— retrieves the transaction fee and block height by transaction ID.wallet/gettransactioncountbyblocknum— retrieves the number of transactions in a specific block.wallet/gettransactioninfobyblocknum— retrieves the list of transaction information in a specific block.wallet/getaccount— retrieves account information.wallet/listwitnesses— retrieves the list of witnesses.wallet/getassetissuelist— retrieves the list of all tokens.wallet/getpaginatedassetissuelist— retrieves the list of all tokens by pagination.wallet/getpaginatedproposallist— retrieves the list of all proposals by pagination.wallet/getpaginatedexchangelist— retrieves the list of all exchange pairs by pagination.wallet/getnextmaintenancetime— retrieves the time interval till the next vote round.wallet/validateaddress— checks the validity of the address.wallet/deploycontract— deploys a smart contract.wallet/triggersmartcontract— triggers a smart contract.wallet/getcontract— retrieves a contract.wallet/proposalcreate— creates a proposal.wallet/getproposalbyid— retrieves a proposal by proposal ID.wallet/listproposals— retrieves all proposals.wallet/proposalapprove— approves a proposal.wallet/proposaldelete— deletes a proposal.wallet/getaccountresource— retrieves the resource information of an account.wallet/exchangecreate— creates an exchange pair.wallet/exchangeinject— injects funds for an exchange pair.wallet/exchangewithdraw— withdraws from an exchange pair.wallet/exchangetransaction— participates the transaction of exchange pair.wallet/getexchangebyid— retrieves an exchange pair by exchange pair ID.wallet/listexchanges— retrieves the list of all exchange pairs.wallet/getchainparameters— retrieves the parameters of the blockchain used for witnesses to create a proposal.wallet/updatesetting— updates theconsume_user_resource_percentparameter of a smart contract.wallet/updateenergylimit— updates theorigin_energy_limitparameter of a smart contract.wallet/getdelegatedresource— retrieves the energy delegation information.wallet/getdelegatedresourceaccountindex— retrieves the energy delegation index by an account.wallet/setaccountid— sets an account ID for an account.wallet/getaccountbyid— retrieves account information by account ID.wallet/triggerconstantcontract— triggers the constant of the smart contract, the transaction is off the blockchain.wallet/clearabi— clears the abi of a smart contract.wallet/getsignweight— retrieves the current signatures total weight of a transaction after signing.wallet/getapprovedlist— retrieves the signatures list of a transaction after signing.wallet/accountpermissionupdate— sets a multi-signature for an account.wallet/getzenpaymentaddress— retrieves payment address.wallet/getrcm— retrieves a random commitment trapdoor.
Methods
Methods
web3_clientVersionweb3_sha3net_versionnet_listeningeth_syncingeth_gasPriceeth_accountseth_blockNumbereth_getBalanceeth_getStorageAteth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_getUncleCountByBlockHasheth_getUncleCountByBlockNumbereth_getCodeeth_calleth_estimateGaseth_getBlockByHasheth_getBlockByNumbereth_getTransactionByHasheth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getTransactionReceipteth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndexeth_getLogs
SolidityNode API
/walletsolidity/getaccountwalletsolidity/listwitnesses/walletsolidity/getassetissuelist/walletsolidity/getpaginatedassetissuelist/walletsolidity/getassetissuebyname/walletsolidity/getassetissuelistbyname/walletsolidity/getassetissuebyid/walletsolidity/getnowblock/walletsolidity/getblockbynum/walletsolidity/gettransactionbyid/walletsolidity/gettransactioncountbyblocknum/walletsolidity/gettransactioninfobyblocknum/walletsolidity/gettransactioninfobyid/walletsolidity/getdelegatedresource/walletsolidity/getdelegatedresourceaccountindex/walletsolidity/getexchangebyid/walletsolidity/listexchanges/walletsolidity/getaccountbyid/walletsolidity/getblockbyid/walletsolidity/getblockbylimitnext/walletsolidity/getblockbylatestnumwallet/createtransactionwallet/broadcasttransactionwallet/broadcasthexwallet/updateaccountwallet/votewitnessaccountwallet/getBrokeragewallet/getRewardwallet/updateBrokeragewallet/getaccountbalancewallet/createassetissuewallet/updatewitnesswallet/createaccountwallet/createwitnesswallet/transferassetwallet/participateassetissuewallet/freezebalancewallet/unfreezebalancewallet/unfreezeassetwallet/withdrawbalancewallet/updateassetwallet/getassetissuebyaccountwallet/getaccountnetwallet/getassetissuebynamewallet/getassetissuelistbynamewallet/getassetissuebyidwallet/getnowblockwallet/getblockbynumwallet/getblockbyidwallet/getblockbylimitnextwallet/getblockbylatestnumwallet/getblockbalancewallet/gettransactionbyidwallet/gettransactioninfobyidwallet/gettransactioncountbyblocknumwallet/gettransactioninfobyblocknum
SolidityNode API
wallet/getaccountwallet/listwitnesseswallet/getassetissuelistwallet/getpaginatedassetissuelistwallet/getpaginatedproposallistwallet/getpaginatedexchangelistwallet/getnextmaintenancetimewallet/validateaddresswallet/deploycontractwallet/triggersmartcontractwallet/getcontractwallet/proposalcreatewallet/getproposalbyidwallet/listproposalswallet/proposalapprovewallet/proposaldeletewallet/getaccountresourcewallet/exchangecreatewallet/exchangeinjectwallet/exchangewithdrawwallet/exchangetransactionwallet/getexchangebyidwallet/listexchangeswallet/getchainparameterswallet/updatesettingwallet/updateenergylimitwallet/getdelegatedresourcewallet/getdelegatedresourceaccountindexwallet/setaccountidwallet/getaccountbyidwallet/triggerconstantcontractwallet/clearabiwallet/getsignweightwallet/getapprovedlistwallet/accountpermissionupdateResponse examplewallet/getzenpaymentaddresswallet/getrcmwallet/gettriggerinputforshieldedtrc20contract