Skip to content

Broadcast Transaction

The Broadcast Transaction method is used to send a transaction to the network for processing.

The key parameters include the transaction itself and the mode of broadcasting, which is optional and defaults to synchronous broadcasting mode.

Method Declaration

Python
async def broadcast(self, transaction: Tx, mode=BroadcastMode.BROADCAST_MODE_SYNC)

Parameters

ParameterLocationTypeRequiredDescription
transactionqueryTxtrueThe transaction to broadcast.
modequeryBroadcastModefalseThe broadcast mode. Defaults to BroadcastMode.BROADCAST_MODE_SYNC.

:::

Response

StatusMeaningSchema
200OKTxHash
400Bad RequestThe request was malformed or invalid.
404Not FoundThe transaction was not found.

Examples: Rust