POST /api/v2/sendtx/ - Blockbook REST API
Please note that this REST method requires the Zcash Blockbook add-on enabled on your Quicknode endpoint.
身體參數
hex
字串
必填
載入中...
退貨
結果
字串
載入中...
請求
1curl -X POST "https://docs-demo.zec-mainnet.quiknode.pro/sendtx/" \2-H "Content-Type: application/json" \3-H "Accept: application/json" \4-d '{5"hex": "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"6}'
1curl -X POST "https://docs-demo.zec-mainnet.quiknode.pro/sendtx/" \2-H "Content-Type: application/json" \3-H "Accept: application/json" \4-d '{5"hex": "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"6}'
1const 正文 = {2hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"3}45async 函式 main() {6const response = await fetch('https://docs-demo.zec-mainnet.quiknode.pro/sendtx/', {7方法: 'POST',8headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},9正文: JSON.stringify(body)10})11const data = 等待 response.json()12控制台.日誌(資料)13}1415主頁()
1const 正文 = {2hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"3}45async 函式 main() {6const response = await fetch('https://docs-demo.zec-mainnet.quiknode.pro/sendtx/', {7方法: 'POST',8headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},9正文: JSON.stringify(body)10})11const data = 等待 response.json()12控制台.日誌(資料)13}1415主頁()
1匯入 請求2import json34url = "https://docs-demo.zec-mainnet.quiknode.pro/sendtx/"56有效載荷 = json.dumps({7"hex": "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"8})910標題 = {11「Content-Type」: 'application/json',12'Accept': 'application/json'13}1415回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)1617列印(回應.text)
1匯入 請求2import json34url = "https://docs-demo.zec-mainnet.quiknode.pro/sendtx/"56有效載荷 = json.dumps({7"hex": "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"8})910標題 = {11「Content-Type」: 'application/json',12'Accept': 'application/json'13}1415回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)1617列印(回應.text)
1需要 "uri"2require "json"3需要 "net/http"45uri = URI("https://docs-demo.zec-mainnet.quiknode.pro/sendtx/")67有效載荷 = {8hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"9}1011請求 = 淨::HTTP::POST.new(URI)12請求["Content-Type"] = "application/json"13請求[「接受」] = "application/json"14請求。正文 = JSON.generate(有效載荷)1516回應 = 淨::HTTP.開始(uri.主機, uri.port, use_ssl: true) 執行 |http|17http.請求(請求)18結束1920將回應。正文
1需要 "uri"2require "json"3需要 "net/http"45uri = URI("https://docs-demo.zec-mainnet.quiknode.pro/sendtx/")67有效載荷 = {8hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"9}1011請求 = 淨::HTTP::POST.new(URI)12請求["Content-Type"] = "application/json"13請求[「接受」] = "application/json"14請求。正文 = JSON.generate(有效載荷)1516回應 = 淨::HTTP.開始(uri.主機, uri.port, use_ssl: true) 執行 |http|17http.請求(請求)18結束1920將回應。正文
回應
1{2"result": "txid_of_broadcasted_transaction"3}
1{2"result": "txid_of_broadcasted_transaction"3}