Getting Transaction Receipt
Retrieving Transaction Receipt by User Operation Hash
The sdk.getTrxReceiptByUserOpHash(userOpHash, chainId)
function is a crucial method in our SDK that allows you to retrieve the transaction receipt for a user operation hash. This receipt contains important information about the status and details of a transaction on the blockchain. You can use this function to confirm the successful execution of a transaction before proceeding with subsequent actions.
Parameters
userOpHash
(string): The user operation hash for which you want to retrieve the transaction receipt. You will get this as an response ofsendUserOp
orsendUserOpBatch
function.chainId
(number): The chain ID of the blockchain network where the transaction was executed.
Returns
If the transaction with the provided
userOpHash
exists on the blockchain and has been successfully executed, the function returns the transaction receipt object.If the transaction has not been executed or does not exist, the function returns an error or a suitable indication of the transaction's absence.
Here's an example of how to achieve this using JavaScript's async/await
and a simple retry loop:
Last updated