# \#javascript

**URL:** https://forum.canton.network/tag/javascript/51.md

[Latest](https://forum.canton.network/latest.md) · [Categories](https://forum.canton.network/categories.md) · [Tags](https://forum.canton.network/tags.md)

---

## [Wallet and Exchange](https://forum.canton.network/t/wallet-and-exchange/8993)

<div class="topic-metadata">

**Author:** [@bluedev742](https://forum.canton.network/u/bluedev742)\
**Replies:** 4\
**Last updated:** [July 25, 2026, 8:52pm UTC](https://forum.canton.network/t/wallet-and-exchange/8993 "2026-07-25T20:52:13Z")

</div>

Hi @Dave, I reviewed the Canton Wallet Gateway repository and the open-source reference wallet proposal. I have 10 years of software development experience, particularly in full-stack architecture, backend systems and in…

---

## [Using @daml/ledger TypeScript library for backend code](https://forum.canton.network/t/using-daml-ledger-typescript-library-for-backend-code/6708)

<div class="topic-metadata">

**Author:** [@huw](https://forum.canton.network/u/huw)\
**Replies:** 2\
**Last updated:** [June 26, 2023, 10:21pm UTC](https://forum.canton.network/t/using-daml-ledger-typescript-library-for-backend-code/6708 "2023-06-26T22:21:15Z")

</div>

Is using the TypeScript library @daml/ledger supported for use in non-UI applications (e.g. a Node JS backend)? I believe it is technically possible, but the docs seem to be mostly focused on using it for front-end devel…

---

## [How to manage the server state in React Application?](https://forum.canton.network/t/how-to-manage-the-server-state-in-react-application/6164)

<div class="topic-metadata">

**Author:** [@cdfwb](https://forum.canton.network/u/cdfwb)\
**Replies:** 0\
**Last updated:** [February 22, 2023, 1:22pm UTC](https://forum.canton.network/t/how-to-manage-the-server-state-in-react-application/6164 "2023-02-22T13:22:58Z")

</div>

Data coming from userContext.useQuery(ToDoList.Lists) may be used on serveral pages/components in my react app, so I am considering how to manage this kind of data using a state management tool like redux, but I am not a…

---

## [How to mock useStreamQueries in jest test?](https://forum.canton.network/t/how-to-mock-usestreamqueries-in-jest-test/2095)

<div class="topic-metadata">

**Author:** [@Richard\_Kapolnai](https://forum.canton.network/u/Richard_Kapolnai)\
**Replies:** 3\
**Last updated:** [February 17, 2021, 6:26pm UTC](https://forum.canton.network/t/how-to-mock-usestreamqueries-in-jest-test/2095 "2021-02-17T18:26:54Z")

</div>

We’d like to render a page in a test which connects to the ledger during rendering. How would be possible to mock useStreamQueries to always return an empty contract list? We could not figure out how to do this with jes…

---

## [Can I explicitly release websocket connections used in the \`@daml/react\` bindings?](https://forum.canton.network/t/can-i-explicitly-release-websocket-connections-used-in-the-daml-react-bindings/5297)

<div class="topic-metadata">

**Author:** [@georg](https://forum.canton.network/u/georg)\
**Replies:** 3\
**Last updated:** [September 27, 2022, 7:46pm UTC](https://forum.canton.network/t/can-i-explicitly-release-websocket-connections-used-in-the-daml-react-bindings/5297 "2022-09-27T19:46:52Z")

</div>

In the Daml Finance Reference App we make use of useStreamQueries a lot. I realized that the websocket connections don’t get released / closed when I eg. navigate away from a page that calls useStreamQueries. This leads …

---

## [DAML codegen js ESM build?](https://forum.canton.network/t/daml-codegen-js-esm-build/4355)

<div class="topic-metadata">

**Author:** [@Mark\_Broadhead](https://forum.canton.network/u/Mark_Broadhead)\
**Replies:** 1\
**Last updated:** [April 18, 2022, 10:55am UTC](https://forum.canton.network/t/daml-codegen-js-esm-build/4355 "2022-04-18T10:55:19Z")

</div>

Is there a way to use the daml codegen js command to generate an ESM build? I am having issues using the generated libraries with the Vite build tool because it is a commons library.

---

## [Using ledger.listKnownParties returns Unhandled Promise Rejection Warning](https://forum.canton.network/t/using-ledger-listknownparties-returns-unhandled-promise-rejection-warning/2229)

<div class="topic-metadata">

**Author:** [@alexkosior](https://forum.canton.network/u/alexkosior)\
**Replies:** 3\
**Last updated:** [September 6, 2021, 7:10am UTC](https://forum.canton.network/t/using-ledger-listknownparties-returns-unhandled-promise-rejection-warning/2229 "2021-09-06T07:10:41Z")

</div>

Hi all, I am new to the daml language and I am attempting to connect to my ledger (running on sandbox with SDK 1.10.0) with JavaScript @daml/ledger JSON API implementation. When I try to use Ledger.listKnownParties it r…

---

## [Error: Failed to look up template (Make sure your @daml/types version agrees with the used Daml SDK version.)](https://forum.canton.network/t/error-failed-to-look-up-template-make-sure-your-daml-types-version-agrees-with-the-used-daml-sdk-version/2687)

<div class="topic-metadata">

**Author:** [@Richard\_Kapolnai](https://forum.canton.network/u/Richard_Kapolnai)\
**Replies:** 8\
**Last updated:** [July 7, 2021, 4:40pm UTC](https://forum.canton.network/t/error-failed-to-look-up-template-make-sure-your-daml-types-version-agrees-with-the-used-daml-sdk-version/2687 "2021-07-07T16:40:51Z")

</div>

When playing with the CBDC UI, every await ledger.exercise calls throw similar to this: Error: Failed to look up template c334f46f934d9633747c1ab4dc1fc3a947b74aa948a4dfc5ad0bea6639e7266d:DA.Finance.Asset:AssetDeposit. M…

---

## [Attempting to create a contract is sending the wrong templateId](https://forum.canton.network/t/attempting-to-create-a-contract-is-sending-the-wrong-templateid/1910)

<div class="topic-metadata">

**Author:** [@anthony](https://forum.canton.network/u/anthony)\
**Replies:** 7\
**Last updated:** [June 5, 2021, 6:46pm UTC](https://forum.canton.network/t/attempting-to-create-a-contract-is-sending-the-wrong-templateid/1910 "2021-06-05T18:46:14Z")

</div>

I’m attempting to use the @daml/ledger library in vanilla JS (really Vue.js but doesn’t matter). However when I submit the following request to the ledger I get an error. import Ledger from '@daml/ledger'; var ledger =…

---

## [How can I use the party display name in the React UI?](https://forum.canton.network/t/how-can-i-use-the-party-display-name-in-the-react-ui/2287)

<div class="topic-metadata">

**Author:** [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Replies:** 6\
**Last updated:** [March 18, 2021, 11:19am UTC](https://forum.canton.network/t/how-can-i-use-the-party-display-name-in-the-react-ui/2287 "2021-03-18T11:19:54Z")

</div>

There are two types for parties: The Party type is a string, and stands for the party identifier. The PartyInfo type is an object, which has the following fields: /\*\* \* Full information about a Party. \* \*/ export t…

---

## [Using @daml/ledger to query ledger - declaring template\`](https://forum.canton.network/t/using-daml-ledger-to-query-ledger-declaring-template/2236)

<div class="topic-metadata">

**Author:** [@alexkosior](https://forum.canton.network/u/alexkosior)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 11:49am UTC](https://forum.canton.network/t/using-daml-ledger-to-query-ledger-declaring-template/2236 "2021-03-09T11:49:44Z")

</div>

Hi, I am trying to use @daml/ledger to perform an api call to v1/query and I am having troubles passing the template to the function. (Ledger connection works fine as ledger.listPackages() returns a correct result). im…

---

## [Connection refused in react.js jest test (websocket closed)](https://forum.canton.network/t/connection-refused-in-react-js-jest-test-websocket-closed/2092)

<div class="topic-metadata">

**Author:** [@Richard\_Kapolnai](https://forum.canton.network/u/Richard_Kapolnai)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 9:58am UTC](https://forum.canton.network/t/connection-refused-in-react-js-jest-test-websocket-closed/2092 "2021-02-16T09:58:44Z")

</div>

How can I fix Error: connect ECONNREFUSED 127.0.0.1:3000 when running npm test? The tests seem to pass: npm test -- --watchAll=false \> daml-demo@0.1.0 test /home/circleci/project/ui \> react-scripts test --testURL='htt…

---

## [Can you retrieve only partial data from contract rather than the whole contract?](https://forum.canton.network/t/can-you-retrieve-only-partial-data-from-contract-rather-than-the-whole-contract/1956)

<div class="topic-metadata">

**Author:** [@jamesljaworski85](https://forum.canton.network/u/jamesljaworski85)\
**Replies:** 3\
**Last updated:** [January 19, 2021, 2:04pm UTC](https://forum.canton.network/t/can-you-retrieve-only-partial-data-from-contract-rather-than-the-whole-contract/1956 "2021-01-19T14:04:30Z")

</div>

Is it possible to access data stored in lists within contracts directly from the Api calls? I have noticed something like this in some daml code from here. let p2Account = (fromSome (ci.d.party!!1).account).accountNum…

---

## [Is there a way to make sure I have a valid token with @daml/ledger without attempting to write to the ledger?](https://forum.canton.network/t/is-there-a-way-to-make-sure-i-have-a-valid-token-with-daml-ledger-without-attempting-to-write-to-the-ledger/1914)

<div class="topic-metadata">

**Author:** [@anthony](https://forum.canton.network/u/anthony)\
**Replies:** 2\
**Last updated:** [January 11, 2021, 6:33pm UTC](https://forum.canton.network/t/is-there-a-way-to-make-sure-i-have-a-valid-token-with-daml-ledger-without-attempting-to-write-to-the-ledger/1914 "2021-01-11T18:33:06Z")

</div>

The problem I have at the moment is that when I generate a token for use with daml-on-fabric (which by default has no authorization) then any token I generate for an unknown submitting party doesn’t produce an error unti…

---

## [Best practices for passing props from location state, and then storing in local memory](https://forum.canton.network/t/best-practices-for-passing-props-from-location-state-and-then-storing-in-local-memory/1821)

<div class="topic-metadata">

**Author:** [@jamesljaworski85](https://forum.canton.network/u/jamesljaworski85)\
**Replies:** 8\
**Last updated:** [December 21, 2020, 1:39pm UTC](https://forum.canton.network/t/best-practices-for-passing-props-from-location-state-and-then-storing-in-local-memory/1821 "2020-12-21T13:39:12Z")

</div>

Hey everyone! Let’s say I have a table in my ui and it lists all currently active contracts of the same Template @ app/template. Each row has a unique name. Using Link router I can click on a button that takes me to a…

---

## [Upgrading from 0.13.34 to 1.7.0](https://forum.canton.network/t/upgrading-from-0-13-34-to-1-7-0/1747)

<div class="topic-metadata">

**Author:** [@jamesljaworski85](https://forum.canton.network/u/jamesljaworski85)\
**Replies:** 3\
**Last updated:** [December 11, 2020, 2:31pm UTC](https://forum.canton.network/t/upgrading-from-0-13-34-to-1-7-0/1747 "2020-12-11T14:31:41Z")

</div>

Hey, DAML Community! It’s been a while… but I am back to working on our front end. Our goal is to be able to deploy to DABL for some testing/demo’ing. Our current demo runs in Sandbox on SDK version 0.13.34. It is based…

---

## [@daml/ledger documentation](https://forum.canton.network/t/daml-ledger-documentation/894)

<div class="topic-metadata">

**Author:** [@alex\_m](https://forum.canton.network/u/alex_m)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 11:24am UTC](https://forum.canton.network/t/daml-ledger-documentation/894 "2020-07-23T11:24:29Z")

</div>

Hello again! I was wondering if there was any detailed documentation for the @daml/ledger client library. I have found this https://docs.daml.com/app-dev/bindings-ts/daml-ledger/index.html but there is no mention of met…

---

## [How can I speed up Typescript compilation for my generated code?](https://forum.canton.network/t/how-can-i-speed-up-typescript-compilation-for-my-generated-code/90)

<div class="topic-metadata">

**Author:** [@georg](https://forum.canton.network/u/georg)\
**Replies:** 12\
**Last updated:** [July 10, 2020, 7:35am UTC](https://forum.canton.network/t/how-can-i-speed-up-typescript-compilation-for-my-generated-code/90 "2020-07-10T07:35:23Z")

</div>

During combined UI and DAML model development I often have to recompile DAML, regenerate the Typescript libraries and restart the sandbox. By far the most time is spent compiling the 20-odd Typescript projects generated …

---

## [Can daml codegen js options be specified in daml.yaml?](https://forum.canton.network/t/can-daml-codegen-js-options-be-specified-in-daml-yaml/648)

<div class="topic-metadata">

**Author:** [@anthony](https://forum.canton.network/u/anthony)\
**Replies:** 2\
**Last updated:** [June 15, 2020, 5:13pm UTC](https://forum.canton.network/t/can-daml-codegen-js-options-be-specified-in-daml-yaml/648 "2020-06-15T17:13:25Z")

</div>

I see that Java and Scala codegen options can be specified in daml.yaml using named flags. However daml codegen js doesn’t have named flags and specifying the letter flags in daml.yaml doesn’t seem to work for me. Examp…

---

## [New blog: Analyzing how DAML, Kotlin and Java can work together](https://forum.canton.network/t/new-blog-analyzing-how-daml-kotlin-and-java-can-work-together/287)

<div class="topic-metadata">

**Author:** [@ManishGrover](https://forum.canton.network/u/ManishGrover)\
**Replies:** 0\
**Last updated:** [April 28, 2020, 5:24pm UTC](https://forum.canton.network/t/new-blog-analyzing-how-daml-kotlin-and-java-can-work-together/287 "2020-04-28T17:24:36Z")

</div>

Here’s a nice blog post by Harvey West of everis that examines where DAML, Kotlin and Java fit in the overall tech stack, and why DAML may be the right choice for the smart contracts layer of your app. Comments welcom…
