getHeaderByBlock
Get ETH Header by block
Get ETH Header by block number or hash
/header/{block}
Usage and SDK Samples
curl -X GET "https://localhost:8080/api/v1/header/{block}?batch=&format="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
BigDecimal block = 8.14; // BigDecimal | Eth header number
BigDecimal batch = 8.14; // BigDecimal | Batch how many blocks
String format = format_example; // String | supports `[
try {
types.Header result = apiInstance.getHeaderByBlock(block, batch, format);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getHeaderByBlock");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
BigDecimal block = 8.14; // BigDecimal | Eth header number
BigDecimal batch = 8.14; // BigDecimal | Batch how many blocks
String format = format_example; // String | supports `[
try {
types.Header result = apiInstance.getHeaderByBlock(block, batch, format);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getHeaderByBlock");
e.printStackTrace();
}
}
}
BigDecimal *block = 8.14; // Eth header number
BigDecimal *batch = 8.14; // Batch how many blocks
String *format = format_example; // supports `[
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Get ETH Header by block
[apiInstance getHeaderByBlockWith:block
batch:batch
format:format
completionHandler: ^(types.Header output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ShadowApi = require('shadow_api');
var api = new ShadowApi.DefaultApi()
var block = 8.14; // {BigDecimal} Eth header number
var batch = 8.14; // {BigDecimal} Batch how many blocks
var format = format_example; // {String} supports `[
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getHeaderByBlock(block, batch, format, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getHeaderByBlockExample
{
public void main()
{
var apiInstance = new DefaultApi();
var block = 8.14; // BigDecimal | Eth header number
var batch = 8.14; // BigDecimal | Batch how many blocks
var format = format_example; // String | supports `[
try
{
// Get ETH Header by block
types.Header result = apiInstance.getHeaderByBlock(block, batch, format);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.getHeaderByBlock: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\DefaultApi();
$block = 8.14; // BigDecimal | Eth header number
$batch = 8.14; // BigDecimal | Batch how many blocks
$format = format_example; // String | supports `[
try {
$result = $api_instance->getHeaderByBlock($block, $batch, $format);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getHeaderByBlock: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $block = 8.14; # BigDecimal | Eth header number
my $batch = 8.14; # BigDecimal | Batch how many blocks
my $format = format_example; # String | supports `[
eval {
my $result = $api_instance->getHeaderByBlock(block => $block, batch => $batch, format => $format);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->getHeaderByBlock: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
block = 8.14 # BigDecimal | Eth header number
batch = 8.14 # BigDecimal | Batch how many blocks
format = format_example # String | supports `[
try:
# Get ETH Header by block
api_response = api_instance.get_header_by_block(block, batch, format)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->getHeaderByBlock: %s\n" % e)
Parameters
Path parameters
Name | Description |
---|---|
block* |
BigDecimal
Eth header number
Required
|
Query parameters
Name | Description |
---|---|
batch* |
BigDecimal
Batch how many blocks
Required
|
format* |
String
supports `[
Required
|
Responses
Status: 200 - OK
Name | Type | Format | Description |
---|---|---|---|
Token | String | qwerty |