Daml.Finance.Interface.Account.Account

We recommend to import this module qualified.

Interfaces

interface Account

An interface which represents an established relationship between a provider and an owner.

viewtype V

  • Choice Archive

    Controller: Signatories of implementing template

    Returns: ()

    (no fields)

  • Choice Credit

    Creates a new Holding in the corresponding Account.

    Controller: (DA.Internal.Record.getField @"custodian" (view this)), (DA.Internal.Record.getField @"incoming" (DA.Internal.Record.getField @"controllers" (view this)))

    Returns: ContractId I

    Field Type Description
    quantity Quantity InstrumentKey Decimal The target Instrument and corresponding amount.
  • Choice Debit

    Removes an existing Holding.

    Controller: (DA.Internal.Record.getField @"custodian" (view this)), (DA.Internal.Record.getField @"outgoing" (DA.Internal.Record.getField @"controllers" (view this)))

    Returns: ()

    Field Type Description
    holdingCid ContractId I The Holding’s contract id.
  • Choice GetView

    Retrieves the interface view.

    Controller: viewer

    Returns: View

    Field Type Description
    viewer Party The party fetching the view.
  • Method credit : Credit -> Update (ContractId I)

    Implementation of the Credit choice.

  • Method debit : Debit -> Update ()

    Implementation of the Debit choice.

  • Method getKey : AccountKey

    Get the unique key of the Account.

Data Types

data Controllers

Controllers of the account (related to transfers).

Controllers

Field Type Description
outgoing Parties Parties instructing a transfer (outgoing).
incoming Parties Parties approving a transfer (incoming).

instance Eq Controllers

instance Show Controllers

type I

= Account

Type synonym for Account.

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

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 Account V

data View

View for Account.

View

Field Type Description
custodian Party Party providing accounting services.
owner Party Party owning this account.
id Id Identifier for the account.
description Text Human readable description of the account.
holdingFactoryCid ContractId F Associated holding factory.
controllers Controllers Parties controlling transfers.

instance Eq View

instance Show View

Functions

toKey

: View -> AccountKey

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

getKey
: Account -> AccountKey
credit
: Account -> Credit -> Update (ContractId I)
debit
: Account -> Debit -> Update ()
exerciseInterfaceByKey

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

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

exerciseInterfaceByKey @Account.I accountKey actor Account.Debit with holdingCid
disclose

: (Text, Parties) -> Party -> Parties -> AccountKey -> Update (ContractId I)

Disclose account.

undisclose

: (Text, Parties) -> Party -> Parties -> AccountKey -> Update (Optional (ContractId I))

Undisclose account.