Shadow API

Default

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

Status: 400 - Bad Request


getHeaderWithProof

Get header with proof

Get header with hash proof and mmr roothash


/proof/{block}

Usage and SDK Samples

curl -X GET "https://localhost:8080/api/v1/proof/{block}?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();
        String block = block_example; // String | Eth header number or hash
        String format = format_example; // String | supports `[
        try {
            core.GetEthHeaderWithProofJSONResp result = apiInstance.getHeaderWithProof(block, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getHeaderWithProof");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String block = block_example; // String | Eth header number or hash
        String format = format_example; // String | supports `[
        try {
            core.GetEthHeaderWithProofJSONResp result = apiInstance.getHeaderWithProof(block, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getHeaderWithProof");
            e.printStackTrace();
        }
    }
}
String *block = block_example; // Eth header number or hash
String *format = format_example; // supports `[

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Get header with proof
[apiInstance getHeaderWithProofWith:block
    format:format
              completionHandler: ^(core.GetEthHeaderWithProofJSONResp output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ShadowApi = require('shadow_api');

var api = new ShadowApi.DefaultApi()

var block = block_example; // {String} Eth header number or hash

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.getHeaderWithProof(block, format, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getHeaderWithProofExample
    {
        public void main()
        {
            
            var apiInstance = new DefaultApi();
            var block = block_example;  // String | Eth header number or hash
            var format = format_example;  // String | supports `[

            try
            {
                // Get header with proof
                core.GetEthHeaderWithProofJSONResp result = apiInstance.getHeaderWithProof(block, format);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.getHeaderWithProof: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DefaultApi();
$block = block_example; // String | Eth header number or hash
$format = format_example; // String | supports `[

try {
    $result = $api_instance->getHeaderWithProof($block, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->getHeaderWithProof: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $block = block_example; # String | Eth header number or hash
my $format = format_example; # String | supports `[

eval { 
    my $result = $api_instance->getHeaderWithProof(block => $block, format => $format);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->getHeaderWithProof: $@\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 = block_example # String | Eth header number or hash
format = format_example # String | supports `[

try: 
    # Get header with proof
    api_response = api_instance.get_header_with_proof(block, format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->getHeaderWithProof: %s\n" % e)

Parameters

Path parameters
Name Description
block*
String
Eth header number or hash
Required
Query parameters
Name Description
format*
String
supports `[
Required

Responses

Status: 200 - OK

Name Type Format Description
Token String qwerty

Status: 400 - Bad Request


getHeadersByProposal

Get headers by block numbers

Get headers by block numbers, used for relay proposal


/proposal

Usage and SDK Samples

curl -X POST "https://localhost:8080/api/v1/proposal?numbers=&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();
        array[Integer] numbers = ; // array[Integer] | Eth header numbers
        String format = format_example; // String | supports `[
        try {
            array[array[core.GetEthHeaderWithProofJSONResp]] result = apiInstance.getHeadersByProposal(numbers, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getHeadersByProposal");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        array[Integer] numbers = ; // array[Integer] | Eth header numbers
        String format = format_example; // String | supports `[
        try {
            array[array[core.GetEthHeaderWithProofJSONResp]] result = apiInstance.getHeadersByProposal(numbers, format);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getHeadersByProposal");
            e.printStackTrace();
        }
    }
}
array[Integer] *numbers = ; // Eth header numbers
String *format = format_example; // supports `[

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Get headers by block numbers
[apiInstance getHeadersByProposalWith:numbers
    format:format
              completionHandler: ^(array[array[core.GetEthHeaderWithProofJSONResp]] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ShadowApi = require('shadow_api');

var api = new ShadowApi.DefaultApi()

var numbers = ; // {array[Integer]} Eth header numbers

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.getHeadersByProposal(numbers, format, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getHeadersByProposalExample
    {
        public void main()
        {
            
            var apiInstance = new DefaultApi();
            var numbers = new array[Integer](); // array[Integer] | Eth header numbers
            var format = format_example;  // String | supports `[

            try
            {
                // Get headers by block numbers
                array[array[core.GetEthHeaderWithProofJSONResp]] result = apiInstance.getHeadersByProposal(numbers, format);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.getHeadersByProposal: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DefaultApi();
$numbers = ; // array[Integer] | Eth header numbers
$format = format_example; // String | supports `[

try {
    $result = $api_instance->getHeadersByProposal($numbers, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->getHeadersByProposal: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $numbers = []; # array[Integer] | Eth header numbers
my $format = format_example; # String | supports `[

eval { 
    my $result = $api_instance->getHeadersByProposal(numbers => $numbers, format => $format);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->getHeadersByProposal: $@\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()
numbers =  # array[Integer] | Eth header numbers
format = format_example # String | supports `[

try: 
    # Get headers by block numbers
    api_response = api_instance.get_headers_by_proposal(numbers, format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->getHeadersByProposal: %s\n" % e)

Parameters

Query parameters
Name Description
numbers*
array[Integer]
Eth header numbers
Required
format*
String
supports `[
Required

Responses

Status: 200 - OK

Name Type Format Description
Token String qwerty

Status: 400 - Bad Request


getReceiptByTx

Get receipt by tx hash

Get receipt by tx hash, used for cross-chain transfer


/receipt/{tx}

Usage and SDK Samples

curl -X GET "https://localhost:8080/api/v1/receipt/{tx}?last="
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();
        String tx = tx_example; // String | tx hash
        BigDecimal last = 8.14; // BigDecimal | last confirm block
        try {
            array[core.GetReceiptResp] result = apiInstance.getReceiptByTx(tx, last);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getReceiptByTx");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String tx = tx_example; // String | tx hash
        BigDecimal last = 8.14; // BigDecimal | last confirm block
        try {
            array[core.GetReceiptResp] result = apiInstance.getReceiptByTx(tx, last);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getReceiptByTx");
            e.printStackTrace();
        }
    }
}
String *tx = tx_example; // tx hash
BigDecimal *last = 8.14; // last confirm block

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Get receipt by tx hash
[apiInstance getReceiptByTxWith:tx
    last:last
              completionHandler: ^(array[core.GetReceiptResp] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var ShadowApi = require('shadow_api');

var api = new ShadowApi.DefaultApi()

var tx = tx_example; // {String} tx hash

var last = 8.14; // {BigDecimal} last confirm block


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getReceiptByTx(tx, last, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getReceiptByTxExample
    {
        public void main()
        {
            
            var apiInstance = new DefaultApi();
            var tx = tx_example;  // String | tx hash
            var last = 8.14;  // BigDecimal | last confirm block

            try
            {
                // Get receipt by tx hash
                array[core.GetReceiptResp] result = apiInstance.getReceiptByTx(tx, last);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.getReceiptByTx: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\DefaultApi();
$tx = tx_example; // String | tx hash
$last = 8.14; // BigDecimal | last confirm block

try {
    $result = $api_instance->getReceiptByTx($tx, $last);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->getReceiptByTx: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $tx = tx_example; # String | tx hash
my $last = 8.14; # BigDecimal | last confirm block

eval { 
    my $result = $api_instance->getReceiptByTx(tx => $tx, last => $last);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->getReceiptByTx: $@\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()
tx = tx_example # String | tx hash
last = 8.14 # BigDecimal | last confirm block

try: 
    # Get receipt by tx hash
    api_response = api_instance.get_receipt_by_tx(tx, last)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->getReceiptByTx: %s\n" % e)

Parameters

Path parameters
Name Description
tx*
String
tx hash
Required
Query parameters
Name Description
last*
BigDecimal
last confirm block
Required

Responses

Status: 200 - OK

Name Type Format Description
Token String qwerty

Status: 400 - Bad Request