wait For Transaction
Waits for a transaction block to be processed and available on the network by polling the getTransactionBlock
API.
This is a crucial utility to use after signAndExecuteTransactionBlock
to ensure a transaction's effects are finalized and available for querying before proceeding. This implementation uses idiomatic Kotlin coroutines for robust handling of timeouts, polling, and cancellation.
Return
A Result.Ok containing the transaction block response once it's found, or a Result.Err if the operation times out or encounters an unrecoverable error.
Parameters
The digest of the transaction to wait for.
The options object specifying which fields to return (e.g., effects, object changes).
The total time in milliseconds to wait for the transaction before failing. Defaults to 60 seconds.
The time in milliseconds to wait between each polling attempt. Defaults to 2 seconds.