Monitor Call count by Trace

⚠️

Trace is only supported in a subset of networks. See full list in supported-networks

Sometimes you may not be getting proper events; in this case, trace is the way to go.

Say you want to monitor the submitBlocks from the smart contract. We automatically generate a method onCallSubmitBlocks so you could use it directly in the code.

ExchangeV3Processor.bind({ address: LOOPRING_EXCHANGE }).onCallSubmitBlocks(
  async (call: SubmitBlocksCallTrace, ctx: ExchangeV3Context) => {
    if (call.error) {
      return;
    }
    ctx.meter.Counter("submit_block").add(1);
  }
);

βœ…

See this repo for more context.