check_tx - Cosmos

check_tx. Discover how to broadcast transactions

check_tx - Cosmos [Value: 20CU]
Retrieves how to broadcast transactions
Use cases

Use cases

  • Validate transaction without broadcasting to the network
  • Check transaction gas requirements before execution
  • Pre-check transaction status before committing
Constraints

Constraints

  • Transaction might still fail after validation
  • Validation does not guarantee block inclusion
  • Resource usage depends on transaction complexity
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": "check_tx",
    "params": [
        "TRANSACTION_HASH"
    ],
    "id": 1
}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "result": {
    "code": 0,
    "data": "CHECK_TX_DATA",
    "log": "CheckTx passed successfully",
    "info": "",
    "gas_wanted": "200000",
    "gas_used": "150000",
    "events": [],
    "codespace": ""
  },
  "id": 1
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersstring
string
txstring
The encoded transaction to be checked. The transaction should be base64 encoded.

Response

200
Contains the result of the transaction check

Response params

object
idinteger
jsonrpcstring
resultobject
object
codeinteger
The status code indicating the outcome of the transaction check. A code of 0 typically means success.
datastring
The data associated with the transaction, often containing relevant details or identifiers.
logstring
The log message providing details about the transaction's processing and outcome.
codespacestring
The codespace within which the status code is defined, indicating the module that generated the code.
gas_wantedstring
The amount of gas requested for the transaction during the CheckTx phase.
gas_usedstring
The amount of gas actually used by the transaction during the CheckTx phase.
eventsarray
A list of events triggered during the transaction check.
object
typestring
The type of event triggered during the transaction check.
attributesarray
Attributes associated with the event, providing key-value pairs.
object
keystring
The key of the attribute.
valuestring
The value of the attribute.
errorobject
Details of the error, if any occurred during the transaction check.