Skip to main content
Generated from published @daml/types TypeDoc snapshots.

Table of Contents

NameKindSummaryIntroducedChangedDeprecatedRemoved
ChoiceInterfaceInterface for objects representing Daml choices.3.4.8---
ChoiceFromInterfaceThe origin companion that contained a [[Choice]].3.4.8---
ContractTypeCompanionInterfaceCompanion objects for templates and interfaces, containing their choices.3.4.83.4.9: members added: templateIdWithPackageId--
FromTemplateInterfaceA mixin for [[InterfaceCompanion]]. This supplies the basis
for the methods of [[ToInterface]].

Even interfaces that retroactively implement for no templates implement this,
because forward implementations still require this marker to work.
3.4.8---
MapInterfaceThe counterpart of Daml’s DA.Map.Map K V type.

This is an immutable map which compares keys via deep equality. The order of
iteration is unspecified; the only guarantee is that the order in keys and
values match, i.e. m.get(k) is (deep-, value-based) equal to
[...m.values()][[...m.keys()].findIndex((l) => _.isEqual(k, l))]
3.4.8---
SerializableInterfaceInterface for companion objects of serializable types. Its main purpose is
to serialize and deserialize values between raw JSON and typed values.
3.4.8---
TemplateInterfaceInterface for objects representing Daml templates. It is similar to the
Template type class in Daml.
3.4.83.4.9: members added: templateIdWithPackageId--
ToInterfaceInterfaceA mixin for [[Template]] that provides the toInterface and
unsafeFromInterface contract ID conversion functions.

Even templates that directly implement no interfaces implement this, because
this also permits conversion with interfaces that supply retroactive
implementations to this template.
3.4.8---
UnitInterfaceThe counterpart of Daml’s () type.3.4.8---
BoolType AliasThe counterpart of Daml’s Bool type.3.4.8---
ContractIdType AliasThe 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.
3.4.8---
DateType AliasThe counterpart of Daml’s Date type.

We represent Dates as strings with format YYYY-MM-DD.
3.4.8---
DecimalType AliasThe counterpart of Daml’s Decimal type.

In Daml, Decimal’s are the same as Numeric with precision 10.
3.4.8---
DisclosedContractType AliasA disclosed contract that can be passed on a command submission.3.4.8---
IntType AliasThe counterpart of Daml’s Int type.

We represent Ints as string in order to avoid a loss of precision.
3.4.8---
InterfaceType AliasAn interface type, for use with contract IDs.3.4.8---
InterfaceCompanionType AliasInterface for objects representing Daml interfaces.3.4.8---
ListType AliasThe counterpart of Daml’s [T] list type.

We represent lists using arrays.
3.4.8---
NumericType AliasThe counterpart of Daml’s Numeric type.

We represent Numerics as string in order to avoid a loss of precision. The string must match
the regular expression -?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?.
3.4.8---
OptionalType AliasThe counterpart of Daml’s Optional T type.3.4.8---
PartyType AliasThe counterpart of Daml’s Party type.

We represent Partys as strings matching the regular expression [A-Za-z0-9:_\- ]+.
3.4.8---
TemplateOrInterfaceType Alias-3.4.83.4.9: signature updated; type parameter renamed: I -> Id--
TextType AliasThe counterpart of Daml’s Text type.3.4.8---
TextMapType AliasThe counterpart of Daml’s TextMap T type.

We represent TextMaps as dictionaries.
3.4.8---
TimeType AliasThe counterpart of Daml’s Time type.

We represent Timess as strings with format YYYY-MM-DDThh:mm:ss[.ssssss]Z.
3.4.8---
BoolVariableCompanion object of the [[Bool]] type.3.4.8---
DateVariableCompanion object of the [[Date]] type.3.4.8---
DecimalVariableCompanion object of the [[Decimal]] type.3.4.8---
IntVariableCompanion object of the [[Int]] type.3.4.8---
PartyVariableCompanion object of the [[Party]] type.3.4.8---
TextVariableCompanion object of the [[Text]] type.3.4.8---
TimeVariableCompanion object of the [[Time]] type.3.4.8---
UnitVariableCompanion object of the [[Unit]] type.3.4.8---
ContractIdFunctionCompanion object of the [[ContractId]] type.3.4.8---
emptyMapFunction-3.4.8---
ListFunctionCompanion object of the [[List]] type.3.4.8---
MapFunctionCompanion function of the [[GenMap]] type.3.4.8---
NumericFunctionCompanion function of the [[Numeric]] type.3.4.8---
OptionalFunctionCompanion function of the [[Optional]] type.3.4.8---
TextMapFunctionCompanion object of the [[TextMap]] type.3.4.8---

