PoC-Doc-Delivery / PoC_Transaction_Data / transactionResponse.js
transactionResponse.js
Raw
const ethers = require('ethers');
const { JsonRpcProvider, txHash } = require('./parameters');

// Load the RPC provider
const provider = new ethers.JsonRpcProvider(JsonRpcProvider);

// Retrieve the transaction response
const getTransactionResponse = async (tx) => {
	const transaction = await provider.getTransaction(tx);
	console.log(transaction);
}

// Display the transaction receipt logs of the functions
const showTransactionResponse = async () => {
	console.log('accept transaction response:');
	await getTransactionResponse(txHash.accept);
	console.log();
	console.log('publish transaction response:');
	await getTransactionResponse(txHash.publish);
}

showTransactionResponse();