broadcast tx - Stable

Broadcasts a signed, protobuf-encoded transaction. The body carries the base64 tx_bytes and a broadcast mode (SYNC, ASYNC, or BLOCK).

Endpoint

httpPOST /cosmos/tx/v1beta1/txs

Example

bashexport STABLE_REST=https://shared.ap-southeast-1.getblock.io/<ACCESS-TOKEN>/

curl -X POST "${STABLE_REST}cosmos/tx/v1beta1/txs" \
  -H "Content-Type: application/json" \
  -d '{"tx_bytes": "Cr4BCr...base64-encoded-tx", "mode": "BROADCAST_MODE_SYNC"}'

Response

json{
    "tx_response": {
        "height": "0",
        "txhash": "9A1B2C...",
        "code": 0,
        "raw_log": "",
        "gas_wanted": "200000",
        "gas_used": "84000"
    }
}

Response Fields

FieldTypeDescription
tx_response.txhashstringThe transaction hash
tx_response.codenumberResult code (0 = accepted)
tx_response.raw_logstringLog or error message
tx_response.gas_usedstringGas used

Use Cases

  • Submission: Broadcast a signed Cosmos transaction
  • Mode choice: Use SYNC for mempool confirmation, ASYNC for fire-and-forget

Error Handling

ErrorMessageDescription
400 / Bad requestBad requestA path, query, or body parameter was invalid
404 / Not foundNot foundThe account, validator, proposal, or resource does not exist
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect