sdk-js

@nevermined-io/sdk - v3.0.44 / EventHandler

Class: EventHandler

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new EventHandler(): EventHandler

Returns

EventHandler

Properties

events

Private events: Set<(blockNumber: bigint) => void>

Defined in

src/events/EventHandler.ts:6


getBlockNumber

Private getBlockNumber: () => Promise<bigint>

Type declaration

▸ (): Promise<bigint>

Returns

Promise<bigint>

Defined in

src/events/EventHandler.ts:16


interval

Private interval: number = 200

Defined in

src/events/EventHandler.ts:10


lastBlock

Private lastBlock: bigint

Defined in

src/events/EventHandler.ts:8


lastTimeout

Private lastTimeout: Timeout

Defined in

src/events/EventHandler.ts:14


polling

Private polling: boolean = false

Defined in

src/events/EventHandler.ts:12

Accessors

count

get count(): number

Returns

number

Defined in

src/events/EventHandler.ts:2

Methods

checkBlock

checkBlock(isInterval?): Promise<void>

Parameters

Name Type
isInterval? boolean

Returns

Promise<void>

Defined in

src/events/EventHandler.ts:38


subscribe

subscribe(callback, getBlockNumber): Object

Parameters

Name Type
callback (blockNumber: bigint) => void
getBlockNumber () => Promise<bigint>

Returns

Object

Name Type
unsubscribe () => void

Defined in

src/events/EventHandler.ts:18


unsubscribe

unsubscribe(callback): void

Parameters

Name Type
callback (blockNumber: bigint) => void

Returns

void

Defined in

src/events/EventHandler.ts:28