Get Transactions Details

Returns details about a transaction.

import 'dotenv/config';
import { DataService } from '@kanalabs/mirai';

(async () => {

   // Define the transaction hash and chainId
   const hash = '';
   const chainId = 80001;
   const dataApiKey = process.env.DATASERVICE_API_KEY || '' as string;
   
  // initializating DataService...
  const dataService = new DataService();
   
   // Retrieve transaction details using the specified hash and chainId with your api key
   const response = await dataService.getTransaction(hash, chainId, dataApiKey);
   
   // Log the transaction response
   console.log('response', response);
})()

Last updated