I am currently trying to use the javascript api to send dot between accounts and I was wondering if there was a function/way to find out whether a transaction is finalized just based off the transaction hash. I read the docs here: https://polkadot.js.org/docs/api/start/api.tx.subs, I understand how to use the callback for status updates however I would really like a standalone function that takes in a transaction hash and outputs whether it is finalized if such a thing exists
1 Answer
On Substrate the transaction hashes are not unique and there is no RPC that actually provides an index of this non-unique identifier. There are a couple of existing questions answered on this, see this, this and this.
If you wish to see if something is finalized, one approach would be to
- subscribe to the finalized headers,
- retrieve the block and
- check for the extrinsic you are after in the block