TAAL Transaction Endpoints
The simplest way to broadcast transactions to BSV is to use the broadcast and the batchBroadcast endpoints. /api/v1/broadcast expects a single transaction whilst /api/v1/batchBroadcast expects a batch of them.
With both of these it is possible to send your request as text with the
application/json
mimetype or binary with the application/octet-stream
mimetype (discussed below).The binary format has 2 advantages:
- 1.The size of the request payload is half of the text equivalent.
- 2.Unlike with JSON, the 1st transaction in the binary stream can be processed before the entire payload has been received.
The endpoints are:
curl -X POST https://api.taal.com/api/v1/broadcast
curl -X POST https://api.taal.com/api/v1/batchBroadcast
Please note that these endpoints require a Taal APIKey that can be obtained for free by registering at https://platform.taal.com
Request body
{
"rawTx": "bitcoin transaction in hex..."
}
Response, if successful:
201 Created
text/plain
<32 byte TXID in 64 hexadecimal characters>
Response, if not successful
400 Bad request
application/json
{
"status": number,
"code": number,
"error": "string"
}
These are the exact responses returned by the bitcoin node.
Request body
bitcoin transaction as a stream of bytes (binary)
Response, if successful:
201 Created
text/plain
<32 byte TXID in 64 hexadecimal characters>
Request body
[
{
"rawTx": "bitcoin transaction in hex..."
},
{
"rawTx": "bitcoin transaction in hex..."
},
....
]
Request body
one or more bitcoin transactions as a stream of bytes (binary)
Response for both text and binary requests:
200 OK
application/json
{
"txs": [
{
"txid": "<32 byte TXID in 64 hexadecimal characters>",
"returnResult": "success or failure",
"resultDescription": "string"
}
],
"failureCount": number
}
The resultDescription contains the exact responses returned by the bitcoin node for each transaction.
Last modified 2mo ago