MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / decoderawtransaction

Function decoderawtransaction

src/rpcrawtransaction.cpp:393–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393UniValue decoderawtransaction(const UniValue& params, bool fHelp)
394{
395 if (fHelp || params.size() != 1)
396 throw runtime_error(
397 "decoderawtransaction \"hexstring\"\n"
398 "\nReturn a JSON object representing the serialized, hex-encoded transaction.\n"
399
400 "\nArguments:\n"
401 "1. \"hex\" (string, required) The transaction hex string\n"
402
403 "\nResult:\n"
404 "{\n"
405 " \"txid\" : \"id\", (string) The transaction id\n"
406 " \"size\" : n, (numeric) The transaction size\n"
407 " \"version\" : n, (numeric) The version\n"
408 " \"locktime\" : ttt, (numeric) The lock time\n"
409 " \"vin\" : [ (array of json objects)\n"
410 " {\n"
411 " \"txid\": \"id\", (string) The transaction id\n"
412 " \"vout\": n, (numeric) The output number\n"
413 " \"scriptSig\": { (json object) The script\n"
414 " \"asm\": \"asm\", (string) asm\n"
415 " \"hex\": \"hex\" (string) hex\n"
416 " },\n"
417 " \"sequence\": n (numeric) The script sequence number\n"
418 " }\n"
419 " ,...\n"
420 " ],\n"
421 " \"vout\" : [ (array of json objects)\n"
422 " {\n"
423 " \"value\" : x.xxx, (numeric) The value in bcc\n"
424 " \"n\" : n, (numeric) index\n"
425 " \"scriptPubKey\" : { (json object)\n"
426 " \"asm\" : \"asm\", (string) the asm\n"
427 " \"hex\" : \"hex\", (string) the hex\n"
428 " \"reqSigs\" : n, (numeric) The required sigs\n"
429 " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
430 " \"addresses\" : [ (json array of string)\n"
431 " \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) bitcoin address\n"
432 " ,...\n"
433 " ]\n"
434 " }\n"
435 " }\n"
436 " ,...\n"
437 " ],\n"
438 "}\n"
439
440 "\nExamples:\n"
441 + HelpExampleCli("decoderawtransaction", "\"hexstring\"")
442 + HelpExampleRpc("decoderawtransaction", "\"hexstring\"")
443 );
444
445 LOCK(cs_main);
446 RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
447
448 CTransaction tx;
449
450 if (!DecodeHexTx(tx, params[0].get_str()))

Callers

nothing calls this directly

Calls 9

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
RPCTypeCheckFunction · 0.85
DecodeHexTxFunction · 0.85
JSONRPCErrorFunction · 0.85
TxToJSONFunction · 0.85
get_strMethod · 0.80
uint256Class · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected