# Retrieve Information from the Chain

Query interfaces support retrieving information from the chain.

Method Description
getTransaction Get transaction details.
getAccount Get account information on the chain.
getBlock Get block by account address.
getStandbys Get candidate nodes.
getCGP Get on-chain governance parameters.
getChainInfo Get the mainchain information.
queryNodeInfo Get node information by account address.
queryNodeReward Get node reward.
listVoteUsed Get the votes distribution of voter.
queryVoterDividend Get voter dividend.
queryProposal Get proposal details.
getLatestTables Get the latest block height.

# Prerequisite

Before retrieving information on the chain, please make sure that you have an account on the chain, and have sent transactions before.

# Get Transaction

Request Method

getTransaction

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried, transaction sender's account address or receiver's account address.
tx_hash Yes - String The latest transaction hash of the account which can be retrieved via getAccount and is used to query the transaction details.

Response Parameters

Parameter Name Parameter Type Description
original_tx_info Object Original transaction information.
amount Uint64 Transaction amount.
authorization String Transaction body signature.
edge_nodeid String The edge node id that forwards the transaction, currently unused.
ext String Reserved field for extension, defaults to an empty String.
last_tx_nonce String The last transaction nonce.
note String Transaction notes.
premium_price Uint32 Reserved field, defaults to "0".
receiver_account String The account address of the transaction receiver.
receiver_action_name String The name of contract function.
The system smart contract function,please refer to Platform Smart Contract API.
receiver_action_param JSON The transaction receiver action. For the parameter serialization of different actions,please refer to Action Param Serialization.
send_timestamp Uint64 Transaction send timestamp.
sender_account String Account address of the transaction sender.
sender_action_name String Reserved field, defaults to an empty String.
sender_action_param JSON The transaction sender action. For the parameter serialization of different actions,please refer to Action Param Serialization.
token_name String Token symbol, such as top is for TOP.
tx_deposit Uint32 Transaction deposit. The unit is uTOP.
tx_expire_duration Uint16 The expiration time of the transaction. If it exceeds, the transaction will be discarded. It defaults to 100s.
tx_hash String The hexadecimal of the transaction hash.
tx_len Uint16 Transaction length. The gas consumed by a transaction is related to the transaction size.
tx_structure_version Uint32 Transaction structure version, defaults to "2".
tx_type Uint16 Transaction type. Different transaction types have different action param and action type in action.
xtransaction_type_run_contract = 3, // Run contract
xtransaction_type_transfer = 4, // Transfer
xtransaction_type_vote = 20, // Vote for miners
xtransaction_type_abolish_vote = 21, // Cancel votes for miners
xtransaction_type_pledge_token_gas = 22, // Lock TOP to get gas
xtransaction_type_redeem_token_gas = 23, // Unlock the TOP used to get gas
xtransaction_type_pledge_token_vote = 27, // Lock TOP to get votes
xtransaction_type_redeem_token_vote = 28, // Unlock the TOP used to get votes
tx_consensus_state Object Transaction consensus status.
There will be three consensuses for cross-account transactions, so the information of three units will be returned; single-account transactions will only have one consensus under the transaction sending account, so only "confirm_block_info" will be returned.
confirm_block_info Object The information of the table block that packages the confirm transaction.
account String Table address.
exec_status String Final consensus result of the transaction: success or failure.
height Uint64 The height of the table block where the confirm transaction is located.
recv_tx_exec_status String The consensus result of transaction receiver: success or failure.
The consensus of the transaction receiver fails or refuses to execute. Consensus rejection usually happens during the contract transaction is being executed. For example, when registering a miner, if the miner's deposit is lower than the minimum requirement, the contract will fail to execute.
used_deposit Uint64 After the third round consensus, the transaction deposit deducted from the sender's account when the sender's gas is not enough. The unit is uTOP.
used_gas Uint64 For user contract transactions, the gas that deducted from the sender's account after the third round consensus. The unit is Tgas.
If the contract account has paid part of the gas, then the rest of the whole gas consumed by the transaction is deducted here after this round of consensus; If the contract account is unable to pay its share of gas, all the gas consumed by the transaction is deducted here.
recv_block_info Object The information of the table block that packages the recv transaction.
account String Table address.
height Uint64 The height of the table block where the receive transaction is located.
used_gas Uint64 For user contract transactions, the gas that should be deducted from the receiver's account after the second round consensus. The unit is Tgas.
send_block_info Object The information of the table block that packages the send transaction.
account String Table address.
height Uint64 The height of the table block where the send transaction is located.
tx_fee Uint64 For running Beacon system contract (miner registration related, proposal related, starting node process), the system will automatically deduct 100*10^6 uTOP tokens from the transaction sender's account as the transaction fee and burn it.
used_deposit Uint64 The transaction deposit consumed by the sending transaction.
used_gas Uint64 The gas deducted after the first round consensus. The unit is Tgas.
For cross-account transactions that do not run application contract, the gas consumed by the transaction shall be borne by the sender. If the sender account gas is sufficient, the gas required by the transaction will be deducted after the first round consensus. If the sender account gas is insufficient, the system will deduct all the gas available in the sender's account after first round consensus, and deduct the sender transaction deposit to exchange for gas to pay the remaining cost after the third round consensus.
errmsg String Error message.
errno Uint64 Error code.
sequence_id String The number of client sessions, incremented.

Request Sample

curl -X 'POST' -d 'target_account_addr=Ta0000@0&body={"params":{"account_addr":"Ta0000@0","tx_hash":"0xb014bcfa3bb14f350531c95f0a5c32f32aaabb5aaaebe9cc214aab3776f483fe"}}&method=getTransaction&sequence_id=8&version=2.0' '127.0.0.1:19081'

Response Sample

Different transaction information is returned according to the different status of the transaction, as follows.

  • Successful

    • If the transaction is a single-account transaction, there is only one round of consensus under the transaction sender. Only the information of "confirm_block_info" is returned in the result.

    • If the transaction is an across-account transaction, there are three rounds of consensus in total. The information of the three consensus, including "confirm_block_info (the second round of consensus under the sender) ", "recv_block_info(consensus under the receiver)" and "send_block_info" (the first round of consensus under the sender) are returned in the result.

    • Send, receive, and confirm are all completed, and the receive transaction is executed successfully, "tx_state": "success".

      {
        "data": {
            "original_tx_info": {
                "amount": 1000000,
                "authorization": "0x00da74315ede21da0ebc0ce4f8d1fb8409c978c74a0be4d7660410e3eae7ebcfa36f386bff302c3fd6c7c1be040076fe7f5cda50afc7f842aa71bf05d1a6feea02",
                "edge_nodeid": "",
                "ext": "",
                "last_tx_nonce": 0,
                "note": "",
                "premium_price": 0,
                "receiver_account": "T800002276a7d58218ac4978733e5cca927a7d86cb7c87",
                "receiver_action_name": "",
                "receiver_action_param": {
                   "amount": 1000000,
                   "token_name": "TOP"
                },
                "send_timestamp": 1631791128,
                "sender_account": "T8000037d4fbc08bf4513a68a287ed218b0adbd497ef30",
                "sender_action_name": "",
                "sender_action_param": {
                   "amount": 1000000,
                   "token_name": "TOP"
                },
                "token_name": "",
                "tx_deposit": 100000,
                "tx_expire_duration": 100,
                "tx_hash": "0xfb33b056757f7d3ba6bccd0c8cd1a923a68dec1fd0c0633f513cee58214b648d",
                "tx_len": 189,
                "tx_structure_version": 2,
                "tx_type": 0
            },
            "tx_consensus_state": {
                "confirm_block_info": {
                    "account": "Ta0000@39",
                    "exec_status": "success",
                    "height": 7,
                    "recv_tx_exec_status": "success",
                    "used_deposit": 0,
                    "used_gas": 0
                },
                "recv_block_info": {
                    "account": "Ta0000@55",
                    "height": 7,
                    "used_gas": 0
                },
                "send_block_info": {
                    "account": "Ta0000@39",
                    "height": 4,
                    "tx_fee": 0,
                    "used_deposit": 0,
                    "used_gas": 468
                }
            },
            "tx_state" : "success"
        },
        "errmsg": "ok",
        "errno": 0,
        "sequence_id": "17"
      }
      
    • The execution of confirm transaction is not completed, "tx_state": "queue".

      {
       "data" : {
          "original_tx_info" : {
             "amount" : 1000000,
             "authorization" : "0x01c00cf3c8ca7c883b7ab130ac56ccb53c2c066640659d9babe21655a6b3a073455a3b8d06ee5b1a955b756a7800f0230afc7299a97f3ca9c57555d7890518472b",
             "edge_nodeid" : "",
             "ext" : "",
             "last_tx_nonce" : 4,
             "note" : "",
             "premium_price" : 0,
             "receiver_account" : "T8000042537218707b66d49fc06143b60d029cfe2b65f4",
             "receiver_action_name" : "",
             "receiver_action_param": {
                "amount": 1000000,
                "token_name": "TOP"
             },
             "send_timestamp" : 1645012819,
             "sender_account" : "T800008c5a874df3f8b6d1e357890f881704bf8849feeb",
             "sender_action_name" : "",
             "sender_action_param": {
                "amount": 1000000,
                "token_name": "TOP"
             },
             "token_name" : "",
             "tx_deposit" : 100000,
             "tx_expire_duration" : 100,
             "tx_hash" : "0xb014bcfa3bb14f350531c95f0a5c32f32aaabb5aaaebe9cc214aab3776f483fe",
             "tx_len" : 137,
             "tx_structure_version" : 2,
             "tx_type" : 4
          },
          "tx_consensus_state" : {
             "confirm_block_info" : {
                "account" : "Ta0000@31",
                "height" : 0
             },
             "recv_block_info" : {
                "account" : "Ta0000@27",
                "height" : 17,
                "used_gas" : 0
             },
             "send_block_info" : {
                "account" : "Ta0000@31",
                "height" : 25,
                "tx_fee" : 0,
                "used_deposit" : 0,
                "used_gas" : 411
             }
          },
          "tx_state" : "queue"
       },
       "errmsg" : "OK",
       "errno" : 0,
       "sequence_id" : "1"
      }
      
    • The execution of contract transaction has failed, "tx_state": "fail".

      {
      "data": {
        "original_tx_info": {
          "amount": 0,
          "authorization": "0x000188ea6d4c2272f1d2bdb65febbaad968a691d811fc4aa6a7976c7830d3ef1f9074a7579fb9651e18721f4eb342326cf8b909a72a92d901c56edbbbdb924c205",
          "edge_nodeid": "",
          "ext": "",
          "last_tx_nonce": 29,
          "note": "test_app",
          "premium_price": 0,
          "receiver_account": "T20000MTotTKfAJRxrfvEwEJvtgCqzH9GkpMmAUg@19",
          "receiver_action_name": "claimNodeReward",
          "receiver_action_param": {"paras": ""},
          "send_timestamp": 1643285775,
          "sender_account": "T00000LcmaU9qgcsP53o652xMyty5CmEAjXnpW3B",
          "sender_action_name": "",
          "sender_action_param": {
             "amount": "0",
             "token_name": "TOP"
          },
          "token_name": "",
          "tx_deposit": 100000,
          "tx_expire_duration": 100,
          "tx_hash": "0xb98be7520cf6bb08623e3a5a8802b32ffe5821961adac080ca1612ad1933722b",
          "tx_len": 334,
          "tx_structure_version": 0,
          "tx_type": 3
        },
        "tx_consensus_state": {
          "confirm_block_info": {
            "account": "Ta0000@19",
            "exec_status": "failure",
            "height": 180727,
            "recv_tx_exec_status": "failure",
            "used_deposit": 0,
            "used_gas": 0
          },
          "recv_block_info": {
            "account": "Ta0000@19",
            "height": 180724,
            "used_gas": 0
          },
          "send_block_info": {
            "account": "Ta0000@19",
            "height": 180721,
            "tx_fee": 0,
            "used_gas": 1002,
            "used_deposit": 0
          }
        },
        "tx_state": "fail"
      },
      "errmsg": "OK",
      "errno": 0,
      "sequence_id": "8"
      }
      
  • Failed

    The transaction is neither in the block nor in the transaction pool.

    {
       "errmsg" : "account address or transaction hash error/does not exist",
       "errno" : 3,
       "sequence_id" : "20"
    }
    

# Get Account

Request Method

getAccount

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You can enter the account address on the chain you are currently using.

Response Parameters

The units of TOP tokens in RPC are uTOP, 1TOP=1*10^6 uTOP.

Parameters Name Parameter Type Description
account_addr String Normal user account address or contract account address.
available_gas Uint64 The available gas of the account address. The unit is Tgas.
If the return value is negative, there may be two reasons:
  • The account balance after obtaining free gas is less than 100*10^6 uTOP.
  • Unlock the TOP Token after running out the gas exchanged.
