Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Type aliases

Bool

Bool: boolean

The counterpart of Daml's Bool type.

ContractId

ContractId<T>: 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

    The contract template.

Date

Date: string

The counterpart of Daml's Date type.

We represent Dates as strings with format YYYY-MM-DD.

Decimal

Decimal: Numeric

The counterpart of Daml's Decimal type.

In Daml, Decimal's are the same as Numeric with precision 10.

Int

Int: string

The counterpart of Daml's Int type.

We represent Ints as string in order to avoid a loss of precision.

List

List<T>: T[]

The counterpart of Daml's [T] list type.

We represent lists using arrays.

Type parameters

  • T

    The type of the list values.

Numeric

Numeric: string

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

Optional<T>: null | OptionalInner<T>

The counterpart of Daml's Optional T type.

Type parameters

  • T

    The type of the optionally present value.

OptionalInner

OptionalInner<T>: null extends T ? [] | [Exclude<T, null>] : T

Inner type of Optional.

Type parameters

  • T

Party

Party: string

The counterpart of Daml's Party type.

We represent Partys as strings matching the regular expression [A-Za-z0-9:_\- ]+.

Text

Text: string

The counterpart of Daml's Text type.

TextMap

TextMap<T>: {}

The counterpart of Daml's TextMap T type.

We represent TextMaps as dictionaries.

Type parameters

  • T

    The type of the map values.

Type declaration

  • [key: string]: T

Time

Time: string

The counterpart of Daml's Time type.

We represent Timess as strings with format YYYY-MM-DDThh:mm:ss[.ssssss]Z.

Variables

Const ContractIdBrand

ContractIdBrand: unique symbol = Symbol()

Used to brand ContractId.

Const Decimal

Decimal: Serializable<Decimal> = Numeric(10)

Companion object of the Decimal type.

Functions

Const ContractId

Const List

Const Map

Const Numeric

Const Optional

Const TextMap

Const emptyMap

  • emptyMap<K, V>(): Map<K, V>
  • Type parameters

    • K

    • V

    Returns Map<K, V>

it

  • it<T>(arr: T[]): Iterator<T, undefined, undefined>
  • Type parameters

    • T

    Parameters

    • arr: T[]

    Returns Iterator<T, undefined, undefined>

Object literals

Const Bool

Bool: object

Companion object of the Bool type.

decoder

decoder: any = jtv.boolean()

encode

  • encode(b: Bool): boolean
  • Parameters

    Returns boolean

Const Date

Date: object

Companion object of the Date type.

decoder

decoder: any = jtv.string()

encode

  • encode(d: Date): string
  • Parameters

    Returns string

Const Int

Int: object

Companion object of the Int type.

decoder

decoder: any = jtv.string()

encode

  • encode(i: Int): string
  • Parameters

    Returns string

Const Party

Party: object

Companion object of the Party type.

decoder

decoder: any = jtv.string()

encode

  • encode(p: Party): string
  • Parameters

    Returns string

Const Text

Text: object

Companion object of the Text type.

decoder

decoder: any = jtv.string()

encode

  • encode(t: Text): string
  • Parameters

    Returns string

Const Time

Time: object

Companion object of the Time type.

decoder

decoder: any = jtv.string()

encode

  • encode(t: Time): string
  • Parameters

    Returns string

Const Unit

Unit: object

Companion obect of the Unit type.

decoder

decoder: any = jtv.object({})

encode

  • Parameters

    Returns Unit

Generated using TypeDoc