Version Change Summary

VersionAddedChangedRemoved
3.4.840--
3.4.9-3-
3.4.10---
3.4.11---
3.5.2---

Reference

Interfaces

Choice

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:113
Signature
Interface for objects representing Daml choices. Type Parameters
NameConstraintDefaultDescription
Tobject-The template type.
C--The choice type.
R--The choice return type.
K-unknownThe contract key type.
Members
MemberTypeDescription
choiceNamestringThe choice name.
template() => TemplateOrInterfaceReturns the template to which this choice belongs.

ChoiceFrom

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:140
Signature
The origin companion that contained a [[Choice]]. Type Parameters
NameConstraintDefaultDescription
O--The type of the template or interface of which
this [[Choice]] is a member.
Members
MemberTypeDescription
template() => OReturns the template to which this choice belongs.

ContractTypeCompanion

  • Kind: Interface
  • Introduced: 3.4.8
  • Changed in: 3.4.9
  • Source: index.d.ts:25
Version Changes
VersionChanges
3.4.9members added: templateIdWithPackageId
Signature
Companion objects for templates and interfaces, containing their choices. Type Parameters
NameConstraintDefaultDescription
Tobject-The template payload format or interface view.
K--The contract key type.
Istring-The template or interface id.
Members
MemberTypeDescription
templateIdI-
templateIdWithPackageIdstring-

FromTemplate

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:101
Signature
A mixin for [[InterfaceCompanion]]. This supplies the basis for the methods of [[ToInterface]]. Even interfaces that retroactively implement for no templates implement this, because forward implementations still require this marker to work. Type Parameters
NameConstraintDefaultDescription
If--The interface type.
TX--The intersection of template types this interface retroactively
implements, or unknown if there are none.
Members
MemberTypeDescription
[FromTemplateBrand][If, TX]-

Map

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:340
Signature
The counterpart of Daml’s DA.Map.Map K V type. This is an immutable map which compares keys via deep equality. The order of iteration is unspecified; the only guarantee is that the order in keys and values match, i.e. m.get(k) is (deep-, value-based) equal to [...m.values()][[...m.keys()].findIndex((l) => _.isEqual(k, l))] Type Parameters
NameConstraintDefaultDescription
K--The type of the map keys.
V--The type of the map values.
Members
MemberTypeDescription
delete(k: K) => Map<K, V>-
entries() => Iterator<[K, V], undefined, undefined>-
entriesArray() => [K, V][]-
forEach(f: (value: V, key: K, map: Map<K, V>) => T, u?: U) => void-
get(k: K) => undefined | V-
has(k: K) => boolean-
keys() => Iterator<K, undefined, undefined>-
set(k: K, v: V) => Map<K, V>-
values() => Iterator<V, undefined, undefined>-

Serializable

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:8
Signature
Interface for companion objects of serializable types. Its main purpose is to serialize and deserialize values between raw JSON and typed values. Type Parameters
NameConstraintDefaultDescription
T--The template type.

Template

  • Kind: Interface
  • Introduced: 3.4.8
  • Changed in: 3.4.9
  • Source: index.d.ts:50
Version Changes
VersionChanges
3.4.9members added: templateIdWithPackageId
Signature
Interface for objects representing Daml templates. It is similar to the Template type class in Daml. Type Parameters
NameConstraintDefaultDescription
Tobject-The template type.
K-unknownThe contract key type.
IstringstringThe template id type.
Members
MemberTypeDescription
ArchiveChoice<T, {}, {}, K> & ChoiceFrom<Template<T, K, I>>-
templateIdI-
templateIdWithPackageIdstring-

ToInterface

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:69
Signature
A mixin for [[Template]] that provides the toInterface and unsafeFromInterface contract ID conversion functions. Even templates that directly implement no interfaces implement this, because this also permits conversion with interfaces that supply retroactive implementations to this template. Type Parameters
NameConstraintDefaultDescription
Tobject-The template type.
IfU--The union of implemented interfaces, or never for templates
that directly implement no interface.
Members
MemberTypeDescription
toInterfacevoid-
unsafeFromInterfacevoid-

Unit

  • Kind: Interface
  • Introduced: 3.4.8
  • Source: index.d.ts:181
Signature
The counterpart of Daml’s () type.

Type Aliases

Bool

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:190
Signature
The counterpart of Daml’s Bool type.

ContractId

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:294
Signature
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&lt;T&gt; when a ContractId&lt;U&gt; is needed (unless T is a subtype of U). This technique is known as “branding” in the TypeScript community. Type Parameters
NameConstraintDefaultDescription
T--The contract template.

Date

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:272
Signature
The counterpart of Daml’s Date type. We represent Dates as strings with format YYYY-MM-DD.

Decimal

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:218
Signature
The counterpart of Daml’s Decimal type. In Daml, Decimal’s are the same as Numeric with precision 10.

DisclosedContract

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:362
Signature
A disclosed contract that can be passed on a command submission.

Int

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:200
Signature
The counterpart of Daml’s Int type. We represent Ints as string in order to avoid a loss of precision.

Interface

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:81
Signature
An interface type, for use with contract IDs. Type Parameters
NameConstraintDefaultDescription
IfId--The interface ID as a constant string.

InterfaceCompanion

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:87
Signature
Interface for objects representing Daml interfaces. Type Parameters
NameConstraintDefaultDescription
Tobject--
K---
Istringstring-

List

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:262
Signature
The counterpart of Daml’s [T] list type. We represent lists using arrays. Type Parameters
NameConstraintDefaultDescription
T--The type of the list values.

Numeric

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:211
Signature
The counterpart of Daml’s Numeric type. We represent Numerics as string in order to avoid a loss of precision. The string must match the regular expression -?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?.

Optional

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:306
Signature
The counterpart of Daml’s Optional T type. Type Parameters
NameConstraintDefaultDescription
T--The type of the optionally present value.

Party

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:250
Signature
The counterpart of Daml’s Party type. We represent Partys as strings matching the regular expression [A-Za-z0-9:_\- ]+.

TemplateOrInterface

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Changed in: 3.4.9
  • Source: index.d.ts:88
Version Changes
VersionChanges
3.4.9signature updated; type parameter renamed: I -> Id
Signature
Type Parameters
NameConstraintDefaultDescription
Tobject--
K-unknown-
Idstringstring-

Text

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:230
Signature
The counterpart of Daml’s Text type.

TextMap

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:322
Signature
The counterpart of Daml’s TextMap T type. We represent TextMaps as dictionaries. Type Parameters
NameConstraintDefaultDescription
T--The type of the map values.

Time

  • Kind: Type Alias
  • Introduced: 3.4.8
  • Source: index.d.ts:240
Signature
The counterpart of Daml’s Time type. We represent Timess as strings with format YYYY-MM-DDThh:mm:ss[.ssssss]Z.

Variables

Bool

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:190
Signature
Companion object of the [[Bool]] type.

Date

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:272
Signature
Companion object of the [[Date]] type.

Decimal

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:218
Signature
Companion object of the [[Decimal]] type.

Int

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:200
Signature
Companion object of the [[Int]] type.

Party

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:250
Signature
Companion object of the [[Party]] type.

Text

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:230
Signature
Companion object of the [[Text]] type.

Time

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:240
Signature
Companion object of the [[Time]] type.

Unit

  • Kind: Variable
  • Introduced: 3.4.8
  • Source: index.d.ts:181
Signature
Companion object of the [[Unit]] type.

Functions

ContractId

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:294
Signature
Companion object of the [[ContractId]] type. Call Signatures
Type ParameterConstraintDefaultDescription
T---
ParameterTypeRequiredDescription
_tSerializable<T> | TemplateOrInterface<T & object, unknown, string>yes-
Returns: Serializable<ContractId<T>>

emptyMap

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:351
Signature
Call Signatures
Type ParameterConstraintDefaultDescription
K---
V---
Returns: Map<K, V>

List

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:262
Signature
Companion object of the [[List]] type. Call Signatures
Type ParameterConstraintDefaultDescription
T---
ParameterTypeRequiredDescription
tSerializable<T>yes-
Returns: Serializable<T[]>

Map

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:340
Signature
Companion function of the [[GenMap]] type. Call Signatures
Type ParameterConstraintDefaultDescription
K---
V---
ParameterTypeRequiredDescription
kdSerializable<K>yes-
vdSerializable<V>yes-
Returns: Serializable<Map<K, V>>

Numeric

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:211
Signature
Companion function of the [[Numeric]] type. Call Signatures
ParameterTypeRequiredDescription
_numberyes-
Returns: Serializable<string>

Optional

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:306
Signature
Companion function of the [[Optional]] type. Call Signatures
Type ParameterConstraintDefaultDescription
T---
ParameterTypeRequiredDescription
tSerializable<T>yes-
Returns: Serializable<Optional<T>>

TextMap

  • Kind: Function
  • Introduced: 3.4.8
  • Source: index.d.ts:322
Signature
Companion object of the [[TextMap]] type. Call Signatures
Type ParameterConstraintDefaultDescription
T---
ParameterTypeRequiredDescription
tSerializable<T>yes-
Returns: Serializable<TextMap<T>>