Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Type aliases

ArchiveEvent

ArchiveEvent<T, I>: { contractId: ContractId<T>; templateId: I }

An archived contract.

Type parameters

  • T: object

    The contract template type.

  • I: string = string

    The contract id type.

Type declaration

  • contractId: ContractId<T>
  • templateId: I

CreateEvent

CreateEvent<T, K, I>: { agreementText: Text; contractId: ContractId<T>; key: K; observers: List<Party>; payload: T; signatories: List<Party>; templateId: I }

A newly created contract.

Type parameters

  • T: object

    The contract template type.

  • K = unknown

    The contract key type.

  • I: string = string

    The contract id type.

Type declaration

  • agreementText: Text
  • contractId: ContractId<T>
  • key: K
  • observers: List<Party>
  • payload: T
  • signatories: List<Party>
  • templateId: I

Event

Event<T, K, I>: { created: CreateEvent<T, K, I> } | { archived: ArchiveEvent<T, I> }

An event is either the creation or archival of a contract.

Type parameters

  • T: object

    The contract template type.

  • K = unknown

    The contract key type.

  • I: string = string

    The contract id type.

LedgerError

LedgerError: { errors: string[]; status: number; warnings: unknown | undefined }

Error code and messages returned by the ledger.

Type declaration

  • errors: string[]
  • status: number
  • warnings: unknown | undefined

LedgerOptions

LedgerOptions: { httpBaseUrl?: string; reconnectThreshold?: number; token: string; wsBaseUrl?: string }

Options for creating a handle to a Daml ledger.

Type declaration

  • Optional httpBaseUrl?: string

    Optional base URL for the non-streaming endpoints of the JSON API. If this parameter is not provided, the protocol, host and port of the window.location object are used.

  • Optional reconnectThreshold?: number

    Optional number of milliseconds a connection has to be live to be considered healthy. If the connection is closed after being live for at least this amount of time, the Ledger tries to reconnect, else not.

  • token: string

    JSON web token used for authentication.

  • Optional wsBaseUrl?: string

    Optional base URL for the streaming endpoints of the JSON API. If this parameter is not provided, the base URL for the non-streaming endpoints is used with the protocol 'http' or 'https' replaced by 'ws' or 'wss', respectively. Specifying this parameter explicitly can be useful when the non-streaming requests are proxied but the streaming request cannot be proxied, as it is the case with the development server of create-react-app.

LedgerResponse

LedgerResponse: { result: unknown; status: number; warnings: unknown | undefined }

Status code and result returned by a call to the ledger.

Type declaration

  • result: unknown
  • status: number
  • warnings: unknown | undefined

PackageId

PackageId: string

PartyInfo

PartyInfo: { displayName?: string; identifier: Party; isLocal: boolean }

Full information about a Party.

Type declaration

  • Optional displayName?: string
  • identifier: Party
  • isLocal: boolean

Query

Query<T>: T extends object ? {} : T

Query<T> is the type of queries for searching for contracts of template type T.

Query<T> is an object consisting of a subset of the fields of T.

Comparison queries are not yet supported.

NB: This type is heavily related to the DeepPartial type that can be found in the TypeScript community.

Type parameters

  • T

    The contract template type.

QueryResult

QueryResult<T, K, I>: { contracts: readonly CreateEvent<T, K, I>[]; loading: boolean }

The result of a query against the ledger.

Note: this is meant to be used by @daml/react.

Type parameters

  • T: object

    The contract template type of the query.

  • K

    The contract key type of the query.

  • I: string

    The template id type.

Type declaration

  • contracts: readonly CreateEvent<T, K, I>[]

    Contracts matching the query.

  • loading: boolean

    Indicator for whether the query is executing.

StreamCloseEvent

StreamCloseEvent: { code: number; reason: string }

Event emitted when a stream gets closed.

Type declaration

  • code: number
  • reason: string

Variables

Const decodeArchiveEventUnknown

decodeArchiveEventUnknown: jtv.Decoder<ArchiveEvent<object>> = jtv.valueAt(['templateId'], jtv.string()).andThen(templateId =>decodeArchiveEvent(lookupTemplate(templateId)))

Decoder for an ArchiveEvent of unknown contract template.

Const decodeCreateEventUnknown

decodeCreateEventUnknown: jtv.Decoder<CreateEvent<object>> = jtv.valueAt(['templateId'], jtv.string()).andThen((templateId) =>decodeCreateEvent(lookupTemplate(templateId)))

Decoder for a CreateEvent of unknown contract template.

Const decodeEventUnknown

decodeEventUnknown: jtv.Decoder<Event<object>> = jtv.oneOf<Event<object>>(jtv.object({created: decodeCreateEventUnknown}),jtv.object({archived: decodeArchiveEventUnknown}),)

Decoder for an Event with unknown contract template.

Const partyInfoDecoder

partyInfoDecoder: jtv.Decoder<PartyInfo> = jtv.object({identifier: jtv.string(),displayName: jtv.optional(jtv.string()),isLocal: jtv.boolean(),})

Functions

Const decode

  • decode<R>(decoder: jtv.Decoder<R>, data: unknown): R
  • Type parameters

    • R

    Parameters

    • decoder: jtv.Decoder<R>
    • data: unknown

    Returns R

Const decodeArchiveEvent

  • decodeArchiveEvent<T, K, I>(template: Template<T, K, I>): jtv.Decoder<ArchiveEvent<T, I>>
  • Decoder for an ArchiveEvent.

    Type parameters

    • T: object

    • K

    • I: string

    Parameters

    • template: Template<T, K, I>

    Returns jtv.Decoder<ArchiveEvent<T, I>>

Const decodeCreateEvent

  • decodeCreateEvent<T, K, I>(template: Template<T, K, I>): jtv.Decoder<CreateEvent<T, K, I>>
  • Decoder for a CreateEvent.

    Type parameters

    • T: object

    • K

    • I: string

    Parameters

    • template: Template<T, K, I>

    Returns jtv.Decoder<CreateEvent<T, K, I>>

Const decodeEvent

  • decodeEvent<T, K, I>(template: Template<T, K, I>): jtv.Decoder<Event<T, K, I>>
  • Decoder for an Event.

    Type parameters

    • T: object

    • K

    • I: string

    Parameters

    • template: Template<T, K, I>

    Returns jtv.Decoder<Event<T, K, I>>

Generated using TypeDoc