Node API
Supported Chains
API Reference
TRON

TRON


TRON API is available on Web3 API platform (opens in a new tab).

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 (opens in a new tab).


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.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <string>: the current client version.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "web3_clientVersion",
      "params": [],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "TRON/v4.7.1/Linux/Java1.8"
}

web3_sha3

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

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <string> (data): the data to convert into a SHA3 hash.

Returns

  • <string> (data): the SHA3 result of the given string.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "web3_sha3",
      "params": ["0x68656c6c6f20776f726c64"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad"
}

net_version

Returns the current network ID.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <string>: the current network ID.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "net_version",
      "params": [],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x2b6653dc"
}

net_listening

Returns true if client is actively listening for network connections.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <boolean>: true when listening, otherwise false.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "net_listening",
      "params": [],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": true
}

eth_syncing

Returns an object with data about the sync status or false.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <object>|<boolean>: an object with sync status data or FALSE, when not syncing:
    • startingBlock (quantity): the block at which the import started (will only be reset, after the sync reached its head).
    • currentBlock (quantity): the current block, same as eth_blockNumber.
    • highestBlock (quantity): the estimated highest block.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_syncing",
      "params": [],
      "id": 1
    }'

Response example (syncing)

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "startingBlock": "0x2fb6331",
        "currentBlock": "0x2fb6344",
        "highestBlock": "0x2fb6344"
    }
}

Response example (not syncing)

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": false
}

eth_gasPrice

Returns the current price per gas in wei.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <string> (quantity): the current gas price in wei.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_gasPrice",
      "params": [],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x1a4"
}

eth_accounts

Returns a list of addresses owned by client.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <array> (string; data, 20 bytes): addresses owned by the client.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_accounts",
      "params": [],
      "id": 1
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": []
}

eth_blockNumber

Returns the number of most recent block.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): None.

Returns

  • <string> (quantity): the current block number the client is on.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_blockNumber",
      "params": [],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x2fb6363"
}

eth_getBalance

Returns the balance of the account specified by address.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 20 bytes): an address to check for balance.
    2. <string> (quantity|tag): either the hex value of a block number or one of the following block tag:
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.

Returns

  • <string> (quantity): the current balance in wei.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getBalance",
      "params": ["41c2ad4ef36bf52f1a724783c822b3a8dd68ae7e00", "latest"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x1717c"
}

eth_getStorageAt

Returns the value from a storage position at an address specified.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 20 bytes): an address of the storage (hex encoded).

    2. <string> (quantity): a slot position in the storage (hex encoded unsigned integer).

    3. <string> (quantity|tag): either the hex value of a block number or the following block tag:

      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.

Returns

  • <string> (data): the value at this storage position.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getStorageAt",
      "params": ["41c2ad4ef36bf52f1a724783c822b3a8dd68ae7e00", "0x0", "latest"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0000000000000000000000000000000000000000000000000000000000000000"
}

eth_getBlockTransactionCountByHash

Returns the number of transactions in a block specified by block hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a block hash.

Returns

  • <string> (quantity): the number of transactions in this block.

Request example:

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getBlockTransactionCountByHash",
      "params": ["0000000002fb639b337bc09c3864b02ec550eedac1b6387707d0d8ed340e1c7a"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x17a"
}

eth_getBlockTransactionCountByNumber

Returns the number of transactions in the block specified by number.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.

Returns

  • <string> (quantity): the number of transactions in this block.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getBlockTransactionCountByNumber",
      "params": ["0x2FB639B"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x17a"
}

eth_getUncleCountByBlockHash

Returns the number of uncles in a block specified by block hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a block hash.

Returns

  • <string> (quantity): the number of uncles in this block.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getUncleCountByBlockHash",
      "params": ["0000000002fb639b337bc09c3864b02ec550eedac1b6387707d0d8ed340e1c7a"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0"
}

eth_getUncleCountByBlockNumber

Returns the number of uncles in a block specified by block number.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
      • safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
      • pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.

Returns

  • <string> (quantity): the number of uncles in this block.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getUncleCountByBlockNumber",
      "params": ["finalized"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0"
}

eth_getCode

Returns code at a given address.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 20 bytes): a contract address.

    2. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:

      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.

Returns

  • <string> (data): the code from the given address.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getCode",
      "params": ["0xa614f803b6fd780986a42c78ec9c7f77e6ded13c", "latest"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x"
}

eth_call

Executes a new message call immediately without creating a transaction on the blockchain.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <object> (hex encoded): the transaction object:

      • from (string; data, 20 bytes; optional): the address the transaction is sent from.
      • to (string; data, 20 bytes): the address the transaction is directed to.
      • gas (string; quantity; optional): Not supported. The value is 0x0.
      • gasPrice (string; quantity; optional): Not supported. The value is 0x0.
      • value (string; quantity; optional): Not supported. The value is 0x0.
      • data (string; data; optional): the hash of the method signature and encoded parameters.
    2. <string> (quantity|tag): either the hex value of a block number or the following block tag:

      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.

Returns

  • <string> (hex encoded bytes): the return value of executed contract.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
        "from": "0xF0CC5A2A84CD0F68ED1667070934542D673ACBD8",
        "to": "0x70082243784DCDF3042034E7B044D6D342A91360",
        "gas": "0x0",
        "gasPrice": "0x0",
        "value": "0x0",
        "data": "0x70a08231000000000000000000000041f0cc5a2a84cd0f68ed1667070934542d673acbd8"
    }, "latest"],
    "id": 1
}'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0000000000000000000000000000000000000000000000000858898f93629000"
}

eth_estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.

The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <object>: the transaction object:
      • from (string; data, 20 bytes; optional): the address the transaction is sent from.
      • to (string; data, 20 bytes; optional): the address the transaction is directed to.
      • gas (string; quantity; optional): unused.
      • gasPrice (string; quantity; optional): unused.
      • value (string; quantity; optional): the value sent with this transaction, in wei.
      • data (string; data; optional): the hash of the method signature and encoded parameters.

Returns

  • <string> (quantity): the amount of energy used.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_estimateGas",
    "params": [{
        "from": "0x41F0CC5A2A84CD0F68ED1667070934542D673ACBD8",
        "to": "0x4170082243784DCDF3042034E7B044D6D342A91360",
        "gas": "0x01",
        "gasPrice": "0x8c",
        "value": "0x01",
        "data": "0x70a08231000000000000000000000041f0cc5a2a84cd0f68ed1667070934542d673acbd8"
    }]
}'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0"
}

eth_getBlockByHash

Returns information for the block specified by block hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): the block hash.
    2. <boolean>: if true it returns the full transaction objects, if false — only the hashes of the transactions.

Returns

  • <object>: a block object, or null when no block was found:
    • number (string; quantity): the block number; null when it's a pending block.
    • hash (string; data, 32 bytes): the hash of the block; null when it's a pending block.
    • parentHash (string; data, 32 bytes): the hash of the parent block.
    • nonce (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block.
    • sha3Uncles (string; data, 32 bytes): SHA3 of the uncles data in the block.
    • logsBloom (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block.
    • transactionsRoot (string; data, 32 bytes): the root of the transaction trie of the block.
    • stateRoot (string; data, 32 bytes): the root of the final state trie of the block.
    • receiptsRoot (string; data, 32 bytes): the root of the receipts trie of the block.
    • miner (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given.
    • difficulty (string; quantity): the difficulty for this block.
    • totalDifficulty (string; quantity): the total difficulty of the chain until this block.
    • extraData (string; data): the extra data field of this block.
    • size (string; quantity): the size of this block in bytes.
    • gasLimit (string; quantity): the maximum gas allowed in this block.
    • gasUsed (string; quantity): the total used gas by all transactions in this block.
    • timestamp (string; quantity): the unix timestamp for when the block was collated.
    • transactions (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
    • uncles (array of strings): an array of uncle hashes.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByHash",
    "params": ["0000000002fb64e09010fed562392f3dca79d29c9bd823e18c1aed9083058a3f", false],
    "id": 1
}'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "baseFeePerGas": "0x0",
        "difficulty": "0x0",
        "extraData": "0x",
        "gasLimit": "0x1dcf14400",
        "gasUsed": "0x3b090b",
        "hash": "0x0000000002fb64e09010fed562392f3dca79d29c9bd823e18c1aed9083058a3f",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0x78c842ee63b253f8f0d2955bbc582c661a078c9d",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x2fb64e0",
        "parentHash": "0x0000000002fb64df62e0d38a5e5275c78b42653925f47986a4d1db77aa645e3e",
        "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "size": "0x173d6",
        "stateRoot": "0x",
        "timestamp": "0x642d7b08",
        "totalDifficulty": "0x0",
        "transactions": [
            "0x92327d478923335c581d1ca59fb70163548838f2b766d0199fbf64d4860344ad",
            "0xf113fda5cb23e30880c5968e221cef2f23f048470150dd8c04f38d3c227c7002",
            "0x2a8fc9a2e6e2391d330d9a7a41ae5ab494628951da36909fc98b91c9f1dacb8e",
            "0xb173d5070ba0aa5afefe40b67bbb63e8d6bc6ec57019afe426131c565b258ec3",
            "0xecd84aa22c5935bcaf2be7f98e06eadacdada8b262640162364b08ac7aa3e4fa",
            "0xf4c2239f422820a22da6b9e1d4d52493384fbd596457e428c072cd0693671d98",
            "0x22bab3772a77043e10e4cb9f993c9450fcd117ffdcb1bc82288504acb36e6e6b",
            "0xfa5d8defac3e3291ca56f8f44b7aa0db5170e3756ac1c1eade30fd31eaa4d5da",
            "0x2e5c7e1af56f4bd20592671ddf8e5dc0097daf6ca579d26d53c1f643d85618e2",
            "0xa1cfe2e6b9e08d6939bf6c01b1d6b1f2892f0e915df9343a86e8d728ae3630ae"
        ],
        "transactionsRoot": "0x448c3eb29eb9e065a8a22441c0973d70d67e614c498ea748a1af1bead9d22410",
        "uncles": []
    }
}

eth_getBlockByNumber

Returns information for the block specified by block number.

Parameters


  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:

      • earliest: the lowest numbered block available on the client.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
    2. <boolean>: if true it returns the full transaction objects, if false — only the hashes of the transactions.

Returns

  • <object>: a block object, or null when no block was found:
    • number (string; quantity): the block number; null when it's a pending block.
    • hash (string; data, 32 bytes): the hash of the block; null when it's a pending block.
    • parentHash (string; data, 32 bytes): the hash of the parent block.
    • nonce (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block.
    • sha3Uncles (string; data, 32 bytes): SHA3 of the uncles data in the block.
    • logsBloom (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block.
    • transactionsRoot (string; data, 32 bytes): the root of the transaction trie of the block.
    • stateRoot (string; data, 32 bytes): the root of the final state trie of the block.
    • receiptsRoot (string; data, 32 bytes): the root of the receipts trie of the block.
    • miner (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given.
    • difficulty (string; quantity): the difficulty for this block.
    • totalDifficulty (string; quantity): the total difficulty of the chain until this block.
    • extraData (string; data): the extra data field of this block.
    • size (string; quantity): the size of this block in bytes.
    • gasLimit (string; quantity): the maximum gas allowed in this block.
    • gasUsed (string; quantity): the total used gas by all transactions in this block.
    • timestamp (string; quantity): the unix timestamp for when the block was collated.
    • transactions (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
    • uncles (array of strings): an array of uncle hashes.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getBlockByNumber",
      "params": ["0x1b4", false],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "baseFeePerGas": "0x0",
        "difficulty": "0x0",
        "extraData": "0x",
        "gasLimit": "0x0",
        "gasUsed": "0x0",
        "hash": "0x00000000000001b471ba79b1cf4cfe70ff48558f7a2218f52541d54f3403d091",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0x5095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x1b4",
        "parentHash": "0x00000000000001b36c300ca00603e1f4145045fc9667d4b5e1c8e89d91d6446c",
        "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "size": "0xad",
        "stateRoot": "0x",
        "timestamp": "0x5b304fee",
        "totalDifficulty": "0x0",
        "transactions": [],
        "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "uncles": []
    }
}

eth_getTransactionByHash

Returns information on a transaction specified by transaction hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a transaction hash.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getTransactionByHash",
      "params": ["5f72a4ff71f906fb53958a68e8a56613ff56752649ca9ed0fa879890f5f06098"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x0000000002fb6540b72dbe6efa2568db23bdc1155c30253ecbeb180b344c7366",
        "blockNumber": "0x2fb6540",
        "from": "0x7507386fe92eed44c61281ac9513c9c64f8e65d2",
        "gas": "0x0",
        "gasPrice": "0x1a4",
        "hash": "0x5f72a4ff71f906fb53958a68e8a56613ff56752649ca9ed0fa879890f5f06098",
        "input": "0x",
        "nonce": "0x0000000000000000",
        "r": "0x352d87789df75779efd5abbd5dc2b36fdadd64c5b98848107d98a7d46c2cbffe",
        "s": "0x17d117d81dd5a7336ebd3fe5453fce71fa35a1f50b633eaf032ae8bb5d9d9662",
        "to": "0x08b0a04bdfbb7ee6258b19a4d8a57bd41a88f9f1",
        "transactionIndex": "0x6c",
        "type": "0x0",
        "v": "0x1b",
        "value": "0x1"
    }
}

eth_getTransactionByBlockHashAndIndex

Returns information on a transaction specified by block hash and transaction index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a block hash.
    2. <string> (quantity): a transaction index position.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getTransactionByBlockHashAndIndex",
      "params": ["00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b", "0x0"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b",
        "blockNumber": "0x20ef11c",
        "from": "0xb4f1b6e3a1461266b01c2c4ff9237191d5c3d5ce",
        "gas": "0x0",
        "gasPrice": "0x8c",
        "hash": "0x8dd26d1772231569f022adb42f7d7161dee88b97b4b35eeef6ce73fcd6613bc2",
        "input": "0x",
        "nonce": "0x0000000000000000",
        "r": "0x6212a53b962345fb8ab02215879a2de05f32e822c54e257498f0b70d33825cc5",
        "s": "0x6e04221f5311cf2b70d3aacfc444e43a5cf14d0bf31d9227218efaabd9b5a812",
        "to": "0x047d4a0a1b7a9d495d6503536e2a49bb5cc72cfe",
        "transactionIndex": "0x0",
        "type": "0x0",
        "v": "0x1b",
        "value": "0x203226"
    }
}

eth_getTransactionByBlockNumberAndIndex

Returns information on a transaction by block number and transaction index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
    2. <string> (quantity): the transaction index position.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getTransactionByBlockNumberAndIndex",
      "params": ["0x2FB6562", "0x0"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x0000000002fb6562c886d5f844a697b99c73e25b79cb8d3de8771cca9c3700d4",
        "blockNumber": "0x2fb6562",
        "from": "0x9d959e29ca58da6583b460e54d329e3975ddc3b4",
        "gas": "0xacc4",
        "gasPrice": "0x1a4",
        "hash": "0x50f952272174ec81359e91a229b171e881e3a7db44400b53f81ccecf038b2564",
        "input": "0x23b872dd0000000000000000000000417db40dca0d40898c18ab574303c5ff139176b11d0000000000000000000000419339b7a574abc3f201ab56dd66b72964402080fe0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "r": "0x513d8b9990aa2f18cb744d2a1056b75be4fa16bd48108e2010ae904fcffa45d7",
        "s": "0xa622e4e997445f1cff980be4d205c44d2fd1781ab5e863453f8e8fc57d97ec77",
        "to": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c",
        "transactionIndex": "0x0",
        "type": "0x0",
        "v": "0x1b",
        "value": "0x0"
    }
}

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

