broadcast_tx_async - Cosmos

Broadcasts a transaction and returns immediately, without running CheckTx or waiting for inclusion. The transaction may still be rejected.

Method

broadcast_tx_async

Parameters

ParameterTypeDescription
txstringBase64-encoded signed transaction

Example

bashexport COSMOS_TM=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

# JSON-RPC over HTTP (POST)
curl -X POST "${COSMOS_TM}" -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "id": "getblock.io", "method": "broadcast_tx_async", "params": {"tx": "Cg8KQ..."}}'

# URI over HTTP (GET)
curl "${COSMOS_TM}broadcast_tx_async?tx=Cg8KQ..."

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "code": 0,
        "hash": "9A1B2C..."
    }
}

Response Fields

FieldTypeDescription
codenumberAlways 0 (the node did not validate)
hashstringThe transaction hash

Use Cases

  • Fire-and-forget: Submit without waiting for validation

Error Handling

ErrorMessageDescription
-32600 / Invalid requestInvalid requestThe JSON-RPC envelope was malformed
-32602 / Invalid paramsInvalid paramsA parameter was missing or of the wrong type
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect