How to get a pending tx id #14
-
Hi @cffls, i'm able to run the example to create and send a tx via blockfrost but I'd like the txid to be returned from context submit_tx. I naively tried I made a pr assuming it's that simple but didn't test. please advise if there's a way already. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hey there, that's a great question! It turns out that on Cardano you can already calculate the Tx ID directly from the signed transaction! Let me know if that ends up working for you. |
Beta Was this translation helpful? Give feedback.
-
Thanks Jarred @astrojarred ! I also answered the question in @34r7h 's pull request: https://github.com/cffls/pycardano/pull/12#issuecomment-1048127334 |
Beta Was this translation helpful? Give feedback.
-
Oh great! Did not see the PR 😄 |
Beta Was this translation helpful? Give feedback.
-
thanks, |
Beta Was this translation helpful? Give feedback.
Hey there, that's a great question!
It turns out that on Cardano you can already calculate the Tx ID directly from the signed transaction!
@cffls has conveniently implemented this for us. Once you've signed the tx you can get the resulting transaction ID as a string simply with
tx_id = str(signed_tx.id)
, even before you've submitted it.Let me know if that ends up working for you.