The receipt is not available for pending transactions.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a hash of the transaction.

Returns

  • object: a transaction receipt object, or null when no receipt was found:

    • transactionHash (string; data, 32 bytes): a hash of the transaction.

    • transactionIndex (string; quantity): the transactions index position in the block.

    • blockHash (string; data, 32 bytes): a hash of the block containing the transaction.

    • blockNumber (string; quantity): a number of the block containing the transaction.

    • from (string; data, 20 bytes): an address of the sender.

    • to (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction.

    • cumulativeGasUsed (string; quantity): the total amount of gas used when this transaction was executed in the block.

    • effectiveGasPrice (string; quantity): the sum of the base fee and tip paid per unit of gas.

    • gasUsed (string; quantity): the amount of gas used by this specific transaction alone.

    • contractAddress (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null.

    • logs (array): an array of log objects, which this transaction generated.

    • logsBloom (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs.

    • type (string; data): the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either of the following:

      • root (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium).
      • status (string; quantity): either 1 (success) or 0 (failure).

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getTransactionReceipt",
      "params": ["c9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0x00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b",
        "blockNumber": "0x20ef11c",
        "contractAddress": null,
        "cumulativeGasUsed": "0x646e2",
        "effectiveGasPrice": "0x8c",
        "from": "0x6eced5214d62c3bc9eaa742e2f86d5c516785e14",
        "gasUsed": "0x0",
        "logs": [],
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "status": "0x1",
        "to": "0x0697250b9d73b460a9d2bbfd8c4cacebb05dd1f1",
        "transactionHash": "0xc9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0",
        "transactionIndex": "0x6",
        "type": "0x0"
    }
}

eth_getUncleByBlockHashAndIndex

Returns information about an uncle of a block by hash and uncle index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): the hash of a block.
    2. <string> (quantity): the uncle's index position.

Returns

  • <object>: a block object, or null when no block was found:
    • number (string; quantity): the block number; null when it's a pending block.
    • hash (string; data, 32 bytes): the hash of the block; null when it's a pending block.
    • parentHash (string; data, 32 bytes): the hash of the parent block.
    • nonce (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block.
    • sha3Uncles (string; data, 32 bytes): SHA3 of the uncles data in the block.
    • logsBloom (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block.
    • transactionsRoot (string; data, 32 bytes): the root of the transaction trie of the block.
    • stateRoot (string; data, 32 bytes): the root of the final state trie of the block.
    • receiptsRoot (string; data, 32 bytes): the root of the receipts trie of the block.
    • miner (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given.
    • difficulty (string; quantity): the difficulty for this block.
    • totalDifficulty (string; quantity): the total difficulty of the chain until this block.
    • extraData (string; data): the extra data field of this block.
    • size (string; quantity): the size of this block in bytes.
    • gasLimit (string; quantity): the maximum gas allowed in this block.
    • gasUsed (string; quantity): the total used gas by all transactions in this block.
    • timestamp (string; quantity): the unix timestamp for when the block was collated.
    • transactions (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
    • uncles (array of strings): an array of uncle hashes.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getUncleByBlockHashAndIndex",
      "params": ["0000000002fb6562c886d5f844a697b99c73e25b79cb8d3de8771cca9c3700d4", "0x0"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "difficulty": "0x4ea3f27bc",
        "extraData": "0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
        "gasLimit": "0x1388",
        "gasUsed": "0x0",
        "hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
        "mixHash": "0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843",
        "nonce": "0x689056015818adbe",
        "number": "0x1b4",
        "parentHash": "0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x220",
        "stateRoot": "0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d",
        "timestamp": "0x55ba467c",
        "totalDifficulty": "0x78ed983323d",
        "transactions": [],
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "uncles": []
    }
}

eth_getUncleByBlockNumberAndIndex

Returns information about an uncle of a block by number and uncle index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
      • safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
      • pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.
    2. <string> (quantity): the uncle's index position.

Returns

  • <object>: a block object, or null when no block was found:
    • number (string; quantity): the block number; null when it's a pending block.
    • hash (string; data, 32 bytes): the hash of the block; null when it's a pending block.
    • parentHash (string; data, 32 bytes): the hash of the parent block.
    • nonce (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block.
    • sha3Uncles (string; data, 32 bytes): SHA3 of the uncles data in the block.
    • logsBloom (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block.
    • transactionsRoot (string; data, 32 bytes): the root of the transaction trie of the block.
    • stateRoot (string; data, 32 bytes): the root of the final state trie of the block.
    • receiptsRoot (string; data, 32 bytes): the root of the receipts trie of the block.
    • miner (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given.
    • difficulty (string; quantity): the difficulty for this block.
    • totalDifficulty (string; quantity): the total difficulty of the chain until this block.
    • extraData (string; data): the extra data field of this block.
    • size (string; quantity): the size of this block in bytes.
    • gasLimit (string; quantity): the maximum gas allowed in this block.
    • gasUsed (string; quantity): the total used gas by all transactions in this block.
    • timestamp (string; quantity): the unix timestamp for when the block was collated.
    • transactions (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
    • uncles (array of strings): an array of uncle hashes.

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getUncleByBlockNumberAndIndex",
      "params": ["0x29c", "0x0"],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "difficulty": "0x57f117f5c",
        "extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
        "gasLimit": "0x1388",
        "gasUsed": "0x0",
        "hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
        "mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
        "nonce": "0x24732773618192ac",
        "number": "0x299",
        "parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x21d",
        "stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
        "timestamp": "0x55ba4827",
        "totalDifficulty": "0xc46826a2c6a",
        "transactions": [],
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "uncles": []
    }
}

eth_getLogs

Returns an array of all logs matching a given filter object.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. object: the filter options:

      • fromBlock (string; quantity|tag; optional; default: "latest"): either the block number or one of the following block tags:

        • latest: for the last mined block.
        • earliest: for the lowest numbered block available on the client.
        • pending: for not yet mined transactions.
      • toBlock (string; quantity|tag; optional; default: "latest"): either the block number or one of the following block tags:

        • latest: for the last mined block.
        • earliest: for the lowest numbered block available on the client.
        • pending: for not yet mined transactions.
      • address (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate.

      • topics (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options.

      • blockhash (string; data, 32 bytes; optional; future): with the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in the filter criteria, then neither fromBlock nor toBlock are allowed.

Returns

  • removed (string; tag): true when the log was removed, due to a chain reorganization; false if it's a valid log.
  • logIndex (string; quantity): the log index position in the block; null when it's a pending log.
  • transactionIndex (string; quantity): the transactions index position log was created from; null when it's a pending log.
  • transactionHash (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log.
  • blockHash (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log.
  • blockNumber (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log.
  • address (string; data, 20 bytes): an address from which this log originated.
  • data (string; data): contains one or more 32 bytes non-indexed arguments of the log.
  • topics (array of strings; data): an array of 0 to 4 32 bytes data of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.)

Request example

curl -X POST https://rpc.ankr.com/tron_jsonrpc \
-H 'Content-Type: application/json' \
-d '{
      "jsonrpc": "2.0",
      "method": "eth_getLogs",
      "params": [{"address": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c"}],
      "id": 1
    }'

Response example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
        {
            "address": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c",
            "blockHash": "0x0000000002fbb03922d9924ccf3d1d7453e608cf60b9e428b19f63852066c550",
            "blockNumber": "0x2fbb039",
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "logIndex": "0x0",
            "removed": false,
            "topics": [
                "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                "0x000000000000000000000000588f0416ccd8e9a7effe911e932a4889aba151e3",
                "0x000000000000000000000000ddeb92d8428ecfe3a517e46e5e8023027a8d598f"
            ],
            "transactionHash": "0x14398ead0f9c6abb63821304d83f6219498be5efd0dd9ac1a4fb9bee141fd9f3",
            "transactionIndex": "0x3"
        },
        {
            "address": "0xa614f803b6fd780986a42c78ec9c7f77e6ded13c",
            "blockHash": "0x0000000002fbb03922d9924ccf3d1d7453e608cf60b9e428b19f63852066c550",
            "blockNumber": "0x2fbb039",
            "data": "0x0000000000000000000000000000000000000000000000000000000000e4e1c0",
            "logIndex": "0x1",
            "removed": false,
            "topics": [
                "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                "0x00000000000000000000000058c1801b09daa665180dfb3e7ac73bf59253d425",
                "0x000000000000000000000000332189e035485990009731422172df8aac90d948"
            ],
            "transactionHash": "0xf7d84e8b3b6840beea7012789fcfededd77e38f3fc158ed7f38bb4caa5c97467",
            "transactionIndex": "0x8"
        }
    ]
}

REST methods

SolidityNode API:

FullNode API:


SolidityNode API

/walletsolidity/getaccount

Retrieves account information.

Parameters

  • address (string; hex; required): a hex-encoded account address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getaccount' \
-H 'Content-Type: application/json' \
-d '{
    "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0"
}'

Response example

{
    "account_name": "636363797979636363",
    "address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
    "asset": [
        {
            "key": "TRX",
            "value": 1
        },
        {
            "key": "DEX",
            "value": 0
        },
        {
            "key": "Kitty",
            "value": 0
        },
        {
            "key": "SEED",
            "value": 0
        },
        {
            "key": "WIN",
            "value": 0
        },
        {
            "key": "Perogies",
            "value": 0
        },
        {
            "key": "TRXTestCoin",
            "value": 0
        }
    ]
}

walletsolidity/listwitnesses

Retrieves the list of witnesses.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/walletsolidity/listwitnesses'

Response example

{
    "witnesses": [
        {
            "address": "4100e9fdbd1d24ab56996bd37d76fb7b16dcf62ff1",
            "voteCount": 1087436,
            "url": "https://www.tronmacau.com"
        },
        {
            "address": "41012f81bd368f632fb22b9ddfeb284155f1f04198",
            "voteCount": 314,
            "url": "https://firekraken.media"
        },
        {
            "address": "4101c17562ee5a1ecb60f9ea6e49ef94ec0de99580",
            "voteCount": 377,
            "url": "https://tronpad.com"
        },
        {
            "address": "41021957c4576cbeae8bdf0576248e3e486a4cf3fa",
            "voteCount": 5,
            "url": "HTTPS://BEFREE"
        },
        {
            "address": "41022939a4a06cbc7b384096c1af8657ec435173af",
            "voteCount": 1399832971,
            "url": "antinvestmentgroup",
            "totalProduced": 891304,
            "totalMissed": 1119,
            "latestBlockNum": 49885242,
            "latestSlotNum": 560089475,
            "isJobs": true
        },
        {
            "address": "4102a0ed82a9609e7ea9155f00137dc3fce818033f",
            "voteCount": 98954,
            "url": "XREGlobal.com"
        },
        {
            "address": "4102f95b2185f52ac539128b28033998ab01466986",
            "voteCount": 114,
            "url": "http://imcash.io"
        },
        {
            "address": "41037e18c9ca44b2ba35f0bb7d0c075f252a191294",
            "voteCount": 175114359,
            "url": "https://trxultra.org",
            "totalProduced": 1164492,
            "totalMissed": 19127,
            "latestBlockNum": 41857315,
            "latestSlotNum": 552045590
        }
    ]
}

/walletsolidity/getassetissuelist

Retrieves the list of all tokens.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/walletsolidity/getassetissuelist'

Response example

{
    "assetIssue": [
        {
            "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa",
            "name": "53454544",
            "abbr": "53454544",
            "total_supply": 100000000000,
            "trx_num": 1000000,
            "num": 1,
            "start_time": 1529987043000,
            "end_time": 1530342060000,
            "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e",
            "url": "687474703a2f2f7777772e736573616d65736565642e6f7267",
            "id": "1000001"
        },
        {
            "owner_address": "410b53ce4aa6f0c2f3c849f11f682702ec99622e2e",
            "name": "545258",
            "abbr": "545258",
            "total_supply": 99000000000,
            "trx_num": 1000000,
            "num": 1,
            "start_time": 1529989896000,
            "end_time": 1537632000000,
            "description": "74726f6e546f6b656e",
            "url": "68747470733a2f2f74726f6e2e6e6574776f726b",
            "id": "1000002"
        },
        {
            "owner_address": "41d13433f53fdf88820c2e530da7828ce15d6585cb",
            "name": "49504653",
            "abbr": "49504653",
            "total_supply": 100000000000,
            "trx_num": 1000000,
            "num": 1,
            "start_time": 1529990700000,
            "end_time": 1537632000000,
            "description": "4950465320636f696e",
            "url": "687474703a2f2f",
            "id": "1000003"
        }
    ]
}

/walletsolidity/getpaginatedassetissuelist

Retrieves the list of all tokens by pagination.

Parameters

  • offset (integer; required): the index of the start token.
  • limit (integer; required): the amount of tokens per page.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getpaginatedassetissuelist' \
-H 'Content-Type: application/json' \
-d '{
      "offset": 0,
      "limit": 10
}'

Response example

{
    "assetIssue": [
        {
            "owner_address": "416b1171698969a36e5eb2eb6ea7aa9204d5e10cfc",
            "name": "21212121474f4c44434f494e",
            "abbr": "474f4c44",
            "total_supply": 9000000000000000000,
            "trx_num": 1000000,
            "num": 1000,
            "start_time": 1556094180182,
            "end_time": 1871799840182,
            "description": "474f4c44",
            "url": "68747470733a2f2f676f6c64636861696e2e78797a",
            "id": "1002341"
        },
        {
            "owner_address": "418f82a73b283c7bf8515fa3cc2c0399d4d593e2e3",
            "name": "21212121476f6c6453706f7421212121",
            "abbr": "476f6c64",
            "total_supply": 99000000000,
            "frozen_supply": [
                {
                    "frozen_amount": 2000000000,
                    "frozen_days": 30
                }
            ],
            "trx_num": 1000000,
            "num": 100,
            "start_time": 1559106000646,
            "end_time": 1609451940646,
            "description": "476f6c6453706f7420666f6c6c6f7720746865207072696365206f6620676f6c6420696e2074686520626c6f636b636861696e212121204f776e6572732077696c6c2067657420414753202861476f6c6453706f74292064726f70206d6f6e74686c792e20476f6c6453706f742077696c6c20626520757067726164656420746f206120747263323020696e20323032302e20496e7665737420696e2074686520676f6c64206d61726b657421212120476c6f62616c20476f6c6420547261646572732121",
            "url": "7777772e676f6c6473706f742e6575",
            "id": "1002467"
        },
        {
            "owner_address": "418225f3aa48a2d30643a64410abb1e914dfa0bd2f",
            "name": "212121363636",
            "abbr": "363636",
            "total_supply": 666666666666666666,
            "frozen_supply": [
                {
                    "frozen_amount": 666666666,
                    "frozen_days": 30
                }
            ],
            "trx_num": 1000000,
            "num": 666,
            "start_time": 1558134600062,
            "end_time": 1589755860062,
            "description": "46756e6e79",
            "url": "68747470733a2f7777772e736174616e2e696f",
            "id": "1002438"
        }
    ]
}

/walletsolidity/getassetissuebyname

Retrieves a token by token name.

Parameters

  • value (string; hex; required): a token name.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getassetissuebyname' \
-H 'Content-Type: application/json' \
-d '{
    "value": "44756354616E"
}'

/walletsolidity/getassetissuelistbyname

Retrieves the list of tokens by name.

Parameters

  • value (string; hex; required): a token name.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getassetissuelistbyname' \
-H 'Content-Type: application/json' \
-d '{
    "value": "44756354616E"
}'

/walletsolidity/getassetissuebyid

Retrieves a token by token ID.

Parameters

  • value (string; required): a token ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getassetissuebyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "1000001"
}'

Response example

{
    "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa",
    "name": "53454544",
    "abbr": "53454544",
    "total_supply": 100000000000,
    "trx_num": 1000000,
    "num": 1,
    "start_time": 1529987043000,
    "end_time": 1530342060000,
    "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e",
    "url": "687474703a2f2f7777772e736573616d65736565642e6f7267",
    "id": "1000001"
}

/walletsolidity/getnowblock

Retrieves the latest block information.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/walletsolidity/getnowblock'

Response example

{
    "blockID": "0000000002fa7ad50ad1632efffc6f8376488681897834ac17bdf137e961b5f3",
    "block_header": {
        "raw_data": {
            "number": 49969877,
            "txTrieRoot": "9fb478348a2f48bd15eb5cff7d6b6a3845e7014a444125981e41c761c05c8898",
            "witness_address": "411761716b76c6a3d885299c366826046c09b08d26",
            "parentHash": "0000000002fa7ad442c90c1be8ab67467e1940017258cb28496bcafe7bcb1bbd",
            "version": 27,
            "timestamp": 1680522399000
        },
        "witness_signature": "50243f8d127f417f407e1df845c77bdf600d33d155cbcebe82b6b6903b8e74492c1bfabbf7be683ff0a20f9ce22565f9e6fe05c4202bb950e0390d4bbc38f7f301"
    },
    "transactions": [
        {
            "ret": [
                {
                    "contractRet": "SUCCESS"
                }
            ],
            "signature": [
                "8939604c6e12c894a5c45abca9337121f172281522227b51a78ddeaf3105c6a959378ef0d7541473ae15b28ee6c744525552577cac04d4ec0a48925e69a2f1ca00"
            ],
            "txID": "e8a35f80078d8e7f562d7b19c91102388d400029f9454d90d4b638bf6094621e",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "data": "a9059cbb000000000000000000000000149e4be8e140208f5640814249406404f475fb1700000000000000000000000000000000000000000000000000000000097a25c0",
                                "owner_address": "41cebabc6a66da33d2135f11207d6ab88b82829813",
                                "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
                            },
                            "type_url": "type.googleapis.com/protocol.TriggerSmartContract"
                        },
                        "type": "TriggerSmartContract"
                    }
                ],
                "ref_block_bytes": "7ac2",
                "ref_block_hash": "182e27a1484a4f66",
                "expiration": 1680533174894,
                "fee_limit": 30000000,
                "timestamp": 1680522374779
            },
            "raw_data_hex": "0a027ac22208182e27a1484a4f6640eef4d4bcf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541cebabc6a66da33d2135f11207d6ab88b82829813121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb000000000000000000000000149e4be8e140208f5640814249406404f475fb1700000000000000000000000000000000000000000000000000000000097a25c070fbdcc1b7f43090018087a70e"
        }
    ]
}

/walletsolidity/getblockbynum

Retrieves a block information by block height.

Parameters

  • num (integer; required): block height.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getblockbynum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 49970163
}'

Response example

{
    "blockID": "0000000002fa7bf3d33e148bbe2b498de606277c331d94432f07e449f76b3772",
    "block_header": {
        "raw_data": {
            "number": 49970163,
            "txTrieRoot": "cf8aa2f25d944b1f9ed76943447e5f628e583bc857fba96360eb57b00483a2c1",
            "witness_address": "41beab998551416b02f6721129bb01b51fceceba08",
            "parentHash": "0000000002fa7bf20d335ed60354f75054deab764811d0f461bb04970fb16318",
            "version": 27,
            "timestamp": 1680523263000
        },
        "witness_signature": "afd69d8ce7fc5418af3b090ee2e47ec57f072403bff6b60f51fa52bd4c27647b6f488a3aeaea140776d7cf35d4bb10570067b3155f069ab67591d6394f91d41000"
    },
    "transactions": [
        {
            "ret": [
                {
                    "contractRet": "SUCCESS"
                }
            ],
            "signature": [
                "a08d1900639be505601be4d2187957abf8f21c9e650c56e8d863aa3392bdfae646069b56e963dcb4da6c9408103e24a0a517db34c62b7ff8ea30db2eda51c0ef00"
            ],
            "txID": "9c22bdf305f1cebc2bebbdfa854ec1cf1bea5dd9e6fd7dca408d871b993f6b10",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "amount": 5,
                                "owner_address": "41e6443f26ecd0595895ec12a581e1f5775a6776ae",
                                "to_address": "4179715c1c95034e146ac451363f8aa68a8ccdb462"
                            },
                            "type_url": "type.googleapis.com/protocol.TransferContract"
                        },
                        "type": "TransferContract"
                    }
                ],
                "ref_block_bytes": "7bdf",
                "ref_block_hash": "dfaa0a7cf8e86900",
                "expiration": 1680523317000,
                "timestamp": 1680523259702
            },
            "raw_data_hex": "0a027bdf2208dfaa0a7cf8e8690040889efbb7f4305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541e6443f26ecd0595895ec12a581e1f5775a6776ae12154179715c1c95034e146ac451363f8aa68a8ccdb462180570b6def7b7f430"
        }
    ]
}

