@@ -957,6 +957,26 @@ RPCHelpMan signrawtransactionwithwallet()
957
957
};
958
958
}
959
959
960
+ // Definition of allowed formats of specifying transaction outputs in
961
+ // `send` and `walletcreatefundedpsbt` RPCs.
962
+ static std::vector<RPCArg> OutputsDoc ()
963
+ {
964
+ return
965
+ {
966
+ {" " , RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, " " ,
967
+ {
968
+ {" address" , RPCArg::Type::AMOUNT, RPCArg::Optional::NO, " A key-value pair. The key (string) is the bitcoin address,\n "
969
+ " the value (float or string) is the amount in " + CURRENCY_UNIT + " " },
970
+ },
971
+ },
972
+ {" " , RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, " " ,
973
+ {
974
+ {" data" , RPCArg::Type::STR_HEX, RPCArg::Optional::NO, " A key-value pair. The key must be \" data\" , the value is hex-encoded data" },
975
+ },
976
+ },
977
+ };
978
+ }
979
+
960
980
static RPCHelpMan bumpfee_helper (std::string method_name)
961
981
{
962
982
const bool want_psbt = method_name == " psbtbumpfee" ;
@@ -1145,18 +1165,7 @@ RPCHelpMan send()
1145
1165
{" outputs" , RPCArg::Type::ARR, RPCArg::Optional::NO, " The outputs (key-value pairs), where none of the keys are duplicated.\n "
1146
1166
" That is, each address can only appear once and there can only be one 'data' object.\n "
1147
1167
" For convenience, a dictionary, which holds the key-value pairs directly, is also accepted." ,
1148
- {
1149
- {" " , RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, " " ,
1150
- {
1151
- {" address" , RPCArg::Type::AMOUNT, RPCArg::Optional::NO, " A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in " + CURRENCY_UNIT + " " },
1152
- },
1153
- },
1154
- {" " , RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, " " ,
1155
- {
1156
- {" data" , RPCArg::Type::STR_HEX, RPCArg::Optional::NO, " A key-value pair. The key must be \" data\" , the value is hex-encoded data" },
1157
- },
1158
- },
1159
- },
1168
+ OutputsDoc (),
1160
1169
RPCArgOptions{.skip_type_check = true }},
1161
1170
{" conf_target" , RPCArg::Type::NUM, RPCArg::DefaultHint{" wallet -txconfirmtarget" }, " Confirmation target in blocks" },
1162
1171
{" estimate_mode" , RPCArg::Type::STR, RPCArg::Default{" unset" }, " The fee estimate mode, must be one of (case insensitive):\n "
@@ -1607,19 +1616,8 @@ RPCHelpMan walletcreatefundedpsbt()
1607
1616
" That is, each address can only appear once and there can only be one 'data' object.\n "
1608
1617
" For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n "
1609
1618
" accepted as second parameter." ,
1610
- {
1611
- {" " , RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, " " ,
1612
- {
1613
- {" address" , RPCArg::Type::AMOUNT, RPCArg::Optional::NO, " A key-value pair. The key (string) is the bitcoin address, the value (float or string) is the amount in " + CURRENCY_UNIT + " " },
1614
- },
1615
- },
1616
- {" " , RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, " " ,
1617
- {
1618
- {" data" , RPCArg::Type::STR_HEX, RPCArg::Optional::NO, " A key-value pair. The key must be \" data\" , the value is hex-encoded data" },
1619
- },
1620
- },
1621
- },
1622
- RPCArgOptions{.skip_type_check = true }},
1619
+ OutputsDoc (),
1620
+ RPCArgOptions{.skip_type_check = true }},
1623
1621
{" locktime" , RPCArg::Type::NUM, RPCArg::Default{0 }, " Raw locktime. Non-0 value also locktime-activates inputs" },
1624
1622
{" options" , RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, " " ,
1625
1623
Cat<std::vector<RPCArg>>(
0 commit comments