- Source:
Methods
(async, static) hash(chainId, hash, networkopt, hostopt) → {Promise}
Query transactions of a block by the 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:
Transactions from the block with the requested hash
- Type
- Promise
(async, static) height(chainId, hash, networkopt, hostopt) → {Promise}
Query transactions by 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:
Transactions from the block of the requested height
- Type
- Promise
(async, static) range(chainId, start, end, networkopt, hostopt) → {Promise}
Transactions 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 transactions
- Type
- Promise
(async, static) range(chainId, start, end, networkopt, hostopt) → {Promise}
Events 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 events
- Type
- Promise
(async, static) recent(chainId, depth, n, networkopt, hostopt) → {Promise}
Recent Transactions
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
chainId |
number | string | a chain id that is valid for the network | ||
depth |
number | 0 | confirmation depth. Only transactions of blocks that this depth are returned | |
n |
number | 1 | maximual number of blocks from which transactions are returned. The actual number of returned transactions may be lower | |
network |
string |
<optional> |
"mainnet01" | chainweb network |
host |
string |
<optional> |
"https://api.chainweb.com" | chainweb api host |
- Source:
Returns:
Array of transactions
- Type
- Promise
(static) stream(depth, chainIds, callback, networkopt, hostopt)
Apply callback to new transactions.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
depth |
number | confirmation depth at which blocks are yielded | ||
chainIds |
Array.<number> | array of chainIds from which blocks are included | ||
callback |
transactionCallback | function that is called for each transaction | ||
network |
string |
<optional> |
"mainnet01" | chainweb network |
host |
string |
<optional> |
"https://api.chainweb.com" | chainweb api host |
- Source:
Returns:
the event source object the backs the stream