/walletsolidity/gettransactionbyid

Retrieves transaction information by transaction ID.

Parameters

  • value (string; required): a transaction ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/gettransactionbyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "041ad82f1aa2628441c4aff5eb6052fb5010d8610dc87927ccc4f66c992373da"
}'

Response example

{
    "ret": [
        {
            "contractRet": "SUCCESS"
        }
    ],
    "signature": [
        "2caaa0c1dfd6e6ec87c6a00ade1fb287047737759b0aaba56bc03af7a9204f2b5f3deecbb58b3b8f66fe2fe6a1fc6c9d720ee7827c04bd67f450f4a094a31f2901"
    ],
    "txID": "041ad82f1aa2628441c4aff5eb6052fb5010d8610dc87927ccc4f66c992373da",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "amount": 5,
                        "owner_address": "415da7530953c34dfe4581d088e1d5bec80b295960",
                        "to_address": "41ea46e0b8c0bf2d8400941188db659b7fb69ab4f4"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                },
                "type": "TransferContract"
            }
        ],
        "ref_block_bytes": "7dab",
        "ref_block_hash": "3eb7d8144eff0a3f",
        "expiration": 1680524697000,
        "timestamp": 1680524638448
    },
    "raw_data_hex": "0a027dab22083eb7d8144eff0a3f40a8bbcfb8f4305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a15415da7530953c34dfe4581d088e1d5bec80b295960121541ea46e0b8c0bf2d8400941188db659b7fb69ab4f4180570f0f1cbb8f430"
}

/walletsolidity/gettransactioncountbyblocknum

Retrieves the number of transactions in a specific block.

Parameters

  • num (integer; required): block height.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/gettransactioncountbyblocknum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 49970622
}'

Response example

{
    "count": 277
}

/walletsolidity/gettransactioninfobyblocknum

Retrieves the list of transaction information in a specific block.

Parameters

  • num (integer; required): block height.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/gettransactioninfobyblocknum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 49970749
}'

Response example

[
    {
        "log": [
            {
                "address": "a614f803b6fd780986a42c78ec9c7f77e6ded13c",
                "data": "00000000000000000000000000000000000000000000000000000000603d7380",
                "topics": [
                    "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                    "000000000000000000000000f49dfc8143deb347b7724aef0e1f5d3c22a0035f",
                    "000000000000000000000000a05367c1538d48e2491ba3094c2e68b2e076284c"
                ]
            }
        ],
        "blockNumber": 49970749,
        "contractResult": [
            "0000000000000000000000000000000000000000000000000000000000000000"
        ],
        "blockTimeStamp": 1680525021000,
        "receipt": {
            "result": "SUCCESS",
            "energy_penalty_total": 17245,
            "energy_usage": 31895,
            "energy_usage_total": 31895,
            "net_usage": 345
        },
        "id": "578bd80976b42a50468c400fa59d6472295bb740a9d7ce3667616fa40d7f090b",
        "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
    },
    {
        "blockNumber": 49970749,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680525021000,
        "receipt": {
            "net_usage": 269
        },
        "id": "110d40b1ab398933dd0981b6dfffc634c3e7b04b2c2b14c889979f009f5b5c11"
    }
]

/walletsolidity/gettransactioninfobyid

Retrieves the transaction fee and block height by transaction ID.

Parameters

  • value (string; required): a transaction ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/gettransactioninfobyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "4267b26e1b8ef4d105bc86184df10fbdeafec64964ea18878e61bde8a27481e0"
}'

Response example

{
    "id": "4267b26e1b8ef4d105bc86184df10fbdeafec64964ea18878e61bde8a27481e0",
    "blockNumber": 49971209,
    "blockTimeStamp": 1680526401000,
    "contractResult": [
        ""
    ],
    "receipt": {
        "net_usage": 268
    }
}

/walletsolidity/getdelegatedresource

Retrieves the energy delegation information.

Parameters

  • fromAddress (string; hex; required): a sender address.
  • toAddress (string; hex; required): a receiver address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getdelegatedresource' \
-H 'Content-Type: application/json' \
-d '{
    "fromAddress": "41ca6a85e52ddf7ea4b52ead38b479180b2d6347af",
    "toAddress": "41085ae1e02fae8af2b83a5c4c4d0f6246d3b5821e"
}'

Response example

{
    "delegatedResource": [
        {
            "from": "41ca6a85e52ddf7ea4b52ead38b479180b2d6347af",
            "to": "41085ae1e02fae8af2b83a5c4c4d0f6246d3b5821e",
            "frozen_balance_for_energy": 1883000000,
            "expire_time_for_energy": 1680786519000
        }
    ]
}

/walletsolidity/getdelegatedresourceaccountindex

Retrieves the energy delegation index by an account.

Parameters

  • value (string; hex; required): an address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getdelegatedresourceaccountindex' \
-H 'Content-Type: application/json' \
-d '{
    "value": "419844f7600e018fd0d710e2145351d607b3316ce9"
}'

/walletsolidity/getexchangebyid

Retrieves an exchange pair by exchange pair ID.

Parameters

  • id (integer; required): an exchange pair ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getexchangebyid' \
-H 'Content-Type: application/json' \
-d '{
    "id": 1
}'

Response example

{
    "exchange_id": 1,
    "creator_address": "41f596e85bfd042744f76880979a133da0728679d9",
    "create_time": 1539673398000,
    "first_token_id": "31303030353634",
    "first_token_balance": 5,
    "second_token_id": "5f",
    "second_token_balance": 4326459
}

/walletsolidity/listexchanges

Retrieves the list of all exchange pairs.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/walletsolidity/listexchanges'

Response example

