Interface Choice<T, C, R, K>

Interface for objects representing Daml choices.

T The template type.

K The contract key type.

C The choice type.

R The choice return type.

interface Choice<T extends object, C, R, K = unknown> {
    argumentDecoder: Decoder<C>;
    argumentEncode: (c: C) => unknown;
    choiceName: string;
    resultDecoder: Decoder<R>;
    template: () => TemplateOrInterface;
}

Type Parameters

  • T extends object
  • C
  • R
  • K = unknown

Hierarchy (View Summary)

Properties

argumentDecoder: Decoder<C>

Returns a decoder to decode the choice arguments.

Note: we never need to decode the choice arguments, as they are sent over the API but not received.

argumentEncode: (c: C) => unknown
choiceName: string

The choice name.

resultDecoder: Decoder<R>

Returns a deocoder to decode the return value.

template: () => TemplateOrInterface

Returns the template to which this choice belongs.