zcash.rpc.github.io/getrawtransaction.html

621 lines
21 KiB
HTML
Raw Normal View History

2018-03-08 17:34:40 -08:00
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=1200px, shrink-to-fit=yes">
2019-08-27 13:43:20 -07:00
<meta name="description" content="Zcash 2.0.7 RPC Docs - getrawtransaction">
2018-03-08 17:34:40 -08:00
<meta name="author" content="">
2019-08-27 13:43:20 -07:00
<title>getrawtransaction - Zcash 2.0.7 RPC Docs</title>
2018-03-08 17:34:40 -08:00
<link href="./bootstrap.min.css" rel="stylesheet">
</head>
<style>
.card-body {
font-size:80%;
padding-top: 0.5em;
}
pre {
word-break: break-word;
white-space: pre-wrap;
}
</style>
<body>
<nav class="navbar navbar-dark bg-dark ">
2019-08-27 13:43:20 -07:00
<a class="navbar-brand" href="/">Zcash 2.0.7 RPC docs</a>
2018-03-08 17:34:40 -08:00
</nav>
<main role="main" class="container-fluid" style="margin-top: 1pc;">
<div class="row">
2018-03-08 18:26:01 -08:00
<div class="col-8 col-lg-9 col-xl-10">
2019-08-27 13:43:20 -07:00
<h1>getrawtransaction - Zcash 2.0.7 RPC</h1>
2018-03-09 04:16:57 -08:00
2018-06-10 07:43:39 -07:00
<pre>getrawtransaction &#34;txid&#34; ( verbose )
2018-03-08 17:34:40 -08:00
2018-06-10 07:43:39 -07:00
NOTE: By default this function only works sometimes. This is when the tx is in the mempool
or there is an unspent output in the utxo for this transaction. To make it always work,
you need to maintain a transaction index, using the -txindex command line option.
2018-03-08 17:34:40 -08:00
Return the raw transaction data.
2018-06-10 07:43:39 -07:00
If verbose=0, returns a string that is serialized, hex-encoded data for &#39;txid&#39;.
If verbose is non-zero, returns an Object with information about &#39;txid&#39;.
2018-03-08 17:34:40 -08:00
Arguments:
2018-03-08 17:41:52 -08:00
1. &#34;txid&#34; (string, required) The transaction id
2018-06-10 07:43:39 -07:00
2. verbose (numeric, optional, default=0) If 0, return a string, other return a json object
2018-03-08 17:34:40 -08:00
2018-06-10 07:43:39 -07:00
Result (if verbose is not set or set to 0):
2018-03-08 17:41:52 -08:00
&#34;data&#34; (string) The serialized, hex-encoded data for &#39;txid&#39;
2018-03-08 17:34:40 -08:00
2018-06-10 07:43:39 -07:00
Result (if verbose &gt; 0):
2018-03-08 17:34:40 -08:00
{
2018-03-08 17:41:52 -08:00
&#34;hex&#34; : &#34;data&#34;, (string) The serialized, hex-encoded data for &#39;txid&#39;
&#34;txid&#34; : &#34;id&#34;, (string) The transaction id (same as provided)
&#34;version&#34; : n, (numeric) The version
&#34;locktime&#34; : ttt, (numeric) The lock time
2018-06-10 07:43:39 -07:00
&#34;expiryheight&#34; : ttt, (numeric, optional) The block height after which the transaction expires
2018-03-08 17:41:52 -08:00
&#34;vin&#34; : [ (array of json objects)
2018-03-08 17:34:40 -08:00
{
2018-03-08 17:41:52 -08:00
&#34;txid&#34;: &#34;id&#34;, (string) The transaction id
&#34;vout&#34;: n, (numeric)
&#34;scriptSig&#34;: { (json object) The script
&#34;asm&#34;: &#34;asm&#34;, (string) asm
&#34;hex&#34;: &#34;hex&#34; (string) hex
2018-03-08 17:34:40 -08:00
},
2018-03-08 17:41:52 -08:00
&#34;sequence&#34;: n (numeric) The script sequence number
2018-03-08 17:34:40 -08:00
}
,...
],
2018-03-08 17:41:52 -08:00
&#34;vout&#34; : [ (array of json objects)
2018-03-08 17:34:40 -08:00
{
2018-06-10 07:43:39 -07:00
&#34;value&#34; : x.xxx, (numeric) The value in ZEC
2018-03-08 17:41:52 -08:00
&#34;n&#34; : n, (numeric) index
&#34;scriptPubKey&#34; : { (json object)
&#34;asm&#34; : &#34;asm&#34;, (string) the asm
&#34;hex&#34; : &#34;hex&#34;, (string) the hex
&#34;reqSigs&#34; : n, (numeric) The required sigs
&#34;type&#34; : &#34;pubkeyhash&#34;, (string) The type, eg &#39;pubkeyhash&#39;
&#34;addresses&#34; : [ (json array of string)
2018-06-10 07:43:39 -07:00
&#34;zcashaddress&#34; (string) Zcash address
2018-03-08 17:34:40 -08:00
,...
]
}
}
,...
],
2018-06-10 07:43:39 -07:00
&#34;vjoinsplit&#34; : [ (array of json objects, only for version &gt;= 2)
{
&#34;vpub_old&#34; : x.xxx, (numeric) public input value in ZEC
&#34;vpub_new&#34; : x.xxx, (numeric) public output value in ZEC
&#34;anchor&#34; : &#34;hex&#34;, (string) the anchor
&#34;nullifiers&#34; : [ (json array of string)
&#34;hex&#34; (string) input note nullifier
,...
],
&#34;commitments&#34; : [ (json array of string)
&#34;hex&#34; (string) output note commitment
,...
],
&#34;onetimePubKey&#34; : &#34;hex&#34;, (string) the onetime public key used to encrypt the ciphertexts
&#34;randomSeed&#34; : &#34;hex&#34;, (string) the random seed
&#34;macs&#34; : [ (json array of string)
&#34;hex&#34; (string) input note MAC
,...
],
&#34;proof&#34; : &#34;hex&#34;, (string) the zero-knowledge proof
&#34;ciphertexts&#34; : [ (json array of string)
&#34;hex&#34; (string) output note ciphertext
,...
]
}
,...
],
2018-03-08 17:41:52 -08:00
&#34;blockhash&#34; : &#34;hash&#34;, (string) the block hash
&#34;confirmations&#34; : n, (numeric) The confirmations
&#34;time&#34; : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)
&#34;blocktime&#34; : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
2018-03-08 17:34:40 -08:00
}
Examples:
2018-06-10 07:43:39 -07:00
&gt; zcash-cli getrawtransaction &#34;mytxid&#34;
&gt; zcash-cli getrawtransaction &#34;mytxid&#34; 1
&gt; curl --user myusername --data-binary &#39;{&#34;jsonrpc&#34;: &#34;1.0&#34;, &#34;id&#34;:&#34;curltest&#34;, &#34;method&#34;: &#34;getrawtransaction&#34;, &#34;params&#34;: [&#34;mytxid&#34;, 1] }&#39; -H &#39;content-type: text/plain;&#39; http://127.0.0.1:8232/
2018-03-08 17:34:40 -08:00
2018-03-09 04:16:57 -08:00
</pre>
<hr>
2018-03-08 17:34:40 -08:00
<p>
2018-06-10 07:43:39 -07:00
Made by <a href="https://twitter.com/karel_3d">@karel_3d</a>; license of the docs is MIT (see <a href="https://github.com/zcash/zcash">zcash repo</a>), license of the scripts and webpage is also MIT ((C) 2018 Karel Bilek) (<a href="https://github.com/zcash-rpc/zcash-rpc.github.io">github repo</a>)
2018-03-08 17:34:40 -08:00
</p>
<p>
2018-08-20 09:15:35 -07:00
Note it uses a mainnet node
2018-03-08 17:34:40 -08:00
</p>
</div>
2018-03-08 18:26:01 -08:00
<div class="col-4 col-lg-3 col-xl-2">
2018-03-09 04:16:57 -08:00
2019-08-27 13:43:20 -07:00
<div class="card">
<div class="card-header">
Addressindex
</div>
<div class="card-body">
<a href="getaddressbalance.html">getaddressbalance</a>
<br>
<a href="getaddressdeltas.html">getaddressdeltas</a>
<br>
<a href="getaddressmempool.html">getaddressmempool</a>
<br>
<a href="getaddresstxids.html">getaddresstxids</a>
<br>
<a href="getaddressutxos.html">getaddressutxos</a>
<br>
</div>
</div>
<br>
2018-03-09 04:16:57 -08:00
<div class="card">
<div class="card-header">
Blockchain
</div>
<div class="card-body">
<a href="getbestblockhash.html">getbestblockhash</a>
<br>
<a href="getblock.html">getblock</a>
<br>
<a href="getblockchaininfo.html">getblockchaininfo</a>
<br>
<a href="getblockcount.html">getblockcount</a>
<br>
2019-08-27 13:43:20 -07:00
<a href="getblockdeltas.html">getblockdeltas</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="getblockhash.html">getblockhash</a>
<br>
2019-08-27 13:43:20 -07:00
<a href="getblockhashes.html">getblockhashes</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="getblockheader.html">getblockheader</a>
<br>
<a href="getchaintips.html">getchaintips</a>
<br>
<a href="getdifficulty.html">getdifficulty</a>
<br>
<a href="getmempoolinfo.html">getmempoolinfo</a>
<br>
<a href="getrawmempool.html">getrawmempool</a>
<br>
2019-08-27 13:43:20 -07:00
<a href="getspentinfo.html">getspentinfo</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="gettxout.html">gettxout</a>
<br>
<a href="gettxoutproof.html">gettxoutproof</a>
<br>
<a href="gettxoutsetinfo.html">gettxoutsetinfo</a>
<br>
<a href="verifychain.html">verifychain</a>
<br>
<a href="verifytxoutproof.html">verifytxoutproof</a>
<br>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Control
</div>
<div class="card-body">
2018-06-10 07:43:39 -07:00
<a href="getinfo.html">getinfo</a>
2018-03-09 04:16:57 -08:00
<br>
<a href="help.html">help</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="stop.html">stop</a>
2018-03-09 04:16:57 -08:00
<br>
2018-06-10 07:43:39 -07:00
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Disclosure
</div>
<div class="card-body">
<a href="z_getpaymentdisclosure.html">z_getpaymentdisclosure</a>
2018-03-09 04:16:57 -08:00
<br>
2018-06-10 07:43:39 -07:00
<a href="z_validatepaymentdisclosure.html">z_validatepaymentdisclosure</a>
2018-03-09 04:16:57 -08:00
<br>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Generating
</div>
<div class="card-body">
<a href="generate.html">generate</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="getgenerate.html">getgenerate</a>
<br>
<a href="setgenerate.html">setgenerate</a>
2018-03-09 04:16:57 -08:00
<br>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Mining
</div>
<div class="card-body">
2018-06-10 07:43:39 -07:00
<a href="getblocksubsidy.html">getblocksubsidy</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="getblocktemplate.html">getblocktemplate</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="getlocalsolps.html">getlocalsolps</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="getmininginfo.html">getmininginfo</a>
<br>
<a href="getnetworkhashps.html">getnetworkhashps</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="getnetworksolps.html">getnetworksolps</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="prioritisetransaction.html">prioritisetransaction</a>
<br>
<a href="submitblock.html">submitblock</a>
<br>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Network
</div>
<div class="card-body">
<a href="addnode.html">addnode</a>
<br>
<a href="clearbanned.html">clearbanned</a>
<br>
<a href="disconnectnode.html">disconnectnode</a>
<br>
<a href="getaddednodeinfo.html">getaddednodeinfo</a>
<br>
<a href="getconnectioncount.html">getconnectioncount</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="getdeprecationinfo.html">getdeprecationinfo</a>
<br>
2018-03-09 04:16:57 -08:00
<a href="getnettotals.html">getnettotals</a>
<br>
<a href="getnetworkinfo.html">getnetworkinfo</a>
<br>
<a href="getpeerinfo.html">getpeerinfo</a>
<br>
<a href="listbanned.html">listbanned</a>
<br>
<a href="ping.html">ping</a>
<br>
<a href="setban.html">setban</a>
<br>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Rawtransactions
</div>
<div class="card-body">
<a href="createrawtransaction.html">createrawtransaction</a>
<br>
<a href="decoderawtransaction.html">decoderawtransaction</a>
<br>
<a href="decodescript.html">decodescript</a>
<br>
<a href="fundrawtransaction.html">fundrawtransaction</a>
<br>
<a href="getrawtransaction.html">getrawtransaction</a>
<br>
<a href="sendrawtransaction.html">sendrawtransaction</a>
<br>
<a href="signrawtransaction.html">signrawtransaction</a>
<br>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Util
</div>
<div class="card-body">
<a href="createmultisig.html">createmultisig</a>
<br>
<a href="estimatefee.html">estimatefee</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="estimatepriority.html">estimatepriority</a>
2018-03-09 04:16:57 -08:00
<br>
<a href="validateaddress.html">validateaddress</a>
<br>
<a href="verifymessage.html">verifymessage</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="z_validateaddress.html">z_validateaddress</a>
<br>
2018-03-09 04:16:57 -08:00
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Wallet
</div>
<div class="card-body">
<a href="addmultisigaddress.html">addmultisigaddress</a>
<br>
<a href="backupwallet.html">backupwallet</a>
<br>
<a href="dumpprivkey.html">dumpprivkey</a>
<br>
<a href="dumpwallet.html">dumpwallet</a>
<br>
<a href="encryptwallet.html">encryptwallet</a>
<br>
<a href="getaccount.html">getaccount</a>
<br>
<a href="getaccountaddress.html">getaccountaddress</a>
<br>
<a href="getaddressesbyaccount.html">getaddressesbyaccount</a>
<br>
<a href="getbalance.html">getbalance</a>
<br>
<a href="getnewaddress.html">getnewaddress</a>
<br>
<a href="getrawchangeaddress.html">getrawchangeaddress</a>
<br>
<a href="getreceivedbyaccount.html">getreceivedbyaccount</a>
<br>
<a href="getreceivedbyaddress.html">getreceivedbyaddress</a>
<br>
<a href="gettransaction.html">gettransaction</a>
<br>
<a href="getunconfirmedbalance.html">getunconfirmedbalance</a>
<br>
<a href="getwalletinfo.html">getwalletinfo</a>
<br>
<a href="importaddress.html">importaddress</a>
<br>
<a href="importprivkey.html">importprivkey</a>
<br>
<a href="importwallet.html">importwallet</a>
<br>
<a href="keypoolrefill.html">keypoolrefill</a>
<br>
<a href="listaccounts.html">listaccounts</a>
<br>
<a href="listaddressgroupings.html">listaddressgroupings</a>
<br>
<a href="listlockunspent.html">listlockunspent</a>
<br>
<a href="listreceivedbyaccount.html">listreceivedbyaccount</a>
<br>
<a href="listreceivedbyaddress.html">listreceivedbyaddress</a>
<br>
<a href="listsinceblock.html">listsinceblock</a>
<br>
<a href="listtransactions.html">listtransactions</a>
<br>
<a href="listunspent.html">listunspent</a>
<br>
<a href="lockunspent.html">lockunspent</a>
<br>
<a href="move.html">move</a>
<br>
<a href="sendfrom.html">sendfrom</a>
<br>
<a href="sendmany.html">sendmany</a>
<br>
<a href="sendtoaddress.html">sendtoaddress</a>
<br>
<a href="setaccount.html">setaccount</a>
<br>
<a href="settxfee.html">settxfee</a>
<br>
<a href="signmessage.html">signmessage</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="z_exportkey.html">z_exportkey</a>
<br>
<a href="z_exportviewingkey.html">z_exportviewingkey</a>
<br>
<a href="z_exportwallet.html">z_exportwallet</a>
<br>
<a href="z_getbalance.html">z_getbalance</a>
<br>
2019-05-08 13:34:30 -07:00
<a href="z_getmigrationstatus.html">z_getmigrationstatus</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="z_getnewaddress.html">z_getnewaddress</a>
<br>
<a href="z_getoperationresult.html">z_getoperationresult</a>
<br>
<a href="z_getoperationstatus.html">z_getoperationstatus</a>
<br>
<a href="z_gettotalbalance.html">z_gettotalbalance</a>
<br>
<a href="z_importkey.html">z_importkey</a>
<br>
<a href="z_importviewingkey.html">z_importviewingkey</a>
<br>
<a href="z_importwallet.html">z_importwallet</a>
<br>
<a href="z_listaddresses.html">z_listaddresses</a>
<br>
<a href="z_listoperationids.html">z_listoperationids</a>
<br>
<a href="z_listreceivedbyaddress.html">z_listreceivedbyaddress</a>
<br>
<a href="z_listunspent.html">z_listunspent</a>
<br>
<a href="z_mergetoaddress.html">z_mergetoaddress</a>
<br>
<a href="z_sendmany.html">z_sendmany</a>
<br>
2019-05-08 13:34:30 -07:00
<a href="z_setmigration.html">z_setmigration</a>
<br>
2018-06-10 07:43:39 -07:00
<a href="z_shieldcoinbase.html">z_shieldcoinbase</a>
<br>
<a href="zcbenchmark.html">zcbenchmark</a>
<br>
<a href="zcrawjoinsplit.html">zcrawjoinsplit</a>
<br>
<a href="zcrawkeygen.html">zcrawkeygen</a>
2018-03-09 04:16:57 -08:00
<br>
2018-06-10 07:43:39 -07:00
<a href="zcrawreceive.html">zcrawreceive</a>
2018-03-09 04:16:57 -08:00
<br>
2018-06-10 07:43:39 -07:00
<a href="zcsamplejoinsplit.html">zcsamplejoinsplit</a>
2018-03-09 04:16:57 -08:00
<br>
</div>
</div>
<br>
</div>
2018-03-08 17:34:40 -08:00
</div>
2018-03-09 04:16:57 -08:00
</main>
2018-03-08 17:34:40 -08:00
</body>
2018-03-09 04:16:57 -08:00
</html>