➡ī¸Submitting Event Logs

Event Log API is the same among all different chains.

Typical Case For DAU

Assume you'd like to emit a log for all swap user activities in order to compute the Daily unique wallets. You could do the followings:

 .onEventSwapEvent(async (evt, ctx) => {
   ctx.eventLogger.emit("user", { distinctId: ctx.transaction.sender })
 })

Submit Attributes

You could also attach attributes to the event log:

.onEventDepositEvent(async (evt, ctx)=>{
  ctx.eventLogger.emit("user", {
    distinctId: evt.data_decoded.user, eventLabel: "Deposit",
    amount: evt.data_decoded.amount,
  })
 })

To view the results of the submitted logs, see View And Search Event Logs

For more detailed information about how to submit logs in processor, refer to Event Logs In Processors

For the definition, refer to Event Logs

Last updated