Broadcast UTXO transaction (ZEC)
curl --request POST \
--url https://api.leokit.dev/broadcast \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "zcash",
"tx_hex": "0500008085202f8901..."
}
'import requests
url = "https://api.leokit.dev/broadcast"
payload = {
"chain": "zcash",
"tx_hex": "0500008085202f8901..."
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain: 'zcash', tx_hex: '0500008085202f8901...'})
};
fetch('https://api.leokit.dev/broadcast', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leokit.dev/broadcast",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'zcash',
'tx_hex' => '0500008085202f8901...'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leokit.dev/broadcast"
payload := strings.NewReader("{\n \"chain\": \"zcash\",\n \"tx_hex\": \"0500008085202f8901...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.leokit.dev/broadcast")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"zcash\",\n \"tx_hex\": \"0500008085202f8901...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leokit.dev/broadcast")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"zcash\",\n \"tx_hex\": \"0500008085202f8901...\"\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"data": {
"txid": "<string>"
}
}{
"message": "<string>",
"code": "<string>"
}Endpoint Details
Broadcast Transaction
Broadcast a signed UTXO transaction via LeoKit’s NowNodes proxy (currently ZEC only)
POST
/
broadcast
Broadcast UTXO transaction (ZEC)
curl --request POST \
--url https://api.leokit.dev/broadcast \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "zcash",
"tx_hex": "0500008085202f8901..."
}
'import requests
url = "https://api.leokit.dev/broadcast"
payload = {
"chain": "zcash",
"tx_hex": "0500008085202f8901..."
}
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chain: 'zcash', tx_hex: '0500008085202f8901...'})
};
fetch('https://api.leokit.dev/broadcast', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leokit.dev/broadcast",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'zcash',
'tx_hex' => '0500008085202f8901...'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leokit.dev/broadcast"
payload := strings.NewReader("{\n \"chain\": \"zcash\",\n \"tx_hex\": \"0500008085202f8901...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.leokit.dev/broadcast")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"zcash\",\n \"tx_hex\": \"0500008085202f8901...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leokit.dev/broadcast")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"zcash\",\n \"tx_hex\": \"0500008085202f8901...\"\n}"
response = http.request(request)
puts response.read_body{
"status": 123,
"data": {
"txid": "<string>"
}
}{
"message": "<string>",
"code": "<string>"
}Overview
/leokit/broadcast is a server-side proxy for broadcasting signed UTXO transactions on chains where public APIs don’t allow CORS from a browser. Currently the only supported chain is Zcash (ZEC), where the most reliable public node (NowNodes) requires a server-side API key.
Use this endpoint when your client-side ZEC swap flow needs to push a signed transaction without exposing your NowNodes key.
Endpoint
POST /leokit/broadcast
Request
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
Api-Key | Your API key |
Body
| Field | Type | Required | Description |
|---|---|---|---|
chain | string | Yes | Chain identifier. Currently only zcash |
tx_hex | string | Yes | Hex-encoded signed transaction |
Response
Success (200)
{
"data": {
"txid": "f4d6c2..."
},
"status": 200
}
| Field | Description |
|---|---|
txid | Confirmed transaction ID returned by the upstream node |
Errors
| Status | Code | Description |
|---|---|---|
400 | BAD_REQUEST | Missing/invalid tx_hex, or chain not in the supported list |
405 | METHOD_NOT_ALLOWED | Non-POST request |
502 | BROADCAST_FAILED | Upstream node rejected the broadcast (returned in error body) |
503 | SERVICE_UNAVAILABLE | Server has no NowNodes API key configured |
Example
curl -X POST https://api.leokit.dev/leokit/broadcast \
-H "Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain": "zcash",
"tx_hex": "0500008085202f8901..."
}'
Notes
- Successful broadcasts return immediately once the upstream node accepts the transaction. Use
/leokit/statusto track confirmation. - ZEC transparent (
t-) transactions are forwarded to NowNodes’ BlockBooksendtxendpoint. Shielded (z-) transactions are not yet supported by this proxy. - This endpoint is a thin pass-through: the same
txidyou’d get by calling NowNodes directly.
Authorizations
Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4
Body
application/json