Submit transaction replacement
curl --request POST \
--url https://api.kas.fyi/v1/rpc/submitTransactionReplacement \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"transaction": {
"version": 0,
"inputs": [
{
"previousOutpoint": {
"transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
"index": 1
},
"signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
"sequence": 0,
"sigOpCount": 1
}
],
"outputs": [
{
"value": "100000",
"scriptPublicKey": {
"version": 0,
"script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
}
}
],
"lockTime": 0,
"subnetworkId": "0000000000000000000000000000000000000000",
"gas": "0",
"payload": ""
}
}
'import requests
url = "https://api.kas.fyi/v1/rpc/submitTransactionReplacement"
payload = { "transaction": {
"version": 0,
"inputs": [
{
"previousOutpoint": {
"transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
"index": 1
},
"signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
"sequence": 0,
"sigOpCount": 1
}
],
"outputs": [
{
"value": "100000",
"scriptPublicKey": {
"version": 0,
"script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
}
}
],
"lockTime": 0,
"subnetworkId": "0000000000000000000000000000000000000000",
"gas": "0",
"payload": ""
} }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction: {
version: 0,
inputs: [
{
previousOutpoint: {
transactionId: 'fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820',
index: 1
},
signatureScript: '4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01',
sequence: 0,
sigOpCount: 1
}
],
outputs: [
{
value: '100000',
scriptPublicKey: {
version: 0,
script: '208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac'
}
}
],
lockTime: 0,
subnetworkId: '0000000000000000000000000000000000000000',
gas: '0',
payload: ''
}
})
};
fetch('https://api.kas.fyi/v1/rpc/submitTransactionReplacement', 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.kas.fyi/v1/rpc/submitTransactionReplacement",
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([
'transaction' => [
'version' => 0,
'inputs' => [
[
'previousOutpoint' => [
'transactionId' => 'fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820',
'index' => 1
],
'signatureScript' => '4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01',
'sequence' => 0,
'sigOpCount' => 1
]
],
'outputs' => [
[
'value' => '100000',
'scriptPublicKey' => [
'version' => 0,
'script' => '208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac'
]
]
],
'lockTime' => 0,
'subnetworkId' => '0000000000000000000000000000000000000000',
'gas' => '0',
'payload' => ''
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.kas.fyi/v1/rpc/submitTransactionReplacement"
payload := strings.NewReader("{\n \"transaction\": {\n \"version\": 0,\n \"inputs\": [\n {\n \"previousOutpoint\": {\n \"transactionId\": \"fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820\",\n \"index\": 1\n },\n \"signatureScript\": \"4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01\",\n \"sequence\": 0,\n \"sigOpCount\": 1\n }\n ],\n \"outputs\": [\n {\n \"value\": \"100000\",\n \"scriptPublicKey\": {\n \"version\": 0,\n \"script\": \"208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac\"\n }\n }\n ],\n \"lockTime\": 0,\n \"subnetworkId\": \"0000000000000000000000000000000000000000\",\n \"gas\": \"0\",\n \"payload\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-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.kas.fyi/v1/rpc/submitTransactionReplacement")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction\": {\n \"version\": 0,\n \"inputs\": [\n {\n \"previousOutpoint\": {\n \"transactionId\": \"fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820\",\n \"index\": 1\n },\n \"signatureScript\": \"4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01\",\n \"sequence\": 0,\n \"sigOpCount\": 1\n }\n ],\n \"outputs\": [\n {\n \"value\": \"100000\",\n \"scriptPublicKey\": {\n \"version\": 0,\n \"script\": \"208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac\"\n }\n }\n ],\n \"lockTime\": 0,\n \"subnetworkId\": \"0000000000000000000000000000000000000000\",\n \"gas\": \"0\",\n \"payload\": \"\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kas.fyi/v1/rpc/submitTransactionReplacement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction\": {\n \"version\": 0,\n \"inputs\": [\n {\n \"previousOutpoint\": {\n \"transactionId\": \"fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820\",\n \"index\": 1\n },\n \"signatureScript\": \"4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01\",\n \"sequence\": 0,\n \"sigOpCount\": 1\n }\n ],\n \"outputs\": [\n {\n \"value\": \"100000\",\n \"scriptPublicKey\": {\n \"version\": 0,\n \"script\": \"208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac\"\n }\n }\n ],\n \"lockTime\": 0,\n \"subnetworkId\": \"0000000000000000000000000000000000000000\",\n \"gas\": \"0\",\n \"payload\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transactionId": "34e9538fd3225652553930657c3d767d5ccab0fcd545038a69c202e45929dcd6",
"replacedTransaction": {
"version": 0,
"inputs": [
{
"previousOutpoint": {
"transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
"index": 1
},
"signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
"sequence": 0,
"sigOpCount": 1
}
],
"outputs": [
{
"value": "100000",
"scriptPublicKey": {
"version": 0,
"script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
}
}
],
"lockTime": 0,
"subnetworkId": "0000000000000000000000000000000000000000",
"gas": "0",
"payload": ""
}
}Transaction Operations
Submit transaction replacement
Submits a replacement transaction to the network.
POST
/
v1
/
rpc
/
submitTransactionReplacement
Submit transaction replacement
curl --request POST \
--url https://api.kas.fyi/v1/rpc/submitTransactionReplacement \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"transaction": {
"version": 0,
"inputs": [
{
"previousOutpoint": {
"transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
"index": 1
},
"signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
"sequence": 0,
"sigOpCount": 1
}
],
"outputs": [
{
"value": "100000",
"scriptPublicKey": {
"version": 0,
"script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
}
}
],
"lockTime": 0,
"subnetworkId": "0000000000000000000000000000000000000000",
"gas": "0",
"payload": ""
}
}
'import requests
url = "https://api.kas.fyi/v1/rpc/submitTransactionReplacement"
payload = { "transaction": {
"version": 0,
"inputs": [
{
"previousOutpoint": {
"transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
"index": 1
},
"signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
"sequence": 0,
"sigOpCount": 1
}
],
"outputs": [
{
"value": "100000",
"scriptPublicKey": {
"version": 0,
"script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
}
}
],
"lockTime": 0,
"subnetworkId": "0000000000000000000000000000000000000000",
"gas": "0",
"payload": ""
} }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
transaction: {
version: 0,
inputs: [
{
previousOutpoint: {
transactionId: 'fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820',
index: 1
},
signatureScript: '4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01',
sequence: 0,
sigOpCount: 1
}
],
outputs: [
{
value: '100000',
scriptPublicKey: {
version: 0,
script: '208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac'
}
}
],
lockTime: 0,
subnetworkId: '0000000000000000000000000000000000000000',
gas: '0',
payload: ''
}
})
};
fetch('https://api.kas.fyi/v1/rpc/submitTransactionReplacement', 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.kas.fyi/v1/rpc/submitTransactionReplacement",
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([
'transaction' => [
'version' => 0,
'inputs' => [
[
'previousOutpoint' => [
'transactionId' => 'fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820',
'index' => 1
],
'signatureScript' => '4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01',
'sequence' => 0,
'sigOpCount' => 1
]
],
'outputs' => [
[
'value' => '100000',
'scriptPublicKey' => [
'version' => 0,
'script' => '208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac'
]
]
],
'lockTime' => 0,
'subnetworkId' => '0000000000000000000000000000000000000000',
'gas' => '0',
'payload' => ''
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.kas.fyi/v1/rpc/submitTransactionReplacement"
payload := strings.NewReader("{\n \"transaction\": {\n \"version\": 0,\n \"inputs\": [\n {\n \"previousOutpoint\": {\n \"transactionId\": \"fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820\",\n \"index\": 1\n },\n \"signatureScript\": \"4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01\",\n \"sequence\": 0,\n \"sigOpCount\": 1\n }\n ],\n \"outputs\": [\n {\n \"value\": \"100000\",\n \"scriptPublicKey\": {\n \"version\": 0,\n \"script\": \"208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac\"\n }\n }\n ],\n \"lockTime\": 0,\n \"subnetworkId\": \"0000000000000000000000000000000000000000\",\n \"gas\": \"0\",\n \"payload\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-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.kas.fyi/v1/rpc/submitTransactionReplacement")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"transaction\": {\n \"version\": 0,\n \"inputs\": [\n {\n \"previousOutpoint\": {\n \"transactionId\": \"fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820\",\n \"index\": 1\n },\n \"signatureScript\": \"4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01\",\n \"sequence\": 0,\n \"sigOpCount\": 1\n }\n ],\n \"outputs\": [\n {\n \"value\": \"100000\",\n \"scriptPublicKey\": {\n \"version\": 0,\n \"script\": \"208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac\"\n }\n }\n ],\n \"lockTime\": 0,\n \"subnetworkId\": \"0000000000000000000000000000000000000000\",\n \"gas\": \"0\",\n \"payload\": \"\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kas.fyi/v1/rpc/submitTransactionReplacement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"transaction\": {\n \"version\": 0,\n \"inputs\": [\n {\n \"previousOutpoint\": {\n \"transactionId\": \"fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820\",\n \"index\": 1\n },\n \"signatureScript\": \"4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01\",\n \"sequence\": 0,\n \"sigOpCount\": 1\n }\n ],\n \"outputs\": [\n {\n \"value\": \"100000\",\n \"scriptPublicKey\": {\n \"version\": 0,\n \"script\": \"208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac\"\n }\n }\n ],\n \"lockTime\": 0,\n \"subnetworkId\": \"0000000000000000000000000000000000000000\",\n \"gas\": \"0\",\n \"payload\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transactionId": "34e9538fd3225652553930657c3d767d5ccab0fcd545038a69c202e45929dcd6",
"replacedTransaction": {
"version": 0,
"inputs": [
{
"previousOutpoint": {
"transactionId": "fa99f98b8e9b0758100d181eccb35a4c053b8265eccb5a89aadd794e087d9820",
"index": 1
},
"signatureScript": "4123c94e322fd98ce4ba8b2e33b47f2984a2f741ecfea6fb48eb90d209a46b9d58639888a1575a717cb243b006edd720a7153e9a7e63f4539958d0a44eea8bfa9f01",
"sequence": 0,
"sigOpCount": 1
}
],
"outputs": [
{
"value": "100000",
"scriptPublicKey": {
"version": 0,
"script": "208b42bec57f9a538f740b067f947a5b29e04043218a37ff1fa7fb5ee850fd3fd3ac"
}
}
],
"lockTime": 0,
"subnetworkId": "0000000000000000000000000000000000000000",
"gas": "0",
"payload": ""
}
}Cost
This endpoint costs 0.1 RU (Request Units) per call.Authorizations
API key required for authentication. Get your API key at https://developer.kas.fyi
Body
application/json
Replacement transaction to submit
Show child attributes
Show child attributes
Response
200 - application/json
Transaction replacement submitted successfully
⌘I