Gathering detailed insights and metrics for @daml/react
Gathering detailed insights and metrics for @daml/react
Gathering detailed insights and metrics for @daml/react
Gathering detailed insights and metrics for @daml/react
npm install @daml/react
Typescript
Module System
Node Version
NPM Version
72.3
Supply Chain
97.6
Quality
97
Maintenance
100
Vulnerability
99.3
License
3.4.0-snapshot.20250710.0
Updated on Jul 10, 2025
3.4.0-snapshot.20250709.0
Updated on Jul 09, 2025
3.4.0-snapshot.20250702.0
Updated on Jul 02, 2025
3.4.0-snapshot.20250625.0
Updated on Jun 25, 2025
3.4.0-snapshot.20250618.0
Updated on Jun 18, 2025
2.10.1
Updated on Jun 02, 2025
Scala (80.6%)
Haskell (12.69%)
Starlark (2.33%)
Java (2.04%)
Shell (0.73%)
TypeScript (0.66%)
Python (0.41%)
Nix (0.12%)
TeX (0.11%)
PLpgSQL (0.09%)
PowerShell (0.07%)
C++ (0.03%)
Smarty (0.02%)
Makefile (0.01%)
JavaScript (0.01%)
Batchfile (0.01%)
Go (0.01%)
jq (0.01%)
Dockerfile (0.01%)
HTML (0.01%)
NASL (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
817 Stars
14,001 Commits
214 Forks
31 Watchers
386 Branches
222 Contributors
Updated on Jul 11, 2025
Latest Version
2.10.1
Package Id
@daml/react@2.10.1
Unpacked Size
133.54 kB
Size
23.24 kB
File Count
16
NPM Version
8.19.2
Node Version
18.12.1
Published on
May 30, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
React framework for Daml applications
Comprehensive documentation for @daml/react
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.
To get an overview on how to build a Daml application, please read the application architecture overview.
To use @daml/react
your application needs to be connected to the JSON API of a Daml ledger. If
your JSON API server for the ledger runs on the local host on port 7575, set
1"proxy": "http://localhost:7575"
in your package.json
and wrap your main component in the DamlLedger
component of @daml/react
1import DamlLedger from @daml/react 2 3const App: React.FC = () => { 4 <DamlLedger 5 token: <your authentication token> 6 httpBaseUrl?: <optional http base url> 7 wsBaseUrl?: <optional websocket base url> 8 reconnectThreshold?: <optional delay in ms> 9 party: <the logged in party> 10 > 11 <MainScreen /> 12 </DamlLedger> 13};
Now you can use the following React hooks to interact with a Daml ledger:
useParty
useParty
returns the party, for which commands are currently send to the ledger.
1const party = useParty();
useLedger
useLedger
returns an instance of the Ledger
class of @daml/ledger to interact with the Daml
ledger.
1const ledger = useLedger(); 2const newContract = await ledger.create(ContractTemplate, arguments); 3const archiveEvent = await Ledger.archive(ContractTemplate, contractId); 4const [choiceReturnValue, events] = await ledger.exercise(ContractChoice, contractId, choiceArguments);
useQuery
useQuery
returns the contracts matching a given query. The query matches for a given contract
template and specified field values of the contracts of that template.
1const {contracts, loading} = useQuery(ContractTemplate, () => {field: value}, [dependency1, 2dependency2, ...]);
If the query is omitted, all visible contracts of the given template are returned.
1const {contracts, loading} = useQuery(ContractTemplate);
useReload
useReload
returns a function to reload the results of queries.
1const reload = useReload(); 2const onClick = reload;
useStreamQuery
Deprecated: prefer
useStreamQueries
useStreamQuery
has the same signature as useQuery
, but it constantly refreshes the results.
1const {contracts, loading} = useStreamQuery(ContractTemplate, () => {field: value}, [dependency1, 2dependency2, ...]);
If the query is omitted, all visible contracts of the given template are returned.
1const {contracts, loading} = useStreamQuery(ContractTemplate);
useStreamQueries
useStreamQueries
is similar to useQuery
, except that:
useQuery
, if no factory function is provided, or if the provided
function returns an empty array, the set will contain all contracts of that
template.1const {contracts, loading} = useStreamQueries(ContractTemplate, 2 () => [{field: value}, ...], 3 [dependency1, dependency2, ...]);
You can additionally pass in an extra function to handle WebSocket connection failures.
useFetchByKey
useFetchByKey
returns the unique contract of a given template and a given contract key.
1const {contract, loading} = useFetchByKey(ContractTemplate, () => key, [dependency1, dependency2, ...]);
useStreamFetchByKey
Deprecated: prefer
useStreamFetchByKeys
useStreamFetchByKey
has the same signature as useFetchByKey
, but it constantly keeps refreshing
the result.
1const {contract, loading} = useStreamFetchByKey(ContractTemplate, () => key, [dependency1, dependency2, ...]);
useStreamFetchByKeys
useStreamFetchByKeys
takes a template and a factory that returns a list of
keys, and returns a list of contracts that correspond to those keys (or null if
no contract matches the corresponding key). This hook will keep an open
WebSocket connection and listen for any change to the corresponding contracts.
If the factory function returns an empty array, the hook will similarly produce an empty array of contracts.
1const {contracts, loading} = useStreamFetchByKeys(ContractTemplate, 2 () => [key1, key2, ...], 3 [dependency1, dependency2, ...]);
You can additionally pass in an extra function to handle WebSocket connection failures.
In order to interact as multiple parties or to connect to several ledgers, one needs to create an extra
DamlLedger
contexts specific to your requirement.
createLedgerContext
createLedgerContext
returns another DamlLedger
context and associated hooks (useParty
, useLedger
... etc)
that will look up their connection within that returned context.
https://github.com/digital-asset/daml.
No vulnerabilities found.
Reason
all changesets reviewed
Reason
30 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
no dangerous workflow patterns detected
Reason
project is fuzzed
Details
Reason
no binaries found in the repo
Reason
5 out of the last 5 releases have a total of 5 signed artifacts.
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
14 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More