const Web3 = require('web3');
const web3 = new Web3('http://localhost:8546');
const lendingNFTContract = new web3.eth.Contract(LENDING_NFT_CONTRACT_ABI, LENDING_NFT_CONTRACT_ADDRESS);
// contract abi and address see above
async function getContractEvent() {
const pastLentEvents = await lendingNFTContract.getPastEvents('Lent', {
nftAddress: // your game nft
for (let i = 0; i < pastLentEvents.length; i++) {
const event = pastLentEvents[i];
const { tokenId, lenderAddress, minTime, maxTime, pricePerHour } = event.returnValues;