balance Uint64 The balance of the account address. The unit is uTOP.
burned_token Uint64 All burned TOP tokens of the account address. The unit is uTOP.
cluster_id Uint8 cluster ID.
contract_address List If a application contract is deployed by a ordinary account, the application contract account address will be returned.
created_time Uint64 The clock height when the account created on the blockchain.
disk_staked_token Uint64 The amount of locked TOP tokens to exchange disk. The unit is uTOP.
gas_staked_token Uint64 The amount of locked TOP tokens to exchange gas. The unit is uTOP.
group_id Uint8 group ID.
latest_tx_hash String The hash of the latest successful transaction.
latest_tx_hash_xxhash64 String The xx64hash of the latest successful transaction.
latest_unit_height Uint64 The unit block height of the latest successful transaction.
lock_balance Uint64 Locked TOP tokens used for application contract transactions. Unit of measurement is uTOP.
When running application contract, the transaction sender can transfer TOP tokens to the contract account at the same time. If the contract fails to execute, the transferred TOP tokens needs to be returned to the sender. Therefore, the transferred money should be locked before running the contract successfully.
lock_gas Uint64 Application contract transaction costs are related to the CPU time and transaction size. The costs of the application contract transactions cannot be determined at the beginning of the transaction. The method adopted is to freeze part of the gas of the transaction sender. At the third round of consensus of the transaction, according to the final execution of the application contract, the gas of the sender is deducted to pay for the costs. Measured in Tgas.
nonce Uint64 The nonce of the latest successful transaction. Unique in the global network.
table_id Unit16 ID of the table.
total_free_gas Uint64 Total free gas of the account address. Measured in Tgas.
At present, when the account balance ≥100*10^6 uTOP, the system will give the account 25,000 Tgas for free. This value changes along with the on-chain governance parameters changes.
total_gas Uint64 Total gas of the account address. Measured in Tgas.
A normal account can get no more than 200,000 Tgas within 24 hours.
A contract account can get no more than 10,000,000 Tgas within 24 hours.
total_stake_gas Uint64 Total gas obtained by locking TOP Tokens. Measured in Tgas.
unlock_disk_staked Uint64 TOP tokens to exchange disk in unlock. After initiating the unlock, we need to wait 24 hours for the unlocked amount to arrive in the account.
unlock_gas_staked Uint64 TOP tokens to exchange gas in unlock. After initiating the unlock, we need to wait 24 hours for the unlocked amount to arrive in the account.
unused_vote_amount Uint64 Unused vote amount of the account.
vote_staked_index - Details of staking TOP for votes, including the following 3 parameters:
  • duration: Duration of locking TOP, parameter type is Uint16.
  • lock_time: Time of locking TOP, parameter type is Uint64.
  • vote_num: Numbers of swapped votes, parameter type is Uint64.
vote_staked_token Uint64 TOP tokens to exchange votes in lock.
zone_id Uint8 zone ID.

Shard to which the account belongs:

ID Shard
zone_id, cluster_id, group_id, are 1, 0, 0 or 2, 0, 0 Beacon Network
zone_id, cluster_id, group_id, are 14, 1, 1 Archive Network
zone_id, cluster_id, group_id, are 15, 1, 1 Edge Network
zone_id, cluster_id, are 0, 1, group_id∈[1,63] Audit Network
zone_id, cluster_id, are 0, 1, group_id∈[64,126] Validate Network

To query application contract account information, return the following two parameters in addition to the above parameters.

Parameter Name Parameter Name Description
contract_code String Application contract code.
contract_parent_account String Contract parent account that deployed the application contract.

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325"}}&method=getAccount&sequence_id=5&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

    {
       "data" : {
          "account_addr" : "T800002276a7d58218ac4978733e5cca927a7d86cb7c87",
          "available_gas" : 25000,
          "balance" : 100000000000000,
          "burned_token" : 0,
          "cluster_id" : 1,
          "contract_address" : [T30000MaSkcvg2iyqMRDRMFnTQ8o5237Xs1dT9TR],
          "created_time" : 1596520429,
          "disk_staked_token" : 0,
          "group_id" : 64,
          "gas_staked_token" : 0,
          "latest_tx_hash" : "0xfcd8843c36b1c8fee81bcac7e7cf2b38682deef723e9a237918b70b3a6dfc4c9",
          "latest_tx_hash_xxhash64" : "0xdb73d04d0f5daa84",
          "latest_unit_height" : 1,
          "lock_balance" : 0,
          "lock_deposit_balance" : 0,
          "lock_gas" : 0,
          "nonce" : 1,
          "table_id" : 102,
          "total_free_gas" : 25000,
          "total_gas" : 25000,
          "total_stake_gas" : 0,
          "unlock_disk_staked" : 0, 
          "unlock_gas_staked" : 0,
          "unused_free_gas" : 25000,
          "unused_stake_gas" : 0,
          "unused_vote_amount" : 0,
          "vote_staked_token" : 0,
          "zone_id" : 0
       },
       "errmsg" : "ok",
       "errno" : 0,
       "sequence_id" : "5"
    }
    
  • Failed

    {
       "errmsg" : "account not found on chain",
       "errno" : 3,
       "sequence_id" : "38"
    }
    

# Get Block by Account Address

Get block by account address.

The premise of retrieving block information is that the account has sent the transaction and the transaction was consensused successfully.

Request Method

getBlock

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried.
Use the ordinary account address to retrieve the unit block, such as"T8000066ab344963eaa071f9636faac26b0d1a39900325".
Use the table block account address to retrieve the unit block, such as"T-a-gRD2qVpp2S7UpjAsznRiRhbE1qNnhMbEDp@0".
height Yes - String/Uint64 The latest block height(String) or the specific block height(Number).

