wscat -c wss:///mainnet.optimism.validationcloud.io/v1/wss/<YOUR_API_KEY_HERE>
{"jsonrpc": "2.0", "id": 1, "method":"eth_subscribe","params":["newHeads"]}
{"jsonrpc":"2.0","result":"0x5302037dae412a3454143512a3c7617b","id":1}
Returns an object with data about the sync status or false.
This method will use 10
Compute Units.
subscription name
- string - The type of event you want to subscribe to (i.e., newHeads, logs, pendingTransactions, newPendingTransactions). This method supports the following subscription types:
pendingTransactions - Returns full transactions that are sent to the network, marked as pending, and are sent from or to a certain address.\
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.
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.