Skip to main content

Domain Events

Domain events are events that represent changes in the state of Alpha services in the system or on the blockchain. These events are emitted by Alfa services and can be listened to by applications to react to changes in the state of the blockchain.

All events extend from the DomainEvent class, which has the following attributes:

export abstract class DomainEvent<T = any, P = EventPayload<T>> {
readonly id: UUID;
readonly name: string;
readonly payload: P;
abstract toPrimitive(): Primitives<DomainEvent>;
}
Primitives

See more information about primitives in the section Primitives

Events available

  • MintAssetEvent
  • BurnAssetEvent
  • TransferAssetEvent
  • TransferAmountEvent
  • CommandEvent
  • ipfsUploadFileEvent
  • NewOrderEvent
  • FillOrderEvent
  • CancelOrderEvent
caution

All classes have a static method eventName to access the name of the event. This is so to avoid unexpected effects when changing the class name.

Listen events

info

To listen for events use the EventBus of the sdk. See more information in the EventBus section.