POST /api/v2/sendtx/ - Blockbook REST API
Please note that this REST method requires the Litecoin Blockbook add-on enabled on your Quicknode endpoint.
身体参数
hex
字符串
必填
正在加载...
退货
结果
字符串
正在加载...
请求
1curl -X POST "https://docs-demo.ltc-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.ltc-mainnet.quiknode.pro/sendtx/" \2-H "Content-Type: application/json" \3-H "Accept: application/json" \4-d '{5"hex": "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"6}'
1const body = {2hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"3}45async 函数 main() {6const response = await fetch('https://docs-demo.ltc-mainnet.quiknode.pro/sendtx/', {7方法: 'POST',8headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},9正文: JSON.stringify(body)10})11const data = await response.json()12控制台.log(数据)13}1415主()
1const body = {2hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"3}45async 函数 main() {6const response = await fetch('https://docs-demo.ltc-mainnet.quiknode.pro/sendtx/', {7方法: 'POST',8headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},9正文: JSON.stringify(body)10})11const data = await response.json()12控制台.log(数据)13}1415主()
1导入 请求2import json34url = "https://docs-demo.ltc-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.ltc-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)
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.ltc-mainnet.quiknode.pro/sendtx/")67有效载荷 = {8hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"9}1011请求 = Net::HTTP::POST.new(URI)12请求["Content-Type"] = "application/json"13请求[“接受”] = "application/json"14请求.请求体 = JSON.生成(有效载荷)1516回复 = 净::HTTP.start(uri.主机, uri.端口, use_ssl: true) 执行 |http|17http.请求(请求)18结束1920返回响应.正文
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.ltc-mainnet.quiknode.pro/sendtx/")67有效载荷 = {8hex: "0200000001ab3f6d2e1c4b5a68397d2f1e0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c101000000ffffffff01e803000000000000ffffffff00000000"9}1011请求 = Net::HTTP::POST.new(URI)12请求["Content-Type"] = "application/json"13请求[“接受”] = "application/json"14请求.请求体 = JSON.生成(有效载荷)1516回复 = 净::HTTP.start(uri.主机, uri.端口, use_ssl: true) 执行 |http|17http.请求(请求)18结束1920返回响应.正文
回复
1{2"result": "txid_of_broadcasted_transaction"3}
1{2"result": "txid_of_broadcasted_transaction"3}