Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"is in a block in the blockchain.\n" | "is in a block in the blockchain.\n" | ||||
"\nReturn the raw transaction data.\n" | "\nReturn the raw transaction data.\n" | ||||
"\nIf verbose is 'true', returns an Object with information " | "\nIf verbose is 'true', returns an Object with information " | ||||
"about 'txid'.\n" | "about 'txid'.\n" | ||||
"If verbose is 'false' or omitted, returns a string that is " | "If verbose is 'false' or omitted, returns a string that is " | ||||
"serialized, hex-encoded data for 'txid'.\n", | "serialized, hex-encoded data for 'txid'.\n", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, /* opt */ false, | {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", "The transaction id"}, | "The transaction id"}, | ||||
{"verbose", RPCArg::Type::BOOL, /* opt */ true, | {"verbose", RPCArg::Type::BOOL, /* default */ "false", | ||||
/* default_val */ "false", | |||||
"If false, return a string, otherwise return a json " | "If false, return a string, otherwise return a json " | ||||
"object"}, | "object"}, | ||||
{"blockhash", RPCArg::Type::STR_HEX, /* opt */ true, | {"blockhash", RPCArg::Type::STR_HEX, /* default */ "null", | ||||
Fabien: OMITTED_NAMED_ARGS | |||||
/* default_val */ "null", | |||||
"The block in which to look for the transaction"}, | "The block in which to look for the transaction"}, | ||||
}, | }, | ||||
{ | { | ||||
RPCResult{"if verbose is not set or set to false", | RPCResult{"if verbose is not set or set to false", | ||||
"\"data\" (string) The serialized, hex-encoded " | "\"data\" (string) The serialized, hex-encoded " | ||||
"data for 'txid'\n"}, | "data for 'txid'\n"}, | ||||
RPCResult{ | RPCResult{ | ||||
"if verbose is set to true", | "if verbose is set to true", | ||||
▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | if (request.fHelp || | ||||
"you need to maintain a transaction index, using the " | "you need to maintain a transaction index, using the " | ||||
"-txindex command line option or\n" | "-txindex command line option or\n" | ||||
"specify the block in which the transaction is included " | "specify the block in which the transaction is included " | ||||
"manually (by blockhash).\n", | "manually (by blockhash).\n", | ||||
{ | { | ||||
{ | { | ||||
"txids", | "txids", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of txids to filter", | "A json array of txids to filter", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, /* opt */ false, | {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", "A transaction hash"}, | "A transaction hash"}, | ||||
}, | }, | ||||
}, | }, | ||||
{"blockhash", RPCArg::Type::STR_HEX, /* opt */ true, | {"blockhash", RPCArg::Type::STR_HEX, /* default */ "null", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED_NAMED_ARGS Fabien: OMITTED_NAMED_ARGS | |||||
/* default_val */ "null", | |||||
"If specified, looks for txid in the block with this hash"}, | "If specified, looks for txid in the block with this hash"}, | ||||
}, | }, | ||||
RPCResult{"\"data\" (string) A string that is a " | RPCResult{"\"data\" (string) A string that is a " | ||||
"serialized, hex-encoded data for the proof.\n"}, | "serialized, hex-encoded data for the proof.\n"}, | ||||
RPCExamples{""}, | RPCExamples{""}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | static UniValue verifytxoutproof(const Config &config, | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"verifytxoutproof", | "verifytxoutproof", | ||||
"\nVerifies that a proof points to a transaction in a " | "\nVerifies that a proof points to a transaction in a " | ||||
"block, returning the transaction it commits to\n" | "block, returning the transaction it commits to\n" | ||||
"and throwing an RPC error if the block is not in our " | "and throwing an RPC error if the block is not in our " | ||||
"best chain\n", | "best chain\n", | ||||
{ | { | ||||
{"proof", RPCArg::Type::STR_HEX, /* opt */ false, | {"proof", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"The hex-encoded proof generated by gettxoutproof"}, | "The hex-encoded proof generated by gettxoutproof"}, | ||||
}, | }, | ||||
RPCResult{"[\"txid\"] (array, strings) The txid(s) which the " | RPCResult{"[\"txid\"] (array, strings) The txid(s) which the " | ||||
"proof commits to, or empty array if the proof can not " | "proof commits to, or empty array if the proof can not " | ||||
"be validated.\n"}, | "be validated.\n"}, | ||||
RPCExamples{""}, | RPCExamples{""}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
"Outputs can be addresses or data.\n" | "Outputs can be addresses or data.\n" | ||||
"Returns hex-encoded raw transaction.\n" | "Returns hex-encoded raw transaction.\n" | ||||
"Note that the transaction's inputs are not signed, and\n" | "Note that the transaction's inputs are not signed, and\n" | ||||
"it is not stored in the wallet or transmitted to the network.\n", | "it is not stored in the wallet or transmitted to the network.\n", | ||||
{ | { | ||||
{ | { | ||||
"inputs", | "inputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of json objects", | "A json array of json objects", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* default */ "", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, | {"txid", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, "The transaction id"}, | ||||
"The transaction id"}, | {"vout", RPCArg::Type::NUM, | ||||
{"vout", RPCArg::Type::NUM, /* opt */ false, | RPCArg::Optional::NO, "The output number"}, | ||||
/* default_val */ "", "The output number"}, | {"sequence", RPCArg::Type::NUM, /* default */ | ||||
{"sequence", RPCArg::Type::NUM, /* opt */ true, | |||||
/* default_val */ | |||||
"depends on the value of the 'locktime' " | "depends on the value of the 'locktime' " | ||||
"argument", | "argument", | ||||
"The sequence number"}, | "The sequence number"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"outputs", | "outputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"a json array with outputs (key-value pairs).\n" | "a json array with outputs (key-value pairs).\n" | ||||
"For compatibility reasons, a dictionary, which holds " | "For compatibility reasons, a dictionary, which holds " | ||||
"the key-value pairs directly, is also\n" | "the key-value pairs directly, is also\n" | ||||
" accepted as second " | " accepted as second " | ||||
"parameter.", | "parameter.", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* default */ "", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"address", RPCArg::Type::AMOUNT, | {"address", RPCArg::Type::AMOUNT, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, | ||||
"A key-value pair. The key (string) is " | "A key-value pair. The key (string) is " | ||||
"the bitcoin address, the value (float or " | "the bitcoin address, the value (float or " | ||||
"string) is the amount in " + | "string) is the amount in " + | ||||
CURRENCY_UNIT}, | CURRENCY_UNIT}, | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* default */ "", | ||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"data", RPCArg::Type::STR_HEX, | {"data", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, | ||||
"A key-value pair. The key must be " | "A key-value pair. The key must be " | ||||
"\"data\", the value is hex-encoded data"}, | "\"data\", the value is hex-encoded data"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{"locktime", RPCArg::Type::NUM, /* opt */ true, | {"locktime", RPCArg::Type::NUM, /* default */ "0", | ||||
/* default_val */ "0", | |||||
"Raw locktime. Non-0 value also locktime-activates " | "Raw locktime. Non-0 value also locktime-activates " | ||||
"inputs"}, | "inputs"}, | ||||
}, | }, | ||||
RPCResult{"\"transaction\" (string) hex string of the " | RPCResult{"\"transaction\" (string) hex string of the " | ||||
"transaction\n"}, | "transaction\n"}, | ||||
RPCExamples{ | RPCExamples{ | ||||
HelpExampleCli("createrawtransaction", | HelpExampleCli("createrawtransaction", | ||||
"\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]" | "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]" | ||||
Show All 27 Lines | |||||
static UniValue decoderawtransaction(const Config &config, | static UniValue decoderawtransaction(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(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"decoderawtransaction", | "decoderawtransaction", | ||||
"\nReturn a JSON object representing the serialized, " | "\nReturn a JSON object representing the serialized, " | ||||
"hex-encoded transaction.\n", | "hex-encoded transaction.\n", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, /* opt */ false, | {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", "The transaction hex string"}, | "The transaction hex string"}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
" \"txid\" : \"id\", (string) The transaction id\n" | " \"txid\" : \"id\", (string) The transaction id\n" | ||||
" \"hash\" : \"id\", (string) The transaction hash " | " \"hash\" : \"id\", (string) The transaction hash " | ||||
"(differs from txid for witness transactions)\n" | "(differs from txid for witness transactions)\n" | ||||
" \"size\" : n, (numeric) The transaction size\n" | " \"size\" : n, (numeric) The transaction size\n" | ||||
" \"version\" : n, (numeric) The version\n" | " \"version\" : n, (numeric) The version\n" | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
static UniValue decodescript(const Config &config, | static UniValue decodescript(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(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"decodescript", | "decodescript", | ||||
"\nDecode a hex-encoded script.\n", | "\nDecode a hex-encoded script.\n", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, /* opt */ false, | {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", "the hex-encoded script"}, | "the hex-encoded script"}, | ||||
}, | }, | ||||
RPCResult{"{\n" | RPCResult{"{\n" | ||||
" \"asm\":\"asm\", (string) Script public key\n" | " \"asm\":\"asm\", (string) Script public key\n" | ||||
" \"hex\":\"hex\", (string) hex-encoded public key\n" | " \"hex\":\"hex\", (string) hex-encoded public key\n" | ||||
" \"type\":\"type\", (string) The output type\n" | " \"type\":\"type\", (string) The output type\n" | ||||
" \"reqSigs\": n, (numeric) The required signatures\n" | " \"reqSigs\": n, (numeric) The required signatures\n" | ||||
" \"addresses\": [ (json array of string)\n" | " \"addresses\": [ (json array of string)\n" | ||||
" \"address\" (string) bitcoin address\n" | " \"address\" (string) bitcoin address\n" | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
"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.", | ||||
{ | { | ||||
{ | { | ||||
"txs", | "txs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of hex strings of partially signed " | "A json array of hex strings of partially signed " | ||||
"transactions", | "transactions", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, | {"hexstring", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, "A transaction hash"}, | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
"A transaction hash"}, | |||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
RPCResult{"\"hex\" (string) The hex-encoded raw " | RPCResult{"\"hex\" (string) The hex-encoded raw " | ||||
"transaction with signature(s)\n"}, | "transaction with signature(s)\n"}, | ||||
RPCExamples{HelpExampleCli("combinerawtransaction", | RPCExamples{HelpExampleCli("combinerawtransaction", | ||||
"[\"myhex1\", \"myhex2\", \"myhex3\"]")}, | "[\"myhex1\", \"myhex2\", \"myhex3\"]")}, | ||||
} | } | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
"\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", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, /* opt */ false, | {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", "The transaction hex string"}, | "The transaction hex string"}, | ||||
{ | { | ||||
"privkeys", | "privkeys", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of base58-encoded private keys for signing", | "A json array of base58-encoded private keys for signing", | ||||
{ | { | ||||
{"privatekey", RPCArg::Type::STR, | {"privatekey", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* opt */ false, /* default_val */ "", | |||||
"private key in base58-encoding"}, | "private key in base58-encoding"}, | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"prevtxs", | "prevtxs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* default */ "null", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED_NAMED_ARGS Fabien: OMITTED_NAMED_ARGS | |||||
/* default_val */ "null", | |||||
"A json array of previous dependent transaction outputs", | "A json array of previous dependent transaction outputs", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* default */ "", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED_NAMED_ARGS Fabien: OMITTED_NAMED_ARGS | |||||
FabienUnsubmitted Not Done Inline ActionsStill missing Fabien: Still missing | |||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, | {"txid", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, "The transaction id"}, | ||||
"The transaction id"}, | {"vout", RPCArg::Type::NUM, | ||||
{"vout", RPCArg::Type::NUM, /* opt */ false, | RPCArg::Optional::NO, "The output number"}, | ||||
/* default_val */ "", "The output number"}, | |||||
{"scriptPubKey", RPCArg::Type::STR_HEX, | {"scriptPubKey", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, "script key"}, | ||||
"script key"}, | |||||
{"redeemScript", RPCArg::Type::STR_HEX, | {"redeemScript", RPCArg::Type::STR_HEX, | ||||
/* opt */ true, /* default_val */ "omitted", | /* default */ "omitted", | ||||
FabienUnsubmitted Not Done Inline ActionsThere is a hint in the default value :) Fabien: There is a hint in the default value :) | |||||
"(required for P2SH) redeem script"}, | "(required for P2SH) redeem script"}, | ||||
{"amount", RPCArg::Type::AMOUNT, | {"amount", RPCArg::Type::AMOUNT, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, "The amount spent"}, | ||||
"The amount spent"}, | |||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{"sighashtype", RPCArg::Type::STR, /* opt */ true, | {"sighashtype", RPCArg::Type::STR, /* default */ "ALL|FORKID", | ||||
/* default_val */ "ALL|FORKID", | |||||
"The signature hash type. Must be one of:\n" | "The signature hash type. Must be one of:\n" | ||||
" \"ALL|FORKID\"\n" | " \"ALL|FORKID\"\n" | ||||
" \"NONE|FORKID\"\n" | " \"NONE|FORKID\"\n" | ||||
" \"SINGLE|FORKID\"\n" | " \"SINGLE|FORKID\"\n" | ||||
" \"ALL|FORKID|ANYONECANPAY\"\n" | " \"ALL|FORKID|ANYONECANPAY\"\n" | ||||
" \"NONE|FORKID|ANYONECANPAY\"\n" | " \"NONE|FORKID|ANYONECANPAY\"\n" | ||||
" \"SINGLE|FORKID|ANYONECANPAY\""}, | " \"SINGLE|FORKID|ANYONECANPAY\""}, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"sendrawtransaction", | "sendrawtransaction", | ||||
"\nSubmits raw transaction (serialized, hex-encoded) to local node " | "\nSubmits raw transaction (serialized, hex-encoded) to local node " | ||||
"and network.\n" | "and network.\n" | ||||
"\nAlso see createrawtransaction and " | "\nAlso see createrawtransaction and " | ||||
"signrawtransactionwithkey calls.\n", | "signrawtransactionwithkey calls.\n", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, /* opt */ false, | {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", "The hex string of the raw transaction"}, | "The hex string of the raw transaction"}, | ||||
{"allowhighfees", RPCArg::Type::BOOL, /* opt */ true, | {"allowhighfees", RPCArg::Type::BOOL, /* default */ "false", | ||||
/* default_val */ "false", "Allow high fees"}, | "Allow high fees"}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"\"hex\" (string) The transaction hash in hex\n"}, | "\"hex\" (string) The transaction hash in hex\n"}, | ||||
RPCExamples{ | RPCExamples{ | ||||
"\nCreate a transaction\n" + | "\nCreate a transaction\n" + | ||||
HelpExampleCli( | HelpExampleCli( | ||||
"createrawtransaction", | "createrawtransaction", | ||||
"\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" " | "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" " | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"accepted by mempool.\n" | "accepted by mempool.\n" | ||||
"\nThis checks if the transaction violates the consensus or policy " | "\nThis checks if the transaction violates the consensus or policy " | ||||
"rules.\n" | "rules.\n" | ||||
"\nSee sendrawtransaction call.\n", | "\nSee sendrawtransaction call.\n", | ||||
{ | { | ||||
{ | { | ||||
"rawtxs", | "rawtxs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"An array of hex strings of raw transactions.\n" | "An array of hex strings of raw transactions.\n" | ||||
" Length must be " | " Length must be " | ||||
"one for now.", | "one for now.", | ||||
{ | { | ||||
{"rawtx", RPCArg::Type::STR_HEX, | {"rawtx", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* opt */ false, /* default_val */ "", ""}, | ""}, | ||||
}, | }, | ||||
}, | }, | ||||
{"allowhighfees", RPCArg::Type::BOOL, /* opt */ true, | {"allowhighfees", RPCArg::Type::BOOL, /* default */ "false", | ||||
/* default_val */ "false", "Allow high fees"}, | "Allow high fees"}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"[ (array) The result of the mempool " | "[ (array) The result of the mempool " | ||||
"acceptance test for each raw transaction in the input array.\n" | "acceptance test for each raw transaction in the input array.\n" | ||||
" Length is exactly one for now.\n" | " Length is exactly one for now.\n" | ||||
" {\n" | " {\n" | ||||
" \"txid\" (string) The transaction hash in hex\n" | " \"txid\" (string) The transaction hash in hex\n" | ||||
" \"allowed\" (boolean) If the mempool allows this tx " | " \"allowed\" (boolean) If the mempool allows this tx " | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
static UniValue decodepsbt(const Config &config, | static UniValue decodepsbt(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(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"decodepsbt", | "decodepsbt", | ||||
"\nReturn a JSON object representing the serialized, " | "\nReturn a JSON object representing the serialized, " | ||||
"base64-encoded partially signed Bitcoin transaction.\n", | "base64-encoded partially signed Bitcoin transaction.\n", | ||||
{ | { | ||||
{"psbt", RPCArg::Type::STR, /* opt */ false, | {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
/* default_val */ "", "The PSBT base64 string"}, | "The PSBT base64 string"}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
" \"tx\" : { (json object) The decoded " | " \"tx\" : { (json object) The decoded " | ||||
"network-serialized unsigned transaction.\n" | "network-serialized unsigned transaction.\n" | ||||
" ... The layout is " | " ... The layout is " | ||||
"the same as the output of decoderawtransaction.\n" | "the same as the output of decoderawtransaction.\n" | ||||
" },\n" | " },\n" | ||||
▲ Show 20 Lines • Show All 265 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
"combinepsbt", | "combinepsbt", | ||||
"\nCombine multiple partially signed Bitcoin transactions into " | "\nCombine multiple partially signed Bitcoin transactions into " | ||||
"one transaction.\n" | "one transaction.\n" | ||||
"Implements the Combiner role.\n", | "Implements the Combiner role.\n", | ||||
{ | { | ||||
{ | { | ||||
"txs", | "txs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of base64 strings of partially signed " | "A json array of base64 strings of partially signed " | ||||
"transactions", | "transactions", | ||||
{ | { | ||||
{"psbt", RPCArg::Type::STR, /* opt */ false, | {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", "A base64 string of a PSBT"}, | "A base64 string of a PSBT"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
RPCResult{" \"psbt\" (string) The base64-encoded " | RPCResult{" \"psbt\" (string) The base64-encoded " | ||||
"partially signed transaction\n"}, | "partially signed transaction\n"}, | ||||
RPCExamples{HelpExampleCli( | RPCExamples{HelpExampleCli( | ||||
"combinepsbt", | "combinepsbt", | ||||
"[\"mybase64_1\", \"mybase64_2\", \"mybase64_3\"]")}, | "[\"mybase64_1\", \"mybase64_2\", \"mybase64_3\"]")}, | ||||
Show All 37 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"Finalize the inputs of a PSBT. If the transaction is " | "Finalize the inputs of a PSBT. If the transaction is " | ||||
"fully signed, it will produce a\n" | "fully signed, it will produce a\n" | ||||
"network serialized transaction which can be broadcast " | "network serialized transaction which can be broadcast " | ||||
"with sendrawtransaction. Otherwise a PSBT will be\n" | "with sendrawtransaction. Otherwise a PSBT will be\n" | ||||
"created which has the final_scriptSigfields filled for " | "created which has the final_scriptSigfields filled for " | ||||
"inputs that are complete.\n" | "inputs that are complete.\n" | ||||
"Implements the Finalizer and Extractor roles.\n", | "Implements the Finalizer and Extractor roles.\n", | ||||
{ | { | ||||
{"psbt", RPCArg::Type::STR, /* opt */ false, | {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
/* default_val */ "", "A base64 string of a PSBT"}, | "A base64 string of a PSBT"}, | ||||
{"extract", RPCArg::Type::BOOL, /* opt */ true, | {"extract", RPCArg::Type::BOOL, /* default */ "true", | ||||
/* default_val */ "true", | |||||
"If true and the transaction is complete,\n" | "If true and the transaction is complete,\n" | ||||
" extract and return the complete " | " extract and return the complete " | ||||
"transaction in normal network serialization instead of the " | "transaction in normal network serialization instead of the " | ||||
"PSBT."}, | "PSBT."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
" \"psbt\" : \"value\", (string) The base64-encoded " | " \"psbt\" : \"value\", (string) The base64-encoded " | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
"createpsbt", | "createpsbt", | ||||
"\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", | ||||
{ | { | ||||
{ | { | ||||
"inputs", | "inputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of json objects", | "A json array of json objects", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, | {"txid", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, "The transaction id"}, | ||||
"The transaction id"}, | {"vout", RPCArg::Type::NUM, | ||||
{"vout", RPCArg::Type::NUM, /* opt */ false, | RPCArg::Optional::NO, "The output number"}, | ||||
/* default_val */ "", "The output number"}, | {"sequence", RPCArg::Type::NUM, /* default */ | ||||
{"sequence", RPCArg::Type::NUM, /* opt */ true, | |||||
/* default_val */ | |||||
"depends on the value of the 'locktime' " | "depends on the value of the 'locktime' " | ||||
"argument", | "argument", | ||||
"The sequence number"}, | "The sequence number"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"outputs", | "outputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"a json array with outputs (key-value pairs).\n" | "a json array with outputs (key-value pairs).\n" | ||||
"For compatibility reasons, a dictionary, which holds " | "For compatibility reasons, a dictionary, which holds " | ||||
"the key-value pairs directly, is also\n" | "the key-value pairs directly, is also\n" | ||||
" accepted as second " | " accepted as second " | ||||
"parameter.", | "parameter.", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* default */ "", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"address", RPCArg::Type::AMOUNT, | {"address", RPCArg::Type::AMOUNT, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, | ||||
"A key-value pair. The key (string) is " | "A key-value pair. The key (string) is " | ||||
"the bitcoin address, the value (float or " | "the bitcoin address, the value (float or " | ||||
"string) is the amount in " + | "string) is the amount in " + | ||||
CURRENCY_UNIT}, | CURRENCY_UNIT}, | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* default */ "", | ||||
FabienUnsubmitted Not Done Inline ActionsOMITTED Fabien: OMITTED | |||||
/* default_val */ "", | |||||
"", | "", | ||||
{ | { | ||||
{"data", RPCArg::Type::STR_HEX, | {"data", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | RPCArg::Optional::NO, | ||||
"A key-value pair. The key must be " | "A key-value pair. The key must be " | ||||
"\"data\", the value is hex-encoded data"}, | "\"data\", the value is hex-encoded data"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{"locktime", RPCArg::Type::NUM, /* opt */ true, | {"locktime", RPCArg::Type::NUM, /* default */ "0", | ||||
/* default_val */ "0", | |||||
"Raw locktime. Non-0 value also locktime-activates inputs"}, | "Raw locktime. Non-0 value also locktime-activates inputs"}, | ||||
}, | }, | ||||
RPCResult{" \"psbt\" (string) The resulting raw " | RPCResult{" \"psbt\" (string) The resulting raw " | ||||
"transaction (base64-encoded string)\n"}, | "transaction (base64-encoded string)\n"}, | ||||
RPCExamples{HelpExampleCli( | RPCExamples{HelpExampleCli( | ||||
"createpsbt", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]" | "createpsbt", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]" | ||||
"\" \"[{\\\"data\\\":\\\"00010203\\\"}]\"")}, | "\" \"[{\\\"data\\\":\\\"00010203\\\"}]\"")}, | ||||
} | } | ||||
Show All 36 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"converttopsbt", | "converttopsbt", | ||||
"\nConverts a network serialized transaction to a PSBT. " | "\nConverts a network serialized transaction to a PSBT. " | ||||
"This should be used only with createrawtransaction and " | "This should be used only with createrawtransaction and " | ||||
"fundrawtransaction\n" | "fundrawtransaction\n" | ||||
"createpsbt and walletcreatefundedpsbt should be used for new " | "createpsbt and walletcreatefundedpsbt should be used for new " | ||||
"applications.\n", | "applications.\n", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, /* opt */ false, | {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
/* default_val */ "", "The hex string of a raw transaction"}, | "The hex string of a raw transaction"}, | ||||
{"permitsigdata", RPCArg::Type::BOOL, /* opt */ true, | {"permitsigdata", RPCArg::Type::BOOL, /* default */ "false", | ||||
/* default_val */ "false", | |||||
"If true, any signatures in the input will be discarded and " | "If true, any signatures in the input will be discarded and " | ||||
"conversion.\n" | "conversion.\n" | ||||
" will continue. If false, RPC " | " will continue. If false, RPC " | ||||
"will fail if any signatures are present."}, | "will fail if any signatures are present."}, | ||||
}, | }, | ||||
RPCResult{" \"psbt\" (string) The resulting raw " | RPCResult{" \"psbt\" (string) The resulting raw " | ||||
"transaction (base64-encoded string)\n"}, | "transaction (base64-encoded string)\n"}, | ||||
RPCExamples{ | RPCExamples{ | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
UniValue utxoupdatepsbt(const Config &config, const JSONRPCRequest &request) { | UniValue utxoupdatepsbt(const Config &config, const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"utxoupdatepsbt", | "utxoupdatepsbt", | ||||
"\nUpdates a PSBT with witness UTXOs retrieved from the UTXO set " | "\nUpdates a PSBT with witness UTXOs retrieved from the UTXO set " | ||||
"or the mempool.\n", | "or the mempool.\n", | ||||
{{"psbt", RPCArg::Type::STR, | {{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
/* opt */ false, /* default_val */ "", | |||||
"A base64 string of a PSBT"}}, | "A base64 string of a PSBT"}}, | ||||
RPCResult{" \"psbt\" (string) The base64-encoded " | RPCResult{" \"psbt\" (string) The base64-encoded " | ||||
"partially signed transaction with inputs updated\n"}, | "partially signed transaction with inputs updated\n"}, | ||||
RPCExamples{HelpExampleCli("utxoupdatepsbt", "\"psbt\"")}} | RPCExamples{HelpExampleCli("utxoupdatepsbt", "\"psbt\"")}} | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
RPCTypeCheck(request.params, {UniValue::VSTR}, true); | RPCTypeCheck(request.params, {UniValue::VSTR}, true); | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"joinpsbts", | "joinpsbts", | ||||
"\nJoins multiple distinct PSBTs with different inputs and outputs " | "\nJoins multiple distinct PSBTs with different inputs and outputs " | ||||
"into one PSBT with inputs and outputs from all of the PSBTs\n" | "into one PSBT with inputs and outputs from all of the PSBTs\n" | ||||
"No input in any of the PSBTs can be in more than one of the " | "No input in any of the PSBTs can be in more than one of the " | ||||
"PSBTs.\n", | "PSBTs.\n", | ||||
{{"txs", | {{"txs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ false, | RPCArg::Optional::NO, | ||||
/* default_val */ "", | |||||
"A json array of base64 strings of partially signed transactions", | "A json array of base64 strings of partially signed transactions", | ||||
{{"psbt", RPCArg::Type::STR, /* opt */ false, | {{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
/* default_val */ "", "A base64 string of a PSBT"}}}}, | "A base64 string of a PSBT"}}}}, | ||||
RPCResult{" \"psbt\" (string) The base64-encoded " | RPCResult{" \"psbt\" (string) The base64-encoded " | ||||
"partially signed transaction\n"}, | "partially signed transaction\n"}, | ||||
RPCExamples{HelpExampleCli("joinpsbts", "\"psbt\"")}} | RPCExamples{HelpExampleCli("joinpsbts", "\"psbt\"")}} | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
RPCTypeCheck(request.params, {UniValue::VARR}, true); | RPCTypeCheck(request.params, {UniValue::VARR}, true); | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
UniValue analyzepsbt(const Config &config, const JSONRPCRequest &request) { | UniValue analyzepsbt(const Config &config, const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"analyzepsbt", | "analyzepsbt", | ||||
"\nAnalyzes and provides information about the current status of a " | "\nAnalyzes and provides information about the current status of a " | ||||
"PSBT and its inputs\n", | "PSBT and its inputs\n", | ||||
{{"psbt", RPCArg::Type::STR, /* opt */ false, /* default_var */ "", | {{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"A base64 string of a PSBT"}}, | "A base64 string of a PSBT"}}, | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
" \"inputs\" : [ (array of json " | " \"inputs\" : [ (array of json " | ||||
"objects)\n" | "objects)\n" | ||||
" {\n" | " {\n" | ||||
" \"has_utxo\" : true|false (boolean) Whether a UTXO " | " \"has_utxo\" : true|false (boolean) Whether a UTXO " | ||||
"is provided\n" | "is provided\n" | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |
OMITTED_NAMED_ARGS