Type Alias ContractId<T>

ContractId: string & { "[ContractIdBrand]": T }

The counterpart of Daml's ContractId T type.

We represent ContractIds as strings. Their exact format of these strings depends on the ledger the Daml application is running on.

The purpose of the intersection with { [ContractIdBrand]: T } is to prevent accidental use of a ContractId<T> when a ContractId<U> is needed (unless T is a subtype of U). This technique is known as "branding" in the TypeScript community.

Type Parameters

  • T

T The contract template.