For the complete documentation index, see llms.txt. This page is also available as Markdown.

check_tx - Cosmos

Example code for the check_tx JSON-RPC method. Complete guide on how to use check_tx JSON-RPC in GetBlock Web3 documentation.

Runs CheckTx against the application without broadcasting the transaction to the network. Use this to validate a signed transaction before deciding to broadcast — checks signature, sequence, fees, etc.

Parameters

Parameter
Type
Required
Description

tx

string

Yes

Base64-encoded signed transaction bytes

Request Example

# JSON-RPC over HTTP POST (canonical)
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/check_tx' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "check_tx",
    "params": {
        "tx": "Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczF0NnJsZ2Y4MGpkOHRhbnBubnZtbXhmcWRjbTljbjd3Y3RyczdoaxItY29zbW9zMWdoZDc1M3NoamVjajRpdjJ4Mmk4eHJrenphbnpqdnZjMjJ4MmtuGgoKBXVhdG9tEgExEnIKWg=="
    },
    "id": "getblock.io"
}'

# URI over HTTP GET (alternate, for simple methods)
curl --location --request GET 'https://go.getblock.io/<ACCESS-TOKEN>/check_tx?tx="Co0BCooBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmoKLWNvc21vczF0NnJsZ2Y4MGpkOHRhbnBubnZtbXhmcWRjbTljbjd3Y3RyczdoaxItY29zbW9zMWdoZDc1M3NoamVjajRpdjJ4Mmk4eHJrenphbnpqdnZjMjJ4MmtuGgoKBXVhdG9tEgExEnIKWg=="'

Response Example

Response Parameters

Field
Type
Description

result.code

integer

0 if the transaction would be accepted

result.log

string

Failure reason if code is non-zero

result.gas_wanted

string

Gas limit declared by the transaction

result.codespace

string

Module codespace for non-zero codes

Use Cases

  • Pre-flight transaction validation in wallets

  • Simulating transactions for fee estimation

  • Debugging signing failures before broadcast

Error Handling

Status Code
Error Message
Cause

404

Not found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?