|
10 | 10 | #include <consensus/validation.h> |
11 | 11 | #include <core_io.h> |
12 | 12 | #include <index/txindex.h> |
13 | | -#include <keystore.h> |
14 | | -#include <validation.h> |
15 | | -#include <validationinterface.h> |
| 13 | +#include <init.h> |
16 | 14 | #include <key_io.h> |
| 15 | +#include <keystore.h> |
17 | 16 | #include <merkleblock.h> |
18 | 17 | #include <net.h> |
19 | 18 | #include <node/transaction.h> |
20 | 19 | #include <policy/policy.h> |
21 | 20 | #include <primitives/transaction.h> |
22 | 21 | #include <psbt.h> |
23 | | -#include <rpc/util.h> |
24 | 22 | #include <rpc/rawtransaction.h> |
25 | 23 | #include <rpc/server.h> |
| 24 | +#include <rpc/util.h> |
26 | 25 | #include <script/script.h> |
27 | 26 | #include <script/script_error.h> |
28 | 27 | #include <script/sign.h> |
|
31 | 30 | #include <uint256.h> |
32 | 31 | #include <util/validation.h> |
33 | 32 | #include <util/strencodings.h> |
| 33 | +#include <validation.h> |
| 34 | +#include <validationinterface.h> |
34 | 35 | #ifdef ENABLE_WALLET |
35 | 36 | #include <wallet/rpcwallet.h> |
36 | 37 | #endif |
@@ -251,7 +252,16 @@ static UniValue gettxoutproof(const JSONRPCRequest& request) |
251 | 252 | { |
252 | 253 | if (request.fHelp || (request.params.size() != 1 && request.params.size() != 2)) |
253 | 254 | throw std::runtime_error( |
254 | | - "gettxoutproof [\"txid\",...] ( blockhash )\n" |
| 255 | + RPCHelpMan{"gettxoutproof", |
| 256 | + { |
| 257 | + {"txids", RPCArg::Type::ARR, |
| 258 | + { |
| 259 | + {"txid", RPCArg::Type::STR_HEX, false}, |
| 260 | + }, |
| 261 | + false}, |
| 262 | + {"blockhash", RPCArg::Type::STR_HEX, true}, |
| 263 | + }} |
| 264 | + .ToString() + |
255 | 265 | "\nReturns a hex-encoded proof that \"txid\" was included in a block.\n" |
256 | 266 | "\nNOTE: By default this function only works sometimes. This is when there is an\n" |
257 | 267 | "unspent output in the utxo for this transaction. To make it always work,\n" |
@@ -672,10 +682,17 @@ static void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std:: |
672 | 682 |
|
673 | 683 | static UniValue combinerawtransaction(const JSONRPCRequest& request) |
674 | 684 | { |
675 | | - |
676 | 685 | if (request.fHelp || request.params.size() != 1) |
677 | 686 | throw std::runtime_error( |
678 | | - "combinerawtransaction [\"hexstring\",...]\n" |
| 687 | + RPCHelpMan{"combinerawtransaction", |
| 688 | + { |
| 689 | + {"txs", RPCArg::Type::ARR, |
| 690 | + { |
| 691 | + {"hexstring", RPCArg::Type::STR_HEX, false}, |
| 692 | + }, |
| 693 | + false}, |
| 694 | + }} |
| 695 | + .ToString() + |
679 | 696 | "\nCombine multiple partially signed transactions into one transaction.\n" |
680 | 697 | "The combined transaction may be another partially signed transaction or a \n" |
681 | 698 | "fully signed transaction." |
@@ -892,7 +909,30 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request) |
892 | 909 | { |
893 | 910 | if (request.fHelp || request.params.size() < 2 || request.params.size() > 4) |
894 | 911 | throw std::runtime_error( |
895 | | - "signrawtransactionwithkey \"hexstring\" [\"privatekey1\",...] ( [{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\",\"redeemScript\":\"hex\"},...] sighashtype )\n" |
| 912 | + RPCHelpMan{"signrawtransactionwithkey", |
| 913 | + { |
| 914 | + {"hexstring", RPCArg::Type::STR, false}, |
| 915 | + {"privkyes", RPCArg::Type::ARR, |
| 916 | + { |
| 917 | + {"privatekey", RPCArg::Type::STR_HEX, false}, |
| 918 | + }, |
| 919 | + false}, |
| 920 | + {"prevtxs", RPCArg::Type::ARR, |
| 921 | + { |
| 922 | + {"", RPCArg::Type::OBJ, |
| 923 | + { |
| 924 | + {"txid", RPCArg::Type::STR_HEX, false}, |
| 925 | + {"vout", RPCArg::Type::NUM, false}, |
| 926 | + {"scriptPubKey", RPCArg::Type::STR_HEX, false}, |
| 927 | + {"redeemScript", RPCArg::Type::STR_HEX, false}, |
| 928 | + {"amount", RPCArg::Type::AMOUNT, false}, |
| 929 | + }, |
| 930 | + true}, |
| 931 | + }, |
| 932 | + true}, |
| 933 | + {"sighashtype", RPCArg::Type::STR, true}, |
| 934 | + }} |
| 935 | + .ToString() + |
896 | 936 | "\nSign inputs for raw transaction (serialized, hex-encoded).\n" |
897 | 937 | "The second argument is an array of base58-encoded private\n" |
898 | 938 | "keys that will be the only keys used to sign the transaction.\n" |
@@ -1445,7 +1485,15 @@ UniValue combinepsbt(const JSONRPCRequest& request) |
1445 | 1485 | { |
1446 | 1486 | if (request.fHelp || request.params.size() != 1) |
1447 | 1487 | throw std::runtime_error( |
1448 | | - "combinepsbt [\"psbt\",...]\n" |
| 1488 | + RPCHelpMan{"combinepsbt", |
| 1489 | + { |
| 1490 | + {"txs", RPCArg::Type::ARR, |
| 1491 | + { |
| 1492 | + {"psbt", RPCArg::Type::STR_HEX, false}, |
| 1493 | + }, |
| 1494 | + false}, |
| 1495 | + }} |
| 1496 | + .ToString() + |
1449 | 1497 | "\nCombine multiple partially signed Dash transactions into one transaction.\n" |
1450 | 1498 | "Implements the Combiner role.\n" |
1451 | 1499 | "\nArguments:\n" |
@@ -1551,7 +1599,36 @@ UniValue createpsbt(const JSONRPCRequest& request) |
1551 | 1599 | { |
1552 | 1600 | if (request.fHelp || request.params.size() < 2 || request.params.size() > 4) |
1553 | 1601 | throw std::runtime_error( |
1554 | | - "createpsbt [{\"txid\":\"id\",\"vout\":n},...] [{\"address\":amount},{\"data\":\"hex\"},...] ( locktime )\n" |
| 1602 | + RPCHelpMan{"createpsbt", |
| 1603 | + { |
| 1604 | + {"inputs", RPCArg::Type::ARR, |
| 1605 | + { |
| 1606 | + {"", RPCArg::Type::OBJ, |
| 1607 | + { |
| 1608 | + {"txid", RPCArg::Type::STR_HEX, false}, |
| 1609 | + {"vout", RPCArg::Type::NUM, false}, |
| 1610 | + {"sequence", RPCArg::Type::NUM, true}, |
| 1611 | + }, |
| 1612 | + false}, |
| 1613 | + }, |
| 1614 | + false}, |
| 1615 | + {"outputs", RPCArg::Type::ARR, |
| 1616 | + { |
| 1617 | + {"", RPCArg::Type::OBJ, |
| 1618 | + { |
| 1619 | + {"address", RPCArg::Type::AMOUNT, false}, |
| 1620 | + }, |
| 1621 | + true}, |
| 1622 | + {"", RPCArg::Type::OBJ, |
| 1623 | + { |
| 1624 | + {"data", RPCArg::Type::STR_HEX, false}, |
| 1625 | + }, |
| 1626 | + true}, |
| 1627 | + }, |
| 1628 | + false}, |
| 1629 | + {"locktime", RPCArg::Type::NUM, true}, |
| 1630 | + }} |
| 1631 | + .ToString() + |
1555 | 1632 | "\nCreates a transaction in the Partially Signed Transaction format.\n" |
1556 | 1633 | "Implements the Creator role.\n" |
1557 | 1634 | "\nArguments:\n" |
|
0 commit comments