Module Daml.Finance.Interface.Instrument.Generic.Election

Interfaces

interface Election

Interface implemented by templates that represents a claim-based election. This interface requires the Event interface implementation.

  • Choice Apply

    Applies the election to the instrument, returning the new instrument as well as the corresponding effects. The election is archived as part of this choice.

    Field Type Description
    observableCids [ContractId I] Set of observables.
    exercisableCid ContractId Exercisable The contract that is used to apply an election to the instrument.
  • Choice Archive

    (no fields)

  • Choice GetView

    Retrieves the interface view.

    Field Type Description
    viewer Party The party retrieving the view.
  • Method apply : ContractId Election -> Apply -> Update (Optional InstrumentKey, [ContractId I])

    Implementation of the Apply choice.

  • Method asEvent : I

    Conversion to Event interface.

interface Exercisable

Interface implemented by instruments that admit (claim-based) elections.

  • Choice ApplyElection

    Applies an election to the instrument.

    Field Type Description
    electionCid ContractId Election The election.
    observableCids [ContractId I] Set of observables.
  • Choice Archive

    (no fields)

  • Choice Exercisable_GetView

    Retrieves the interface view.

    Field Type Description
    viewer Party The party retrieving the view.
  • Method applyElection : ApplyElection -> Update (Optional InstrumentKey, [ContractId I])

    Implementation of the ApplyElection choice.

Data Types

type ExercisableImplementation t

= HasToInterface t Exercisable

Type constraint for requiring templates to implement Exercisable.

data ExercisableView

View for Exercisable.

ExercisableView

Field Type Description
lifecycler Party Party processing the election.

instance Eq ExercisableView

instance Show ExercisableView

instance HasFromAnyView Exercisable ExercisableView

type I

= Election

Type synonym for Election.

instance HasMethod Factory "create’" (Create -> Update (ContractId I))

type Implementation t

= (HasToInterface t I, Implementation t)

Type constraint for requiring templates to implement Exercisable along with Event.

type V

= View

Type synonym for View.

instance HasFromAnyView Election V

data View

View for Election.

View

Field Type Description
id Id The identifier for an election.
description Text A description of the instrument.
claim C The claim representation of the election (i.e., the elected sub-tree).
elector Party Parties on behalf of which the election is made.
counterparty Party Faces the elector in the Holding.
electorIsOwner Bool True if election is on behalf of the owner of the holding, False otherwise.
observers PartiesMap Observers of the election.
amount Decimal Number of instrument units to which the election applies.
provider Party Party that is authorized to process the election and generate the new instrument version and effects.
instrument InstrumentKey The instrument to which the election applies.

instance Eq View

instance Show View

Functions

asEvent
: Election -> I
apply
: Election -> ContractId Election -> Apply -> Update (Optional InstrumentKey, [ContractId I])
getElectionTime

: Election -> Time

Retrieves the election’s time.

applyElection
: Exercisable -> ApplyElection -> Update (Optional InstrumentKey, [ContractId I])