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.
Typeclasses¶
class Implementation t => HasImplementation t where
class ExercisableImplementation t => ExercisableHasImplementation t where
instance ExercisableHasImplementation Exercisable
Data Types¶
- type ExercisableImplementation t
= HasToInterface t Exercisable
Type constraint for requiring templates to implement
Exercisable
.
data ExercisableView
View for
Exercisable
.
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 withEvent
.
- type V
= View
Type synonym for
View
.instance HasFromAnyView Election V
data View
View for
Election
.
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 theHolding
.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.
Functions¶
- apply
- : Election -> ContractId Election -> Apply -> Update (Optional InstrumentKey, [ContractId I])
- getElectionTime
-
Retrieves the election’s time.
- applyElection
- : Exercisable -> ApplyElection -> Update (Optional InstrumentKey, [ContractId I])