# Using @daml/ledger to query ledger - declaring template\`

**URL:** <https://forum.canton.network/t/using-daml-ledger-to-query-ledger-declaring-template/2236>\
**Category:** App Development\
**Tags:** javascript, json-api, ledger-api\
**Created:** [March 9, 2021, 11:46am UTC](https://forum.canton.network/t/using-daml-ledger-to-query-ledger-declaring-template/2236 "2021-03-09T11:46:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [March 9, 2021, 11:49am UTC](https://forum.canton.network/t/using-daml-ledger-to-query-ledger-declaring-template/2236/2 "2021-03-09T11:49:44Z")

</div>

Hi Alex, `@daml/ledger` is really intended to be used in combination with the JavaScript codegen which will generate the template for you. I recommend the related post at [Attempting to create a contract is sending the wrong templateId](https://discuss.daml.com/t/attempting-to-create-a-contract-is-sending-the-wrong-templateid/1910) for some more details on that.

---

_[View the full topic](https://forum.canton.network/t/using-daml-ledger-to-query-ledger-declaring-template/2236)._
