Class TableEventBus

TableEventBus provides a way to listen for: mutations, transfers, and changes to controller

Hierarchy

  • TableEventBus

Constructors

  • Create a TableEventBus instance with the specified connection configuration.

    Parameters

    • config: Partial<Partial<ReadConfig & SignerConfig>> = {}

      The connection configuration. This must include an ethersjs Signer. If passing the config from a pre-existing Database instance, it must have a non-null signer key defined.

    Returns TableEventBus

Properties

config: Partial<ReadConfig & SignerConfig>
contracts: ContractMap
listeners: ListenerMap

Methods

  • Parameters

    • contract: TablelandTables
    • emitter: EventEmitter
    • tableIdentifier: TableIdentifier

    Returns ContractEventListener[]

  • Parameters

    • listenerId: string
    • emitter: EventEmitter

    Returns Promise<ContractEventListener[]>

  • Parameters

    • chainId: number

    Returns Promise<TablelandTables>

  • Start listening to the Registry Contract for events that are associated with a given table. There's only ever one "listener" for a table, but the emitter that Contract listener has can have as many event listeners as the environment supports.

    Parameters

    • tableName: string

      The full name of table that you want to listen for changes to.

    Returns Promise<EventEmitter>

  • A simple wrapper around addListener that returns an async iterable which can be used with the for await ... of pattern.

    Type Parameters

    • T

    Parameters

    • tableName: string

      The full name of table that you want to listen for changes to.

    Returns Promise<AsyncIterable<T>>

  • Remove a listener (or iterator) based on chain and tableId

    Parameters

    • params: TableIdentifier

      A TableIdentifier Object. Must have chainId and tableId keys.

    Returns void

Generated using TypeDoc