14
client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")15
ctx := context.Background()17
log.Fatalf("err: %v", err)22
pub fun main(a: Int): Int {30
jsonCDC := fmt.Sprintf(`{"type":"Int","value":"%s"}`, strconv.Itoa(arg))33
args := [][]byte{[]byte(jsonCDC)}36
valueHeightResp, err := client.ExecuteScriptAtBlockHeight(ctx, &access.ExecuteScriptAtBlockHeightRequest{Script: script, Arguments: args, BlockHeight: 54774078})37
respJSON, err := json.Marshal(valueHeightResp)39
log.Fatal("execute script at block height failed: ", err)41
fmt.Println("ExecuteScriptAtBlockHeight response:", string(respJSON))
14
client, err := getAccessClientWithBasicAuth("ENDPOINT-NAME", "TOKEN_GOES_HERE")15
ctx := context.Background()17
log.Fatalf("err: %v", err)22
pub fun main(a: Int): Int {30
jsonCDC := fmt.Sprintf(`{"type":"Int","value":"%s"}`, strconv.Itoa(arg))33
args := [][]byte{[]byte(jsonCDC)}36
valueHeightResp, err := client.ExecuteScriptAtBlockHeight(ctx, &access.ExecuteScriptAtBlockHeightRequest{Script: script, Arguments: args, BlockHeight: 54774078})37
respJSON, err := json.Marshal(valueHeightResp)39
log.Fatal("execute script at block height failed: ", err)41
fmt.Println("ExecuteScriptAtBlockHeight response:", string(respJSON))