Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Stream<T, K, I, State>

Interface for streams returned by the streaming methods of the Ledger class. Each 'change' event contains accumulated state of type State as well as the ledger events that triggered the current state change.

Type parameters

  • T: object

    The contract template type.

  • K

    The contract key type.

  • I: string

    The contract id type.

  • State

    The accumulated state.

Hierarchy

  • Stream

Index

Methods

Methods

close

  • close(): void
  • Returns void

off

  • off(type: "live", listener: (state: State) => void): void
  • off(type: "change", listener: (state: State, events: readonly Event<T, K, I>[]) => void): void
  • off(type: "close", listener: (closeEvent: StreamCloseEvent) => void): void
  • Parameters

    • type: "live"
    • listener: (state: State) => void
        • (state: State): void
        • Parameters

          • state: State

          Returns void

    Returns void

  • Parameters

    • type: "change"
    • listener: (state: State, events: readonly Event<T, K, I>[]) => void
        • (state: State, events: readonly Event<T, K, I>[]): void
        • Parameters

          • state: State
          • events: readonly Event<T, K, I>[]

          Returns void

    Returns void

  • Parameters

    Returns void

on

  • on(type: "live", listener: (state: State) => void): void
  • on(type: "change", listener: (state: State, events: readonly Event<T, K, I>[]) => void): void
  • on(type: "close", listener: (closeEvent: StreamCloseEvent) => void): void
  • Parameters

    • type: "live"
    • listener: (state: State) => void
        • (state: State): void
        • Parameters

          • state: State

          Returns void

    Returns void

  • Parameters

    • type: "change"
    • listener: (state: State, events: readonly Event<T, K, I>[]) => void
        • (state: State, events: readonly Event<T, K, I>[]): void
        • Parameters

          • state: State
          • events: readonly Event<T, K, I>[]

          Returns void

    Returns void

  • Parameters

    Returns void

Generated using TypeDoc