CEP_Account.getTransaction()

With this method you can search a specific transaction by the blockID and the TxID.

Function Signature

async getTransaction(BlockID, TxID)

Parameters

Parameter Name
Datatype

BlockID

String

TxID

String

Example (CommonJS)

const { CEP_Account } = require('circular-enterprise-apis');

const Address = 'your-wallet-address';

let account = new CEP_Account();

async function run() {
    //...
   txBlock = "your_tx_block" //usually you get that from getTransactionOutcome
   txID = "your_tx_id" //usually you get that from submitCertificate
   console.log("Transaction ID:", txID);
   console.log("Transaction Block:", txBlock);
 
   console.log("Searching Transaction");
   const getTxResult = await account.getTransaction(txBlock, txID);
   console.log("Get Transaction Result :", getTxResult);
 
   if (getTxResult.Result === 200) {
       console.log("Certificate found :", getTxResult);
       
   } else {
       console.log("Certificate Not Found :", getTxResult.message);
   }
    //...
}

run();

Example (ES Modules)

Expected Result

Last updated