Response Parameters

  • unit block

    Parameter Name Parameter Name Description
    body Object
    fullunit Object To save data storage space, every 21 lightunits are packaged as a fullunit.
    account_balance Number Account balance, in uTOP.
    account_create_time Number Clock height when the account is created on the chain.
    burned_amount_change Number All TOP tokens that have been destroyed in this account, in uTOP.
    latest_full_unit_hash String Latest fullunit transaction hash.
    latest_full_unit_number Number Height of the latest fullunit block.
    latest_recv_trans_number Number Number of received transactions.
    latest_send_trans_hash String Hash of the latest sent transaction.
    latest_send_trans_number Number Number of sent transactions.
    txs Object The transaction information packaged in this block, in map array format, and the key of the map is a transaction hash.
    tx_consensus_phase String Transaction consensus phase: 1--self; 2--send; 3--recv.
    enum_transaction_subtype_self = 1, // self operate
    enum_transaction_subtype_send = 2, // send to other account
    enum_transaction_subtype_recv = 3, // receive from other account
    enum_transaction_subtype_recv_ack = 4(confirm), // receive ack from other account
    tx_hash String Transaction hash.
    lightunit Object Data of lightunit.
    txs Object The transaction information packaged in this block, in map array format, and the key of the map is a transaction hash.
    tx_consensus_phase String Transaction consensus phase: 1--self; 2--send; 3--recv.
    enum_transaction_subtype_self = 1, // self operate
    enum_transaction_subtype_send = 2, // send to other account
    enum_transaction_subtype_recv = 3, // receive from other account
    enum_transaction_subtype_recv_ack = 4(confirm), // receive ack from other account
    tx_hash String Transaction hash.
    hash String The hexadecimal String of this block hash.
    header Object
    auditor_xip String Auditor leader node of this block (xip).
    timerblock_height Number Clock block height.
    validator String The validator leader miner account address that generated this block.
    The validator and auditor nodes take turns as the consensus leader node. When the returned field contains account address information, for example, in the following response example, the value of the validator field is "T8000085a8e8acd53c72dca85dcb002a6710796975b4ba", which proves that the block generated is the validator node and the miner account address is " T8000085a8e8acd53c72dca85dcb002a6710796975b4ba".
    validator_xip String Validator leader node of this block (xip).
    version Number Protocol version.
    height Number Block height.
    owner String The unit block owner.
    prev_hash String The hexadecimal of the hash of the previous block.
    table_height Number Table height.
    timestamp Number Block time stamp.
    status String Block status.

Account Native Property:

Property Code Field Property Name Property Type Description
XPROPERTY_CONTRACT_CODE "@1" String The specific code for contract execution.
XPROPERTY_LOCK_TOKEN_KEY "@4" Map Set of locked TOP tokens by transactions under an account.
XPROPERTY_LOCK_TOKEN_SUM_KEY "@5" String Total amount of locked TOP tokens.
XPORPERTY_SUB_ACCOUNT_KEY "@13" Llist List of sub account.
XPORPERTY_CONTRACT_SUB_ACCOUNT_KEY "@14" List List of contract sub account.
XPORPERTY_CONTRACT_PARENT_ACCOUNT_KEY "@15" String Parent account of contract account.
XPROPERTY_USED_TGAS_KEY "@30" String Value of gas attenuation.
XPROPERTY_LAST_TX_HOUR_KEY "@32" String The logical clock at @30 was last updated.
XPROPERTY_USED_DISK_KEY "@34" String Disk used, which is useless temporarily this period.
XPROPERTY_CONTRACT_TGAS_LIMIT_KEY "@37" String gas_limit: The upper limit of the gas fee that the user is willing to pay for the transaction.
XPROPERTY_PLEDGE_VOTE_KEY "@45" List Used for exchanging votes, unlocking the TOP tokens used for exchanging votes, storing all votes exchanging transactions of account.
XPROPERTY_EXPIRE_VOTE_TOKEN_KEY "@46" String All the TOP tokens that have expired when exchanging votes.
  • table block

    Parameter Name Parameter Type Description
    tableblock Object The tableblock contains multiple units. When there is no new transaction on the chain for a long time, the latest height data of the tableblock is "null".
    txs Object The transaction information packaged in this block, in map array format, and the key of the map is a transaction hash.
    tx_consensus_phase String Transaction consensus phase: 1--self; 2--send; 3--recv.
    enum_transaction_subtype_self = 1, // self operate
    enum_transaction_subtype_send = 2, // send to other account
    enum_transaction_subtype_recv = 3, // receive from other account
    enum_transaction_subtype_recv_ack = 4(confirm), // receive ack from other account
    tx_hash String Transaction hash.
    units Object Tableblock stores information of unit blocks.
    lightunit_state Object Please refer to the unit block parameter description.
    unit_height Integer Unit block height.
    hash String The hexadecimal String of this block hash.
    header Object
    auditor_xip String Auditor leader node of this block (xip).
    timerblock_height Number Clock block height.
    validator String The validator leader miner account address that generated this block.
    The validator and auditor nodes take turns as the consensus leader node. When the returned field contains account address information, for example, in the following response example, the value of the validator field is "T8000085a8e8acd53c72dca85dcb002a6710796975b4ba", which proves that the block generated is the validator node and the miner account address is " T8000085a8e8acd53c72dca85dcb002a6710796975b4ba".
    validator_xip String Validator leader node of this block (xip).
    version Number Protocol version.
    height Number Block height.
    owner String The table block owner.
    prev_hash String The hexadecimal of the hash of the previous block.
    table_height Number Table height.
    timestamp Number Block time stamp.
    status String Block status.

Request Sample

  • unit block

    curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325","height":"latest"}}&method=getBlock&sequence_id=9&identity_token=&version=2.0'  http://localhost:19081
    
  • table block

    curl -X POST --data 'target_account_addr=T-a-gRD2qVpp2S7UpjAsznRiRhbE1qNnhMbEDp@0&body={"params":{"account_addr":"T-a-gRD2qVpp2S7UpjAsznRiRhbE1qNnhMbEDp@146","height":9}}&method=getBlock&sequence_id=6&identity_token=&version=1.0'  http://localhost:19081
    

