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 correspondingAccount
.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. Choice Remove
Archive the account.
Controller: signatory this
Returns: ()
(no fields)
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).
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
.
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. controllers Controllers Parties controlling transfers. instance HasInterfaceKey Account View AccountKey Reference GetCid SetCid SetObservers GetView
Functions¶
- toKey
: View -> AccountKey
Convert the account’s ‘View’ to its key.
- accountKey
: HasToInterface i Account => i -> AccountKey
Retrieves the key of an
Account
.
- getKey
- : Account -> AccountKey
- disclose
: (Text, Parties) -> Party -> Parties -> AccountKey -> Update (ContractId Account)
Disclose account.
- undisclose
: (Text, Parties) -> Party -> Parties -> AccountKey -> Update (Optional (ContractId Account))
Undisclose account.
- exerciseInterfaceByKey
: (HasInterfaceTypeRep i, HasExercise i c r) => AccountKey -> Party -> c -> Update r
Exercise interface by key. This method can be used to exercise a choice on an
Account
given itsAccountKey
. Requires as input theAccountKey
, For example:exerciseInterfaceByKey @Account.I accountKey actor Account.Debit with holdingCid