In our fronts, until version v5 of ethers.js we did it this way:
contract.on("TokenPurchase", (from, buyer, value, idToken) => {
console.log(`The account ${buyer} has purchased the nft with id #${idToken}`);
});
As I have researched this does not work in version 6. As discussed here:
it is recommended to downgrade to version 5.
The use of async
is indifferent.
Do you know what is the new methodology in v6 to capture events in our fronts?