Updated on 2024-11-14 GMT+08:00

Shared Edition

Table 1 Wallet APIs

API Method

Type

Description

CU

/wallet/validateaddress

POST

Validate address, return either true or false.

5

/wallet/broadcasttransaction

POST

Broadcast the signed transaction.

5

/wallet/broadcasthex

POST

Broadcast the protobuf encoded transaction hexadecimal string after being signed.

4

/wallet/createtransaction

POST

Create a transaction.

9

/wallet/createaccount

POST

Activate an account.

10

/wallet/getaccount

POST

Query information about an account, including TRX balance, TRC-10 balances, stake information, vote information, and permissions.

9

/wallet/updateaccount

POST

Modify the account name.

9

/wallet/accountpermissionupdate

POST

Update the account's permission.

12

/wallet/getaccountresource

POST

Query the resource information of an account (bandwidth, energy, etc).

7

/wallet/getaccountnet

POST

Query the bandwidth information of an account.

7

/wallet/unfreezebalance

POST

Unstake the TRX staked during Stake 1.0, release the obtained bandwidth or energy and TP, and automatically cancel all votes.

5

/wallet/getdelegatedresource

POST

Query all resources delegations during Stake 1.0 phase from an account to another account.

5

/wallet/getdelegatedresourceaccountindex

POST

Query the resource delegation by an account during Stake 1.0 phase and list all addresses that have delegated resources to an account.

40

/wallet/freezebalancev2

POST

In Stake 2.0, stake an amount of TRX to obtain bandwidth or energy, and obtain equivalent TP according to the staked amount.

10

/wallet/unfreezebalancev2

POST

Unstake some TRX staked in Stake 2.0, release the corresponding amount of bandwidth or energy, and voting rights (TP).

7

/wallet/delegateresource

POST

Delegate bandwidth or energy resources to other accounts in Stake 2.0.

5

/wallet/undelegateresource

POST

Cancel the delegation of bandwidth or energy resources to other accounts in Stake 2.0.

7

/wallet/withdrawexpireunfreeze

POST

Withdraw the funds after a waiting period.

7

/wallet/getavailableunfreezecount

POST

Query the remaining times of executing unstake operations in Stake 2.0.

5

/wallet/getcanwithdrawunfreezeamount

POST

Query the withdrawable balance at the specified timestamp.

6

/wallet/getcandelegatedmaxsize

POST

Query the amount of delegatable resources share of the specified resource type for an address. The unit is sun.

7

/wallet/getdelegatedresourcev2

POST

In Stake 2.0, query the detail of resource share delegated from the source to the target address.

5

/wallet/getdelegatedresourceaccountindexv2

POST

Query the resource delegation index in Stake 2.0.

40

/wallet/getblock

POST

Query block header information or entire block information according to block height or block hash.

392

/wallet/getblockbynum

POST

Query the block object corresponding to the block height.

192

/wallet/getblockbyid

POST

Query the block by ID (block hash).

392

/wallet/getblockbylatestnum

POST

Query the latest block objects.

941

/wallet/getblockbylimitnext

POST

Query the block objects in the range specified.

392

/wallet/getnowblock

GET

Query the latest block information.

542

/wallet/gettransactionbyid

POST

Query transaction information by transaction hash.

52

/wallet/gettransactioninfobyid

POST

Return transaction information, including the transaction fee, block height, and VM logs.

19

/wallet/gettransactioninfobyblocknum

POST

Query transaction information in a block specified.

139

/wallet/getchainparameters

GET

Query all proposal parameters that the witnesses can set.

13

/wallet/getenergyprices

GET

Query historical energy unit price.

8

/wallet/getbandwidthprices

GET

Query historical bandwidth unit price.

6

/wallet/getburntrx

GET

Query the amount of TRX burned due to on-chain transaction fees since No. 54 Committee Proposal took effect.

6

/wallet/getapprovedlist

POST

Query the account address list which signed the transaction, by the transaction content and signature information.

20

/wallet/getassetissuebyaccount

POST

Query the TRC-10 token information issued by an account.

523

/wallet/getassetissuebyid

POST

Query the TRC-10 token information by ID.

9

/wallet/getassetissuebyname

POST

Query the TRC-10 token information by token name.

570

/wallet/getassetissuelist

GET

Query the list of all the TRC-10 tokens.

4706

/wallet/getassetissuelistbyname

POST

Query the list of all the TRC-10 tokens with a same name.

509

/wallet/getpaginatedassetissuelist

POST

Query the list of all the TRC-10 tokens by page.

784

/wallet/transferasset

POST

Transfer TRC-10 tokens.

20

/wallet/createassetissue

POST

Issue a TRC-10 token.

20

/wallet/participateassetissue

POST

Participate in issuing a TRC-10 token.

20

/wallet/unfreezeasset

POST

Unstake a TRC-10 token that has passed the minimum freeze duration.

20

/wallet/updateasset

POST

Update the basic TRC-10 token information.