{
    "exchanges": [
        {
            "exchange_id": 184,
            "creator_address": "4165b29b92cb5f33342647c4cc32b6efcb59eb3f45",
            "create_time": 1615538445000,
            "first_token_id": "31303033333934",
            "first_token_balance": 100000000000000,
            "second_token_id": "31303032393232",
            "second_token_balance": 1341470000000
        },
        {
            "exchange_id": 183,
            "creator_address": "41f55075d3c88b65d65e0f4cb19881182adce446b8",
            "create_time": 1602234009000,
            "first_token_id": "31303032373537",
            "second_token_id": "5f"
        },
        {
            "exchange_id": 182,
            "creator_address": "41d4af469119bab46909222e77e277c655f0de9054",
            "create_time": 1600277286000,
            "first_token_id": "31303033333031",
            "first_token_balance": 115545377,
            "second_token_id": "31303032303030",
            "second_token_balance": 86546095
        },
        {
            "exchange_id": 181,
            "creator_address": "41d4af469119bab46909222e77e277c655f0de9054",
            "create_time": 1600208667000,
            "first_token_id": "5f",
            "first_token_balance": 37777779,
            "second_token_id": "31303033333031",
            "second_token_balance": 66176472
        }
    ]
}

/walletsolidity/getaccountbyid

Retrieves an account information by account ID.

Parameters

  • account_id (string; hex; required): an account ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getaccountbyid' \
-H 'Content-Type: application/json' \
-d '{
    "account_id": "41712d3993327b916c33eea0c3e8ea3eab592e88da"
}'

/walletsolidity/getblockbyid

Retrieves block information by block ID.

Parameters

  • value (string; required): a block ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getblockbyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "0000000002fa856df555c6441cf755a551b131a5ca8d84f116dc59c042ef18fa"
}'

Response example

{
    "blockID": "0000000002fa856df555c6441cf755a551b131a5ca8d84f116dc59c042ef18fa",
    "block_header": {
        "raw_data": {
            "number": 49972589,
            "txTrieRoot": "354bd442f2111081081826ae638a0d07422609aeea8dc63c3ad208088525567e",
            "witness_address": "41022939a4a06cbc7b384096c1af8657ec435173af",
            "parentHash": "0000000002fa856c18e27615c5ea553ff7c8318059b555801f329e9533dec810",
            "version": 27,
            "timestamp": 1680530541000
        },
        "witness_signature": "aad4536d655327bcb64a0046f69fc2fa5be5dfc2f76e391736c1bf7e0a96c08c0498a3b5aae821360ffa2a2b1797731a06e02fa9fd314a3d3c23a4eda0301fe501"
    },
    "transactions": [
        {
            "ret": [
                {
                    "contractRet": "SUCCESS"
                }
            ],
            "signature": [
                "c3c631c6d079838166807e67dbf2c734dec6f30cd981066c44758dcd1f4fe1e835d035e7f60501ea9bf42fdd0a54f8592771714c66a4f2a581c2b3d7c3f9d43f01"
            ],
            "txID": "eb337d551043fc90e2f3cbd4ad8a2a61f0e3496e0662114628f0f2ff8a231bb0",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "data": "a9059cbb000000000000000000000000b034574a3a36a2e8c77d7d187facf91b8c3dd80300000000000000000000000000000000000000000000000000000000177bf680",
                                "owner_address": "418695dfd9b3e39cb574fa3893372fa3c6e329320c",
                                "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
                            },
                            "type_url": "type.googleapis.com/protocol.TriggerSmartContract"
                        },
                        "type": "TriggerSmartContract"
                    }
                ],
                "ref_block_bytes": "8559",
                "ref_block_hash": "537fd1c2c65c4c31",
                "expiration": 1680530795000,
                "fee_limit": 100000000,
                "timestamp": 1680530537504
            },
            "raw_data_hex": "0a0285592208537fd1c2c65c4c3140f8d3c3bbf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a15418695dfd9b3e39cb574fa3893372fa3c6e329320c121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb000000000000000000000000b034574a3a36a2e8c77d7d187facf91b8c3dd80300000000000000000000000000000000000000000000000000000000177bf68070a0f8b3bbf430900180c2d72f"
        }
    ]
}

/walletsolidity/getblockbylimitnext

Retrieves a list of blocks by range.

Parameters

  • startNum (integer; required): the block height to start from (included in the range).
  • endNum (integer; required): the block height to end with (excluded from the range).

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getblockbylimitnext' \
-H 'Content-Type: application/json' \
-d '{
    "startNum": 1,
    "endNum": 2
}'

Response example

{
    "block": [
        {
            "blockID": "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247",
            "block_header": {
                "raw_data": {
                    "number": 1,
                    "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000",
                    "witness_address": "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2",
                    "parentHash": "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc",
                    "timestamp": 1529891469000
                },
                "witness_signature": "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00"
            }
        }
    ]
}

/walletsolidity/getblockbylatestnum

Retrieves several latest blocks.

Parameters

  • num (integer; required): the number of blocks to return.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getblockbylatestnum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 1
}'

Response example

{
    "block": [
        {
            "blockID": "0000000002fa889448bff265ae132d3ce3a61c02f5f2f3a8307df772014e2f66",
            "block_header": {
                "raw_data": {
                    "number": 49973396,
                    "txTrieRoot": "1c530d753117305b7ffdca38f6087dc4f5f2cf3f18f46f03f9353be6df733f32",
                    "witness_address": "418440ffd578f7a5abf3537b5f46a6980d382db581",
                    "parentHash": "0000000002fa88938e671ca492f416843f3d8e69ec12f0750955f72cf11604f1",
                    "version": 27,
                    "timestamp": 1680532962000
                },
                "witness_signature": "f2d71f8b28afc21f71c5a2e80a815cfe6f7cc6f56f8059cbb3d0dfed6ad36826299956284650041ca06aaae7f45657f2e2ed8363b9a6eb999d6c6207fa7a830400"
            },
            "transactions": [
                {
                    "ret": [
                        {
                            "contractRet": "SUCCESS"
                        }
                    ],
                    "signature": [
                        "f072741d74c3d637b7f2070be99a8362383e119e08f00db5de31d025fee4cf817cc9f5551479bfb0ad9cf056cb76a76192ddd293ea67096aa94cb129cdc455be01"
                    ],
                    "txID": "929a0c3976c4fc26b3b8a5d922ec5fc1bf3685a0cd7e303d50d3c394120e1ffb",
                    "raw_data": {
                        "contract": [
                            {
                                "parameter": {
                                    "value": {
                                        "data": "a9059cbb00000000000000000000004133751dd8f732e5c0f7c32eb247b524cb3f0b17b0000000000000000000000000000000000000000000000000000000000606f800",
                                        "owner_address": "41d1c4bb7b2f39aba5707711719b2236b5b605af2e",
                                        "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
                                    },
                                    "type_url": "type.googleapis.com/protocol.TriggerSmartContract"
                                },
                                "type": "TriggerSmartContract"
                            }
                        ],
                        "ref_block_bytes": "8880",
                        "ref_block_hash": "24c789571ad256f0",
                        "expiration": 1680533018597,
                        "fee_limit": 30000000,
                        "timestamp": 1680532902000
                    },
                    "raw_data_hex": "0a028880220824c789571ad256f040e5afcbbcf4305aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541d1c4bb7b2f39aba5707711719b2236b5b605af2e121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb00000000000000000000004133751dd8f732e5c0f7c32eb247b524cb3f0b17b0000000000000000000000000000000000000000000000000000000000606f80070f0a0c4bcf43090018087a70e"
                }
            ]
        }
    ]
}

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getdeferredtransactionbyid (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getdeferredtransactioninfobyid (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/getmerkletreevoucherinfo (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/scannotebyivk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/scanandmarknotebyivk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/scannotebyovk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/isspend (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/walletsolidity/scanshieldedtrc20notesbyivk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

FullNode API:

wallet/createtransaction

Creates a transfer transaction.

If to_address doesn't exist, creates an account on the blockchain.

Parameters

  • to_address (string; hex; required): a destination address.
  • owner_address (string; hex; required): a sender address.
  • amount (integer; required): a transfer amount.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/createtransaction' \
-H 'Content-Type: application/json' \
-d '{
    "to_address": "41e9d79cc47518930bc322d9bf7cddd260a0260a8d",
    "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292",
    "amount": 1000
}'

wallet/broadcasttransaction

Broadcasts a transaction after signing.

Parameters

A transaction after signing, containing signature, txID, raw_data

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/broadcasttransaction' \
-H 'Content-Type: application/json' \
-d '{
    "signature": [
        "97c825b41c77de2a8bd65b3df55cd4c0df59c307c0187e42321dcc1cc455ddba583dd9502e17cfec5945b34cad0511985a6165999092a6dec84c2bdd97e649fc01"
    ],
    "txID": "454f156bf1256587ff6ccdbc56e64ad0c51e4f8efea5490dcbc720ee606bc7b8",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "amount": 1000,
                        "owner_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
                        "to_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                },
                "type": "TransferContract"
            }
        ],
        "ref_block_bytes": "267e",
        "ref_block_hash": "9a447d222e8de9f2",
        "expiration": 1530893064000,
        "timestamp": 1530893006233
    }
}'

wallet/broadcasthex

Broadcasts a transaction hex string after signing.

Parameters

  • transaction (string; hex; required): a transaction hex after signing.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/broadcasthex' \
-H 'Content-Type: application/json' \
-d '{
    "transaction": "0A8A010A0202DB2208C89D4811359A28004098A4E0A6B52D5A730802126F0A32747970652E676F6F676C65617069732E636F6D2F70726F746F636F6C2E5472616E736665724173736574436F6E747261637412390A07313030303030311215415A523B449890854C8FC460AB602DF9F31FE4293F1A15416B0580DA195542DDABE288FEC436C7D5AF769D24206412418BF3F2E492ED443607910EA9EF0A7EF79728DAAAAC0EE2BA6CB87DA38366DF9AC4ADE54B2912C1DEB0EE6666B86A07A6C7DF68F1F9DA171EEE6A370B3CA9CBBB00"
}'

Response example

{
    "result": false,
    "code": "SIGERROR",
    "txid": "38a0482d6d5a7d1439a50b848d68cafa7d904db48b82344f28765067a5773e1d",
    "message": "Validate signature error: 8bf3f2e492ed443607910ea9ef0a7ef79728daaaac0ee2ba6cb87da38366df9ac4ade54b2912c1deb0ee6666b86a07a6c7df68f1f9da171eee6a370b3ca9cbbb00 is signed by TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW but it is not contained of permission.",
    "transaction": "{\"raw_data\": {\"ref_block_bytes\": \"02db\",\"ref_block_hash\": \"c89d4811359a2800\",\"expiration\": 1560496575000,\"contract\": [{\"type\": \"TransferAssetContract\",\"parameter\": {\"type_url\": \"type.googleapis.com/protocol.TransferAssetContract\",\"value\": \"0a07313030303030311215415a523b449890854c8fc460ab602df9f31fe4293f1a15416b0580da195542ddabe288fec436c7d5af769d242064\"}}]},\"signature\": [\"8bf3f2e492ed443607910ea9ef0a7ef79728daaaac0ee2ba6cb87da38366df9ac4ade54b2912c1deb0ee6666b86a07a6c7df68f1f9da171eee6a370b3ca9cbbb00\"]}"
}

wallet/updateaccount

Updates the name of an account.

Parameters

  • account_name (string; hex; required): an account name.
  • owner_address (string; hex; required): an owner address.
  • permission_id (string; optional): for multi-sig use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/updateaccount' \
-H 'Content-Type: application/json' \
-d '{
    "account_name": "0x7570646174654e616d6531353330383933343635353139",
    "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292"
}'

Response example

{
    "visible": false,
    "txID": "5814a0c0b25f3cc8926f56b4742f4b7b32979f7c6c2dc240fcfd7bc3061de3a5",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "account_name": "7570646174654e616d6531353330383933343635353139",
                        "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292"
                    },
                    "type_url": "type.googleapis.com/protocol.AccountUpdateContract"
                },
                "type": "AccountUpdateContract"
            }
        ],
        "ref_block_bytes": "cd8f",
        "ref_block_hash": "4441a3e65f66075c",
        "expiration": 1680586065000,
        "timestamp": 1680586007964
    },
    "raw_data_hex": "0a02cd8f22084441a3e65f66075c40e888f1d5f4305a6a080a12660a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74557064617465436f6e747261637412300a177570646174654e616d6531353330383933343635353139121541d1e7a6bc354106cb410e65ff8b181c600ff14292709ccbedd5f430"
}

wallet/votewitnessaccount

Votes for witnesses.

Parameters

  • owner_address (string; hex; required): an owner address.
  • votes (array of key-value pairs): your votes description.
    • vote_address (string; hex; required): the address of the witness you want to vote for.
    • vote_count (integer; required): the number of votes you'd like to give.
  • permission_id (integer; optional): for multi-sig use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/votewitnessaccount' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
    "votes": [
        {
            "vote_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
            "vote_count": 5
        }
    ]
}'

wallet/getBrokerage

Retrieves the ratio of brokerage of the witness.

Parameters

  • address (string; hex; required): the address of the witness's account.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getBrokerage' \
-H 'Content-Type: application/json' \
-d '{
    "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0"
}'

Response example

{
    "brokerage": 20
}

wallet/getReward

Retrieves unclaimed reward.

Parameters

  • address (string; hex; required): the address of the voter's account.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getReward' \
-H 'Content-Type: application/json' \
-d '{
    "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0"
}'

Response example

{
    "reward": 0
}

wallet/updateBrokerage

Updates the ratio of brokerage.

Parameters

  • owner_address (string; hex; required): the address of the witness's account.
  • brokerage (integer; required): the ration of the brokerage you'd like to update to.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/updateBrokerage' \
-H 'Content-Type: application/json' \
-d '{
  "owner_address":"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0",
  "brokerage":30
}'

wallet/getaccountbalance

Retrieves the account balance in a specific block.

