| 505 | } |
| 506 | |
| 507 | static UniValue decoderawtransaction(const JSONRPCRequest& request) |
| 508 | { |
| 509 | if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) |
| 510 | throw std::runtime_error( |
| 511 | "decoderawtransaction \"hexstring\" ( iswitness )\n" |
| 512 | "\nReturn a JSON object representing the serialized, hex-encoded transaction.\n" |
| 513 | |
| 514 | "\nArguments:\n" |
| 515 | "1. \"hexstring\" (string, required) The transaction hex string\n" |
| 516 | "2. iswitness (boolean, optional) Whether the transaction hex is a serialized witness transaction\n" |
| 517 | " If iswitness is not present, heuristic tests will be used in decoding\n" |
| 518 | |
| 519 | "\nResult:\n" |
| 520 | "{\n" |
| 521 | " \"txid\" : \"id\", (string) The transaction id\n" |
| 522 | " \"hash\" : \"id\", (string) The transaction hash (differs from txid for witness transactions)\n" |
| 523 | " \"size\" : n, (numeric) The transaction size\n" |
| 524 | " \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n" |
| 525 | " \"weight\" : n, (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4)\n" |
| 526 | " \"version\" : n, (numeric) The version\n" |
| 527 | " \"locktime\" : ttt, (numeric) The lock time\n" |
| 528 | " \"vin\" : [ (array of json objects)\n" |
| 529 | " {\n" |
| 530 | " \"txid\": \"id\", (string) The transaction id\n" |
| 531 | " \"vout\": n, (numeric) The output number\n" |
| 532 | " \"scriptSig\": { (json object) The script\n" |
| 533 | " \"asm\": \"asm\", (string) asm\n" |
| 534 | " \"hex\": \"hex\" (string) hex\n" |
| 535 | " },\n" |
| 536 | " \"txinwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n" |
| 537 | " \"sequence\": n (numeric) The script sequence number\n" |
| 538 | " }\n" |
| 539 | " ,...\n" |
| 540 | " ],\n" |
| 541 | " \"vout\" : [ (array of json objects)\n" |
| 542 | " {\n" |
| 543 | " \"value\" : x.xxx, (numeric) The value in " + CURRENCY_UNIT + "\n" |
| 544 | " \"n\" : n, (numeric) index\n" |
| 545 | " \"scriptPubKey\" : { (json object)\n" |
| 546 | " \"asm\" : \"asm\", (string) the asm\n" |
| 547 | " \"hex\" : \"hex\", (string) the hex\n" |
| 548 | " \"reqSigs\" : n, (numeric) The required sigs\n" |
| 549 | " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" |
| 550 | " \"addresses\" : [ (json array of string)\n" |
| 551 | " \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) bitcoin address\n" |
| 552 | " ,...\n" |
| 553 | " ]\n" |
| 554 | " }\n" |
| 555 | " }\n" |
| 556 | " ,...\n" |
| 557 | " ],\n" |
| 558 | "}\n" |
| 559 | |
| 560 | "\nExamples:\n" |
| 561 | + HelpExampleCli("decoderawtransaction", "\"hexstring\"") |
| 562 | + HelpExampleRpc("decoderawtransaction", "\"hexstring\"") |
| 563 | ); |
| 564 |
nothing calls this directly
no test coverage detected