20

/wallet/getcontract

POST

Query the contract information from the blockchain, including the bytecode of the contract, ABI, configuration parameters, etc.

84

/wallet/getcontractinfo

POST

Query the contract information from the blockchain. It is different from the wallet/getcontract API. This API returns not only the bytecode but also the runtime bytecode of the contract. Compared with bytecode, runtime bytecode does not contain constructor and constructor parameter information.

114

/wallet/triggersmartcontract

POST

Return TransactionExtention. The transaction needs to be broadcasted after signed.

20

/wallet/triggerconstantcontract

POST

Invoke the read-only function of a contract, invoke the non-read-only function of a contract (for predicting whether the transaction can be successfully executed and the estimate energy consumption), or estimate the energy consumption of contract deployment.

20

/wallet/deploycontract

POST

Return TransactionExtention, which contains an unsigned transaction.

14

/wallet/updatesetting

POST

Update the consume_user_resource_percent parameter of a smart contract. An unsigned transaction is returned and needs to be broadcasted after signed.

20

/wallet/updateenergylimit

POST

Update the origin_energy_limit parameter of a smart contract. An unsigned transaction is returned and needs to be broadcasted after signed.

20

/wallet/clearabi

POST

Clear the ABI info of a smart contract. An unsigned transaction is returned and needs to be broadcasted after signed.

20

/wallet/estimateenergy

POST

Estimate the energy required for the successful execution of smart contract transactions or deploying a contract.

13

/wallet/createwitness

POST

Apply to become a witness. Return the transaction. The transaction needs to be broadcasted after signed.

20

/wallet/updatewitness

POST

Edit the URL of the witness's official website. The transaction needs to be broadcasted after signed.

20

/wallet/listwitnesses

GET

List all witnesses.

20

/wallet/votewitnessaccount

POST

Vote for witnesses. Return the transaction. The transaction needs to be broadcasted after signed.

20

/wallet/updateBrokerage

POST

Update the witness's brokerage setting. The transaction needs to be broadcasted after signed.

7

/wallet/getBrokerage

POST

Query the witness's brokerage ratio.

5

/wallet/getReward

POST

Get the rewards that a witness or a user has not yet withdrawn.

5

/wallet/withdrawbalance

POST

Withdraw rewards by witnesses or users, available every 24 hours. Witnesses can withdraw the balance from the account allowance into the account balance. Users can claim the voting rewards and deposit into their accounts.

20

/wallet/getnextmaintenancetime

GET

Return the timestamp of the next voting time in milliseconds.

20

/wallet/proposalcreate

POST

Create a proposal transaction. An unsigned transaction is returned and needs to be broadcasted after signed.

5

/wallet/proposalapprove

POST

Approve a proposal transaction. An unsigned transaction is returned and needs to be broadcasted after signed.

20

/wallet/proposaldelete

POST

Delete a proposal transaction. An unsigned transaction is returned and needs to be broadcasted after signed.

20

/wallet/listproposals

GET

List all proposals.

116

/wallet/getproposalbyid

POST

Query a proposal based on the ID and return proposal details.

10

/wallet/exchangecreate

POST

Create a transaction pair. The transaction needs to be broadcasted after signed. Note that successful execution, signing, and broadcast of this API call will deduct 1024 TRX from the user's account.

20

/wallet/exchangeinject

POST

Inject capital into the transaction pair to prevent price fluctuation. The transaction needs to be broadcasted after signed.

20

/wallet/exchangewithdraw

POST

Withdraw a transaction pair. The transaction needs to be broadcasted after signed.

20

/wallet/exchangetransaction

POST

Participate in a transaction pair. The transaction needs to be broadcasted after signed.

20

/wallet/getexchangebyid

POST

Query a transaction pair based on ID.

8

/wallet/listexchanges

GET

List all transaction pairs.

79

/wallet/gettransactionlistfrompending

GET

Get transaction list information from the pending pool.

20

/wallet/gettransactionfrompending

POST

Get transaction details from the pending pool.

9

/wallet/getpendingsize

GET

Get the size of the pending pool queue.

7

/wallet/getsignweight

POST

Query the total weight of a signed transaction.

20

Table 2 Wallet solidity APIs

API Method

Type

Description

CU

/walletsolidity/gettransactionbyid

POST

Query transaction information by transaction hash (confirmed state).

28

/walletsolidity/gettransactioninfobyid

POST

Return transaction information, including the transaction fee, block height, and VM logs (confirmed state).

10

/walletsolidity/gettransactioninfobyblocknum

POST

Query transaction information in a block specified (confirmed state).

18

/walletsolidity/getblock

POST

Query block header information or entire block information according to block height or block hash (confirmed state).

392

/walletsolidity/getblockbyid

POST

Query the block by ID, that is, block hash (confirmed state).

376

/walletsolidity/getblockbylatestnum

POST

Query the latest block objects (confirmed state).

965

/walletsolidity/getblockbylimitnext

POST

Query the block objects in the range specified (confirmed state).

376

/walletsolidity/getblockbynum

POST

Query whether a specified block is confirmed.

192

/walletsolidity/getnowblock

GET

Query the latest block information (confirmed state).

542

/walletsolidity/getaccount

POST

Query the information about an account (confirmed state).

9

/walletsolidity/getdelegatedresourcev2

POST

Query the resource delegation index in Stake 2.0 (confirmed state).

5

/walletsolidity/getavailableunfreezecount

POST

Query the remaining times of executing unstake operations in Stake 2.0 (confirmed state).

5

/walletsolidity/getcanwithdrawunfreezeamount

POST

Query the withdrawable balance at the specified timestamp in Stake 2.0 (confirmed state).

6

/walletsolidity/getdelegatedresourceaccountindexv2

POST

Query the resource delegation index in Stake 2.0 (confirmed state). Two lists will be returned. One lists the target addresses that have received the delegation (toAddress). The other lists the addresses that have delegated resources (fromAddress).

7

/walletsolidity/getburntrx

GET

Query the amount of TRX burned due to on-chain transaction fees since No. 54 Committee Proposal took effect (confirmed state).

5

/walletsolidity/triggerconstantcontract

POST

Invoke the read-only function of a contract (view or pure, for querying confirmed state data), or invoke the non-read-only function of a contract (for predicting whether the transaction can be successfully executed and the estimate energy consumption in confirmed state).

20

/walletsolidity/estimateenergy

POST

Estimate the energy required for the successful execution of smart contract transactions (confirmed state).

13

/walletsolidity/getassetissuebyid

POST

Query the TRC-10 token information by ID (confirmed state).

34

/walletsolidity/getassetissuebyname

POST

Query the TRC-10 token information by token name (confirmed state).

36

/walletsolidity/getassetissuelist

GET

Query the list of all the TRC-10 tokens (confirmed state).

4183

/walletsolidity/getassetissuelistbyname

POST

Query the list of all the TRC-10 tokens with a same name (confirmed state).

495

/walletsolidity/getpaginatedassetissuelist

POST

Query the list of all the TRC-10 tokens by page (confirmed state).

784

/walletsolidity/listwitnesses

GET

List all witnesses (confirmed state).

111

/walletsolidity/getexchangebyid

POST

Query a transaction pair by ID (confirmed state).

6

/walletsolidity/listexchanges

GET

Query transaction pairs (confirmed state).

79

/walletsolidity/getenergyprices

GET

Query historical energy unit price.

17

/walletsolidity/getcandelegatedmaxsize

POST

Query the amount of delegatable resources share of the specified resource type for an address in Stake 2.0 (confirmed state). The unit is sun.

7

/walletsolidity/gettransactioncountbyblocknum

POST

Query the number of transactions in a block by block number (confirmed state).

18

Table 3 JSON-RPC APIs

API Method

Type

Description

CU

eth_accounts

POST

Return an array of addresses owned by the client. An empty list will be returned for tron.

13

eth_blockNumber

POST

Return the latest block number.

10

eth_call

POST

Execute a message call immediately without creating a transaction on the blockchain (triggerConstantContract).

20

eth_chainId

POST

Return the chainId of the TRON network which is the last four bytes of the genesis block hash.

1

eth_estimateGas

POST

Return the required energy using triggerConstantContract.

1000

eth_gasPrice

POST

Return the current energy price in sun.

13

eth_getBalance

POST

Return the balance of the given account address.

15

eth_getBlockByHash

POST

Return block information for the given block hash.

45

eth_getBlockByNumber

POST

Return block information for the given block number.

20

eth_getBlockTransactionCountByHash

POST

Return the number of transactions in a block by the given block hash.

13

eth_getBlockTransactionCountByNumber

POST

Return the number of transactions in a block by the given block number.

12

eth_getCode

POST

Return the runtime code of a given smart contract address.

40

eth_getStorageAt

POST

Return the value from a storage position at a given address. It can be used to get the value of a variable in a contract.

15

eth_getTransactionByBlockHashAndIndex

POST

Return information about a transaction by block hash and transaction index position.

17

eth_getTransactionByBlockNumberAndIndex

POST

Return information about a transaction by block number and transaction index position.

18

eth_getTransactionByHash

POST

Return the information about a transaction by transaction hash.

40

eth_getTransactionReceipt

POST

Return transaction information, including the transaction fee, block height, and VM logs.

19

eth_syncing

POST

Return the sync status of a node.

1

eth_getLogs

POST

Return all logs matching a given filter object.

75

net_listening

POST

Return if the client is listening for network connections.

1

net_version

POST

Return the hash of the genesis block.

1

web3_clientVersion

POST

Return the current version of the node.

1

web3_sha3

POST

Return Keccak-256 (not the standardized SHA3-256) of the given data.

5

buildTransaction

POST

Create a transaction. Different transaction types have different parameters.

13