Parameters

  • account_identifier (required): an identifier of the account:
    • address (string; hex; required): an account address.
  • block_identifier (required): an identifier of the block:
    • hash (string; hex; required): a block hash.
    • number (integer): a block number.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getaccountbalance' \
-H 'Content-Type: application/json' \
-d '{
    "account_identifier": {
        "address": "TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm"
    },
    "block_identifier": {
        "hash": "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9",
        "number": 68682
    },
    "visible": true
}'

Response example

{
    "balance": 0,
    "block_identifier": {
        "hash": "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9",
        "number": 68682
    }
}

wallet/createassetissue

Issues a token.

Parameters

  • owner_address (string; hex; required): an owner address.
  • name (string; hex; required): a token name.
  • abbr (string; hex; required): a token name abbreviation.
  • total_supply (integer; required): token total supply.
  • trx_num (integer; required): defines the price by the ratio of trx_num/num.
  • num (integer; required): defines the price by the ratio of trx_num/num.
  • start_time (integer; required): ICO start time.
  • end_time (integer; required): ICO end time.
  • description (string; hex; required): a token description.
  • url (string; hex; required): a token's official website URL.
  • free_asset_net_limit (integer; required): a token's free asset net limit.
  • public_free_asset_net_limit (integer; required): a token's public asset net limit.
  • frozen_supply (object: required): token staked supply:
    • frozen_amount (integer; required): the amount staked.
    • frozen_days (integer; required): the number of days.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/createassetissue' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
    "name": "0x6173736574497373756531353330383934333132313538",
    "abbr": "0x6162627231353330383934333132313538",
    "total_supply": 4321,
    "trx_num": 1,
    "num": 1,
    "start_time": 1530894315158,
    "end_time": 1533894312158,
    "description": "007570646174654e616d6531353330363038383733343633",
    "url": "007570646174654e616d6531353330363038383733343633",
    "free_asset_net_limit": 10000,
    "public_free_asset_net_limit": 10000,
    "frozen_supply": {
        "frozen_amount": 1,
        "frozen_days": 2
    }
}'

wallet/updatewitness

Updates the witness's website URL.

Parameters

  • owner_address (string; hex; required): an owner address.
  • update_url (string; hex; required): a website URL.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/updatewitness' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
    "update_url": "007570646174654e616d6531353330363038383733343633"
}'

wallet/createaccount

Creates an account.

Parameters

  • owner_address (string; hex; required): an owner address.
  • account_address (string; hex; required): a new address.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/createaccount' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
    "account_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0"
}'

wallet/createwitness

Applies to become a witness.

Parameters

  • owner_address (string; hex; required): an owner address.
  • url (string; hex; required): a website URL.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/createwitness' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
    "url": "007570646174654e616d6531353330363038383733343633"
}'

wallet/transferasset

Transfers a token.

Parameters

  • owner_address (string; hex; required): an owner address.
  • to_address (string; hex; required): a destination address.
  • asset_name (string; hex; required): a token ID.
  • amount (integer; required): a token transfer amount.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/transferasset' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
    "to_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
    "asset_name": "31303030303031",
    "amount": 100
}'

wallet/participateassetissue

Participates a token.

Returns a transaction object.

Parameters

  • to_address (string; hex; required): the issuer address of the token.
  • owner_address (string; hex; required): the participant address.
  • amount (integer; required): a participate token amount.
  • asset_name (string; hex; required): a token ID.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/participateassetissue' \
-H 'Content-Type: application/json' \
-d '{
    "to_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0",
    "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1",
    "amount": 100,
    "asset_name": "3230313271756265696a696e67"
}'

wallet/freezebalance

Stakes TRX.

Parameters

  • owner_address (string; hex; required): an owner address.
  • frozen_balance (integer; required): a TRX stake amount.
  • frozen_duration (integer; required): TRX stake duration, at least 3 days.
  • resource (string; required): TRX stake type (BANDWIDTH/ENERGY).
  • receiver_address (string; hex; required): the address to receive the resource.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/freezebalance' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1",
    "frozen_balance": 10000,
    "frozen_duration": 3,
    "resource": "BANDWIDTH",
    "receiver_address": "414332f387585c2b58bc2c9bb4492bc1f17342cd1"
}'

wallet/unfreezebalance

Unstakes the staked TRX that is due.

Parameters

  • owner_address (string; hex; required): an owner address.
  • resource (string; required): staked TRX unstake type (BANDWIDTH/ENERGY).
  • receiver_address (string; hex; required): the address to lose the resource.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/unfreezebalance' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1",
    "resource": "BANDWIDTH",
    "receiver_address": "414332f387585c2b58bc2c9bb4492bc1f17342cd1"
}'

wallet/unfreezeasset

Unstakes the staked token that is due.

Parameters

  • owner_address (string; hex; required): an owner address.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/unfreezeasset' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1"
}'

wallet/withdrawbalance

Withdraws a reward to an account balance for witnesses.

Parameters

  • owner_address (string; hex; required): an owner address.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/withdrawbalance' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1"
}'

wallet/updateasset

Updates token information.

Parameters

  • owner_address (string; hex; required): an owner address.
  • description (string; hex; required): a token description.
  • url (string; hex): the token's website URL.
  • new_limit (integer; required): each token holder's free bandwidth.
  • new_public_limit (integer; required): the total free bandwidth of the token.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/updateasset' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41e472f387585c2b58bc2c9bb4492bc1f17342cd1",
    "description": "",
    "url": "",
    "new_limit": 1000000,
    "new_public_limit": 100
}'

wallet/getassetissuebyaccount

Retrieves the token issue information of an account.

Parameters

  • address (string; hex; required): a token issuer's address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getassetissuebyaccount' \
-H 'Content-Type: application/json' \
-d '{
    "address": "41F9395ED64A6E1D4ED37CD17C75A1D247223CAF2D"
}'

wallet/getaccountnet

Retrieves the bandwidth information of an account.

Parameters

  • address (string; hex; required): an account address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getaccountnet' \
-H 'Content-Type: application/json' \
-d '{
    "address": "4112E621D5577311998708F4D7B9F71F86DAE138B5"
}'

Response example

{
    "freeNetLimit": 1500,
    "assetNetUsed": [
        {
            "key": "1000532",
            "value": 0
        },
        {
            "key": "1002962",
            "value": 0
        },
        {
            "key": "1002775",
            "value": 0
        },
        {
            "key": "1002573",
            "value": 0
        },
        {
            "key": "1003049",
            "value": 0
        },
        {
            "key": "1001871",
            "value": 0
        },
        {
            "key": "1002927",
            "value": 0
        },
        {
            "key": "1002636",
            "value": 0
        }
    ],
    "assetNetLimit": [
        {
            "key": "1000532",
            "value": 0
        },
        {
            "key": "1002962",
            "value": 0
        }
    ],
    "TotalNetLimit": 43200000000,
    "TotalNetWeight": 39127812682
}

wallet/getassetissuebyname

Retrieves a token by token name.

If the token name you query is not unique, this api will return an error.

Parameters

  • value (string; hex; required): a token name.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getassetissuebyname' \
-H 'Content-Type: application/json' \
-d '{
    "value": "44756354616E"
}'

wallet/getassetissuelistbyname

Retrieves the list of tokens by name.

Parameters

  • value (string; hex; required): a token name.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getassetissuelistbyname' \
-H 'Content-Type: application/json' \
-d '{
    "value": "44756354616E"
}'

wallet/getassetissuebyid

Retrieves a token by token ID.

Parameters

  • value (string; hex; required): a token ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getassetissuebyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "1000001"
}'

Response example

{
    "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa",
    "name": "53454544",
    "abbr": "53454544",
    "total_supply": 100000000000,
    "trx_num": 1000000,
    "num": 1,
    "start_time": 1529987043000,
    "end_time": 1530342060000,
    "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e",
    "url": "687474703a2f2f7777772e736573616d65736565642e6f7267",
    "id": "1000001"
}

wallet/getnowblock

Retrieves the latest block information.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/getnowblock'

Response example

{
    "blockID": "0000000002fae045b2c5caae3229fa17f2b9b00c603d19f535581f1ae934d63c",
    "block_header": {
        "raw_data": {
            "number": 49995845,
            "txTrieRoot": "3c06f5e0afe80d8eebf9bc4c019df67c72a4be68d609f69dc1d14147b7aabe02",
            "witness_address": "41d376d829440505ea13c9d1c455317d51b62e4ab6",
            "parentHash": "0000000002fae044905f37c65c913d5eac3ceaed495131f13aa657f7f336efe2",
            "version": 27,
            "timestamp": 1680600327000
        },
        "witness_signature": "01f4d3e47766bd5f763cf53520b0832add1743560a11e43ad1f4f9b1478f494b6c731d5e53096922c00fc5398fbbc68e77e9b5087d064bb33fa1d8685a35bba201"
    },
    "transactions": [
        {
            "ret": [
                {
                    "contractRet": "SUCCESS"
                }
            ],
            "signature": [
                "af028c602ab25e6b701ce5266810d6353e6d7642cf6eb3630554b9e3c09da1e5763f386cc91b726f9fcbbe0a356ba295902397fb9e1d99079be816c2a9775cc701"
            ],
            "txID": "a0f90e85c0969407e8a02a8c25fd752e6a84c42230f05c71f0d07d23be68102d",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "amount": 2500000000,
                                "owner_address": "4159f33c7dcdfb016f14e38f28a3e6ece9ade61c3a",
                                "to_address": "4158c708263724a4b52701f80f63a0c314153317ed"
                            },
                            "type_url": "type.googleapis.com/protocol.TransferContract"
                        },
                        "type": "TransferContract"
                    }
                ],
                "ref_block_bytes": "e030",
                "ref_block_hash": "b977ba00ada6335d",
                "expiration": 1680600499747,
                "timestamp": 1680600319747
            },
            "raw_data_hex": "0a02e0302208b977ba00ada6335d40a38ce2dcf4305a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a154159f33c7dcdfb016f14e38f28a3e6ece9ade61c3a12154158c708263724a4b52701f80f63a0c314153317ed1880f28ba80970838ed7dcf430"
        }
    ]
}

wallet/getblockbynum

Retrieves block information by block height.

Parameters

  • num (integer; required): a block height.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getblockbynum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 1
}'

Response example

{
    "blockID": "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247",
    "block_header": {
        "raw_data": {
            "number": 1,
            "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000",
            "witness_address": "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2",
            "parentHash": "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc",
            "timestamp": 1529891469000
        },
        "witness_signature": "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00"
    }
}

wallet/getblockbyid

Retrieves a block information by block ID.

Parameters

  • value (string; hex; required): a block ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getblockbyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "0000000002fac94622cce188d5cf0fe3e7d9c27e5a01bdf9356b7ef35eeab160"
}'

Response example

{
    "blockID": "0000000002fac94622cce188d5cf0fe3e7d9c27e5a01bdf9356b7ef35eeab160",
    "block_header": {
        "raw_data": {
            "number": 49989958,
            "txTrieRoot": "05f50bb51b90efe53d2d9c6df915c679df083d34c30055a2fc87419980f246f6",
            "witness_address": "4178c842ee63b253f8f0d2955bbc582c661a078c9d",
            "parentHash": "0000000002fac9457ebb855883515d42995029edb217a405aa47aadd8252b6d1",
            "version": 27,
            "timestamp": 1680582660000
        },
        "witness_signature": "b973f3bfd45138beffbdcad06277886ade7941eefec2aebf5dc8061547c5846255dcb4b2316839b33f574ffe2c301d04c2c27f12a941faf3747b8c2dca325c1f01"
    },
    "transactions": [
        {
            "ret": [
                {
                    "contractRet": "SUCCESS"
                }
            ],
            "signature": [
                "76b8a945442917034f7cfb2f6eed70c3f4e37f1ca396221bea0edf991cef8c8c7d8b93c944e6da2f76a4550d25eb64ffecb49b7617fc166398d566dfe9b1e80800"
            ],
            "txID": "4caa8909391afd3dfb28a3d332e735f3cdcddf1d4081ede54f82d9de208a85b9",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "amount": 300000000,
                                "owner_address": "413c6120b82a61d0e0bb0c4d4ebfae56cb664ba5a6",
                                "to_address": "411ba55baf1e61fa22907822730ebfe7a5cf573ad5"
                            },
                            "type_url": "type.googleapis.com/protocol.TransferContract"
                        },
                        "type": "TransferContract"
                    }
                ],
                "ref_block_bytes": "c932",
                "ref_block_hash": "6a781a380ccdd036",
                "expiration": 1680582714000,
                "timestamp": 1680582656449
            },
            "raw_data_hex": "0a02c93222086a781a380ccdd0364090c5a4d4f4305a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a15413c6120b82a61d0e0bb0c4d4ebfae56cb664ba5a61215411ba55baf1e61fa22907822730ebfe7a5cf573ad51880c6868f0170c183a1d4f430"
        }
    ]
}

wallet/getblockbylimitnext

Retrieves a list of blocks by range.

Parameters

  • startNum (integer; required): the block height to start with (included in the range).
  • endNum (integer; required): the block height to end by (excluded from the range)

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getblockbylimitnext' \
-H 'Content-Type: application/json' \
-d '{
    "startNum": 1,
    "endNum": 2
}'

Response example

{
    "block": [
        {
            "blockID": "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247",
            "block_header": {
                "raw_data": {
                    "number": 1,
                    "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000",
                    "witness_address": "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2",
                    "parentHash": "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc",
                    "timestamp": 1529891469000
                },
                "witness_signature": "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00"
            }
        }
    ]
}

wallet/getblockbylatestnum

Retrieves several latest blocks.

Parameters

  • num (integer; required): the number of blocks to retrieve.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getblockbylatestnum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 2
}'

Response example

