# Query Transaction

Request

topio querytx

Request Parameters

Parameter Name Required Deafult Value Type Description
hash Yes - String The latest transaction hash of the account which can be retrieved via topio chain queryAccount.
account_addr No The default account String Transaction sender's account address or receiver's account address. If not specified, the default account transaction information will be queried.

Options

Option Name Value Type Description
-h, --help - - Check the command's help information.

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.

Request Sample

topio querytx 0x0e4bcb020f2fdf6ed4105385a2d564b6ae33f7ae8d85563d471c7240713d8c5b T800002276a7d58218ac4978733e5cca927a7d86cb7c87

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" : "8"
      }
      
    • 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" : "18"
      }
      
    • 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" : "17"
      }
      
  • Failed: The transaction is neither in the block nor in the transaction pool.

    No data!
    Errmsg: account address or transaction hash error/does not exist