Tutorials
GET Transaction Output by Reference
16min
prerequisites before submitting an api request, ensure you have completed the following created an account created a project steps to submit an api request the blockchain indexer docid\ uugbwuwqfuiqf9pp8sd9o api allows applications to retrieve on chain data and submit transactions in this example, we will use the pre production cardano network as the selected network for our project 1\ select the network ensure your project is configured to use the pre production cardano network 2\ retrieve transaction output use the following endpoint to get detailed information about a transaction and its output utxo /transactions/{tx hash}/outputs/{index}/txo 3\ specify path parameters include the required path parameters in your request parameter data type description required tx hash string the unique identifier of the transaction yes index integer the output index is specifying which utxo to retrieve yes 4\ specify query parameters (optional) include optional query parameters as needed parameter data type description required with cbor boolean set to true to include the cbor encoding of the transaction output in the response no 5\ send the api request use curl or your preferred tool to send the api request for this example, we will use tx hash 9907c1bcab96889368d975ec1964e2fedfef22ce4a0e367bf9cb621b9f0dcb4a index 0 with cbor true curl x get \\ h "api key \<your project api key>" \\ h 'accept application/json' \\ https //preprod gomaestro api org/v1/transactions/9907c1bcab96889368d975ec1964e2fedfef22ce4a0e367bf9cb621b9f0dcb4a/outputs/0/txo?resolve datums=true\&with cbor=true 6\ review the response the api will return a response like the following "data" { "tx hash" "9907c1bcab96889368d975ec1964e2fedfef22ce4a0e367bf9cb621b9f0dcb4a", "index" 0, "assets" \[ { "unit" "lovelace", "amount" 7280082022 }, { "unit" "34250edd1e9836f5378702fbf9416b709bc140e04f668cc3552085184154414441636f696e", "amount" 10824 } ], "address" "addr test1vpfwv0ezc5g8a4mkku8hhy3y3vp92t7s3ul8g778g5yegsgalc6gc", "datum" null, "reference script" null, "txout cbor" "a200581d6052e63f22c5107ed776b70f7b92248b02552fd08f3e747bc74509944101821b00000001b1ed3c66a1581c34250edd1e9836f5378702fbf9416b709bc140e04f668cc355208518a1494154414441636f696e192a48" }, "last updated" { "timestamp" "2024 09 06 13 56 56", "block hash" "ca6cf1b408ee8eb02019bce77995c5ed5983c2b553b1b6b2fcecfaaf72d1fc59", "block slot" 69947816 } 7\ understanding the response term definition tx hash the unique hash identifier of a transaction index the index position of the transaction output (utxo) assets unit the reference for native assets, either hex(policy id)#hex(asset name) or lovelace assets quantity the quantity of the native asset address the address controlling the utxo datum type type of datum either inline or hash datum hash the hash of the datum datum bytes hex encoded cbor bytes of the datum ( null if datum type is hash and corresponding datum bytes have not been seen on chain) datum json json format of the datum value reference script type the type of reference script native , plutusv1 , or plutusv2 reference script hash the hash of the reference script reference script bytes the script bytes ( null if the script is native ) reference script json json format of the script