{
    "block": [
        {
            "blockID": "0000000002fae13af77e3d41a08627787aac6d6b14b35a6a0f61d2f6406a6786",
            "block_header": {
                "raw_data": {
                    "number": 49996090,
                    "txTrieRoot": "8d3996515f1a5920b10654086f36bcf0f530884da714ed1c615199ad1cb51802",
                    "witness_address": "4167e39013be3cdd3814bed152d7439fb5b6791409",
                    "parentHash": "0000000002fae139af04335a42dcd2634f64a74b6f50eaabb7d7d4da3c6034f9",
                    "version": 27,
                    "timestamp": 1680601062000
                },
                "witness_signature": "999930eb33440390207ef38a1c5bc2dfe58f5b4daa6999a7da5f1befdace72e3046ee3d7546fc09df68af22e71f126f9f1a247cb1b9bded32651558b6d3ad2e801"
            },
            "transactions": [
                {
                    "ret": [
                        {
                            "contractRet": "SUCCESS"
                        }
                    ],
                    "signature": [
                        "6830537a8b58835a7d1b1f97821e4adb16e8c508de08cc1a50408818593c84d972c7ad32cff868cbab506a4f1cf13e4be9eaf9348621f27f4097a53fc05901551b"
                    ],
                    "txID": "6702a31b744e701527f8b412da6430173dbb0e04e6a70341aa4fdc94719b799f",
                    "raw_data": {
                        "contract": [
                            {
                                "parameter": {
                                    "value": {
                                        "amount": 50000000,
                                        "owner_address": "41c0629df9ebfc8f5ec92e576c350afa72ef63ae5e",
                                        "to_address": "4194b0f036660971a160c434d3a021edbd966f524b"
                                    },
                                    "type_url": "type.googleapis.com/protocol.TransferContract"
                                },
                                "type": "TransferContract"
                            }
                        ],
                        "ref_block_bytes": "e125",
                        "ref_block_hash": "f07be41bafac0989",
                        "expiration": 1680601235964,
                        "timestamp": 1680601055964
                    },
                    "raw_data_hex": "0a02e1252208f07be41bafac098940fc838fddf4305a68080112640a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412330a1541c0629df9ebfc8f5ec92e576c350afa72ef63ae5e12154194b0f036660971a160c434d3a021edbd966f524b1880e1eb1770dc8584ddf430"
                }
            ]
        }
    ]
}

wallet/getblockbalance

Retrieves all balance change operations in a block.

Parameters

  • hash (string; hex; required): a block hash (a hash must belong to a block number specified).
  • number (integer; required): a block number.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getblockbalance' \
-H 'Content-Type: application/json' \
-d '{
    "hash": "0000000002fac947605b4fd36f344e00ab9e79568574b74ac7575419e437956a",
    "number": 49989959,
    "visible": true
}'

wallet/gettransactionbyid

Retrieves transaction information by transaction ID.

Parameters

  • value (string; hex; required): a transaction ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/gettransactionbyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2"
}'

wallet/gettransactioninfobyid

Retrieves the transaction fee and block height by transaction ID.

Parameters

  • value (string; hex; required): a transaction ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/gettransactioninfobyid' \
-H 'Content-Type: application/json' \
-d '{
    "value": "309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2"
}'

wallet/gettransactioncountbyblocknum

Retrieves the number of transactions in a specific block.

Parameters

  • num (integer; required): block height.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/gettransactioncountbyblocknum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 49989959
}'

Response example

{
    "count": 309
}

wallet/gettransactioninfobyblocknum

Retrieves the list of transaction information in a specific block.

Parameters

  • num (integer; required): block height.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/gettransactioninfobyblocknum' \
-H 'Content-Type: application/json' \
-d '{
    "num": 49989959
}'

Response example

[
    {
        "blockNumber": 49989959,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680582663000,
        "receipt": {
            "net_usage": 268
        },
        "id": "1dca7ae3d0fc5b73b5bc3ede1d2eb1b63fc128fce39196088a2198ff83fbc5ed"
    },
    {
        "blockNumber": 49989959,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680582663000,
        "receipt": {
            "net_usage": 265
        },
        "id": "04d86b079842247e14cd0c4648e315b78c861eb91abcaf4e022f88155b73f628"
    },
    {
        "blockNumber": 49989959,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680582663000,
        "receipt": {
            "net_usage": 280
        },
        "id": "a1b550fa6681c4afc90f619a2fa4ca26305b09bc964bef5a833123626e451391"
    }
]

wallet/getaccount

Retrieves account information.

Parameters

  • address (string; hex; required): an account address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getaccount' \
-H 'Content-Type: application/json' \
-d '{
    "address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0"
}'

Response example

[
    {
        "blockNumber": 49989959,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680582663000,
        "receipt": {
            "net_usage": 268
        },
        "id": "1dca7ae3d0fc5b73b5bc3ede1d2eb1b63fc128fce39196088a2198ff83fbc5ed"
    },
    {
        "blockNumber": 49989959,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680582663000,
        "receipt": {
            "net_usage": 265
        },
        "id": "04d86b079842247e14cd0c4648e315b78c861eb91abcaf4e022f88155b73f628"
    },
    {
        "blockNumber": 49989959,
        "contractResult": [
            ""
        ],
        "blockTimeStamp": 1680582663000,
        "receipt": {
            "net_usage": 280
        },
        "id": "a1b550fa6681c4afc90f619a2fa4ca26305b09bc964bef5a833123626e451391"
    }
]

wallet/listwitnesses

Retrieves the list of witnesses.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/listwitnesses'

Response example

{
    "witnesses": [
        {
            "address": "4100e9fdbd1d24ab56996bd37d76fb7b16dcf62ff1",
            "voteCount": 1087436,
            "url": "https://www.tronmacau.com"
        },
        {
            "address": "41012f81bd368f632fb22b9ddfeb284155f1f04198",
            "voteCount": 314,
            "url": "https://firekraken.media"
        },
        {
            "address": "4101c17562ee5a1ecb60f9ea6e49ef94ec0de99580",
            "voteCount": 377,
            "url": "https://tronpad.com"
        },
        {
            "address": "41021957c4576cbeae8bdf0576248e3e486a4cf3fa",
            "voteCount": 5,
            "url": "HTTPS://BEFREE"
        },
        {
            "address": "41022939a4a06cbc7b384096c1af8657ec435173af",
            "voteCount": 1404388255,
            "url": "antinvestmentgroup",
            "totalProduced": 895427,
            "totalMissed": 1119,
            "latestBlockNum": 49996531,
            "latestSlotNum": 560200795,
            "isJobs": true
        },
        {
            "address": "4102a0ed82a9609e7ea9155f00137dc3fce818033f",
            "voteCount": 98954,
            "url": "XREGlobal.com"
        }
    ]
}

wallet/getassetissuelist

Retrieves the list of all tokens.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/getassetissuelist'

Response example

{
    "assetIssue": [
        {
            "owner_address": "414d1ef8673f916debb7e2515a8f3ecaf2611034aa",
            "name": "53454544",
            "abbr": "53454544",
            "total_supply": 100000000000,
            "trx_num": 1000000,
            "num": 1,
            "start_time": 1529987043000,
            "end_time": 1530342060000,
            "description": "536573616d657365656420746f6b656e7320666f7220636f6d6d756e697479207265776172647320616e6420534545446765726d696e61746f7220696e766573746d656e74206f6620636f6d6d756e6974792d766f7465642070726f6a656374732e",
            "url": "687474703a2f2f7777772e736573616d65736565642e6f7267",
            "id": "1000001"
        },
        {
            "owner_address": "410b53ce4aa6f0c2f3c849f11f682702ec99622e2e",
            "name": "545258",
            "abbr": "545258",
            "total_supply": 99000000000,
            "trx_num": 1000000,
            "num": 1,
            "start_time": 1529989896000,
            "end_time": 1537632000000,
            "description": "74726f6e546f6b656e",
            "url": "68747470733a2f2f74726f6e2e6e6574776f726b",
            "id": "1000002"
        },
        {
            "owner_address": "41d13433f53fdf88820c2e530da7828ce15d6585cb",
            "name": "49504653",
            "abbr": "49504653",
            "total_supply": 100000000000,
            "trx_num": 1000000,
            "num": 1,
            "start_time": 1529990700000,
            "end_time": 1537632000000,
            "description": "4950465320636f696e",
            "url": "687474703a2f2f",
            "id": "1000003"
        }
    ]
}

wallet/getpaginatedassetissuelist

Retrieves the list of all tokens by pagination.

Parameters

  • offset (integer; required): the index of the start token.
  • limit (integer; required): the amount of tokens per page.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getpaginatedassetissuelist' \
-H 'Content-Type: application/json' \
-d '{
    "offset": 0,
    "limit": 10
}'

Response example

{
    "assetIssue": [
        {
            "owner_address": "416b1171698969a36e5eb2eb6ea7aa9204d5e10cfc",
            "name": "21212121474f4c44434f494e",
            "abbr": "474f4c44",
            "total_supply": 9000000000000000000,
            "trx_num": 1000000,
            "num": 1000,
            "start_time": 1556094180182,
            "end_time": 1871799840182,
            "description": "474f4c44",
            "url": "68747470733a2f2f676f6c64636861696e2e78797a",
            "id": "1002341"
        },
        {
            "owner_address": "418f82a73b283c7bf8515fa3cc2c0399d4d593e2e3",
            "name": "21212121476f6c6453706f7421212121",
            "abbr": "476f6c64",
            "total_supply": 99000000000,
            "frozen_supply": [
                {
                    "frozen_amount": 2000000000,
                    "frozen_days": 30
                }
            ],
            "trx_num": 1000000,
            "num": 100,
            "start_time": 1559106000646,
            "end_time": 1609451940646,
            "description": "476f6c6453706f7420666f6c6c6f7720746865207072696365206f6620676f6c6420696e2074686520626c6f636b636861696e212121204f776e6572732077696c6c2067657420414753202861476f6c6453706f74292064726f70206d6f6e74686c792e20476f6c6453706f742077696c6c20626520757067726164656420746f206120747263323020696e20323032302e20496e7665737420696e2074686520676f6c64206d61726b657421212120476c6f62616c20476f6c6420547261646572732121",
            "url": "7777772e676f6c6473706f742e6575",
            "id": "1002467"
        }
    ]
}

wallet/getpaginatedproposallist

Retrieves the list of all proposals by pagination.

Parameters

  • offset (integer; required): the index of the proposals starting position.
  • limit (integer; required): the amount of proposals per page.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getpaginatedproposallist' \
-H 'Content-Type: application/json' \
-d '{
    "offset": 0,
    "limit": 10
}'

Response example

{
    "proposals": [
        {
            "proposal_id": 1,
            "proposer_address": "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7",
            "parameters": [
                {
                    "key": 9,
                    "value": 1
                }
            ],
            "expiration_time": 1539259200000,
            "create_time": 1538981229000,
            "approvals": [
                "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7",
                "4167e39013be3cdd3814bed152d7439fb5b6791409",
                "418c66e4883782b793fcf2dcb92b23eece57769499",
                "41bac7378c4265ad2739772337682183b8864f517a",
                "414a193c92cd631c1911b99ca964da8fd342f4cddd",
                "41d25855804e4e65de904faf3ac74b0bdfc53fac76",
                "4193a8bc2e7d6bb1bd75fb2d74107ffbda81af439d",
                "41d1dbde8b8f71b48655bec4f6bb532a0142b88bc0",
                "417b88db9da8aacae0a7e967d24c0fc00129e815f6",
                "41243accc5241d97ce79272b06952ee88a34d8e1f9",
                "41f70386347e689e6308e4172ed7319c49c0f66e0b",
                "41d49bf5202b3dba65d46a5be73396b6b66d3555aa",
                "41beab998551416b02f6721129bb01b51fceceba08",
                "412fb5abdf8a1670f533c219e7251fe30b89849359",
                "4116440834509c59de4ee6ba4933678626f451befe",
                "414d1ef8673f916debb7e2515a8f3ecaf2611034aa",
                "415863f6091b8e71766da808b1dd3159790f61de7d",
                "4138e3e3a163163db1f6cfceca1d1c64594dd1f0ca",
                "41fc45da0e51966bd1af2cb1e0f66633f160603a8b",
                "41d376d829440505ea13c9d1c455317d51b62e4ab6",
                "41b487cdc02de90f15ac89a68c82f44cbfe3d915ea",
                "411103d62d8299e90fa011b4ce7fc6ba151e5f1a23"
            ],
            "state": "APPROVED"
        }
    ]
}

wallet/getpaginatedexchangelist

Retrieves the list of all exchange pairs by pagination.

Parameters

  • offset (integer; required): the index of the starting exchange pair.
  • limit (integer; required): the amount of exchange pairs per page.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getpaginatedexchangelist' \
-H 'Content-Type: application/json' \
-d '{
    "offset": 0,
    "limit": 10
}'

Response example

{
    "exchanges": [
        {
            "exchange_id": 1,
            "creator_address": "41f596e85bfd042744f76880979a133da0728679d9",
            "create_time": 1539673398000,
            "first_token_id": "31303030353634",
            "first_token_balance": 5,
            "second_token_id": "5f",
            "second_token_balance": 4326459
        },
        {
            "exchange_id": 2,
            "creator_address": "41cd3444bd2d493628b14d6dcec93181e15f94d169",
            "create_time": 1541678472000,
            "first_token_id": "31303031333035",
            "first_token_balance": 1,
            "second_token_id": "5f",
            "second_token_balance": 3015102
        },
        {
            "exchange_id": 3,
            "creator_address": "412d7bdb9846499a2e5e6c5a7e6fb05731c83107c7",
            "create_time": 1541717787000,
            "first_token_id": "31303030303138",
            "second_token_id": "5f"
        }
    ]
}

wallet/getnextmaintenancetime

Retrieves the time interval till the next vote round.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/getnextmaintenancetime'

Response example

{
    "num": 1680609600000
}

wallet/validateaddress

Checks the validity of the address.

Parameters

  • address (string; hex; required): an address to check.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/validateaddress' \
-H 'Content-Type: application/json' \
-d '{
    "address": "4189139CB1387AF85E3D24E212A008AC974967E561"
}'

Response example

