Judgers

The judger module contains a function that is specifically designed to retrieve details of an event. The function can vary depending on the type of event as defined in the target configuration.

Take the following code as an example:

function process({ judger, event, utils, dataSource }) {
  const func = judger.getCallFunction();
  if (func === "setWithdrawalFee") {
    const fee = judger.getCallParameter("_newWithdrawalFee");
    return {
      isAlert: fee > 50,
      message: `WithdrawalFee is set to ${fee}. ${JSON.stringify(event)}`
    }
  }
}

The above usecase rule makes use of 2 judger functions:

  • judger.getCallFunction() returns the function name as a string

  • judger.getCallParameter(name) returns the value of the parameter of provided name.

Each judger has common methods, which present in any judger, and several specific methods, depending on the selected event type. Click below to see event-specific methods.

pageTimelock Execution EventpageToken EventpageContract Event

Last updated