Transactions Updater
The Updater
hook will automatically check the status of each pending transaction based on the logic provided in shouldCheck
. It will use the provided callbacks to inform the rest of the app about the status of each transaction, allowing the state to be accurately updated.
Updater Hook
Props
pendingTransactions
: An object mapping transaction hashes to their metadata, including added time and last checked block number.onCheck
: A callback function invoked for transactions that have been checked but not yet confirmed. It receives an object with the transaction'schainId
,hash
, and theblockNumber
it was last checked against. Dispatches thecheckedTransaction
action when a transaction check is triggeredonReceipt
: A callback function invoked for transactions once they're confirmed. It receives an object with the transaction'schainId
,hash
, and itsreceipt
. Dispatches thefinalizeTransaction
action to store the final state of the transaction in the Redux store.
Last updated