Last updated
Last updated
The EventEmitter API allows applications to use an to register callbacks for when various events occur.
This closely follows the Event Emitter provided by other JavaScript libraries with the exception that event names support some more complex objects, not only strings. The objects are normalized internally.
Add a listener to be triggered for each eventName .
Add a listener to be triggered for only the next eventName , at which time it will be removed.
Notify all listeners of the eventName , passing args to each listener. This is generally only used internally.
Remove a listener for the eventName . If no listener is provided, all listeners for eventName are removed.
Remove all the listeners for the eventName . If no eventName is provided, all events are removed.
Returns the number of listeners for the eventName . If no eventName is provided, the total number of listeners is returned.
Any of the following may be used as the eventName in the above methods.
A filter is an object, representing a contract log Filter, which has the optional properties accountLike
(the source contract) and topics
(a topic-set to match).
The value of a Transaction Filter is any transaction hash.
This event is emitted on every mined transaction. It is much more common that the once
method is used than the on
method.
In addition to transaction and filter events, there are several named events.
Returns true if and only if object is a Provider.
Returns the list of Listeners for the eventName .
See for more information on filtering events.