Daml.Finance.Interface.Holding.Factory

Interfaces

interface Factory

Holding factory contract used to create (credit) holdings.

viewtype V

  • Choice Archive

    Controller: Signatories of implementing template

    Returns: ()

    (no fields)

  • Choice Create

    Create a holding on the instrument in the corresponding account.

    Controller: (DA.Internal.Record.getField @"custodian" account), (DA.Internal.Record.getField @"owner" account)

    Returns: ContractId I

    Field Type Description
    instrument InstrumentKey The instrument of which units are held.
    account AccountKey The account at which the holding is held. Defines the holding’s owner and custodian.
    amount Decimal Number of units.
    observers PartiesMap Observers of the holding to be credited.
  • Choice GetView

    Retrieves the interface view.

    Controller: viewer

    Returns: View

    Field Type Description
    viewer Party The party fetching the view.
  • Choice Remove

    Archive the factory.

    Controller: signatory this

    Returns: ()

    (no fields)

  • Method create’ : Create -> Update (ContractId I)

    Implementation of Create choice.

  • Method getKey : HoldingFactoryKey

    Get the unique key of the HoldingFactory.

Data Types

type F
= Factory
type I

= Factory

Type synonyms for Factory.

type R

= Reference

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

type V

= View

Type synonym for View.

instance HasFromAnyView Factory V

data View

View

Field Type Description
provider Party The provider of the Factory.
id Id Identifier for the holding factory.

instance HasInterfaceKey Factory View HoldingFactoryKey Reference GetCid SetCid SetObservers GetView

instance Eq View

instance Show View

Functions

toKey

: View -> HoldingFactoryKey

Convert the account’s ‘View’ to its key.

holdingFactoryKey

: HasToInterface i Factory => i -> HoldingFactoryKey

Retrieves the key of a Factory.

getKey
: Factory -> HoldingFactoryKey
create’
: Factory -> Create -> Update (ContractId I)
createFactory

: (HasCreate f, HasToInterface f Factory) => f -> Update (ContractId Factory)

Create factory including reference.

disclose

: (Text, Parties) -> Party -> Parties -> HoldingFactoryKey -> Update (ContractId Factory)

Disclose factory.

undisclose

: (Text, Parties) -> Party -> Parties -> HoldingFactoryKey -> Update (Optional (ContractId Factory))

Undisclose factory.

exerciseInterfaceByKey

: (HasInterfaceTypeRep i, HasExercise i c r) => HoldingFactoryKey -> Party -> c -> Update r

Exercise interface by key. This method can be used to exercise a choice on a Factory given its HoldingFactoryKey. Requires as input the HoldingFactoryKey, the actor exercising the choice, and the choice arguments. For example:

exerciseInterfaceByKey @HoldingFactory.I holdingFactoryKey actor
  HoldingFactory.Create with instrument; account; amount; observers