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

Function CreateTxDoc

src/rpc/rawtransaction.cpp:94–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94static std::vector<RPCArg> CreateTxDoc()
95{
96 return {
97 {"inputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The inputs",
98 {
99 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
100 {
101 {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
102 {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
103 {"sequence", RPCArg::Type::NUM, RPCArg::DefaultHint{"depends on the value of the 'replaceable' and 'locktime' arguments"}, "The sequence number"},
104 {"pegin_bitcoin_tx", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "(only for pegin inputs) The raw bitcoin transaction (in hex) depositing bitcoin to the mainchain_address generated by getpeginaddress"},
105 {"pegin_txout_proof", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "(only for pegin inputs) A rawtxoutproof (in hex) generated by the mainchain daemon's `gettxoutproof` containing a proof of only bitcoin_tx"},
106 {"pegin_claim_script", RPCArg::Type::STR_HEX, RPCArg::Optional::OMITTED_NAMED_ARG, "(only for pegin inputs) The claim script generated by getpeginaddress."},
107 },
108 },
109 },
110 },
111 {"outputs", RPCArg::Type::ARR, RPCArg::Optional::NO, "The outputs (key-value pairs), where none of the keys are duplicated.\n"
112 "That is, each address can only appear once and there can only be one 'data' object.\n"
113 "For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also\n"
114 " accepted as second parameter.",
115 {
116 {"", RPCArg::Type::OBJ_USER_KEYS, RPCArg::Optional::OMITTED, "",
117 {
118 {"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},
119 {"asset", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "The asset tag for this output if it is not the main chain asset"},
120 },
121 },
122 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
123 {
124 {"data", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A key-value pair. The key must be \"data\", the value is hex-encoded data"},
125 },
126 },
127 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
128 {
129 {"vdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The key is \"vdata\", the value is an array of hex encoded data"},
130 },
131 },
132 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
133 {
134 {"burn", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "A key-value pair. The key must be \"burn\", the value is the amount that will be burned."},
135 },
136 },
137 {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
138 {
139 {"fee", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, "The key is \"fee\", the value the fee output you want to add."},
140 },
141 },
142 },
143 },
144 {"locktime", RPCArg::Type::NUM, RPCArg::Default{0}, "Raw locktime. Non-0 value also locktime-activates inputs"},
145 {"replaceable", RPCArg::Type::BOOL, RPCArg::Default{false}, "Marks this transaction as BIP125-replaceable.\n"
146" Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible."},
147 };
148}
149
150static RPCHelpMan getrawtransaction()
151{

Callers 1

createrawtransactionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected