Module 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.
Choice Archive
(no fields)
Choice Credit
Creates a new
Holdingin the correspondingAccount.
Field Type Description quantity Quantity InstrumentKey Decimal The target Instrumentand corresponding amount.Choice Debit
Removes an existing
Holding.
Field Type Description holdingCid ContractId I The Holding’s contract id.Choice GetView
Retrieves the interface view.
Field Type Description viewer Party The party fetching the view. Method asDisclosure : I
Conversion to
Disclosureinterface.Method credit : Credit -> Update (ContractId I)
Implementation of the
Creditchoice.Method debit : Debit -> Update ()
Implementation of the
Debitchoice.Method getKey : AccountKey
Get the unique key of the
Account.
Typeclasses¶
class Implementation t => HasImplementation t where
Data Types¶
data Controllers
Controllers of the account (related to transfers).
instance Eq Controllers
instance Show Controllers
- type I
= Account
Type synonym for
Account.instance HasMethod Factory "create’" (Create -> Update (ContractId I))
- type Implementation t
= (HasToInterface t I, Implementation t)
Type constraint for requiring templates to implement
Accountalong withDisclosure.
- 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.
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.
Functions¶
- toKey
: View -> AccountKey
Convert the account’s ‘View’ to its key.
- asDisclosure
- : Account -> I
- getKey
- : Account -> AccountKey
- credit
- : Account -> Credit -> Update (ContractId I)
- 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
Accountgiven itsAccountKey. Requires as input theAccountKey, 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.