cosmos.tx.v1beta1.Service/BroadcastTx - Cronos
Example code for the cosmos.tx.v1beta1.Service/BroadcastTx gRPC method. Complete guide on how to use cosmos.tx.v1beta1.Service/BroadcastTx gRPC method in GetBlock Web3 documentation.
Submits a signed, protobuf-encoded transaction and returns the broadcast result. The gRPC equivalent of the REST broadcast endpoint; the mode selects sync vs async behaviour.
Service Method
cosmos.tx.v1beta1.Service/BroadcastTxMessage Fields
tx_bytes
string
Base64/hex protobuf-encoded signed transaction
mode
string
BROADCAST_MODE_SYNC or BROADCAST_MODE_ASYNC
Example
grpcurl \
-H "x-api-key: <ACCESS-TOKEN>" \
-d '{
"tx_bytes": "Cr0BCroBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5k...",
"mode": "BROADCAST_MODE_SYNC"
}' \
shared.eu-central-1.getblock.io:443 \
cosmos.tx.v1beta1.Service/BroadcastTxResponse
Response Fields
tx_response.txhash
string
Hash to track the transaction
tx_response.code
integer
0 means accepted; non-zero is an error
Use Cases
Transaction Submission: Broadcast a signed transaction over gRPC
Backends: Typed broadcast in a production service
Mode Control: Choose sync vs async
Error Handling
InvalidArgument
Decode error
tx_bytes could not be decoded
403 / RBAC: access denied
Access denied
The GetBlock access token is missing or incorrect
Last updated
Was this helpful?