Module Daml.Finance.Interface.Instrument.Base.Instrument

Interfaces

interface Instrument

Base interface for all instruments. This interface does not define any lifecycling logic.

  • Choice Archive

    (no fields)

  • Choice GetView

    Retrieves the interface view.

    Field Type Description
    viewer Party The party retrieving the view.
  • Method asDisclosure : I

    Conversion to Disclosure interface.

  • Method getKey : InstrumentKey

    Get the unique key for the Instrument.

Typeclasses

class Implementation t => HasImplementation t where

Data Types

type I

= Instrument

Type synonym for Instrument.

instance HasMethod Claim "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

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

instance HasMethod Instrument "asBaseInstrument" I

instance HasExerciseByKey Reference K GetCid (ContractId I)

type Implementation t

= (HasToInterface t I, Implementation t)

Type constraint for requiring templates to implement Instrument along with Disclosure.

type K

= InstrumentKey

Type synonym for InstrumentKey.

instance HasExerciseByKey Reference K GetCid (ContractId I)

instance HasExerciseByKey Reference K SetCid (ContractId R)

instance HasExerciseByKey Reference K SetObservers (ContractId R)

instance HasExerciseByKey Reference K Archive ()

instance HasFetchByKey Reference K

instance HasFromAnyContractKey Reference K

instance HasKey Reference K

instance HasLookupByKey Reference K

instance HasMaintainer Reference K

instance HasToAnyContractKey Reference K

type Q

= Quantity InstrumentKey Decimal

Instrument quantity.

type R

= Reference

Type synonym for Reference. This type is currently used as a work-around given the lack of interface keys.

instance HasExerciseByKey Reference K SetCid (ContractId R)

instance HasExerciseByKey Reference K SetObservers (ContractId R)

type V

= View

Type synonym for View.

instance HasFromAnyView Instrument V

data View

View for Instrument.

View

Field Type Description
issuer Party The instrument’s issuer.
depository Party The instrument’s depository.
id Id A versioned instrument identifier.
version Text A textual instrument version.
description Text A human readable description of the instrument.
validAsOf Time Timestamp as of which the instrument is valid. This usually coincides with the timestamp of the event that creates the instrument. It usually does not coincide with ledger time.

instance Eq View

instance Show View

Functions

asDisclosure
: Instrument -> I
getKey
: Instrument -> InstrumentKey
exerciseInterfaceByKey

: (HasInterfaceTypeRep i, HasExercise i d r) => K -> Party -> d -> Update r

Exercise interface by key. This method can be used to exercise a choice on an Instrument given its InstrumentKey. Requires as input the InstrumentKey, the actor fetching the instrument and the choice arguments. For example:

toKey

: V -> K

Convert the instrument’s View to its key.

fetchInstrument

: HasToInterface t I => t -> Update I

Fetch instrument from holding.

qty

: Decimal -> K -> Q

Wraps an amount and an instrument key into an instrument quantity.

scale

: Decimal -> Q -> Q

Scale Quantity by the provided factor.