host: the Chainweb API host URL, including the schema and possibly the port.
Currently, no authentication or extra headers are supported. If you need these
features, you may request support by submitting an new issue in the Github
repository.
Some functions require a chainId parameter (or an array of chain IDs). Chain
IDs should be provided as numbers from the set of supported chains of the
respective network. There is no default value.
When a depth parameter is required, a value of 3 or larger is a safe choice.
Functions return items in order ascending by block height. Because the server
usually returns items in reverse order, functions buffer all items from possibly
several pages, which can take some time. When fetching larger numbers of items
it is recommended to use the functions in the package iteratively and possibly
also asynchronously in order to increase performance.
Chain items only include items from the currently winning branch of the chain.
Orphaned blocks from past forks are not included. In order to avoid retrieving
items from a currently winning fork that is orphaned later on it is recommended
to only retrieve confirmed items by using an appropriate the depth parameter.
There are functions for three kinds of chain items:
Headers: these are just the block headers. These functions are generally the
most efficient.
Blocks: these include the block headers and the block payloads, including
transaction outputs. Querying payloads with outputs requires an extra
round-trip.
Transactions: these are just the transactions along with the transaction
output. Transactions from various blocks are flattened into a single array or
stream. Each item contains a height property that indicates the block height
at which it occurred.
Events: these are just the events from transaction outputs. Events from
various blocks are flattened into a single array or stream. Each item contains
a height property that indicates the block height at which it occurred.
The parameters, in order, are: depths, included chains, and a function that is
called for each item in the stream.
Streams are online and only return items from blocks that got mined after the
stream was started. They are thus useful for prompt notification of new items.
In order of exhaustively querying all, including old, items, one should also use
range or recent queries for the respective type of item.
Javascript (Typescript) bindings for the Kadena Chainweb API
The npm package @kadena/chainwebjs receives a total of 51 weekly downloads. As such, @kadena/chainwebjs popularity was classified as not popular.
We found that @kadena/chainwebjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 5 open source maintainers collaborating on the project.
Package last updated on 09 Nov 2023
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.