Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Template IDs extractionForum ↗

Template IDs extraction

App Development4 posts459 views1 likesLast activity May 2022
JE
Jean_Safar1OP
May 2022

Hi,
Is there a way, without generating the full json or java code, to get the template IDs for templates inside a dar?
Best-

CO
cocreature
May 2022

I recommend to use daml damlc inspect-dar --json, see How can I check if my triggers.dar file is linked with my main dar file? - #2 by cocreature for the full command.

LE
Leonid_Rozenberg
May 2022

@cocreature That does not work full, as in the output we only get the packages, main_package_id and the files in the dar, and there isn’t any information in the output that indicates what templates are in what package.

CO
cocreature
May 2022

Oh I thought you’re just interested in the package id. There is daml damlc inspect --json but the output is undocumented and not stable across SDK versions so you probably don’t want to rely on it too heavily.

The other option is decoding the dalf. com.daml:daml-lf-interface is probably the easiest library to use here but it’s a Scala library and can have breaking changes across SDK versions. Alternatively, you can use com.daml:daml-lf-1.14-archive-proto to decode from Java but that gives you the raw protobuf which can be difficult to interpret.

← Back to Discussions