Module Daml.Finance.Interface.Lifecycle.Effect


interface Effect

Interface for contracts exposing effects of lifecycling processes.

  • Choice Archive

    (no fields)

  • Choice Calculate

    Given a holding, it calculates the instrument quantities to settle.

    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.

    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.

    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.


class Implementation t => HasImplementation t where

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 Implementation t

= HasToInterface t I

Type constraint for requiring templates to implement Effect.

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 A holding on this instrument is required to claim the effect.
producedInstrument Optional InstrumentKey The new version of the target instrument, when it exists.
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).
otherProduced [InstrumentQuantity] Produced quantities (in addition to the produced instrument).

instance Eq View

instance Show View


: Effect -> SetProviders -> Update (ContractId Effect)
: Effect -> Calculate -> ContractId Effect -> Update CalculationResult