MCPcopy Create free account
hub / github.com/ElementsProject/elements / sendmany

Function sendmany

src/wallet/rpc/spend.cpp:261–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261RPCHelpMan sendmany()
262{
263 return RPCHelpMan{"sendmany",
264 "\nSend multiple times. Amounts are double-precision floating point numbers." +
265 HELP_REQUIRING_PASSPHRASE,
266 {
267 {"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, "Must be set to \"\" for backwards compatibility.", "\"\""},
268 {"amounts", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::NO, "The addresses and amounts",
269 {
270 {"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The address is the key, the numeric amount (can be string) in " + CURRENCY_UNIT + " is the value"},
271 },
272 },
273 {"minconf", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "Ignored dummy value"},
274 {"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "A comment"},
275 {"subtractfeefrom", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "The addresses.\n"
276 "The fee will be equally deducted from the amount of each selected address.\n"
277 "Those recipients will receive less bitcoins than you enter in their corresponding amount field.\n"
278 "If no addresses are specified here, the sender pays the fee.",
279 {
280 {"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Subtract fee from this address"},
281 },
282 },
283 {"replaceable", RPCArg::Type::BOOL, RPCArg::DefaultHint{"wallet default"}, "Allow this transaction to be replaced by a transaction with higher fees via BIP 125"},
284 {"conf_target", RPCArg::Type::NUM, RPCArg::DefaultHint{"wallet -txconfirmtarget"}, "Confirmation target in blocks"},
285 {"estimate_mode", RPCArg::Type::STR, RPCArg::Default{"unset"}, std::string() + "The fee estimate mode, must be one of (case insensitive):\n"
286 " \"" + FeeModes("\"\n\"") + "\""},
287 {"output_assets", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "A json object of addresses to assets.",
288 {
289 {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "A key-value pair where the key is the address used and the value is an asset label or hex asset ID."},
290 },
291 },
292 {"ignoreblindfail", RPCArg::Type::BOOL, RPCArg::Default{true}, "Return a transaction even when a blinding attempt fails due to number of blinded inputs/outputs."},
293 {"fee_rate", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"not set, fall back to wallet fee estimation"}, "Specify a fee rate in " + CURRENCY_ATOM + "/vB."},
294 {"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "If true, return extra information about the transaction."},
295 },
296 {
297 RPCResult{"if verbose is not set or set to false",
298 RPCResult::Type::STR_HEX, "txid", "The transaction id for the send. Only 1 transaction is created regardless of\n"
299 "the number of addresses."
300 },
301 RPCResult{"if verbose is set to true",
302 RPCResult::Type::OBJ, "", "",
303 {
304 {RPCResult::Type::STR_HEX, "txid", "The transaction id for the send. Only 1 transaction is created regardless of\n"
305 "the number of addresses."},
306 {RPCResult::Type::STR, "fee_reason", "The transaction fee reason."}
307 },
308 },
309 },
310 RPCExamples{
311 "\nSend two amounts to two different addresses:\n"
312 + HelpExampleCli("sendmany", "\"\" \"{\\\"" + EXAMPLE_ADDRESS[0] + "\\\":0.01,\\\"" + EXAMPLE_ADDRESS[1] + "\\\":0.02}\"") +
313 "\nSend two amounts to two different addresses setting the confirmation and comment:\n"
314 + HelpExampleCli("sendmany", "\"\" \"{\\\"" + EXAMPLE_ADDRESS[0] + "\\\":0.01,\\\"" + EXAMPLE_ADDRESS[1] + "\\\":0.02}\" 6 \"testing\"") +
315 "\nSend two amounts to two different addresses, subtract fee from amount:\n"
316 + HelpExampleCli("sendmany", "\"\" \"{\\\"" + EXAMPLE_ADDRESS[0] + "\\\":0.01,\\\"" + EXAMPLE_ADDRESS[1] + "\\\":0.02}\" 1 \"\" \"[\\\"" + EXAMPLE_ADDRESS[0] + "\\\",\\\"" + EXAMPLE_ADDRESS[1] + "\\\"]\"") +
317 "\nAs a JSON-RPC call\n"
318 + HelpExampleRpc("sendmany", "\"\", {\"" + EXAMPLE_ADDRESS[0] + "\":0.01,\"" + EXAMPLE_ADDRESS[1] + "\":0.02}, 6, \"testing\"")

Callers

nothing calls this directly

Calls 12

FeeModesFunction · 0.85
HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
JSONRPCErrorFunction · 0.85
SetFeeEstimateModeFunction · 0.85
ParseRecipientsFunction · 0.85
SendMoneyFunction · 0.85
get_boolMethod · 0.80
isNullMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected