<p>The main option you have with <code>cardano-cli</code> is to keep running</p>
<pre><code>cardano-cli query utxo --tx-in df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#0 --mainnet
</code></pre>
<p>Where <code>df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214</code> is the TxHash and <code>#0</code> indicates the first output of that transaction, noting that all transactions must have at least one output.</p>
<p>It will give an output like the following</p>
<pre><code> TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214     0        49517208 lovelace + 1 7482551a1dab4a992e579718a81e6cd14401bf4d02856c0c738a2587.5061706572536f63696574793032303132 + 1 7482551a1dab4a992e579718a81e6cd14401bf4d02856c0c738a2587.5061706572536f63696574793036333930 + TxOutDatumNone
</code></pre>
<p>Note it will only highlight the moment the transaction makes it to a block accepted by your local node with no additional details such as the block number or assurance level.</p>
<p>As it currently stands there are limited options to query the status of a transaction using the <code>cardano-cli</code>. <code>cardano-serialization-lib-asmjs</code> on the other hand has no querying capability but allows you to build and serialise the transaction itself.</p>
<p>For more information you will have to consume the following resources from HTTP-based APIs</p>
<ul>
<li><a href="https://docs.blockfrost.io/#tag/Cardano-Transactions/paths/%7E1txs%7E1%7Bhash%7D/get" rel="nofollow noreferrer">Blockfrost</a></li>
<li><a href="https://api.koios.rest/#post-/tx_info" rel="nofollow noreferrer">Koios</a></li>
</ul>
<p>These will give you the block number but you will have to calculate the assurance level yourself by subtracting it from the current tip.</p>

CC BY-SA 4.0
2022-05-07T09:02:25.177Z
2022-05-07T09:02:25.177Z
keefie
<p>How can you check the status of a past transaction given the TxHash (i.e. pending, failed, or successful) and also the assurance level / number of confirmations and block number? (like on Cardanoscan here for example <a href="https://cardanoscan.io/transaction/df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#:%7E:text=7214272-,Assurance,-Low" rel="nofollow noreferrer">https://cardanoscan.io/transaction/df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#:~:text=7214272-,Assurance,-Low</a>?</p>
<p>Is this possible using the cli or @emurgo/cardano-serialization-lib-asmjs library?</p>

<cardano-cli><transaction><cardano-serialization-lib>
Check status of past transaction using cli
# Check status of past transaction using cli

(Asked by: username_0 on 2022-05-06)

How can you check the status of a past transaction given the TxHash (i.e. pending, failed, or successful) and also the assurance level / number of confirmations and block number? (like on Cardanoscan here for example [https://cardanoscan.io/transaction/df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#:~:text=7214272-,Assurance,-Low](https://cardanoscan.io/transaction/df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#:%7E:text=7214272-,Assurance,-Low)?

Is this possible using the cli or @emurgo/cardano-serialization-lib-asmjs library?

**Tags:** cardano-cli, transaction, cardano-serialization-lib

---

## 1 answers

### Answer by username_1 on 2022-05-07. Score: 4

The main option you have with cardano-cli is to keep running
cardano-cli query utxo --tx-in df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214#0 --mainnet

Where df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214 is the TxHash and #0 indicates the first output of that transaction, noting that all transactions must have at least one output.
It will give an output like the following
 TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
df8c580d50c1b8f97bd0831edb622be2737bc2a7e46971a8b369ab12e51cb214     0        49517208 lovelace + 1 7482551a1dab4a992e579718a81e6cd14401bf4d02856c0c738a2587.5061706572536f63696574793032303132 + 1 7482551a1dab4a992e579718a81e6cd14401bf4d02856c0c738a2587.5061706572536f63696574793036333930 + TxOutDatumNone

Note it will only highlight the moment the transaction makes it to a block accepted by your local node with no additional details such as the block number or assurance level.
As it currently stands there are limited options to query the status of a transaction using the cardano-cli. cardano-serialization-lib-asmjs on the other hand has no querying capability but allows you to build and serialise the transaction itself.
For more information you will have to consume the following resources from HTTP-based APIs

Blockfrost
Koios

These will give you the block number but you will have to calculate the assurance level yourself by subtracting it from the current tip.


---

