Hi,
Is there a way, without generating the full json or java code, to get the template IDs for templates inside a dar?
Best-
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.
@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.
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.