getrawtransaction

The getrawtransaction is a Litecoin RPC method that retrieves the raw transaction data for a given transaction ID. This method is essential for obtaining detailed information about a specific transaction, whether it's confirmed in a block or still in the memory pool. It can return the transaction in either hex format or as a detailed JSON object, making it useful for transaction analysis, verification, and debugging.


Parameters

parameter
type
description
txid
string (required)
The transaction ID of the transaction to retrieve.
verbose
boolean (optional)
If false (default), returns the serialized transaction as a hex-encoded string. If true, returns a JSON object with detailed transaction information.
blockhash
string (optional)
The block hash to look for the transaction in. Useful if you know which block contains the transaction.
Return Object

If verbose is false, returns a hex-encoded string of the serialized transaction.

If verbose is true, returns a JSON object with the following fields:

field
type
description
txid
string
The transaction ID.
hash
string
The transaction hash (differs from txid for witness transactions).
version
numeric
The transaction version.
size
numeric
The transaction size in bytes.
vsize
numeric
The virtual transaction size.
weight
numeric
The transaction weight.
locktime
numeric
The transaction lock time.
vin
array
Array of transaction inputs.
vout
array
Array of transaction outputs.
hex
string
The serialized transaction in hex format.
blockhash
string
The hash of the block containing this transaction (if confirmed).
confirmations
numeric
The number of confirmations for this transaction.
time
numeric
The transaction time in UNIX timestamp format.
blocktime
numeric
The block time in UNIX timestamp format.
Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?