tx - Cosmos

tx. Learn how to retrieve detailed transaction data

tx - Cosmos [Value: 20CU]
Retrieves detailed transaction data
Use cases

Use cases

  • Retrieve the result of a specific transaction
  • Analyze transaction events and attributes
  • Monitor gas usage for specific transactions
Constraints

Constraints

  • Requires the exact transaction hash
  • May not return detailed error information
  • Transaction processing time affects availability
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --location 'https://cosmos-hub.drpc.org' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "method": "tx",
    "params": ["0x29452510AC68D7C63E3B45024BE446DB03A3CFCC595AA88723C4DE4C8DB57956", true],
    "id": 1
}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "result": {
    "tx_result": {
      "code": 0,
      "data": "Base64-encoded data",
      "log": "Transaction processed successfully",
      "info": "",
      "gas_wanted": "200000",
      "gas_used": "150000",
      "events": [
        {
          "type": "transfer",
          "attributes": [
            {
              "key": "sender",
              "value": "cosmos1..."
            },
            {
              "key": "recipient",
              "value": "cosmos1..."
            },
            {
              "key": "amount",
              "value": "1000uatom"
            }
          ]
        }
      ]
    },
    "tx": "Base64-encoded transaction data",
    "hash": "0x29452510AC68D7C63E3B45024BE446DB03A3CFCC595AA88723C4DE4C8DB57956"
  },
  "id": 1
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
hashstring
The hash of the transaction you want to query.
proveboolean
Indicates whether a proof of the transaction should be included in the response. If true, a Merkle proof is provided.

Response

200
The result object containing details of the queried transaction

Response params

object
idinteger
jsonrpcstring
resultobject
The result object containing details of the queried transaction, including transaction data, proof (if requested), and metadata.
object
hashstring
The hash of the queried transaction.
heightstring
The block height at which the transaction was included.
indexinteger
The index of the transaction within the block.
tx_resultobject
The result of executing the transaction, including any logs, codes, and gas information.
object
codeinteger
The response code indicating the result of the transaction execution. A code of 0 indicates success.
datastring
Any data returned by the transaction execution.
logstring
The log output from the transaction execution, providing details about events and messages.
infostring
Additional information or details related to the transaction execution.
gas_wantedstring
The amount of gas requested by the transaction.
gas_usedstring
The amount of gas actually used by the transaction.
eventsarray
An array of events emitted by the transaction during execution.
object
typestring
The type of event emitted.
attributesarray
Key-value pairs providing additional information about the event.
object
keystring
The key of the attribute.
valuestring
The value of the attribute.
codespacestring
The namespace for the error code, if any.
txobject
The actual transaction data, typically encoded in base64.
object
typestring
The type of the transaction.
valueobject
The transaction's value, which includes all its fields and data.
proofobject
The Merkle proof for the transaction, included if requested.
object
root_hashstring
The root hash of the Merkle tree for the block.
datastring
The transaction data used in the Merkle proof.
proofobject
Details of the proof structure, including the hashes and paths used to verify the transaction's inclusion.
object
totalstring
The total number of leaf nodes in the Merkle tree.
indexstring
The index of the transaction within the Merkle tree.
leaf_hashstring
The hash of the transaction leaf node.
auntsarray
The sibling hashes on the path from the transaction leaf to the root.