Join AWS, Dust Labs & OrangeDAO at QuickPitch. Win $80k — Apply Today.
Parameters:
Returns:
slot - string - The corresponding slot
block - string - The information about the specified block
state - string - The activation state
current_duty_dependent_root - string - The current duty dependent root
previous_duty_dependent_root - string - The previous duty dependent root
epoch_transition - boolean - The epoch transition
execution_optimistic - boolean - It's true if the response references an unverified execution payload. The optimistic information may be invalidated at a later time. If the field is not present, assume the false value
Code Examples:
require "uri" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/eth/v1/events?topics=head") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["accept"] = "text/event-stream" response = https.request(request) puts response.read_body
import json import sseclient import requests url = "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/eth/v1/events?topics=head" response = requests.get(url, stream=True, headers={'Accept': 'text/event-stream'}) client = sseclient.SSEClient(response) for event in client.events(): subscriptionData = json.loads(event.data) print(json.dumps(subscriptionData, indent=2))
const EventSource = require("eventsource"); let url = "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/eth/v1/events?topics=head" let eventSourceInitDict = {headers: {'Accept': 'text/event-stream'}}; async function main() { let es = new EventSource(url, eventSourceInitDict); es.addEventListener('head', function (e) { console.log(e.data) }) } main();
curl -X GET \ "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/eth/v1/events?topics=head" \ -H "accept: text/event-stream"