Subscriptions are a feature of the Ethereum JSON-RPC API that allows developers to receive real-time updates on various blockchain events. Developers can subscribe to specific events of interest, such as new block headers, pending transactions, or contract events.
web3.eth.filter
methods and provide a way for developers to receive real-time updates about events on the blockchain without constantly polling the blockchain for new data.
Subscriptions can be created using one of the following methods:
The subscriptions created can be cleared using the following method: