GetEventsForHeightRange Access API Method
参数
类型
字符串
必填
正在加载...
StartHeight
整数
必填
正在加载...
EndHeight
整数
必填
正在加载...
退货
结果
数组
正在加载...
block_id
字符串
正在加载...
block_height
整数
正在加载...
block_timestamp
对象
正在加载...
seconds
整数
正在加载...
nanos
整数
正在加载...
请求
1包 main23导入 (4"上下文"5"encoding/json"6"fmt"7"日志"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()17如果 err != nil {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})25如果 err != nil {26log.Fatal("Get Events For HeightRange failed: ", err)27}28respJSON, err := json.Marshal(eventsResp)29如果 err != nil {30log.Fatal("err: ", err)31}32fmt.Println("GetEventsForHeightRange response:", string(respJSON))3334}35
1包 main23导入 (4"上下文"5"encoding/json"6"fmt"7"日志"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()17如果 err != nil {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})25如果 err != nil {26log.Fatal("Get Events For HeightRange failed: ", err)27}28respJSON, err := json.Marshal(eventsResp)29如果 err != nil {30log.Fatal("err: ", err)31}32fmt.Println("GetEventsForHeightRange response:", string(respJSON))3334}35