{
    "result": true,
    "message": "Hex string format"
}

wallet/deploycontract

Deploys a smart contract.

Parameters

  • abi (array of key-value pairs; required): an ABI.
  • bytecode (string; hex; required): bytecode.
  • parameter (string; hex; optional): the list of constructor parameters, converted to Hex after being encoded according to ABI encoder.
  • call_value (integer; required): a TRX transfer to the contract for each call.
  • name (string; required): a contract name.
  • consume_user_resource_percent (integer; required): the percentage of user's resource consumption; an integer between [0, 100]; 0 means it does not consume user's resource until the developer's resource has been used up.
  • fee_limit (integer; required): the maximum TRX burns for resource consumption.
  • origin_energy_limit (integer; required): the maximum resource consumption of the creator in one execution or creation.
  • owner_address (string; hex; required): an owner address of the contract.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/deploycontract' \
-H 'Content-Type: application/json' \
-d '{
    "abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]",
    "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029",
    "parameter": "",
    "call_value": 100,
    "name": "SomeContract",
    "consume_user_resource_percent": 30,
    "fee_limit": 10,
    "origin_energy_limit": 10,
    "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292"
}'

Response example

{
    "visible": false,
    "txID": "b0311a4ac0b819f06be5957ca5ec707d6e1e2895db615f1e98d314780f821b89",
    "contract_address": "41a1bade45e57cd6883d745f3cfaa9e71e60a1ea70",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "owner_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
                        "new_contract": {
                            "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029",
                            "consume_user_resource_percent": 30,
                            "name": "SomeContract",
                            "origin_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
                            "abi": {
                                "entrys": [
                                    {
                                        "inputs": [
                                            {
                                                "name": "key",
                                                "type": "uint256"
                                            },
                                            {
                                                "name": "value",
                                                "type": "uint256"
                                            }
                                        ],
                                        "name": "set",
                                        "stateMutability": "Nonpayable",
                                        "type": "Function"
                                    },
                                    {
                                        "outputs": [
                                            {
                                                "name": "value",
                                                "type": "uint256"
                                            }
                                        ],
                                        "constant": true,
                                        "inputs": [
                                            {
                                                "name": "key",
                                                "type": "uint256"
                                            }
                                        ],
                                        "name": "get",
                                        "stateMutability": "View",
                                        "type": "Function"
                                    }
                                ]
                            },
                            "origin_energy_limit": 10,
                            "call_value": 100
                        }
                    },
                    "type_url": "type.googleapis.com/protocol.CreateSmartContract"
                },
                "type": "CreateSmartContract"
            }
        ],
        "ref_block_bytes": "e938",
        "ref_block_hash": "16069bb4f2f73549",
        "expiration": 1680607314000,
        "fee_limit": 10,
        "timestamp": 1680607256012
    },
    "raw_data_hex": "0a02e938220816069bb4f2f7354940d08082e0f4305add03081e12d8030a30747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e437265617465536d617274436f6e747261637412a3030a1541d1e7a6bc354106cb410e65ff8b181c600ff142921289030a1541d1e7a6bc354106cb410e65ff8b181c600ff142921a5c0a2b1a03736574220e12036b65791a0775696e743235362210120576616c75651a0775696e74323536300240030a2d10011a03676574220e12036b65791a0775696e743235362a10120576616c75651a0775696e743235363002400222fd01608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b250400292864301e3a0c536f6d65436f6e7472616374400a70ccbbfedff43090010a"
}

wallet/triggersmartcontract

Triggers a smart contract.

Note: The unit of TRX in the parameters is SUN.

Parameters

  • contract_address (string; hex; required): a contract address.
  • function_selector (string; required): a function call; must not leave any blank space.
  • parameter (string; required): the parameter passed to function_selector; the format must match with the VM's requirements; you can use a tool provided by remix to convert a parameter [1,2] into the format required by VM.
  • fee_limit (integer; required): the maximum TRX burns for resource consumption.
  • call_value (integer; required): the TRX transfer to the contract for each call.
  • owner_address (string; hex; required): an owner address that triggers the contract.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/triggersmartcontract' \
-H 'Content-Type: application/json' \
-d '{
    "contract_address": "4189139CB1387AF85E3D24E212A008AC974967E561",
    "function_selector": "set(uint256,uint256)",
    "parameter": "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002",
    "fee_limit": 10,
    "call_value": 100,
    "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292"
}'

Response example

{
    "result": {
        "code": "CONTRACT_VALIDATE_ERROR",
        "message": "4e6f20636f6e7472616374206f72206e6f7420612076616c696420736d61727420636f6e7472616374"
    }
}

wallet/getcontract

Retrieves a contract.

Parameters

  • value (string; hex; required): a contract address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getcontract' \
-H 'Content-Type: application/json' \
-d '{
    "value": "4189139CB1387AF85E3D24E212A008AC974967E561"
}'

wallet/proposalcreate

Creates a proposal.

Parameters

  • owner_address (string; hex; required): a creator address.
  • parameters (array of objects): proposal parameters.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/proposalcreate' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844F7600E018FD0D710E2145351D607B3316CE9",
    "parameters": [
        {
            "key": 0,
            "value": 100000
        },
        {
            "key": 1,
            "value": 2
        }
    ]
}'

wallet/getproposalbyid

Retrieves a proposal by proposal ID.

Parameters

  • id (integer; required): a proposal ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getproposalbyid' \
-H 'Content-Type: application/json' \
-d '{
    "id": 1
}'

Response example

{
    "proposal_id": 1,
    "proposer_address": "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7",
    "parameters": [
        {
            "key": 9,
            "value": 1
        }
    ],
    "expiration_time": 1539259200000,
    "create_time": 1538981229000,
    "approvals": [
        "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7",
        "4167e39013be3cdd3814bed152d7439fb5b6791409",
        "418c66e4883782b793fcf2dcb92b23eece57769499",
        "41bac7378c4265ad2739772337682183b8864f517a",
        "414a193c92cd631c1911b99ca964da8fd342f4cddd",
        "41d25855804e4e65de904faf3ac74b0bdfc53fac76",
        "4193a8bc2e7d6bb1bd75fb2d74107ffbda81af439d",
        "41d1dbde8b8f71b48655bec4f6bb532a0142b88bc0",
        "417b88db9da8aacae0a7e967d24c0fc00129e815f6",
        "41243accc5241d97ce79272b06952ee88a34d8e1f9",
        "41f70386347e689e6308e4172ed7319c49c0f66e0b",
        "41d49bf5202b3dba65d46a5be73396b6b66d3555aa",
        "41beab998551416b02f6721129bb01b51fceceba08",
        "412fb5abdf8a1670f533c219e7251fe30b89849359",
        "4116440834509c59de4ee6ba4933678626f451befe",
        "414d1ef8673f916debb7e2515a8f3ecaf2611034aa",
        "415863f6091b8e71766da808b1dd3159790f61de7d",
        "4138e3e3a163163db1f6cfceca1d1c64594dd1f0ca",
        "41fc45da0e51966bd1af2cb1e0f66633f160603a8b",
        "41d376d829440505ea13c9d1c455317d51b62e4ab6",
        "41b487cdc02de90f15ac89a68c82f44cbfe3d915ea",
        "411103d62d8299e90fa011b4ce7fc6ba151e5f1a23"
    ],
    "state": "APPROVED"
}

wallet/listproposals

Retrieves all proposals.

Parameters

None.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/listproposals'

Response example

{
    "proposals": [
        {
            "proposal_id": 84,
            "proposer_address": "41456798cb4ab28109d8cc643cd7da7bd6069ceae9",
            "parameters": [
                {
                    "key": 70,
                    "value": 14
                },
                {
                    "key": 59,
                    "value": 1
                }
            ],
            "expiration_time": 1680847200000,
            "create_time": 1680581727000,
            "approvals": [
                "41456798cb4ab28109d8cc643cd7da7bd6069ceae9",
                "418440ffd578f7a5abf3537b5f46a6980d382db581",
                "4167e39013be3cdd3814bed152d7439fb5b6791409",
                "414ce8225c8ea6c8e1e0a483132211610c765fc6df",
                "41c189fa6fc9ed7a3580c3fe291915d5c6a6259be7"
            ]
        }
    ]
}

wallet/proposalapprove

Approves a proposal.

Parameters

  • owner_address (string; hex; required): the address that makes the approval
  • proposal_id (integer; required): a proposal ID.
  • is_add_approval (boolean; required): whether to approve or not.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/proposalapprove' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844F7600E018FD0D710E2145351D607B3316CE9",
    "proposal_id": 1,
    "is_add_approval": true
}'

wallet/proposaldelete

Deletes a proposal.

Parameters

  • owner_address (string; hex; required): a proposal's owner address.
  • proposal_id (integer; required): a proposal ID.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/proposaldelete' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844F7600E018FD0D710E2145351D607B3316CE9",
    "proposal_id": 1
}'

wallet/getaccountresource

Retrieves the resource information of an account.

Parameters

  • address (string; hex; required): an account address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getaccountresource' \
-H 'Content-Type: application/json' \
-d '{
    "address": "419844f7600e018fd0d710e2145351d607b3316ce9"
}'

wallet/exchangecreate

Creates an exchange pair.

Parameters

  • owner_address (string; hex; required): an owner address.
  • first_token_id (string; hex; required): the first token's ID.
  • first_token_balance (integer; required): the first token's balance.
  • second_token_id (string; hex; required): the second token's ID.
  • second_token_balance (integer; required): the second token's balance.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/exchangecreate' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "first_token_id": "token_a",
    "first_token_balance": 100,
    "second_token_id": "token_b",
    "second_token_balance": 200
}'

wallet/exchangeinject

Injects funds for an exchange pair.

Parameters

  • owner_address (string; hex; required): an owner address of the exchange pair.
  • exchange_id (integer; required): an exchange pair.
  • token_id (string; hex; required): a token ID.
  • quant (integer; required): a token inject amount.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/exchangeinject' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "exchange_id": 1,
    "token_id": "74726f6e6e616d65",
    "quant": 100
}'

wallet/exchangewithdraw

Withdraws from an exchange pair.

Parameters

  • owner_address (string; hex; required): an owner address of the exchange pair.
  • exchange_id (integer; required): an exchange pair.
  • token_id (string; hex; required): a token ID.
  • quant (integer; required): a token inject amount.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/exchangewithdraw' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "exchange_id": 1,
    "token_id": "74726f6e6e616d65",
    "quant": 100
}'

wallet/exchangetransaction

Participates the transaction of exchange pair.

Parameters

  • owner_address (string; hex; required): an owner address of the exchange pair.
  • exchange_id (integer; required): an exchange pair.
  • token_id (string; hex; required): a token ID.
  • quant (integer; required): a token inject amount.
  • expected (integer; required): an expected token amount to get.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/exchangetransaction' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "exchange_id": 1,
    "token_id": "74726f6e6e616d65",
    "quant": 100,
    "expected": 10
}'

wallet/getexchangebyid

Retrieves an exchange pair by exchange pair ID.

Parameters

  • id (integer; required): an exchange pair ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getexchangebyid' \
-H 'Content-Type: application/json' \
-d '{
    "id": 1
}'

Response example

{
    "exchange_id": 1,
    "creator_address": "41f596e85bfd042744f76880979a133da0728679d9",
    "create_time": 1539673398000,
    "first_token_id": "31303030353634",
    "first_token_balance": 5,
    "second_token_id": "5f",
    "second_token_balance": 4326459
}

wallet/listexchanges

Retrieves the list of all exchange pairs.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/listexchanges'

Response example

{
    "exchanges": [
        {
            "exchange_id": 184,
            "creator_address": "4165b29b92cb5f33342647c4cc32b6efcb59eb3f45",
            "create_time": 1615538445000,
            "first_token_id": "31303033333934",
            "first_token_balance": 100000000000000,
            "second_token_id": "31303032393232",
            "second_token_balance": 1341470000000
        },
        {
            "exchange_id": 183,
            "creator_address": "41f55075d3c88b65d65e0f4cb19881182adce446b8",
            "create_time": 1602234009000,
            "first_token_id": "31303032373537",
            "second_token_id": "5f"
        },
        {
            "exchange_id": 182,
            "creator_address": "41d4af469119bab46909222e77e277c655f0de9054",
            "create_time": 1600277286000,
            "first_token_id": "31303033333031",
            "first_token_balance": 115545377,
            "second_token_id": "31303032303030",
            "second_token_balance": 86546095
        },
        {
            "exchange_id": 181,
            "creator_address": "41d4af469119bab46909222e77e277c655f0de9054",
            "create_time": 1600208667000,
            "first_token_id": "5f",
            "first_token_balance": 37777779,
            "second_token_id": "31303033333031",
            "second_token_balance": 66176472
        }
    ]
}

wallet/getchainparameters

Retrieves the parameters of the blockchain used for witnesses to create a proposal.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/getchainparameters'

Response example

{
    "chainParameter": [
        {
            "key": "getMaintenanceTimeInterval",
            "value": 21600000
        },
        {
            "key": "getAccountUpgradeCost",
            "value": 9999000000
        },
        {
            "key": "getCreateAccountFee",
            "value": 100000
        },
        {
            "key": "getTransactionFee",
            "value": 1000
        },
        {
            "key": "getAssetIssueFee",
            "value": 1024000000
        },
        {
            "key": "getWitnessPayPerBlock",
            "value": 16000000
        },
        {
            "key": "getWitnessStandbyAllowance",
            "value": 115200000000
        },
        {
            "key": "getCreateNewAccountFeeInSystemContract",
            "value": 1000000
        }
    ]
}

wallet/updatesetting

Updates the consume_user_resource_percent parameter of a smart contract.

Parameters

  • owner_address (string; hex; required): an owner address of the smart contract.
  • contract_address (string; hex; required): a smart contract address.
  • consume_user_resource_percent (integer; required): a percentage of user resource consumption.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/updatesetting' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "contract_address": "41c6600433381c731f22fc2b9f864b14fe518b322f",
    "consume_user_resource_percent": 7
}'

