Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 819 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 819 Bytes

Cardano JS SDK | projection

Chain Sync event projection utilities.

Summary

Projection is based on RxJS, where source observable of Chain Sync events is processed with various operators.

There are no restrictions what an operator can do - you can utilize the full power of RxJS which makes it very flexible.

All operators implemented in this package are extending the source event object with extra properties, e.g.

  chainSync$.pipe(
    withStabilityWindow(dataWithPoolRetirement.genesis),
    tap(({ stabilityWindowSlotsCount }) => console.log('Stability window:', stabilityWindowSlotsCount)),
    withRolledBackEvents(),
    tap((evt) => evt.eventType === ChainSyncEventType.RollBackward && console.log('Rolled back events:', evt.rolledBackEvents)),
  )