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

{
    "hash": "fe014c6a9ebc6d14c823fd12ddaa83f0bf6c747d228ccbcea24a1cd120f5dd85"
}

Returns:

A promise that resolves with the transaction receipt.

 {
    transaction: { 
        tx_type: Number,
        nonce: String,
        fee_limit: String,
        signature: [Array],
        verifying_key: [Array],
        transaction: { NativeTokenTransfer: [Object] }
    },
    block_hash: 'd122e87c7939a93c3743dd7433d92515c65f13a9bddd350c866b7ce129bed0d4',
    block_number: 5178109,
    fee_used: '1',
    timestamp: 1706513499429,
    from: '51ab9c4805ff60048e05b7535be0081b271068fd',
    transaction_hash: 'fe014c6a9ebc6d14c823fd12ddaa83f0bf6c747d228ccbcea24a1cd120f5dd85'
}

Last updated