wallet/updateenergylimit

Updates the origin_energy_limit parameter of a smart contract.

Parameters

  • owner_address (string; hex; required): an owner address of the smart contract.
  • contract_address (string; hex; required): a smart contract address.
  • origin_energy_limit (integer; required): the maximum resource consumption of the creator in one execution or creation.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/updateenergylimit' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "contract_address": "41c6600433381c731f22fc2b9f864b14fe518b322f",
    "origin_energy_limit": 7
}'

wallet/getdelegatedresource

Retrieves the energy delegation information.

Parameters

  • fromAddress (string; hex; required): the energy "from" address.
  • toAddress (string; hex; required): the energy "to" address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getdelegatedresource' \
-H 'Content-Type: application/json' \
-d '{
    "fromAddress": "419844f7600e018fd0d710e2145351d607b3316ce9",
    "toAddress": "41c6600433381c731f22fc2b9f864b14fe518b322f"
}'

wallet/getdelegatedresourceaccountindex

Retrieves the energy delegation index by an account.

Parameters

  • value (string; hex; required): an account address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getdelegatedresourceaccountindex' \
-H 'Content-Type: application/json' \
-d '{
    "value": "419844f7600e018fd0d710e2145351d607b3316ce9"
}'

Response example

{
    "account": "419844f7600e018fd0d710e2145351d607b3316ce9"
}

wallet/setaccountid

Sets an account ID for an account.

Parameters

  • owner_address (string; hex; required): an owner address.
  • account_id (string; hex; required): an account ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/setaccountid' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41a7d8a35b260395c14aa456297662092ba3b76fc0",
    "account_id": "6161616162626262"
}'

Response example

{
    "visible": false,
    "txID": "5e0bec70e545e1ec197d580ae90d2d4a105409d99f7666d33e31d1b05512794a",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "account_id": "6161616162626262",
                        "owner_address": "41a7d8a35b260395c14aa456297662092ba3b76fc0"
                    },
                    "type_url": "type.googleapis.com/protocol.SetAccountIdContract"
                },
                "type": "SetAccountIdContract"
            }
        ],
        "ref_block_bytes": "444a",
        "ref_block_hash": "5078253a302d67ab",
        "expiration": 1680677295000,
        "timestamp": 1680677235852
    },
    "raw_data_hex": "0a02444a22085078253a302d67ab4098a7b181f5305a5a081312560a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5365744163636f756e744964436f6e747261637412210a086161616162626262121541a7d8a35b260395c14aa456297662092ba3b76fc0708cd9ad81f530"
}

wallet/getaccountbyid

Retrieves account information by account ID.

Parameters

  • account_id (string; hex; required): an account ID.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getaccountbyid' \
-H 'Content-Type: application/json' \
-d '{
    "account_id": "6161616162626262"
}'

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getdeferredtransactionbyid (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/canceldeferredtransactionbyid (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getdeferredtransactioninfobyid (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

wallet/triggerconstantcontract

Triggers the constant of the smart contract, the transaction is off the blockchain.

Parameters

  • contract_address (string; hex; required): a smart contract address.
  • function_selector (string; required): a function call; must not leave any blank space.
  • parameter (string; required): the parameter passed to function_selector; the format must match with the VM's requirements; you can use a tool provided by remix to convert a parameter [1,2] into the format required by VM.
  • fee_limit (integer; required): the maximum TRX burns for resource consumption.
  • call_value (integer; required): the TRX transfer to the contract for each call.
  • owner_address (string; hex; required): an owner address that triggers the contract.
  • permission_id (string; optional): for multi-signature use.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/triggerconstantcontract' \
-H 'Content-Type: application/json' \
-d '{
    "contract_address": "4189139CB1387AF85E3D24E212A008AC974967E561",
    "function_selector": "set(uint256,uint256)",
    "parameter": "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002",
    "fee_limit": 10,
    "call_value": 100,
    "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292"
}'

Response example

{
    "result": {
        "code": "CONTRACT_VALIDATE_ERROR",
        "message": "536d61727420636f6e7472616374206973206e6f742065786973742e"
    }
}

wallet/clearabi

Clears the abi of a smart contract.

Parameters

  • owner_address (string; hex; required): an owner address of the smart contract.
  • contract_address (string; hex; required): a smart contract address.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/clearabi' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "41a7d8a35b260395c14aa456297662092ba3b76fc0",
    "contract_address": "417bcb781f4743afaacf9f9528f3ea903b3782339f"
}'

wallet/getsignweight

Retrieves the current signatures total weight of a transaction after signing.

Parameters

A transaction object after signing.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getsignweight' \
-H 'Content-Type: application/json' \
-d '{
    "visible": true,
    "signature": [
        "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200"
    ],
    "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "amount": 1000000,
                        "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                        "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                },
                "type": "TransferContract",
                "Permission_id": 2
            }
        ],
        "ref_block_bytes": "0380",
        "ref_block_hash": "6cdc8193f096be0f",
        "expiration": 1556249055000,
        "timestamp": 1556248995694
    },
    "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d"
}'

Response example

{
    "result": {
        "code": "PERMISSION_ERROR",
        "message": "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200 is signed by TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR but it is not contained of permission."
    },
    "permission": {
        "operations": "7fff1fc0033e0300000000000000000000000000000000000000000000000000",
        "keys": [
            {
                "address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                "weight": 1
            },
            {
                "address": "TGsy6W3T4fs3nAMk4E6ohfXXsosbHXRLvK",
                "weight": 10
            }
        ],
        "threshold": 10,
        "id": 2,
        "type": "Active",
        "permission_name": "active"
    },
    "transaction": {
        "result": {
            "result": true
        },
        "txid": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d",
        "transaction": {
            "signature": [
                "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200"
            ],
            "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "amount": 1000000,
                                "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                                "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
                            },
                            "type_url": "type.googleapis.com/protocol.TransferContract"
                        },
                        "type": "TransferContract",
                        "Permission_id": 2
                    }
                ],
                "ref_block_bytes": "0380",
                "ref_block_hash": "6cdc8193f096be0f",
                "expiration": 1556249055000,
                "timestamp": 1556248995694
            },
            "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d"
        }
    }
}

wallet/getapprovedlist

Retrieves the signatures list of a transaction after signing.

Parameters

A transaction object after signing.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getapprovedlist' \
-H 'Content-Type: application/json' \
-d '{
    "visible": true,
    "signature": [
        "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200"
    ],
    "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "amount": 1000000,
                        "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                        "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                },
                "type": "TransferContract",
                "Permission_id": 2
            }
        ],
        "ref_block_bytes": "0380",
        "ref_block_hash": "6cdc8193f096be0f",
        "expiration": 1556249055000,
        "timestamp": 1556248995694
    },
    "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d"
}'

Response example

{
    "result": {},
    "approved_list": [
        "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR"
    ],
    "transaction": {
        "result": {
            "result": true
        },
        "txid": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d",
        "transaction": {
            "signature": [
                "36c9d227b9dd6b6f377d018bb2df784be884f28c743dc97edfdaa8bd64b2ffb058bca24a4eb8b4543a052a4f353fee8cb9e606ff739c74d22f9451c7a35c8f5200"
            ],
            "txID": "4d928f7adfbad5c82f5b8518a6f7b7c5e459d06d1cb5306c61fad8a793587d2d",
            "raw_data": {
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "amount": 1000000,
                                "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                                "to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
                            },
                            "type_url": "type.googleapis.com/protocol.TransferContract"
                        },
                        "type": "TransferContract",
                        "Permission_id": 2
                    }
                ],
                "ref_block_bytes": "0380",
                "ref_block_hash": "6cdc8193f096be0f",
                "expiration": 1556249055000,
                "timestamp": 1556248995694
            },
            "raw_data_hex": "0a02038022086cdc8193f096be0f40989eb0bda52d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d280270eeceacbda52d"
        }
    }
}

wallet/accountpermissionupdate

Sets a multi-signature for an account.

Parameters

  • owner_address (string; hex; required): an owner address of the account.
  • owner (object): an account owner permission.
  • witness (object): an account witness permission; only for the witness.
  • actives (array): an operation permission.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/accountpermissionupdate' \
-H 'Content-Type: application/json' \
-d '{
    "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
    "owner": {
        "type": 0,
        "permission_name": "owner",
        "threshold": 1,
        "keys": [
            {
                "address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                "weight": 1
            }
        ]
    },
    "actives": [
        {
            "type": 2,
            "permission_name": "active12323",
            "threshold": 2,
            "operations": "7fff1fc0033e0000000000000000000000000000000000000000000000000000",
            "keys": [
                {
                    "address": "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR",
                    "weight": 1
                },
                {
                    "address": "TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP",
                    "weight": 1
                }
            ]
        }
    ],
    "visible": true
}'

Response example

{
    "visible": true,
    "txID": "893420ec0302c29b8a060b3a2ebbdf5239b628570a329b492f3e9a38222eb9a1",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "owner": {
                            "keys": [
                                {
                                    "address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                                    "weight": 1
                                }
                            ],
                            "threshold": 1,
                            "permission_name": "owner"
                        },
                        "owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
                        "actives": [
                            {
                                "operations": "7fff1fc0033e0000000000000000000000000000000000000000000000000000",
                                "keys": [
                                    {
                                        "address": "TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR",
                                        "weight": 1
                                    },
                                    {
                                        "address": "TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP",
                                        "weight": 1
                                    }
                                ],
                                "threshold": 2,
                                "type": "Active",
                                "permission_name": "active12323"
                            }
                        ]
                    },
                    "type_url": "type.googleapis.com/protocol.AccountPermissionUpdateContract"
                },
                "type": "AccountPermissionUpdateContract"
            }
        ],
        "ref_block_bytes": "4ffc",
        "ref_block_hash": "4e38306be89d0e14",
        "expiration": 1680686277000,
        "timestamp": 1680686217702
    },
    "raw_data_hex": "0a024ffc22084e38306be89d0e144088c3d585f5305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541a7d8a35b260395c14aa456297662092ba3b76fc012241a056f776e657220013a190a1541a7d8a35b260395c14aa456297662092ba3b76fc01001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15418ba2aaae540c642e44e3bed5522c63bbc21fff9210013a190a15416d684e23fdb378cd815852f42ab7d20c35160548100170e6f3d185f530"
}

wallet/getzenpaymentaddress

Retrieves payment address.

Parameters

  • ivk (string; hex; required): an incoming viewing key.
  • d (string; required): d.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/createtransaction' \
-H 'Content-Type: application/json' \
-d '{
  "ivk": "8c7852e10862d8eec058635974f70f24c1f8d73819131bb5b54028d0a9408a03",
  "d": "736ba8692ed88a5473e009"
 }'

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/scannotebyivk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/scanandmarknotebyivk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/scannotebyovk (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

wallet/getrcm

Retrieves a random commitment trapdoor.

Parameters

None.

Request example

curl -X GET 'https://rpc.ankr.com/http/tron/wallet/getrcm'

Response example

{
    "value": "cf41ab2baca05e1fee6d34778f1b059ae93669aa8011f4bc629a75c495226801"
}

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getmerkletreevoucherinfo (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/isspend (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/createshieldnullifier (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

//: # (curl -X POST 'https://rpc.ankr.com/http/tron/wallet/getshieldtransactionhash (opens in a new tab)' )

//: # (-H 'Content-Type: application/json' )

wallet/gettriggerinputforshieldedtrc20contract

Retrieves the trigger input data of shielded TRC-20 contract for the shielded TRC-20 parameters without spending authority signature.

Parameters

  • shielded_TRC20_Parameters (object; required): the generated shielded TRC-20 parameters.
  • spend_authority_signature (array; required): the spend authority signatures.
  • amount (string; required): an amount.
  • transparent_to_address (string; required): the receiver for the burn operation.

Request example

curl -X POST 'https://rpc.ankr.com/http/tron/wallet/gettriggerinputforshieldedtrc20contract' \
-H 'Content-Type: application/json' \
-d '{
     "shielded_TRC20_Parameters": {"spend_description": [{"value_commitment": "e3fcc8609ff6a4b00b77a00ef624f305cec5f55cc7312ff5526d0b3057f2ef9e","anchor": "4c9cbebece033dc1d253b93e4a3682187daae4f905515761d10287b801e69816","nullifier": "74edce8798a3976ee41e045bb666f3a121c27235b0f1b44b3456d2c84bc725dc","rk": "9dcf4254aa7c4fb7c8bc6956d4b0c7c6c87c37a2552e7bf4e60c12cb5bc6c8cd","zkproof": "9926045cd1442a7d20153e6abda9f77a6526895f0a29a57cb1bc76ef6b7cacef2d0f4c94aa97c3acacdb95cabb065057b7edb4cbea098149a8aa7114a6a6b340c58007ac64b64e592eb18fdd299de5962a2a32ab0caebb2ab198704c751a9d0e143d68a50257d7c9e2230a7420fa46450299fd167141367e201726532d8e815413d8571d6c8c12937674dec92caf1f4583ebe560ac4c7eba290deee0a1c0da5f72c0b9df89fb3b338c683b654b3dc2373a4c2a4fef7f4fa489b44405fb7d2bfb"}],"binding_signature": "11e949887d9ec92eb32c78f0bc48afdc9a16a2ecbd5a0eca1be070fb900eeda347918bd6e9521d4baf1f74963bee0c1956559623a9e7cbc886941b227341ea06","message_hash": "7e6a00736c4f9e0036cb74c7fa3b1e3cd8f6bf0f038edeb03b668c4c5536a357","parameter_type": "burn"},
     "spend_authority_signature": [
       {
         "value": "eeaaecd725ac80ec398b95cf188b769c1be66cc8e76e6c90843b7f23818704595719ce8bf694ffb8cd7aaa8739d50fe8eea7ba39d5026c4b019c973185ca7201"
       }
     ],
     "amount": "6000",
     "transparent_to_address": "4140cd765f8e637a2bbe00f9bc458f6b21eb0e648f"
 }'