Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | static UniValue getrawtransaction(const Config &config, | ||||
return result; | return result; | ||||
} | } | ||||
static UniValue gettxoutproof(const Config &config, | static UniValue gettxoutproof(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || | if (request.fHelp || | ||||
(request.params.size() != 1 && request.params.size() != 2)) { | (request.params.size() != 1 && request.params.size() != 2)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"gettxoutproof [\"txid\",...] ( blockhash )\n" | RPCHelpMan{"gettxoutproof", | ||||
{ | |||||
{"txids", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"txid", RPCArg::Type::STR_HEX, false}, | |||||
}, | |||||
false}, | |||||
{"blockhash", RPCArg::Type::STR_HEX, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nReturns a hex-encoded proof that \"txid\" was included in a " | "\nReturns a hex-encoded proof that \"txid\" was included in a " | ||||
"block.\n" | "block.\n" | ||||
"\nNOTE: By default this function only works sometimes. This is " | "\nNOTE: By default this function only works sometimes. This is " | ||||
"when there is an\n" | "when there is an\n" | ||||
"unspent output in the utxo for this transaction. To make it " | "unspent output in the utxo for this transaction. To make it " | ||||
"always work,\n" | "always work,\n" | ||||
"you need to maintain a transaction index, using the -txindex " | "you need to maintain a transaction index, using the -txindex " | ||||
"command line option or\n" | "command line option or\n" | ||||
▲ Show 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | static void TxInErrorToJSON(const CTxIn &txin, UniValue &vErrorsRet, | ||||
entry.pushKV("error", strMessage); | entry.pushKV("error", strMessage); | ||||
vErrorsRet.push_back(entry); | vErrorsRet.push_back(entry); | ||||
} | } | ||||
static UniValue combinerawtransaction(const Config &config, | static UniValue combinerawtransaction(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"combinerawtransaction [\"hexstring\",...]\n" | RPCHelpMan{"combinerawtransaction", | ||||
{ | |||||
{"txs", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"hexstring", RPCArg::Type::STR_HEX, false}, | |||||
}, | |||||
false}, | |||||
}} | |||||
.ToString() + | |||||
"\nCombine multiple partially signed transactions into one " | "\nCombine multiple partially signed transactions into one " | ||||
"transaction.\n" | "transaction.\n" | ||||
"The combined transaction may be another partially signed " | "The combined transaction may be another partially signed " | ||||
"transaction or a \n" | "transaction or a \n" | ||||
"fully signed transaction." | "fully signed transaction." | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"txs\" (string) A json array of hex strings of " | "1. \"txs\" (string) A json array of hex strings of " | ||||
▲ Show 20 Lines • Show All 255 Lines • ▼ Show 20 Lines | UniValue SignTransaction(interfaces::Chain &chain, CMutableTransaction &mtx, | ||||
return result; | return result; | ||||
} | } | ||||
static UniValue signrawtransactionwithkey(const Config &config, | static UniValue signrawtransactionwithkey(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
request.params.size() > 4) { | request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"signrawtransactionwithkey \"hexstring\" [\"privatekey1\",...] ( " | RPCHelpMan{ | ||||
"[{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\"," | "signrawtransactionwithkey", | ||||
"\"redeemScript\":\"hex\"},...] sighashtype )\n" | { | ||||
{"hexstring", RPCArg::Type::STR, false}, | |||||
{"privkyes", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"privatekey", RPCArg::Type::STR_HEX, false}, | |||||
}, | |||||
false}, | |||||
{"prevtxs", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"", | |||||
RPCArg::Type::OBJ, | |||||
{ | |||||
{"txid", RPCArg::Type::STR_HEX, false}, | |||||
{"vout", RPCArg::Type::NUM, false}, | |||||
{"scriptPubKey", RPCArg::Type::STR_HEX, false}, | |||||
{"redeemScript", RPCArg::Type::STR_HEX, false}, | |||||
{"amount", RPCArg::Type::AMOUNT, false}, | |||||
}, | |||||
true}, | |||||
}, | |||||
true}, | |||||
{"sighashtype", RPCArg::Type::STR, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nSign inputs for raw transaction (serialized, hex-encoded).\n" | "\nSign inputs for raw transaction (serialized, hex-encoded).\n" | ||||
"The second argument is an array of base58-encoded private\n" | "The second argument is an array of base58-encoded private\n" | ||||
"keys that will be the only keys used to sign the transaction.\n" | "keys that will be the only keys used to sign the transaction.\n" | ||||
"The third optional argument (may be null) is an array of previous " | "The third optional argument (may be null) is an array of previous " | ||||
"transaction outputs that\n" | "transaction outputs that\n" | ||||
"this transaction depends on but may not yet be in the block " | "this transaction depends on but may not yet be in the block " | ||||
"chain.\n" | "chain.\n" | ||||
▲ Show 20 Lines • Show All 578 Lines • ▼ Show 20 Lines | static UniValue decodepsbt(const Config &config, | ||||
return result; | return result; | ||||
} | } | ||||
static UniValue combinepsbt(const Config &config, | static UniValue combinepsbt(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"combinepsbt [\"psbt\",...]\n" | RPCHelpMan{"combinepsbt", | ||||
{ | |||||
{"txs", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"psbt", RPCArg::Type::STR_HEX, false}, | |||||
}, | |||||
false}, | |||||
}} | |||||
.ToString() + | |||||
"\nCombine multiple partially signed Bitcoin transactions into one " | "\nCombine multiple partially signed Bitcoin transactions into one " | ||||
"transaction.\n" | "transaction.\n" | ||||
"Implements the Combiner role.\n" | "Implements the Combiner role.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"txs\" (string) A json array of base64 " | "1. \"txs\" (string) A json array of base64 " | ||||
"strings of partially signed transactions\n" | "strings of partially signed transactions\n" | ||||
" [\n" | " [\n" | ||||
" \"psbt\" (string) A base64 string of a PSBT\n" | " \"psbt\" (string) A base64 string of a PSBT\n" | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | static UniValue finalizepsbt(const Config &config, | ||||
return result; | return result; | ||||
} | } | ||||
static UniValue createpsbt(const Config &config, | static UniValue createpsbt(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
request.params.size() > 3) { | request.params.size() > 3) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"createpsbt [{\"txid\":\"id\",\"vout\":n},...] " | RPCHelpMan{"createpsbt", | ||||
"[{\"address\":amount},{\"data\":\"hex\"},...] ( locktime )\n" | { | ||||
{"inputs", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"", | |||||
RPCArg::Type::OBJ, | |||||
{ | |||||
{"txid", RPCArg::Type::STR_HEX, false}, | |||||
{"vout", RPCArg::Type::NUM, false}, | |||||
{"sequence", RPCArg::Type::NUM, true}, | |||||
}, | |||||
false}, | |||||
}, | |||||
false}, | |||||
{"outputs", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"", | |||||
RPCArg::Type::OBJ, | |||||
{ | |||||
{"address", RPCArg::Type::AMOUNT, false}, | |||||
}, | |||||
true}, | |||||
{"", | |||||
RPCArg::Type::OBJ, | |||||
{ | |||||
{"data", RPCArg::Type::STR_HEX, false}, | |||||
}, | |||||
true}, | |||||
}, | |||||
false}, | |||||
{"locktime", RPCArg::Type::NUM, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nCreates a transaction in the Partially Signed Transaction " | "\nCreates a transaction in the Partially Signed Transaction " | ||||
"format.\n" | "format.\n" | ||||
"Implements the Creator role.\n" | "Implements the Creator role.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"inputs\" (array, required) A json array of " | "1. \"inputs\" (array, required) A json array of " | ||||
"json objects\n" | "json objects\n" | ||||
" [\n" | " [\n" | ||||
" {\n" | " {\n" | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |