getrawtransaction
getrawtransaction "txid" ( verbose "blockhash" )
Returns the raw transaction data.
By default, this function works only for mempool transactions. If a blockhash argument is provided, getrawtransaction
will return the transaction if the specified block is available and the transaction is found within it. Without a blockhash argument, it will return the transaction if it is in the mempool, or if -txindex
is enabled and the transaction is in a block within the blockchain.
Hint: Use gettransaction
for transactions in your wallet.
- If
verbose
is set totrue
, it returns an object with detailed information about thetxid
. - If
verbose
isfalse
or omitted, it returns a serialized, hex-encoded string of data for thetxid
.
Argument #1 – txid
Type: string, required
The transaction id
Argument #2 – verbose
Type: boolean, optional, default=false
If false, return a string, otherwise return a json object
Argument #3 – blockhash
Type: string, optional
The block in which to look for the transaction
Result (if verbose is not set or set to false)
Name |
Type |
Description |
---|---|---|
str |
string |
The serialized, hex-encoded data for ‘txid’ |