Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show All 29 Lines | |||||
static bool fCreateBlank; | static bool fCreateBlank; | ||||
static std::map<std::string, UniValue> registers; | static std::map<std::string, UniValue> registers; | ||||
static const int CONTINUE_EXECUTION = -1; | static const int CONTINUE_EXECUTION = -1; | ||||
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr; | ||||
static void SetupBitcoinTxArgs() { | static void SetupBitcoinTxArgs() { | ||||
gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, false, | gArgs.AddArg("-?", "This help message", ArgsManager::ALLOW_ANY, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-create", "Create new, empty TX.", ArgsManager::ALLOW_ANY, | gArgs.AddArg("-create", "Create new, empty TX.", ArgsManager::ALLOW_ANY, | ||||
false, OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-json", "Select JSON output", ArgsManager::ALLOW_ANY, false, | gArgs.AddArg("-json", "Select JSON output", ArgsManager::ALLOW_ANY, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-txid", | gArgs.AddArg("-txid", | ||||
"Output only the hex-encoded transaction id of the resultant " | "Output only the hex-encoded transaction id of the resultant " | ||||
"transaction.", | "transaction.", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
SetupChainParamsBaseOptions(); | SetupChainParamsBaseOptions(); | ||||
gArgs.AddArg("delin=N", "Delete input N from TX", ArgsManager::ALLOW_ANY, | gArgs.AddArg("delin=N", "Delete input N from TX", ArgsManager::ALLOW_ANY, | ||||
false, OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("delout=N", "Delete output N from TX", ArgsManager::ALLOW_ANY, | gArgs.AddArg("delout=N", "Delete output N from TX", ArgsManager::ALLOW_ANY, | ||||
false, OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", | gArgs.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("locktime=N", "Set TX lock time to N", ArgsManager::ALLOW_ANY, | gArgs.AddArg("locktime=N", "Set TX lock time to N", ArgsManager::ALLOW_ANY, | ||||
false, OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("nversion=N", "Set TX version to N", ArgsManager::ALLOW_ANY, | gArgs.AddArg("nversion=N", "Set TX version to N", ArgsManager::ALLOW_ANY, | ||||
false, OptionsCategory::COMMANDS); | OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", | gArgs.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outpubkey=VALUE:PUBKEY[:FLAGS]", | gArgs.AddArg("outpubkey=VALUE:PUBKEY[:FLAGS]", | ||||
"Add pay-to-pubkey output to TX. " | "Add pay-to-pubkey output to TX. " | ||||
"Optionally add the \"S\" flag to wrap the output in a " | "Optionally add the \"S\" flag to wrap the output in a " | ||||
"pay-to-script-hash.", | "pay-to-script-hash.", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", | gArgs.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("outscript=VALUE:SCRIPT[:FLAGS]", | gArgs.AddArg("outscript=VALUE:SCRIPT[:FLAGS]", | ||||
"Add raw script output to TX. " | "Add raw script output to TX. " | ||||
"Optionally add the \"S\" flag to wrap the output in a " | "Optionally add the \"S\" flag to wrap the output in a " | ||||
"pay-to-script-hash.", | "pay-to-script-hash.", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", | "outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", | ||||
"Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. " | "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. " | ||||
"Optionally add the \"S\" flag to wrap the output in a " | "Optionally add the \"S\" flag to wrap the output in a " | ||||
"pay-to-script-hash.", | "pay-to-script-hash.", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg("sign=SIGHASH-FLAGS", | gArgs.AddArg("sign=SIGHASH-FLAGS", | ||||
"Add zero or more signatures to transaction. " | "Add zero or more signatures to transaction. " | ||||
"This command requires JSON registers:" | "This command requires JSON registers:" | ||||
"prevtxs=JSON object, " | "prevtxs=JSON object, " | ||||
"privatekeys=JSON object. " | "privatekeys=JSON object. " | ||||
"See signrawtransactionwithkey docs for format of sighash " | "See signrawtransactionwithkey docs for format of sighash " | ||||
"flags, JSON objects.", | "flags, JSON objects.", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); | ||||
gArgs.AddArg( | gArgs.AddArg("load=NAME:FILENAME", | ||||
"load=NAME:FILENAME", "Load JSON file FILENAME into register NAME", | "Load JSON file FILENAME into register NAME", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::REGISTER_COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::REGISTER_COMMANDS); | ||||
gArgs.AddArg( | gArgs.AddArg("set=NAME:JSON-STRING", | ||||
"set=NAME:JSON-STRING", "Set register NAME to given JSON-STRING", | "Set register NAME to given JSON-STRING", | ||||
ArgsManager::ALLOW_ANY, false, OptionsCategory::REGISTER_COMMANDS); | ArgsManager::ALLOW_ANY, OptionsCategory::REGISTER_COMMANDS); | ||||
// Hidden | // Hidden | ||||
gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, false, | gArgs.AddArg("-h", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); | ||||
OptionsCategory::HIDDEN); | gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); | ||||
gArgs.AddArg("-help", "", ArgsManager::ALLOW_ANY, false, | |||||
OptionsCategory::HIDDEN); | |||||
} | } | ||||
// | // | ||||
// This function returns either one of EXIT_ codes when it's expected to stop | // This function returns either one of EXIT_ codes when it's expected to stop | ||||
// the process or CONTINUE_EXECUTION when it's expected to continue further. | // the process or CONTINUE_EXECUTION when it's expected to continue further. | ||||
// | // | ||||
static int AppInitRawTx(int argc, char *argv[]) { | static int AppInitRawTx(int argc, char *argv[]) { | ||||
// | // | ||||
▲ Show 20 Lines • Show All 800 Lines • Show Last 20 Lines |