Response Sample

  • Successful

    • unit block

      • lightunit

        {
           "result" : "ok",
           "value" : {
              "body" : {
                 "lightunit" : {
                    "txs" : [
                       {
                          "tx_consensus_phase" : "send",
                          "tx_hash" : "0x36ec1efb79385bc67629a924caf8db41b25dd080f265866c325be43179d76fe1"
                       }
                    ]
                 }
              },
              "hash" : "1f73f5e7d4b8744d9d051a215bb3aeabc08bde93946550988fd744aecfc10d4e",
              "header" : {
                 "auditor" : "T00000LNi53Ub726HcPXZfC4z6zLgTo5ks6GzTUp",
                 "auditor_xip" : "100000000000016:f60000ff00040401",
                 "timerblock_height" : 7301997,
                 "validator_xip" : "100000000000016:f60000ff000503ff",
                 "version" : 196608
              },
              "height" : 2,
              "owner" : "T8000062d241d05334a8bc02dea1e97a5381cbe4885729",
              "prev_hash" : "3a0aa3d2e728b93ce38dac45778579ab08724d3168ac4fb9c381172f91a21d4e",
              "table_height" : 4,
              "timestamp" : 1646209170
           }
        }
        
      • fullunit

        {
            "data": {
                "value": {
                    "body": {
                        "fullunit": {
                            "account_balance": 1875000762900000,
                            "account_create_time": 1609412970,
                            "burned_amount_change": 0,
                            "latest_full_unit_hash": "82a730ec0df3b86260af57c3dad0c511dd30bf4aea813cb0f4e077991b629b61",
                            "latest_full_unit_number": 42,
                            "latest_recv_trans_number": 1,
                            "latest_send_trans_hash": "401e87b7ba6c5b82311c24a886ab3ea9dc98cb4f2e04779424a6f239be95aecf",
                          "latest_send_trans_number": 8,
                            "txs": [{
                                "tx_consensus_phase": "send",
                                "tx_hash": "0x401e87b7ba6c5b82311c24a886ab3ea9dc98cb4f2e04779424a6f239be95aecf"
                            }]
                        }
                    },
                    "hash": "82a730ec0df3b86260af57c3dad0c511dd30bf4aea813cb0f4e077991b629b61",
                    "header": {
                        "auditor": "T00000LR3QHZf1DD1Usn1oEP4THaYhdBJGgxZ1ga",
                        "auditor_xip": "1000000000005652:f60000000004081",
                        "timerblock_height": 7197540,
                        "validator_xip": "2000000000005652:f600000000050ff",
                        "version": 196608
                    },
                    "height": 9,
                    "owner": "T00000LbgaCLnuxnqaqPh8e9EpeNqsRju6MuCr4z",
                    "prev_hash": "c962a4d464dd9a14e0ff337b07bdda3ff1ff79bcf34394e90ffbcd0de02e2bd8",
                    "table_height": 150872,
                    "timestamp": 1645164600
                }
            },
            "errmsg": "OK",
            "errno": 0,
            "sequence_id": "9"
        }
        
    • table block

      {
          "data": {
              "value": {
                  "body": {
                      "tableblock": {
                          "txs": [{
                              "tx_consensus_phase": "send",
                              "tx_hash": "0x2ed974afd473b8188f0601e1956376897d90fc3175c7b5d3a905032275c84860"
                          }],
                          "units": [{
                              "account": "T00000LhEBn4hwcVgiZJWMtZCV3Xz4Qxko2huSSM",
                              "unit_height": 32039
                          }]
                      }
                  },
                  "hash": "c0eac42fe93d39ff6d7339192f4520d3f4b99d6f833b1f7b6143350d97df7955",
                  "header": {
                      "auditor_xip": "1000000000005c3b:f6000000000407f",
                      "multisign_auditor": "740000005f0000000694de06000000002100038b37abb47aed5d1827e01ceae22b4c7292476f17fce4d57a84b1f4c5417170322000fb10f842a1479949715ad57c20606c1ce1ea6fdf0e6219fde622052e8b78111e4000eb65dbeffefffefb",
                      "multisign_validator": "74000000670000000694de060000000021000316f597e2edf094d63d922db06a32895d72beaf54fde3230fd31476e00d6f548020004e257d99224f8462abc7ca8e36d0e28e25a8779573da58e119306a5e36df8bb7800076e6dc7bef4c3eff20f836f9beb6fffd",
                      "timerblock_height": 7760752,
                      "validator": "T00000LTe5A139dZWCtprNUpeVteR23v8rtEDK5K",
                      "validator_xip": "2000000000005c3b:f60000000005007",
                      "version": 196608
                  },
                  "height": 931803,
                  "owner": "Ta0000@1",
                  "prev_hash": "22adcb9e156724c0e79023f02acd64050660d3e3a6cffa8a685eb46be78f7590",
                  "table_height": 931803,
                  "timestamp": 1650796720
              }
          },
          "errmsg": "OK",
          "errno": 0,
          "sequence_id": "1"
      }
      
  • Failed

    Block information not found:

    {
        "errmsg": "account address is valid",
        "errno": 1,
        "sequence_id": "1"
    }
    

# Get Standbys

Includes all nodes information in the candidate pool contract on the Beacon, including information of nodes those have been elected as the edge, archive, validator, auditor, and Beacon.

Request Method

getStandbys

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You may use the "node registration" contract account address: T2000138M7UrM9d2o1J9v1SVRDPtSSMHr4Qsn96N4@0.
node_account_addr No - String Candidate node account address. If not specified, all candidate nodes are queried by default.

Response Parameters

Parameter Name Parameter Type Description
consensus_public_key String Public key of account or asset-free public-private key pair used when registering node.
node_id String Node account address.
stake Unit64 Node comprehensive stake.
is_genesis_node String Whether it is a genesis node.
program_version String Program version.
miner_type String Miner type.
credit_score String Credit score.

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325@0","node_account_addr":""}}&method=getStandbys&sequence_id=49&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

     {
        "data": {
           "activated_state": "activated",
           "archive": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "0",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "auditor": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "530000",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "edge": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "0",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "eth": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "0",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "exchange": [{
                 "consensus_public_key": "BGGBA8KZEg7cujs0WRZ4TPgsp0lmP1xZx13Zg+mkOqq8yBTnK2Mq5RZIAs3iSbqN8m0iGIPzcYKI7K6CGVbXZ9g=",
                 "credit_score": "0",
                 "is_genesis_node": "false",
                 "miner_type": "exchange",
                 "node_id": "T00000LYSBndie9zVKycUyygy529JaCPCHGGyEX8",
                 "program_version": "1.4.0",
                 "stake": 0
           }],
           "fullnode": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "0",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "root_beacon": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "0",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "sub_beacon": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "0",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }],
           "validator": [{
                 "consensus_public_key": "BMz9dh7/AozzPXzP8vq5jaMKtK7YYTM0YO/C7P4jFWi33kfZo9poTjAceSRJJ5lO8ch+nM71nUuLpqYxgZ+zRpE=",
                 "credit_score": "260000",
                 "is_genesis_node": "true",
                 "miner_type": "advance,validator,edge",
                 "node_id": "T00000LMhJMWwmFMwTfpfrCzqtQQ9DBveVUirkSC",
                 "program_version": "1.1.0",
                 "stake": 0
           }]
        },
        "errmsg": "OK",
        "errno": 0,
        "sequence_id": "49"
     }
    
  • Failed

    {
        "data": null,
        "errmsg": "ok",
        "errno": 0,
        "sequence_id": "50"
    }
    

