Generated from publishedDocumentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
@daml/types TypeDoc snapshots.
Table of Contents
| Name | Kind | Summary | Introduced | Changed | Deprecated | Removed |
|---|---|---|---|---|---|---|
Choice | Interface | Interface for objects representing Daml choices. | 3.4.8 | - | - | - |
ChoiceFrom | Interface | The origin companion that contained a [[Choice]]. | 3.4.8 | - | - | - |
ContractTypeCompanion | Interface | Companion objects for templates and interfaces, containing their choices. | 3.4.8 | 3.4.9: members added: templateIdWithPackageId | - | - |
FromTemplate | Interface | 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. | 3.4.8 | - | - | - |
Map | Interface | 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 andvalues match, i.e. m.get(k) is (deep-, value-based) equal to[...m.values()][[...m.keys()].findIndex((l) => _.isEqual(k, l))] | 3.4.8 | - | - | - |
Serializable | Interface | Interface for companion objects of serializable types. Its main purpose is to serialize and deserialize values between raw JSON and typed values. | 3.4.8 | - | - | - |
Template | Interface | Interface for objects representing Daml templates. It is similar to theTemplate type class in Daml. | 3.4.8 | 3.4.9: members added: templateIdWithPackageId | - | - |
ToInterface | Interface | A mixin for [[Template]] that provides the toInterface andunsafeFromInterface 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 | - | - | - |
Unit | Interface | The counterpart of Daml’s () type. | 3.4.8 | - | - | - |
Bool | Type Alias | The counterpart of Daml’s Bool type. | 3.4.8 | - | - | - |
ContractId | Type Alias | The counterpart of Daml’s ContractId T type.We represent ContractIds as strings. Their exact format of these strings depends on the ledgerthe Daml application is running on. The purpose of the intersection with { [ContractIdBrand]: T } is toprevent accidental use of a ContractId<T> when a ContractId<U> isneeded (unless T is a subtype of U). This technique is known as”branding” in the TypeScript community. | 3.4.8 | - | - | - |
Date | Type Alias | The counterpart of Daml’s Date type.We represent Dates as strings with format YYYY-MM-DD. | 3.4.8 | - | - | - |
Decimal | Type Alias | The counterpart of Daml’s Decimal type.In Daml, Decimal’s are the same as Numeric with precision 10. | 3.4.8 | - | - | - |
DisclosedContract | Type Alias | A disclosed contract that can be passed on a command submission. | 3.4.8 | - | - | - |
Int | Type Alias | The counterpart of Daml’s Int type.We represent Ints as string in order to avoid a loss of precision. | 3.4.8 | - | - | - |
Interface | Type Alias | An interface type, for use with contract IDs. | 3.4.8 | - | - | - |
InterfaceCompanion | Type Alias | Interface for objects representing Daml interfaces. | 3.4.8 | - | - | - |
List | Type Alias | The counterpart of Daml’s [T] list type.We represent lists using arrays. | 3.4.8 | - | - | - |
Numeric | Type Alias | The counterpart of Daml’s Numeric type.We represent Numerics as string in order to avoid a loss of precision. The string must matchthe regular expression -?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?. | 3.4.8 | - | - | - |
Optional | Type Alias | The counterpart of Daml’s Optional T type. | 3.4.8 | - | - | - |
Party | Type Alias | The counterpart of Daml’s Party type.We represent Partys as strings matching the regular expression [A-Za-z0-9:_\- ]+. | 3.4.8 | - | - | - |
TemplateOrInterface | Type Alias | - | 3.4.8 | 3.4.9: signature updated; type parameter renamed: I -> Id | - | - |
Text | Type Alias | The counterpart of Daml’s Text type. | 3.4.8 | - | - | - |
TextMap | Type Alias | The counterpart of Daml’s TextMap T type.We represent TextMaps as dictionaries. | 3.4.8 | - | - | - |
Time | Type Alias | The counterpart of Daml’s Time type.We represent Timess as strings with format YYYY-MM-DDThh:mm:ss[.ssssss]Z. | 3.4.8 | - | - | - |
Bool | Variable | Companion object of the [[Bool]] type. | 3.4.8 | - | - | - |
Date | Variable | Companion object of the [[Date]] type. | 3.4.8 | - | - | - |
Decimal | Variable | Companion object of the [[Decimal]] type. | 3.4.8 | - | - | - |
Int | Variable | Companion object of the [[Int]] type. | 3.4.8 | - | - | - |
Party | Variable | Companion object of the [[Party]] type. | 3.4.8 | - | - | - |
Text | Variable | Companion object of the [[Text]] type. | 3.4.8 | - | - | - |
Time | Variable | Companion object of the [[Time]] type. | 3.4.8 | - | - | - |
Unit | Variable | Companion object of the [[Unit]] type. | 3.4.8 | - | - | - |
ContractId | Function | Companion object of the [[ContractId]] type. | 3.4.8 | - | - | - |
emptyMap | Function | - | 3.4.8 | - | - | - |
List | Function | Companion object of the [[List]] type. | 3.4.8 | - | - | - |
Map | Function | Companion function of the [[GenMap]] type. | 3.4.8 | - | - | - |
Numeric | Function | Companion function of the [[Numeric]] type. | 3.4.8 | - | - | - |
Optional | Function | Companion function of the [[Optional]] type. | 3.4.8 | - | - | - |
TextMap | Function | Companion object of the [[TextMap]] type. | 3.4.8 | - | - | - |
Version Change Summary
| Version | Added | Changed | Removed |
|---|---|---|---|
3.4.8 | 40 | - | - |
3.4.9 | - | 3 | - |
3.4.10 | - | - | - |
3.4.11 | - | - | - |
Reference
Interfaces
Choice
- Kind:
Interface - Introduced:
3.4.8 - Source:
index.d.ts:113
| Name | Constraint | Default | Description |
|---|---|---|---|
T | object | - | The template type. |
C | - | - | The choice type. |
R | - | - | The choice return type. |
K | - | unknown | The contract key type. |
| Member | Type | Description |
|---|---|---|
choiceName | string | The choice name. |
template | () => TemplateOrInterface | Returns the template to which this choice belongs. |
ChoiceFrom
- Kind:
Interface - Introduced:
3.4.8 - Source:
index.d.ts:140
| Name | Constraint | Default | Description |
|---|---|---|---|
O | - | - | The type of the template or interface of which this [[Choice]] is a member. |
| Member | Type | Description |
|---|---|---|
template | () => O | Returns 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 |
|---|---|
3.4.9 | members added: templateIdWithPackageId |
| Name | Constraint | Default | Description |
|---|---|---|---|
T | object | - | The template payload format or interface view. |
K | - | - | The contract key type. |
I | string | - | The template or interface id. |
| Member | Type | Description |
|---|---|---|
templateId | I | - |
templateIdWithPackageId | string | - |
FromTemplate
- Kind:
Interface - Introduced:
3.4.8 - Source:
index.d.ts:101
| Name | Constraint | Default | Description |
|---|---|---|---|
If | - | - | The interface type. |
TX | - | - | The intersection of template types this interface retroactively implements, or unknown if there are none. |
| Member | Type | Description |
|---|---|---|
[FromTemplateBrand] | [If, TX] | - |
Map
- Kind:
Interface - Introduced:
3.4.8 - Source:
index.d.ts:340
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
| Name | Constraint | Default | Description |
|---|---|---|---|
K | - | - | The type of the map keys. |
V | - | - | The type of the map values. |
| Member | Type | Description |
|---|---|---|
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
| Name | Constraint | Default | Description |
|---|---|---|---|
T | - | - | The template type. |
Template
- Kind:
Interface - Introduced:
3.4.8 - Changed in:
3.4.9 - Source:
index.d.ts:50
| Version | Changes |
|---|---|
3.4.9 | members added: templateIdWithPackageId |
Template type class in Daml.
Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
T | object | - | The template type. |
K | - | unknown | The contract key type. |
I | string | string | The template id type. |
| Member | Type | Description |
|---|---|---|
Archive | Choice<T, {}, {}, K> & ChoiceFrom<Template<T, K, I>> | - |
templateId | I | - |
templateIdWithPackageId | string | - |
ToInterface
- Kind:
Interface - Introduced:
3.4.8 - Source:
index.d.ts:69
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
| Name | Constraint | Default | Description |
|---|---|---|---|
T | object | - | The template type. |
IfU | - | - | The union of implemented interfaces, or never for templatesthat directly implement no interface. |
| Member | Type | Description |
|---|---|---|
toInterface | void | - |
unsafeFromInterface | void | - |
Unit
- Kind:
Interface - Introduced:
3.4.8 - Source:
index.d.ts:181
() type.
Type Aliases
Bool
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:190
Bool type.
ContractId
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:294
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
| Name | Constraint | Default | Description |
|---|---|---|---|
T | - | - | The contract template. |
Date
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:272
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
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
Int
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:200
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
| Name | Constraint | Default | Description |
|---|---|---|---|
IfId | - | - | The interface ID as a constant string. |
InterfaceCompanion
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:87
| Name | Constraint | Default | Description |
|---|---|---|---|
T | object | - | - |
K | - | - | - |
I | string | string | - |
List
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:262
[T] list type.
We represent lists using arrays.
Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
T | - | - | The type of the list values. |
Numeric
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:211
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
Optional T type.
Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
T | - | - | The type of the optionally present value. |
Party
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:250
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 |
|---|---|
3.4.9 | signature updated; type parameter renamed: I -> Id |
| Name | Constraint | Default | Description |
|---|---|---|---|
T | object | - | - |
K | - | unknown | - |
Id | string | string | - |
Text
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:230
Text type.
TextMap
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:322
TextMap T type.
We represent TextMaps as dictionaries.
Type Parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
T | - | - | The type of the map values. |
Time
- Kind:
Type Alias - Introduced:
3.4.8 - Source:
index.d.ts:240
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
Date
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:272
Decimal
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:218
Int
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:200
Party
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:250
Text
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:230
Time
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:240
Unit
- Kind:
Variable - Introduced:
3.4.8 - Source:
index.d.ts:181
Functions
ContractId
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:294
| Type Parameter | Constraint | Default | Description |
|---|---|---|---|
T | - | - | - |
| Parameter | Type | Required | Description |
|---|---|---|---|
_t | Serializable<T> | TemplateOrInterface<T & object, unknown, string> | yes | - |
Serializable<ContractId<T>>
emptyMap
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:351
| Type Parameter | Constraint | Default | Description |
|---|---|---|---|
K | - | - | - |
V | - | - | - |
Map<K, V>
List
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:262
| Type Parameter | Constraint | Default | Description |
|---|---|---|---|
T | - | - | - |
| Parameter | Type | Required | Description |
|---|---|---|---|
t | Serializable<T> | yes | - |
Serializable<T[]>
Map
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:340
| Type Parameter | Constraint | Default | Description |
|---|---|---|---|
K | - | - | - |
V | - | - | - |
| Parameter | Type | Required | Description |
|---|---|---|---|
kd | Serializable<K> | yes | - |
vd | Serializable<V> | yes | - |
Serializable<Map<K, V>>
Numeric
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:211
| Parameter | Type | Required | Description |
|---|---|---|---|
_ | number | yes | - |
Serializable<string>
Optional
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:306
| Type Parameter | Constraint | Default | Description |
|---|---|---|---|
T | - | - | - |
| Parameter | Type | Required | Description |
|---|---|---|---|
t | Serializable<T> | yes | - |
Serializable<Optional<T>>
TextMap
- Kind:
Function - Introduced:
3.4.8 - Source:
index.d.ts:322
| Type Parameter | Constraint | Default | Description |
|---|---|---|---|
T | - | - | - |
| Parameter | Type | Required | Description |
|---|---|---|---|
t | Serializable<T> | yes | - |
Serializable<TextMap<T>>