Daml.Finance.Interface.Lifecycle.Effect¶
Interfaces¶
interface Effect
Interface for contracts exposing effects of lifecycling processes.
viewtype V
Choice Archive
Controller: Signatories of implementing template
Returns: ()
(no fields)
Choice Calculate
Given a holding, it calculates the instrument quantities to settle.
Controller: actor
Returns: CalculationResult
Field Type Description actor Party The party calculating the quantities to settle. holdingCid ContractId I The holding being targeted. Choice GetView
Retrieves the interface view.
Controller: viewer
Returns: View
Field Type Description viewer Party The party retrieving the view. Choice SetProviders
Set the provider of the effect. The provider has visibility on all sub-transactions triggered by
Claim
\ing an effect.Controller: (DA.Internal.Record.getField @"providers" (view this)), newProviders
Returns: ContractId Effect
Field Type Description newProviders Parties The new provider. Method calculate : Calculate -> ContractId Effect -> Update CalculationResult
Implementation of the
Calculate
choice.Method setProviders : SetProviders -> Update (ContractId Effect)
Implementation of the
SetProviders
choice.
Data Types¶
data CalculationResult
Data type encapsulating the effect’s calculation result.
Field Type Description consumed [InstrumentQuantity] Consumed quantities. produced [InstrumentQuantity] Produced quantities. instance Eq CalculationResult
instance Show CalculationResult
instance HasMethod Effect "calculate" (Calculate -> ContractId Effect -> Update CalculationResult)
- type I
= Effect
Type synonym for
Effect
.instance HasMethod Election "apply" (ContractId Election -> Apply -> Update (Optional InstrumentKey, [ContractId I]))
instance HasMethod Exercisable "applyElection" (ApplyElection -> Update (Optional InstrumentKey, [ContractId I]))
instance HasMethod Lifecycle "evolve" (Evolve -> Update (Optional InstrumentKey, [ContractId I]))
- type V
= View
Type synonym for
View
.instance HasFromAnyView Effect V
data View
View for
Effect
.
Field Type Description providers Parties The parties providing the claim processing. targetInstrument InstrumentKey The target instrument. A holding on this instrument is required to claim the effect. For example, in the case of a swap instrument, this would be the original instrument version before lifecycling, that contains the current swap payment. producedInstrument Optional InstrumentKey The produced instrument, if it exists. For example, in the case of a swap instrument, this would be the new instrument version after lifecycling, that does not contain the current swap payment. If there are no more claims remaining after the current lifecycling, this would be None. id Id A textual identifier. description Text A human readable description of the Effect. settlementTime Optional Time The effect’s settlement time (if any). otherConsumed [InstrumentQuantity] Consumed quantities (in addition to the target instrument). For example, in the case of a fix vs floating rate swap, this could be a 2.5% fix payment. otherProduced [InstrumentQuantity] Produced quantities (in additon to the produced instrument). For example, in the case of a fix vs floating rate swap, this could be a 3M Euribor floating payment.
Functions¶
- setProviders
- : Effect -> SetProviders -> Update (ContractId Effect)
- calculate
- : Effect -> Calculate -> ContractId Effect -> Update CalculationResult