How do I use a variable from the daml.yml file in my code?

G-d willing

Hello,
I would like to use the debug function to print the package’s version from its daml.yaml file.
How can I do that?

I cannot think of a built-in way to accomplish this. :thinking:

  • There’s nothing like reflection in Daml.
  • There’s no access to environment variables.
  • There’s no access from within Daml to call Ledger API endpoints.

Do you need this from a choice implementation? Or from Daml Script?

What about hardcoding a version identifier into the Daml code? And updating it with each release? :man_shrugging:

1 Like

G-d willing

Thanks @WallaceKelly for your response.
Well, I need that from within a choice.
This is related to some upgrade’s coding related to SCU
As for hardcoding, I thought about that, and I planned on doing it that way if there wasn’t any other way.