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

Function walletcreatefundedpsbt

src/wallet/rpc/spend.cpp:1432–1692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1430}
1431
1432RPCHelpMan walletcreatefundedpsbt()
1433{
1434 return RPCHelpMan{"walletcreatefundedpsbt",
1435 "\nCreates and funds a transaction in the Partially Signed Transaction format.\n"
1436 "Implements the Creator and Updater roles.\n"
1437 "All existing inputs must either have their previous output transaction be in the wallet\n"
1438 "or be in the UTXO set. Solving data must be provided for non-wallet inputs.\n",
1439 {
1440 {"inputs", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "Leave empty to add inputs automatically. See add_inputs option.",
1441 {
1442 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
1443 {
1444 {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
1445 {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
1446 {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'locktime' and 'options.replaceable' arguments"}, "The sequence number"},
1447 {"pegin_bitcoin_tx", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The raw bitcoin transaction (in hex) depositing bitcoin to the mainchain_address generated by getpeginaddress"},
1448 {"pegin_txout_proof", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A rawtxoutproof (in hex) generated by the mainchain daemon's `gettxoutproof` containing a proof of only bitcoin_tx"},
1449 {"pegin_claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The witness program generated by getpeginaddress."},
1450 {"issuance_amount", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The amount to be issued"},
1451 {"issuance_tokens", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The number of asset issuance tokens to generate"},
1452 {"asset_entropy", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "For new asset issuance, this is any additional entropy to be used in the asset tag calculation. For reissuance, this is the original asaset entropy"},
1453 {"asset_blinding_nonce", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED, "Do not set for new asset issuance. For reissuance, this is the blinding factor for reissuance token output for the asset being reissued"},
1454 {"blind_reissuance", RPCArg::Type::BOOL, RPCArg::Default{true}, "Whether to mark the issuance input for blinding or not. Only affects issuances with re-issuance tokens."},
1455 {"weight", RPCArg::Type::NUM, RPCArg::DefaultHint{"Calculated from wallet and solving data"}, "The maximum weight for this input, "
1456 "including the weight of the outpoint and sequence number. "
1457 "Note that signature sizes are not guaranteed to be consistent, "
1458 "so the maximum DER signatures size of 73 bytes should be used when considering ECDSA signatures."
1459 "Remember to convert serialized sizes to weight units when necessary."},
1460 },
1461 },
1462 },
1463 },
1464 {"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
1465 "That is, each address can only appear once and there can only be one 'data' object.\n"
1466 "For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
1467 "accepted as second parameter.",
1468 {
1469 {"", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, "",
1470 {
1471 {"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "A key-value pair. The key (string) is the address, the value (float or string) is the amount in " + CURRENCY_UNIT + ""},
1472 {"blinder_index", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The index of the input whose signer will blind this output. Must be provided if this output is to be blinded"},
1473 {"asset", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "The asset tag for this output if it is not the main chain asset"},
1474 },
1475 },
1476 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
1477 {
1478 {"data", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A key-value pair. The key must be \"data\", the value is hex-encoded data"},
1479 },
1480 },
1481 },
1482 },
1483 {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
1484 {"options", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED_NAMED_ARG, "",
1485 Cat<std::vector<RPCArg>>(
1486 {
1487 {"add_inputs", RPCArg::Type::BOOL, RPCArg::Default{false}, "If inputs are specified, automatically include more if they are not enough."},
1488 {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include inputs that are not safe to spend (unconfirmed transactions from outside keys and unconfirmed replacement transactions).\n"
1489 "Warning: the resulting transaction may become invalid if one of the unsafe inputs disappears.\n"

Callers

nothing calls this directly

Calls 15

FundTxDocFunction · 0.85
HelpExampleCliFunction · 0.85
RPCTypeCheckFunction · 0.85
UniValueTypeClass · 0.85
RPCTypeCheckArgumentFunction · 0.85
ConstructTransactionFunction · 0.85
JSONRPCErrorFunction · 0.85
GenerateAssetEntropyFunction · 0.85
CalculateAssetFunction · 0.85
CalculateReissuanceTokenFunction · 0.85
SetOptionsInputWeightsFunction · 0.85

Tested by

no test coverage detected