SyncingSubscription
Hierarchy
- Web3Subscription<{ changed: boolean; data: SyncOutput }>
- SyncingSubscription
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
args: any
options: { returnFormat?: DataFormat; subscriptionManager: Web3SubscriptionManager<unknown, {}> }
optionalreturnFormat: DataFormat
subscriptionManager: Web3SubscriptionManager<unknown, {}>
Returns SyncingSubscription
Properties
readonlyargs
Accessors
id
Returns undefined | string
lastBlock
Returns undefined | BlockOutput
Methods
_processSubscriptionError
Parameters
error: Error
Returns void
public_processSubscriptionResult
Parameters
data: boolean | { status: SyncOutput; syncing: boolean }
status: SyncOutput
syncing: boolean
Returns void
emit
Type parameters
- K: Web3EventKey<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents>
Parameters
eventName: K
params: { changed: boolean; data: SyncOutput } & CommonSubscriptionEvents[K]
Returns void
eventNames
Returns (string | symbol)[]
getMaxListeners
Returns number
listenerCount
Type parameters
- K: Web3EventKey<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents>
Parameters
eventName: K
Returns number
listeners
Type parameters
- K: Web3EventKey<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents>
Parameters
eventName: K
Returns (...args: any[]) => void[]
off
Type parameters
- K: Web3EventKey<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents>
Parameters
eventName: K
fn: Web3EventCallback<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents[K]>
Returns void
on
Type parameters
- K: Web3EventKey<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents>
Parameters
eventName: K
fn: Web3EventCallback<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents[K]>
Returns void
once
Type parameters
- K: Web3EventKey<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents>
Parameters
eventName: K
fn: Web3EventCallback<{ changed: boolean; data: SyncOutput } & CommonSubscriptionEvents[K]>
Returns void
processSubscriptionData
Parameters
Returns void
removeAllListeners
Returns EventEmitter
resubscribe
Returns Promise<void>
sendSubscriptionRequest
Returns Promise<string>
sendUnsubscribeRequest
Returns Promise<void>
setMaxListenerWarningThreshold
Parameters
maxListenersWarningThreshold: number
Returns void
subscribe
Returns Promise<string>
unsubscribe
Returns Promise<void>
subscribe('syncing')
Subscribe to syncing events. This will return
true
when the node is syncing and when it’s finished syncing will returnfalse
, for thechanged
event.