Client side API implementation for a DAML based ledgers. This library implements the JSON API for a DAML ledger.
The best way to get you started quickly is to look at Create DAML App and to read the Quickstart Guide.
We recommend to use the React framework and the @daml/react library to
build frontends for DAML applications. If you choose a different Javascript based framework, please
take a look at the source of @daml/react and it's usage of the @daml/ledger library.
The main export of @daml/ledger is the Ledger class. It's constructor takes an authentication
token used to communicate with the JSON API, an HTTP
base URL and a websocket base URL.
An instance of the Ledger class provides the following methods to communicate with a DAML ledger.
Please consult the
documentation
for their exact signatures.
createCreate a new contract of the given template with given arguments.
archiveArchive a contract identified by its contract id.
archiveByKeyArchive a contract identified by its contract key.
exerciseExercise a choice on a contract identified by its contract id.
exerciseByKeyExercise a choice on a contract identified by its contract key.
queryRetrieve contracts for a given template matching a given query. If no query is given, all contracts of that template visible for the submitting party are returned.
streamQueryRetrieve a consolidated stream of events for a given template and query. The accumulated state is
the current set of active contracts matching the query. An event can be a CreateEvent or an
ArchiveEvent. When no query argument is given, all events visible to the submitting party are
returned.
fetchFetch a contract identified by its contract id.
fetchByKeyFetch a contract identified by its contract key.
streamFetchByKeyRetrieve a consolidated stream of CreateEvent's for a given template and contract key.
https://github.com/digital-asset/daml/tree/master/language-support/ts/daml-ledger
Generated using TypeDoc