eth_subscribe
Subscribes to real-time events over WebSocket and returns a subscription ID that is attached to every notification.
This method will use 20 Compute Units and each notification delivered on the subscription will use 10 Compute Units regardless of size.
Reference: Here
Parameters
subscription name - string - The type of event you want to subscribe to (i.e. newPendingTransactions, newHeads, logs). This method supports the following subscription types:
newPendingTransactions - Returns the hash for all transactions that are added to the pending state and are signed with a key that is available in the node.\
newHeads - Fires a notification each time a new header is appended to the chain, including chain reorganizations.
logs - Returns logs that are included in new imported blocks and match the given filter criteria.
data - object - (Optional) - Arguments such as an address, multiple addresses, and topics. Note, only logs that are created from these addresses or match the specified topics will return logs.
params: [
"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
]Returns
result - string - Hex encoded subscription ID. This ID will be attached to all received events and can also be used to cancel the subscription using eth_unsubscribe.
Last updated
Was this helpful?