- Source:
Methods
(async, static) hash(chainId, hash, networkopt, hostopt) → {Promise}
Query block header by its block hash
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
chainId |
number | string | a chain id that is valid for the network | ||
hash |
string | block hash | ||
network |
string |
<optional> |
"mainnet01" | chainweb network |
host |
string |
<optional> |
"https://api.chainweb.com" | chainweb api host |
- Source:
Returns:
Block with the requested hash
- Type
- Promise
(async, static) height(chainId, hash, networkopt, hostopt) → {Promise}
Query block by its height
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
chainId |
number | string | a chain id that is valid for the network | ||
hash |
string | block height | ||
network |
string |
<optional> |
"mainnet01" | chainweb network |
host |
string |
<optional> |
"https://api.chainweb.com" | chainweb api host |
- Source:
Returns:
Block at the requested height
- Type
- Promise
(async, static) range(chainId, start, end, networkopt, hostopt) → {Promise}
Blocks from a range of block heights
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 | ||
network |
string |
<optional> |
"mainnet01" | chainweb network |
host |
string |
<optional> |
"https://api.chainweb.com" | chainweb api host |
- Source:
Returns:
Array of blocks
- Type
- Promise
(async, static) recent(chainId, depth, n, networkopt, hostopt) → {Promise}
Recent Blocks
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
chainId |
number | string | a chain id that is valid for the network | ||
depth |
number | 0 | confirmation depth. Only blocks at this depth are returned | |
n |
number | 1 | maximual number of blocks that are returned. The actual number of returned blocks may be lower. | |
network |
string |
<optional> |
"mainnet01" | chainweb network |
host |
string |
<optional> |
"https://api.chainweb.com" | chainweb api host |
- Source:
Returns:
Array of blocks
- Type
- Promise