Web3SubscriptionManager <API, RegisteredSubs>
Index
Constructors
Properties
Accessors
Methods
Constructors
publicconstructor
Type parameters
- API: unknown = unknown
- RegisteredSubs: {} = {}
Parameters
requestManager: Web3RequestManager<API>
registeredSubscriptions: RegisteredSubs
Returns Web3SubscriptionManager<API, RegisteredSubs>
Properties
publicreadonlyregisteredSubscriptions
publicreadonlyrequestManager
Accessors
publicsubscriptions
Will returns all subscriptions.
Returns Map<string, InstanceType<RegisteredSubs[keyof RegisteredSubs]>>
Methods
publicaddSubscription
Adds an instance of Web3Subscription and subscribes to it
Parameters
sub: InstanceType<RegisteredSubs[keyof RegisteredSubs]>
A Web3Subscription object
Returns Promise<string>
publicclear
Clears all subscriptions
Returns void
publicremoveSubscription
Will clear a subscription
Parameters
sub: InstanceType<RegisteredSubs[keyof RegisteredSubs]>
Returns Promise<string>
publicsubscribe
Will create a new subscription
Type parameters
- T: string | number | symbol
Parameters
name: T
The subscription you want to subscribe to
optionalargs: ConstructorParameters<RegisteredSubs[T]>[0]
Optional additional parameters, depending on the subscription type
returnFormat: DataFormat = DEFAULT_RETURN_FORMAT
Returns Promise<InstanceType<RegisteredSubs[T]>>
The subscription object
publicsupportsSubscriptions
Check whether the current provider supports subscriptions.
Returns boolean
true
orfalse
depending on if the current provider supports subscriptions
publicunsubscribe
Will unsubscribe all subscriptions that fulfill the condition
Parameters
optionalcondition: ShouldUnsubscribeCondition
A function that access and
id
and asubscription
and returntrue
orfalse
Returns Promise<string[]>
An array of all the un-subscribed subscriptions