cosmos/tx/v1beta1/txs

Broadcast a transaction

Parameters

Object NameRequiredTypeDetail
tx_bytesStringThe raw transaction.
modeStringThe broadcast mode for the transaction. Choose from BROADCAST_MODE_UNSPECIFIED, BROADCAST_MODE_BLOCK, BROADCAST_MODE_SYNC and BROADCAST_MODE_ASYNC
{
    "tx_bytes": "CpEBCo4BChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEm4KLWNvc21vczFmN253amZya3M1enBhZ3V1Z2VyanRncDJlaDZmdXFkMDkzOWZlMhItY29zbW9zMXU0cGczcXhncjhkdzhrM3QybG0yeHo3ZjJ6Y2p5ZWh3OG5lY2tsGg4KBXVhdG9tEgU1MDAwMBJnClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED5aKrECAn98W+IUI7OjOPCu5jLUqx64jSP+HOQn/PaMcSBAoCCH8YARITCg0KBXVhdG9tEgQyMDAwEIDxBBpA+GbfnijcDQV96uvIJD0Ks+68bWl4aK6QR496KeBcheUx4ZOviZlaVHRBCsLOQLKy94+VJv5Ip6SEhcUEgus5eA==",
    "mode": "BROADCAST_MODE_SYNC"
}

Result

The broadcasted transaction.

Example

Request

curl <your-rest-endpoint>/cosmos/tx/v1beta1/txs \
  -X POST \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"tx_bytes": "CpEBCo4BChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEm4KLWNvc21vczFmN253amZya3M1enBhZ3V1Z2VyanRncDJlaDZmdXFkMDkzOWZlMhItY29zbW9zMXU0cGczcXhncjhkdzhrM3QybG0yeHo3ZjJ6Y2p5ZWh3OG5lY2tsGg4KBXVhdG9tEgU1MDAwMBJnClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED5aKrECAn98W+IUI7OjOPCu5jLUqx64jSP+HOQn/PaMcSBAoCCH8YARITCg0KBXVhdG9tEgQyMDAwEIDxBBpA+GbfnijcDQV96uvIJD0Ks+68bWl4aK6QR496KeBcheUx4ZOviZlaVHRBCsLOQLKy94+VJv5Ip6SEhcUEgus5eA==","mode": "BROADCAST_MODE_SYNC"}'

Return

{
  "tx_response": {
    "height": "0",
    "txhash": "026480527250ED416428E9AF34CBA475899EC11E95513616E3425FFAB465EC51",
    "codespace": "sdk",
    "code": 19,
    "data": "",
    "raw_log": "",
    "logs": [
    ],
    "info": "",
    "gas_wanted": "0",
    "gas_used": "0",
    "tx": null,
    "timestamp": ""
  }
}