Namespace: event

chainweb.event

Methods

(async, static) hash(chainId, hash, networkopt, hostopt) → {Promise}

Query events 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:
Events from the block with the requested hash
Type
Promise

(async, static) height(chainId, hash, networkopt, hostopt) → {Promise}

Query Events 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:
Events from the block of the requested height
Type
Promise

(async, static) recent(chainId, depth, n, networkopt, hostopt) → {Promise}

Recent Events
Parameters:
Name Type Attributes Default Description
chainId number | string a chain id that is valid for the network
depth number 0 confirmation depth. Only events of blocks that this depth are returned
n number 1 maximual number of blocks from which events are returned. The actual number of returned events may be lower.
network string <optional>
"mainnet01" chainweb network
host string <optional>
"https://api.chainweb.com" chainweb api host
Source:
Returns:
Array of Pact events
Type
Promise

(static) stream(depth, chainIds, callback, networkopt, hostopt)

Apply callback to new events.
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 eventCallback function that is called for each event
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