Parsing Emitted Events

By setting a trigger on an event signature you can parse emitted events and send only specific information to your backend.

export const triggerHandler = (context, data) => {
    const log = data;

    if (context.dataType === "DATA_TYPE_LOG") {
        console.log("Event from contract " + log.address);
        console.log("Topics: " + log.topics);

        return {
            topics: log.topics,
            address: log.address,
            data: log.data,
            txHash: context.txHash
        };
    }
};