| 674 | } |
| 675 | |
| 676 | UniValue decoderawtransaction(const UniValue& params, bool fHelp) |
| 677 | { |
| 678 | if (fHelp || params.size() != 1) |
| 679 | throw runtime_error( |
| 680 | "decoderawtransaction \"hexstring\"\n" |
| 681 | "\nReturn a JSON object representing the serialized, hex-encoded transaction.\n" |
| 682 | |
| 683 | "\nArguments:\n" |
| 684 | "1. \"hex\" (string, required) The transaction hex string\n" |
| 685 | |
| 686 | "\nResult:\n" |
| 687 | "{\n" |
| 688 | " \"txid\" : \"id\", (string) The transaction id\n" |
| 689 | " \"hash\" : \"id\", (string) The transaction hash (differs from txid for witness transactions)\n" |
| 690 | " \"size\" : n, (numeric) The transaction size\n" |
| 691 | " \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n" |
| 692 | " \"version\" : n, (numeric) The version\n" |
| 693 | " \"locktime\" : ttt, (numeric) The lock time\n" |
| 694 | " \"vin\" : [ (array of json objects)\n" |
| 695 | " {\n" |
| 696 | " \"txid\": \"id\", (string) The transaction id\n" |
| 697 | " \"vout\": n, (numeric) The output number\n" |
| 698 | " \"scriptSig\": { (json object) The script\n" |
| 699 | " \"asm\": \"asm\", (string) asm\n" |
| 700 | " \"hex\": \"hex\" (string) hex\n" |
| 701 | " },\n" |
| 702 | " \"txinwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n" |
| 703 | " \"sequence\": n (numeric) The script sequence number\n" |
| 704 | " }\n" |
| 705 | " ,...\n" |
| 706 | " ],\n" |
| 707 | " \"vout\" : [ (array of json objects)\n" |
| 708 | " {\n" |
| 709 | " \"value\" : x.xxx, (numeric) The value in btc\n" |
| 710 | " \"n\" : n, (numeric) index\n" |
| 711 | " \"scriptPubKey\" : { (json object)\n" |
| 712 | " \"asm\" : \"asm\", (string) the asm\n" |
| 713 | " \"hex\" : \"hex\", (string) the hex\n" |
| 714 | " \"reqSigs\" : n, (numeric) The required sigs\n" |
| 715 | " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" |
| 716 | " \"addresses\" : [ (json array of string)\n" |
| 717 | " \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) lux address\n" |
| 718 | " ,...\n" |
| 719 | " ]\n" |
| 720 | " }\n" |
| 721 | " }\n" |
| 722 | " ,...\n" |
| 723 | " ],\n" |
| 724 | "}\n" |
| 725 | |
| 726 | "\nExamples:\n" + |
| 727 | HelpExampleCli("decoderawtransaction", "\"hexstring\"") + HelpExampleRpc("decoderawtransaction", "\"hexstring\"")); |
| 728 | |
| 729 | LOCK(cs_main); |
| 730 | |
| 731 | RPCTypeCheck(params, list_of(UniValue::VSTR)); |
| 732 | |
| 733 | CTransaction tx; |
nothing calls this directly
no test coverage detected