Skip to main content

TypeScript package

@daml/types

TypeScript and JavaScript language bindings for Canton.

Generated from published @daml/types TypeDoc snapshots.

Table of Contents

Reference

Interfaces

Choice

InterfaceAdded 3.4.8
  • Kind: Interface
  • Source: index.d.ts:113
Signature
Interface for objects representing Daml choices. Type Parameters Members

ChoiceFrom

InterfaceAdded 3.4.8
  • Kind: Interface
  • Source: index.d.ts:140
Signature
The origin companion that contained a [[Choice]]. Type Parameters Members

ContractTypeCompanion

  • Kind: Interface
  • Source: index.d.ts:25
Signature
Companion objects for templates and interfaces, containing their choices. Type Parameters Members

FromTemplate

InterfaceAdded 3.4.8
  • Kind: Interface
  • 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 Members

Map

InterfaceAdded 3.4.8
  • Kind: Interface
  • 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 Members

Serializable

InterfaceAdded 3.4.8
  • Kind: Interface
  • 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

Template

  • Kind: Interface
  • Source: index.d.ts:50
Signature
Interface for objects representing Daml templates. It is similar to the Template type class in Daml. Type Parameters Members

ToInterface

InterfaceAdded 3.4.8
  • Kind: Interface
  • 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 Members

Unit

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

Type Aliases

Bool

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

ContractId

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • 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<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

Date

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

Decimal

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • 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

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

Int

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • 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

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • Source: index.d.ts:81
Signature
An interface type, for use with contract IDs. Type Parameters

InterfaceCompanion

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • Source: index.d.ts:87
Signature
Interface for objects representing Daml interfaces. Type Parameters

List

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

Numeric

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • 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

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • Source: index.d.ts:306
Signature
The counterpart of Daml’s Optional T type. Type Parameters

Party

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • 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
  • Source: index.d.ts:88
Signature
Type Parameters

Text

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

TextMap

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

Time

Type AliasAdded 3.4.8
  • Kind: Type Alias
  • 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

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

Date

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

Decimal

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

Int

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

Party

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

Text

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

Time

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

Unit

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

Functions

ContractId

FunctionAdded 3.4.8
  • Kind: Function
  • Source: index.d.ts:294
Signature
Companion object of the [[ContractId]] type. Call Signatures
Returns: Serializable<ContractId<T>>

emptyMap

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

List

FunctionAdded 3.4.8
  • Kind: Function
  • Source: index.d.ts:262
Signature
Companion object of the [[List]] type. Call Signatures
Returns: Serializable<T[]>

Map

FunctionAdded 3.4.8
  • Kind: Function
  • Source: index.d.ts:340
Signature
Companion function of the [[GenMap]] type. Call Signatures
Returns: Serializable<Map<K, V>>

Numeric

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

Optional

FunctionAdded 3.4.8
  • Kind: Function
  • Source: index.d.ts:306
Signature
Companion function of the [[Optional]] type. Call Signatures
Returns: Serializable<Optional<T>>

TextMap

FunctionAdded 3.4.8
  • Kind: Function
  • Source: index.d.ts:322
Signature
Companion object of the [[TextMap]] type. Call Signatures
Returns: Serializable<TextMap<T>>

History

Updated3.4.9

ContractTypeCompanion: members added: templateIdWithPackageId

Template: members added: templateIdWithPackageId

TemplateOrInterface: signature updated; type parameter renamed: I -> Id

Added3.4.8

40 exported symbols added.