FUNCTION

emit_event

function emit_event(type: text, data: gtv): unit

Register an event for handling by the blockchain at the end of the current transaction.

Postchain allows a set of events to be triggered at the end of every transaction, after all operations have been executed. This function is used to trigger such an event. Handlers for these events, sometimes called event sinks, are registered with the block builder in Postchain extensions.

emit_event is used internally in several Chromia platform extensions such as ICMF and EIF.

Parameters

  • type — the event processor to trigger
  • data — arguments to the event processor

Throws

  • exception — if there is no operation context

See Also

  1. Usage of op_context.emit_event() in EIF
  2. Usage of op_context.emit_event() in ICMF

Since

0.10.4

© 2026 Chromia