Namespace: internal

chainweb.internal

Internal Utilities Anything that is exported within the `internal` namespace is not covered by semantic versioning policy.
Source:

Methods

(async, static) branch(chainId, upperopt, loweropt, minHeightopt, maxHeightopt, nopt, nextopt, formatopt, networkopt, hostopt, retryOptionsopt) → {Object}

A signle block header page in decending order
Parameters:
Name Type Attributes Default Description
chainId number | string a chain id that is valid for the network
upper Array.<string> <optional>
only antecessors of these block hashes are returned. Note that if this is null, the result is empty.
lower Array.<string> <optional>
no antecessors of these block hashes are returned.
minHeight number <optional>
if given, minimum height of returned headers
maxHeight number <optional>
if given, maximum height of returned headers
n number <optional>
if given, limits the number of results. This is an upper limit. The actual number of returned items can be lower.
next number <optional>
if given, provides a cursor that points to the next page of the result. The cursor is the `next` property of the previous page.
format string <optional>
'json' encoding of result headers. Possible values are 'json' (default) and 'binary'.
network string <optional>
"mainnet01" chainweb network
host string <optional>
"https://api.chainweb.com" chainweb api host
retryOptions Object <optional>
retry options object as accepted by the retry package
Properties
Name Type Attributes Default Description
retry404 boolean <optional>
false whether to retry on 404 results
Source:
Returns:
Page of block headers in requested format. Headers are listed in decending order by height. The page size of a page is determined by the server.
Type
Object

(async, static) branch(chainId, upperopt, loweropt, minHeightopt, maxHeightopt, nopt, formatopt, networkopt, hostopt, retryOptionsopt)

Return block headers from chain
Parameters:
Name Type Attributes Default Description
chainId number | string a chain id that is valid for the network
upper Array.<string> <optional>
only antecessors of these block hashes are returned. Note that if this is null, the result is empty.
lower Array.<string> <optional>
no antecessors of these block hashes are returned.
minHeight number <optional>
if given, minimum height of returned headers
maxHeight number <optional>
if given, maximum height of returned headers
n number <optional>
if given, limits the number of results. This is an upper limit. The actual number of returned items can be lower.
format string <optional>
'json' encoding of result headers. Possible values are 'json' (default) and 'binary'.
network string <optional>
"mainnet01" chainweb network
host string <optional>
"https://api.chainweb.com" chainweb api host
retryOptions Object <optional>
retry options object as accepted by the retry package
Properties
Name Type Attributes Default Description
retry404 boolean <optional>
false whether to retry on 404 results
Source:
Returns:
[Object] Array of block headers in the requested format.

(async, static) currentBranch(chainId, start, end, nopt, formatopt, networkopt, hostopt)

Headers from the current branch of the chain
Parameters:
Name Type Attributes Default Description
chainId number | string a chain id that is valid for the network
start number start block height
end number end block height
n number <optional>
if given, limits the number of results. This is an upper limit. The actual number of returned items can be lower.
format string <optional>
'json' encoding of result headers. Possible values are 'json' (default) and 'binary'.
network string <optional>
"mainnet01" chainweb network
host string <optional>
"https://api.chainweb.com" chainweb api host
Source:
Returns:
[Object] Array of block headers in the requested format.

(async, static) payloads(chainId, hashes, formatopt, networkopt, hostopt, retryOptionsopt) → {Array.<Object>}

Payloads with outputs
Parameters:
Name Type Attributes Default Description
chainId number | string a chain id that is valid for the network
hashes Array.<string> array of block payload hashes
format string <optional>
'json' encoding of payload properties. Possible values are 'json' (default) and 'base64'.
network string <optional>
"mainnet01" chainweb network
host string <optional>
"https://api.chainweb.com" chainweb api host
retryOptions Object <optional>
retry options object as accepted by the retry package
Properties
Name Type Attributes Default Description
retry404 boolean <optional>
false whether to retry on 404 results
Source:
Returns:
Array of block header objects. There is no guarantee about how many paylaods are returned and what payloads aer included in the result.
Type
Array.<Object>