getTransaction - Litecoin

Returns a normalized transaction by its id, with inputs, outputs, addresses, values, and confirmation data. This is the WebSocket form of the REST api/v2/tx endpoint.

Parameters

ParameterTypeRequiredDescription
txidstringYesTransaction id

Message

bashwscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

# then send:
{
    "id": "getblock.io",
    "method": "getTransaction",
    "params": {
        "txid": "51a31c4236a99bfd17cda606f079c9c4814851119e7593ab7c739bd5972b1969"
    }
}

Response

json{
    "id": "getblock.io",
    "data": {
        "txid": "51a31c4236a99bfd17cda606f079c9c4814851119e7593ab7c739bd5972b1969",
        "version": 2,
        "vin": [
            {
                "txid": "4c3d9548bb03a42551c10f2472e99cd86776ed00fd3bfb530c4466b93e7ddac7",
                "vout": 2121,
                "sequence": 4294967295,
                "n": 0,
                "addresses": ["LUnYgfpJMLM2h27wDcJypQHQhRXXrZrfvE"],
                "isAddress": true,
                "value": "720950"
            }
        ],
        "vout": [
            {
                "value": "8324080358",
                "n": 0,
                "hex": "76a914182c25bf95cacc04fd35d1ea8ea49539251bd55288ac",
                "addresses": ["LMRmNEdhi5F43vtW5qPdv1q9s7xsMp4XK5"],
                "isAddress": true
            }
        ],
        "blockHash": "0fc24234c2379a5262023a4b4a653ff3a11df6bb1c12851aff820d27ea02b0b6",
        "blockHeight": 3179800,
        "confirmations": 17,
        "blockTime": 1789699786,
        "size": 73090,
        "vsize": 73090,
        "value": "103517609950",
        "valueIn": "103517609950",
        "fees": "0"
    }
}

Response Fields

FieldTypeDescription
txidstringThe transaction id
vinarrayInputs with addresses and values
voutarrayOutputs with values, scripts, and destination addresses
blockHeightintegerBlock height, or -1 while unconfirmed
confirmationsintegerNumber of confirmations. 0 while unconfirmed
sizeintegerSerialized size in bytes
vsizeintegerVirtual size in vbytes
valuestringTotal output value in litoshis
feesstringFee paid in litoshis

Use Cases

  • Payment Verification: Confirm the amount and destination of a deposit
  • Confirmation Checks: Read the current depth of a transaction
  • Fee Analysis: Compare fees paid against virtual size
  • Input Tracing: Follow the addresses a transaction spends

Error Handling

ErrorMessageDescription
errorNot foundNo transaction exists with the requested id
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect