How to get the transaction recipt?

  • getTransactionReceipt

This function is used to retrieve the transaction receipt for a given transaction hash.

import { L1XProvider, GetTransactionReceiptArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
  endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});

let params: GetTransactionReceiptArg = {
  hash: "fe014c6a9ebc6d14c823fd12ddaa83f0bf6c747d228ccbcea24a1cd120f5dd85",
};

l1xProvider.core
  .getTransactionReceipt(params)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

The transaction hash of the transaction for which the transaction receipt needs to be retrieved

Returns:

A promise that resolves with the transaction receipt.

Last updated