# Get On-chain Governance Parameters

Request Method

getCGP

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You may use the "on-chain governance" contract account address: T2000138QMHWxXshXyZa1E48JU1LREu3UrT5KGD2U@0.

Response Parameters

The query returns the latest values of the parameters, the description and initial values of the parameters please refer to On-chain Governance Parameters.

Request Sample

curl -X POST --data 'target_account_addr=T8000085a8e8acd53c72dca85dcb002a6710796975b4ba&body={"params":{"account_addr":"T2000138QMHWxXshXyZa1E48JU1LREu3UrT5KGD2U@0"}}&method=getCGP&sequence_id=4&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

    {
       "data" : {
          "additional_issue_year_ratio" : "8",
          "application_contract_code_max_len" : "32768",
          "archive_election_interval" : "360",
          "auditor_group_count" : "2",
          "auditor_nodes_per_segment" : "27",
          "auditor_reward_ratio" : "10",
          "award_auditor_credit" : "30000",
          "award_validator_credit" : "30000",
          "backward_auditor_slash_credit" : "100000",
          "backward_node_lock_duration_increment" : "103680",
          "backward_validator_slash_credit" : "100000",
          "beacon_tx_fee" : "100000000",
          "cluster_election_interval" : "60",
          "cluster_election_minimum_rotation_ratio" : "66",
          "cluster_zero_workload" : "0",
          "contract_call_contracts_num" : "25",
          "cpu_gas_exchange_ratio" : "40",
          "cross_reading_rec_reg_contract_height_step_limitation" : "12",
          "cross_reading_rec_reg_contract_logic_timeout_limitation" : "60",
          "cross_reading_rec_standby_pool_contract_height_step_limitation" : "12",
          "cross_reading_rec_standby_pool_contract_logic_timeout_limitation" : "67",
          "custom_property_max_number" : "128",
          "custom_property_name_max_len" : "16",
          "dividend_ratio_change_interval" : "120960",
          "edge_election_interval" : "360",
          "edge_reward_ratio" : "2",
          "election_rotation_count_ratio" : "16",
          "free_gas" : "25000",
          "fullunit_contain_of_unit_num" : "21",
          "governance_reward_ratio" : "4",
          "initial_total_locked_token" : "1000000000000000",
          "max_archive_group_size" : "512",
          "max_auditor_group_size" : "64",
          "max_auditor_rotation_count" : "2",
          "max_edge_group_size" : "512",
          "max_election_committee_size" : "256",
          "max_gas_account" : "1000000",
          "max_gas_contract" : "50000000",
          "max_nodedeposit_lock_duration" : "3110400",
          "max_validator_group_size" : "128",
          "max_validator_stake" : "5000",
          "max_vote_nodes_num" : "10000",
          "min_auditor_deposit" : "1000000000000",
          "min_auditor_group_size" : "6",
          "min_credit" : "100000",
          "min_edge_deposit" : "200000000000",
          "min_election_committee_size" : "32",
          "min_free_gas_balance" : "100000000",
          "min_mainnet_active_archives" : "1",
          "min_mainnet_active_auditors" : "128",
          "min_mainnet_active_edges" : "1",
          "min_mainnet_active_validators" : "512",
          "min_mainnet_active_votes" : "384000000",
          "min_node_reward" : "0",
          "min_ratio_annual_total_reward" : "2",
          "min_stake_votes_num" : "1",
          "min_table_block_report" : "32",
          "min_tcc_proposal_deposit" : "0",
          "min_tx_deposit" : "100000",
          "min_validator_deposit" : "500000000000",
          "min_validator_group_size" : "6",
          "min_voter_dividend" : "0",
          "min_votes_num" : "1",
          "punish_interval_table_block" : "368640",
          "punish_interval_time_block" : "8640",
          "rec_election_interval" : "259201",
          "rec_standby_pool_update_interval" : "11",
          "reward_issue_interval" : "8640",
          "shard_zero_workload" : "0",
          "sign_block_publishment_threshold_value" : "0",
          "sign_block_ranking_publishment_threshold_value" : "10",
          "sign_block_ranking_reward_threshold_value" : "0",
          "sign_block_reward_threshold_value" : "80",
          "tableslash_report_schedule_interval" : "1",
          "tableworkload_report_schedule_interval" : "1",
          "task_num_per_round" : "16",
          "tcc_member_number" : "T800002276a7d58218ac4978733e5cca927a7d86cb7c87,T8000066ab344963eaa071f9636faac26b0d1a39900325",
          "tcc_proposal_expire_time" : "259200",
          "toggle_whitelist" : "0",
          "total_gas_shard" : "2160000000000",
          "tx_deposit_gas_exchange_ratio" : "20",
          "tx_send_timestamp_tolerance" : "300",
          "unlock_gas_staked_delay_time" : "8640",
          "usedgas_decay_cycle" : "8640",
          "validator_group_count" : "4",
          "validator_reward_ratio" : "60",
          "vote_reward_ratio" : "20",
          "votes_report_interval" : "30",
          "whitelist" : "T800002276a7d58218ac4978733e5cca927a7d86cb7c87,T8000066ab344963eaa071f9636faac26b0d1a39900325,T8000085a8e8acd53c72dca85dcb002a6710796975b4ba,T80000fd4f433c036268f17a1b4204ea907e70618d030e",
          "workload_per_tableblock" : "2",
          "workload_per_tx" : "1",
          "workload_report_min_table_block_num" : "32",
          "workload_timer_interval" : "17",
          "zec_election_interval" : "120977",
          "zec_standby_pool_update_interval" : "31",
          "zone_election_trigger_interval" : "31"
       },
       "errmsg" : "OK",
       "errno" : 0,
       "sequence_id" : "1"
    }
    
  • Failed

    {
    	"data": null,
    	"errmsg": "ok",
    	"errno": 0,
    	"sequence_id": "5"
    }
    

# Get ChainInfo

Request Method

getChainInfo

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You can enter the account address on the chain you are currently using.

Response Parameters

Parameter Name Parameter Type Description
first_timerblock_hash String Hash of the first clock block.
first_timerblock_stamp Number Generation time of the first clock block.
init_total_locked_token Number Total TOP Token initially locked by the system. The system initializes the exchange rate of gas = total gas/ total locked amount of the system to avoid the system initialized exchange rate of gas to be 0.
token_price Number Exchange rate of locking TOP Token for gas, measured in tgas/top, which changes dynamically with the change of locked TOP token in the system.
total_gas_shard Number Total gas per shard for 24 hours.
validator_group_count Number Number of validator group, it currently defaults to 4.
network_activate_time Number Network activate time.

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325"}}&method=getChainInfo&sequence_id=10&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

    {
       "data" : {
          "first_timerblock_hash" : "0b98350d3e8ec4511ec1720bff0c6d6205519ffa90a879a65eed23e9312b21de",
          "first_timerblock_stamp" : 1573189200,
          "init_total_locked_token" : 10000000000000,
          "network_activate_time":3620325,
          "token_price" : 432000,
          "total_gas_shard" : 2160000000000,
          "validator_group_count" : 2
       },
       "errmsg" : "OK",
       "errno" : 0,
       "sequence_id" : "10"
    }
    
  • Failed

    None.

# Query Node Information

Request Method

queryNodeInfo

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr The account address that stores the data being queried. You may use the "node registration" contract account address: T2000138DSqqwBWkHKxkVuCq3htW47BGtJRCM2paf@0.
node_account_addr No - String Node account address, if not specified, all nodes are queried by default.

Response Parameters

Parameter Name Parameter Type Description
account_addr String Node account address.
auditor_credit String Auditor credit.
auditor_stake Number Auditor stake: auditor stake=(node deposit+vote amount/2)*auditor credit
dividend_ratio Number Dividend ratio, percentage %, value [0,100].
network_id String A value of 0 indicates that the node joins the mainchain network.
node_deposit Number Node deposit(uTOP).
miner_type String Node type: edge, validator, advance, exchange.
In which, edge, validator, and advance are genesis nodes.
nodename String Node name.
rec_stake String Beacon stake.
registered_node_type String Registered node type: edge, validator, advance.
node_sign_key String Public key used in registering node.
validator_credit String Validator credit.
validator_stake Number Validator stake: validator stake=(node deposit+vote amount/2)*validator credit
vote_amount Number Total number of votes received from voting.
zec_stake String Sub-beacon stake.
genesis String Whether it is a genesis node.

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T2000138NZjvNJjRNG5iEqVKydpqAqoeNjBuFmNbj@0","node_account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325"}}&method=queryNodeInfo&sequence_id=6&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

     {
        "data": {
           "account_addr": "T00000Lhacc8ecibdjYozdZtwEdinSpL5zwAn3K5",
           "auditor_credit": "0.000000",
           "auditor_stake": 0,
           "dividend_ratio": 0,
           "genesis": "false",
           "miner_type": "validator",
           "network_id": "0 ",
           "node_deposit": 3000000000000,
           "node_sign_key": "BOBtgYod1934eW5G60dppbT+m5hi/1pP5tf+lXineOaiig2l0/gYuIQtf18SosgiPnCg5skgwS2xd6dsUq+tEf0=",
           "nodename": "bitpool",
           "rec_stake": 0,
           "registered_node_type": "validator",
           "validator_credit": "1.000000",
           "validator_stake": 1732,
           "vote_amount": 0,
           "zec_stake": 0
        },
        "errmsg": "OK",
        "errno": 0,
        "sequence_id": "49"
     }
    
  • Failed

    The node has not been registered.

    {
    	"data": null,
    	"errmsg": "ok",
    	"errno": 0,
    	"sequence_id": "8"
    }
    

# Query Miner Reward

Node reward includes workload reward and votes reward.

Request Method

queryNodeReward

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You may use the "shard claim node reward" contract account address: T20000MT3itmNbWs4XYn8R1NUcoucmppJwN7qE69.
node_account_addr No - String Miner account address, if not specified, all miners' reward are queried by default.

Response Parameters

Parameter Name Parameter Type Description
accumulated Uint64 Total amount of miner reward. The unit is uTOP.
issue_time Uint64 The height of the clock when the reward is issued.
last_claim_time Uint64 Clock height of the last time to claim miner reward.
unclaimed Uint64 Unclaimed reward. The unit is uTOP.

Request Sample

  • Query individual miner rewards

    curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325","node_account_addr":"T8000085a8e8acd53c72dca85dcb002a6710796975b4ba"}}&method=queryNodeReward&sequence_id=49&identity_token=&version=1.0'  http://localhost:19081
    
  • Query all miner rewards

    curl -X POST --data 'target_account_addr=T80000fd4f433c036268f17a1b4204ea907e70618d030e&body={"params":{"account_addr":"T20000MTotTKfAJRxrfvEwEJvtgCqzH9GkpMmAUg","node_account_addr":""}}&method=queryNodeReward&sequence_id=49&identity_token=&version=1.0'  http://localhost:19081
    

Response Sample

  • Successful

    • Individual miner rewards

      {
         "data" : {
            "accumulated" : 188072630515731,
            "accumulated_decimals" : 209604,
            "issue_time" : 3533760,
            "last_claim_time" : 0,
            "unclaimed" : 188072630515731,
            "unclaimed_decimals" : 209604
         },
         "errmsg" : "ok",
         "errno" : 0,
         "sequence_id" : "49"
      }
      
    • All miner rewards

      {
         "data" : {
            "T800002276a7d58218ac4978733e5cca927a7d86cb7c87" : {
               "accumulated" : 188072630515731,
               "accumulated_decimals" : 209604,
               "issue_time" : 3533760,
               "last_claim_time" : 0,
               "unclaimed" : 188072630515731,
               "unclaimed_decimals" : 209604
            },
            "T8000066ab344963eaa071f9636faac26b0d1a39900325" : {
               "accumulated" : 135157655656316,
               "accumulated_decimals" : 441988,
               "issue_time" : 3533760,
               "last_claim_time" : 0,
               "unclaimed" : 135157655656316,
               "unclaimed_decimals" : 441988
            }
         },
         "errmsg" : "ok",
         "errno" : 0,
         "sequence_id" : "49"
      }
      
  • Failed

    {
    	"data": null,
    	"errmsg": "ok",
    	"errno": 0,
    	"sequence_id": "10"
    }
    

# List Vote Used

Request Method

listVoteUsed

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You may use the "vote" contract account address: T20000MVfDLsBKVcy1wMp4CoEHWxUeBEAVBL9ZEa.
node_account_addr Yes - String Voter account address.

Response Parameters

