Checking Transaction Status with Eidolon
In this example, we’ll demonstrate how to use the Provider
class from Eidolon to check the status of a blockchain transaction using its hash. This functionality is essential for monitoring the success or failure of transactions on the blockchain.
Let’s walk through the process step by step.
Prerequisites
Before you begin, make sure you have the Eidolon SDK integrated into your project, and you have a valid transaction hash that you want to check.
Code Example
In this example, we create a TransactionStatusChecker
script that fetches the status of a transaction using its hash. Replace "0xYourTransactionHashHere"
with the actual transaction hash you want to check.
Explanation
- We use the
Provider.GetTransactionStatus(transactionHash)
method provided by Eidolon to retrieve the transaction status. - The status can be one of the following:
Success
: The transaction succeeded.Failed
: The transaction failed.- ”Transaction Receipt Not Found or Status Unknown”: The transaction receipt was not found, or its status is unknown.