digital-asset/daml

Document "package name" for JSON API

Opened this issue · 0 comments

From https://docs.daml.com/2.9.4/json-api/index.html#http-request:

templateId is the contract template identifier which has the following two formats: #<package name>:<module>:<entity> or <package ID>:<module>:<entity>.

The package name format works with the smart contract upgrading feature so that contracts with different package IDs but the same package name can be used in a uniform manner.

Using the package ID format refers to a single package.

Given a daml.yaml:

sdk-version: 2.9.4
name: myproject-main
source: ./daml
version: 0.0.1

I tried the following, none of them worked as package name:

  • #myproject-main
  • #myproject-main-0.0.1
  • #myproject-main-0.0.1-daaf4bedcf34174be56d4bc7652194ea1885ac0b35528293ff62fedf318ac181

My questions regarding <package name> that would be nice to have answered in the doc:

  • What is the format?
  • How can I extract a <package name> of a Daml template?