Parameter Name Parameter Type Description
vote_infos Map Array Account address of node be voted(String); Amount of votes(Integer).

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T20000MVfDLsBKVcy1wMp4CoEHWxUeBEAVBL9ZEa","node_account_addr":"T8000066ab344963eaa071f9636faac26b0d1a399003254"}}&method=listVoteUsed&sequence_id=80&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

    {
       "data" : {
          "vote_infos" : {
             "T8000085a8e8acd53c72dca85dcb002a6710796975b4ba" : 200
          }
       },
       "errmsg" : "ok",
       "errno" : 0,
       "sequence_id" : "80"
    }
    
  • Failed

    {
    	"data": null,
    	"errmsg": "ok",
    	"errno": 0,
    	"sequence_id": "12"
    }
    

# Query Voter Dividend

Request Method

queryVoterDividend

Request Parameters

Parameter Name Required Default Value Parameter Type Description
account_addr The account address that stores the data being queried. You may use the "shard claim node reward" contract account address: T20000MVfDLsBKVcy1wMp4CoEHWxUeBEAVBL9ZEa.
node_account_addr Yes - String Voter account address.

Response Parameters

Parameter Name Parameter Type Description
accumulated Uint64 Total amount of voter dividend. The unit is uTOP.
last_claim_time Uint64 Clock height of the last time to claim voter dividend.
node_dividend List Dividend information of the miner being voted.
account_addr String Account address of the miner being voted.
accumulated Uint64 The dividend given to the voter by the miner be voted. The unit is uTOP.
last_claim_time Uint64 The height of the clock at which the dividend of the miner was last claimed.
unclaimed Uint64 The unclaimed dividend given to the voter by the miner be voted. The unit is uTOP.
unclaimed Uint64 The total amount of dividends the voter has not claimed. The unit is uTOP.

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T20000MTotTKfAJRxrfvEwEJvtgCqzH9GkpMmAUg","node_account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325"}}&method=queryVoterDividend&sequence_id=82&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

    {
       "data" : {
             "accumulated" : 6994245799976,
             "accumulated_decimals" : 419004,
             "issue_time" : 3535500,
             "last_claim_time" : 0,
             "node_dividend" : [
                {
                   "account_addr" : "T8000085a8e8acd53c72dca85dcb002a6710796975b4ba",
                   "accumulated" : 6994245799976,
                   "accumulated_decimals" : 419004,
                   "issue_time" : 3535500,
                   "last_claim_time" : 0,
                   "unclaimed" : 6994245799976,
                   "unclaimed_decimals" : 419004
                }
             ],
             "unclaimed" : 6994245799976,
             "unclaimed_decimals" : 419004
       },
       "errmsg" : "OK",
       "errno" : 0,
       "sequence_id" : "1"
    }
    
  • Failed

    {
    	"data": null,
    	"errmsg": "ok",
    	"errno": 0,
    	"sequence_id": "14"
    }
    

# Query Proposal

Request Method

queryProposal

Request Parameters

Parameter Name Required default value Parameter Type Description
account_addr Yes - String The account address that stores the data being queried. You may use the "on-chain governance" contract account address: T2000138QMHWxXshXyZa1E48JU1LREu3UrT5KGD2U@0.
proposal_id No - String Proposal ID, if not specified, all proposals are queried by default.

Response Parameters

Parameter Name Parameter Type Description
effective_timer_height Uint64 Proposal effective clock height. If the clock height is less than the clock height at which the proposal was voted through, the proposal will take effect immediately.
expire_time String Proposal expiration time. If the proposal is not approved or rejected by TCC within 259,200 clock height, the proposal will become invalid.
priority Uint8 Proposal priority: 1--Normal;2--Important;3--Critical.
Only the TCC members have the right to vote on a proposal.
proposal_account_addr String The account address of the initiator of proposal.
proposal_deposit Uint64 Proposal deposit,the minimum is 100*10^6 uTOP.
proposal_id String Proposal ID, automatically generated by the system, unique.
proposal_type Uint8 Proposal Type: 1--on-chain parameter modification proposal;2--community fund management proposal.
target String On-Chain Governance Parameter Modification Proposal: Target is on-chain governance parameter, more about on-chain governance parameter please refer to On-Chain Governance Prarameters ;
Community Fund Management Proposal: Target is burn account address: T!0001Ebj8hBvoLdvcEEUwNZ423zM3Kh9d4nL1Ug.
value String When target is on-chain governance parameter, value=new parameter value.
When target is burn account address, value=transferd amount, the unit is uTOP.
voting_status Uint16 Voting status of the proposal: 0-- not begun; 8-- In progress; 9 - failure; 10 - success.

Request Sample

curl -X POST --data 'target_account_addr=T80000fd4f433c036268f17a1b4204ea907e70618d030e&body={"params":{"account_addr":"T2000138QMHWxXshXyZa1E48JU1LREu3UrT5KGD2U@0","proposal_id":"1"}}&method=queryProposal&sequence_id=3&identity_token=&version=1.0'  http://localhost:19081

Response Sample

  • Successful

    {
    	"chain_timer_height": 40,
    	"proposal_deposit": 400,
    	"end_time": "1590487691",
    	"modification_description": "bbb",
    	"new_value": "2",
    	"orig_value": "10000",
    	"parameter": "archive_deposit",
    	"priority": 3,
    	"proposal_account_addr": "T80000fd4f433c036268f17a1b4204ea907e70618d030e",
    	"proposal_id": "1",
    	"voting_status": 0
    }
    
  • Failed

    {
    	"data": null,
    	"errmsg": "ok",
    	"errno": 0,
    	"sequence_id": "16"
    }
    

# Get the Latest Block Height

Get the block heights of 256 shard tables.

Request Method

getLatestTables

Request Parameter

Parameter Name Required default value Parameter Type Description
account_addr Yes - String The rec account address,such as T2000138JQPo5TcurZsVLFUMd5vHJRBLenLWjLhk6@0

Response Parameters

Parameter Name Parameter Type Description
data Uint64 Array 256 parameters, such as [0,1,2,...,0]
Among them, the value of each element in the array represents the latest height of the corresponding table account. For example: the first element of the array is 0, which means that the latest height of the account, with the address Ta0000gRD2qVpp2S7UpjAsznRiRhbE1qNnhMbEDp@0, is 0.

Request Sample

curl -X POST --data 'target_account_addr=T800002276a7d58218ac4978733e5cca927a7d86cb7c87&body={"params":{"account_addr":"T8000066ab344963eaa071f9636faac26b0d1a39900325"}}&method=getLatestTables&sequence_id=5&identity_token=&version=1.0'  http://localhost:19081