In my application, I need to fire multiple transactions from same address, and want to create statusCheck()
function, which will let me know how many transactions of total are still pending to be added to block. Is it possible?
In my usecase, there is need to fire multiple transactions signed by same stash. There are lots of transactions, and they take lots of blocks before all of them are finalized. (As each transaction is a batch transaction, I see only one transaction getting added in one block at a time. Hence N transaction takes N blocks to complete all transactions).
For simplicity at Javascript side, I can not make JS code to wait for events from each transaction to return "status.isFinalized". Instead, after firing all N transactions, I want to write statusCheck() function, which when called will find how many transactions are yet pending to be finalized. That way, top level APP can call this statusCheck() again and again to find % completion (number of transactions pending / all transactions).
I am firing transactions by calling api.tx.utility.batch(txs).signAndSend
. I tried using api.query.system.account
and api.rpc.system.accountNextIndex
, but they give nonce
which include "pending transactions" as well. Is there way to find out when a specific transaction/nonce gets confirmed/finalized? Thanks for help guys.