Daml.Finance.Interface.Lifecycle.Election¶
Interfaces¶
interface Election
Interface implemented by templates that represents a claim-based election. This interface requires the
Event
interface implementation.viewtype V
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.
Controller: (DA.Internal.Record.getField @"provider" (view this))
Returns: (Optional InstrumentKey, [ContractId I])
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
Controller: Signatories of implementing template
Returns: ()
(no fields)
Choice GetView
Retrieves the interface view.
Controller: viewer
Returns: 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.
interface Exercisable
Interface implemented by instruments that admit (claim-based) elections.
viewtype ExercisableView
Choice ApplyElection
Applies an election to the instrument.
Controller: (DA.Internal.Record.getField @"lifecycler" (view this))
Returns: (Optional InstrumentKey, [ContractId I])
Field Type Description electionCid ContractId Election The election. observableCids [ContractId I] Set of observables. Choice Archive
Controller: Signatories of implementing template
Returns: ()
(no fields)
Choice Exercisable_GetView
Retrieves the interface view.
Controller: viewer
Returns: ExercisableView
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¶
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))
instance HasMethod Factory "create’" (Create -> Update (ContractId I))
- 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 Text The tag corresponding to 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])