
Security News
Suno Breached via Shai-Hulud Worm, Leaked Code Exposes AI Music Scraping
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.
@daml/ledger
Advanced tools
Client side API implementation for a Daml based ledger. This library implements the JSON based API for a Daml ledger documented in https://docs.daml.com/json-api/index.html.
Client side API implementation for a Daml based ledgers. This library implements the JSON API for a Daml ledger.
Comprehensive documentation for @daml/ledger can be found
here.
The best way to get you started quickly is to use the create-daml-app template:
daml new --template=create-daml-app my-project-name
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.
createAndExerciseCreate a new contract and, within the same transaction, immediately exercise a choice on it. Primarily meant for consuming choices, but that's not a requirement.
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.
streamQueryDeprecated: prefer
streamQueries.
Retrieve a consolidated stream of events for a given template and optional
query. The accumulated state is the current set of active contracts matching
the query if one was given; if the function was called without a query
argument, or the query argument was undefined, the accumulated state will
instead contain all of the active contracts for the given template.
streamQueriesRetrieve a consolidated stream of events for a given template and queries. The accumulated state is the current set of active contracts matching at least one of the given queries, or all contracts for the given template if no query is given.
fetchFetch a contract identified by its contract id.
fetchByKeyFetch a contract identified by its contract key.
streamFetchByKeyDeprecated: prefer
streamFetchByKeys.
Retrieve a consolidated stream of CreateEvent's for a given template and
contract key. The accumulated state is either the CreateEvent for the active
contract matching the given key, or null if there is no currently-active
contract for the given key.
streamFetchByKeysRetrieve a consolidated stream of CreateEvent's for a given template and
contract keys. The accumulated state is a vector of the same length as the
given vector of keys, where each element is the CreateEvent for the current
active contract of the corresponding key (element-wise), or null if there is no
current active contract for that key.
Note: the given key objects will be compared for (deep) equality with the
values returned by the API. As such, they have to be given in the "output"
format of the JSON API. See the JSON API docs for details.
getPartiesFor a given list of party identifiers, return full information, or null if the party doesn't exist.
listKnownPartiesReturn an array of PartyInfo for all parties on the ledger.
allocatePartyAllocate a new party.
getUserReturns the current User implicitly described by the currently used JWT.
listPackagesFetch a list of all known package IDs.
getPackageGiven a package ID, fetch the binary data for the corresponding DALF.
uploadDarFileUpload a given byte array as a DAR to the ledger. Note that this requires a token with admin access.
https://github.com/digital-asset/daml/tree/main/language-support/ts/daml-ledger
FAQs
Client side API implementation for a Daml based ledger. This library implements the JSON based API for a Daml ledger documented in https://docs.daml.com/json-api/index.html.
The npm package @daml/ledger receives a total of 12,043 weekly downloads. As such, @daml/ledger popularity was classified as popular.
We found that @daml/ledger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
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.

Security News
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.

Security News
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.