After sending a transaction, you need to monitor its status and retrieve the receipt to confirm its execution. This guide demonstrates how to get transaction receipts using , , and .
Prerequisites
You need Web3 libraries configured with Para authentication.
Get Transaction Receipt
import { ethers } from "ethers";
async function getTransactionReceipt(
provider: ethers.Provider,
txHash: string
) {
const receipt = await provider.getTransactionReceipt(txHash);
console.log("Transaction Receipt:", receipt);
return receipt;
}
async function waitForTransaction(provider: ethers.Provider, txHash: string) {
const receipt = await provider.waitForTransaction(txHash);
console.log("Transaction Confirmed:", receipt);
return receipt;
}