Yeah, it's not a wallet RPC so everything that should be inputted is manual.
I forgot to tell you about "
getrawtransaction" to get the raw transaction and suggested "
decoderawtransaction" right away;
As instructed by HCP, you need to use "
getrawtransaction", but instead of using the two commands,
you can just add the optional "
true" or "
1" flag to get the result decoded.
Try it on HCP's example transaction:getrawtransaction 2c7a86754ea57332533cc0ff8ede520741d9c1028eef9c18ff40b728787f20d9 true
Not sure yet which information from "decoderawtransaction" I have to input in "creatrawtransaction".
From the result, you need to take note of the things I've mentioned in my previous post.
Inside the inputs (
"vin": under "locktime":): The "
txid" and the "
output index" under it (
"vout":); there may be more than one input.
Sample to-be-replaced txn (with three inputs):
{
"txid": "1b953d716cade46990479251b33b078bf4ed7331750a0921da4ffa3cc766a7d5",
"hash": "04c5071e1eb4e11014d5932858f5c8ec79b43233fd09775021b337cea5d688eb",
"version": 2,
"size": 518,
"vsize": 435,
"weight": 1739,
"locktime": 0,
"vin": [
{
"txid": "0663168bf247f75b8907179f4ee6d7bf92874f2619933587fc97dc066f74659a",
"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"304402206628679c970c5d66bb3d3c9cc8998a98887....."
],
"sequence": 4294967293
},
{
"txid": "97e38ad0eff0977de905febc508c0c5cb722dcfb172435f6092a822dd529dd4a",
"vout": 0,
"scriptSig": {
"asm": "304402205caec4d3f4b4b34343b4ca4269035f.....",
"hex": "47304402205caec4d3f4b4b34343b4ca426903....."
},
"sequence": 4294967293
},
{
"txid": "d1bcbfdd3769b7cdb8b1ed1147f743cf8525b38f425564e72c2612ac3f3ae5b6",
"vout": 0,
"scriptSig": {
"asm": "304402203ba35046f9779385bc20fcd384572d......",
"hex": "47304402203ba35046f9779385bc20fcd384572....."
},
"sequence": 4294967293
}
],
"vout": [
{
"value": 0.08100000,
"n": 0,
"scriptPubKey": {
"asm": "0 993b422c3f321f8abc317ebc260f2bb67891039d",
"hex": "0014993b422c3f321f8abc317ebc260f2bb67891039d",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"bcrt1qnya5ytplxg0c40p3067zvretkeufzquafczmsr"
]
}
},
{
"value": 0.00002143,
"n": 1,
"scriptPubKey": {
"asm": "0 403c394137dcddecbfb76707fb1ebefd65b87d03",
"hex": "0014403c394137dcddecbfb76707fb1ebefd65b87d03",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"bcrt1qgq7rjsfhmnw7e0ahvurlk847l4jmslgr93pdad"
]
}
}
]
}
If you want to completely re-create the txn, just use all the inputs and copy the outputs but reduce the amount of the change by a value enough to cover the additional fee for the replacement txn.
Getting the inputs' amounts is necessary if you'll not use all of them for the replacement txn.