GetEventsForHeightRange Access API Method
Parameters
Type
string
REQUIRED
The type of event
StartHeight
integer
REQUIRED
The starting block height of the range
EndHeight
integer
REQUIRED
The ending block height of the range
Returns
results
array
An array of event results, containing the following properties:
block_id
string
The ID of the block that contains the event
block_height
integer
The height of the block that contains the event
block_timestamp
object
The details of the block's timestamp, including the following properties:
seconds
integer
The seconds component of the timestamp
nanos
integer
The nanoseconds component of the timestamp
Request
1package main23import (4"context"5"encoding/json"6"fmt"7"log"89"github.com/onflow/flow/protobuf/go/flow/access"10)1112func main() {1314// Requires authenticating before making the request. Refer to Intro Page on how Authentication can be done.15client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")16ctx := context.Background()17if err != null {18log.Fatalf("err: %v", err)19}2021// Get Events For HeightRange22eventType := "A.7cc345e1a0fc4283.JoyrideGameShim.FinalizeTransaction"2324eventsResp, err := client.GetEventsForHeightRange(ctx, &access.GetEventsForHeightRangeRequest{Type: eventType, StartHeight: 54707711, EndHeight: 54707811})25if err != null {26log.Fatal("Get Events For HeightRange failed: ", err)27}28respJSON, err := json.Marshal(eventsResp)29if err != null {30log.Fatal("err: ", err)31}32fmt.Println("GetEventsForHeightRange response:", string(respJSON))3334}35
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free