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
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
transaction | query | Tx | true | The transaction to broadcast. |
mode | query | BroadcastMode | false | The broadcast mode. Defaults to BroadcastMode.BROADCAST_MODE_SYNC. |
:::
Response
| Status | Meaning | Schema | |
|---|---|---|---|
200 | OK | TxHash | |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The transaction was not found. |
Examples: Rust