Daml.Finance.Interface.Holding.Base

Interfaces

interface Base

Base interface for a holding.

viewtype V

  • Choice Acquire

    Lock a contract.

    Controller: (DA.Internal.Record.getField @"owner" (DA.Internal.Record.getField @"account" (view this))), newLockers

    Returns: ContractId Base

    Field Type Description
    newLockers Parties Parties which restrain the contract’s ability to perform specified actions.
    context Text Reason for acquiring a lock.
    lockType LockType Type of lock to acquire
  • Choice Archive

    Controller: Signatories of implementing template

    Returns: ()

    (no fields)

  • Choice GetView

    Retrieves the interface view.

    Controller: viewer

    Returns: V

    Field Type Description
    viewer Party The party retrieving the view.
  • Choice Release

    Unlock a locked contract.

    Controller: getLockers this

    Returns: ContractId Base

    Field Type Description
    context Text  
  • Method acquire : Acquire -> Update (ContractId Base)

    Implementation of the Acquire choice.

  • Method release : Release -> Update (ContractId Base)

    Implementation of the Release choice.

Data Types

type I

= Base

Type synonym for Base.

instance HasMethod Account "credit" (Credit -> Update (ContractId I))

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

instance HasMethod Batch "cancel" (Cancel -> Update [ContractId I])

instance HasMethod Batch "settle" (Settle -> Update [ContractId I])

instance HasMethod Instruction "allocate" (Allocate -> Update (ContractId Instruction, Optional (ContractId I)))

instance HasMethod Instruction "cancel" (Cancel -> Update (Optional (ContractId I)))

instance HasMethod Instruction "execute" (Execute -> Update (Optional (ContractId I)))

data Lock

Locking details.

Lock

Field Type Description
lockers Parties Parties which are locking the contract.
context Set Text Why this lock is held by the locking parties.
lockType LockType The type of lock applied.

instance Eq Lock

instance Show Lock

data LockType

Type of lock held.

Semaphore

A one time only lock.

Reentrant

A mutual exclusion lock where the same lockers may lock a contract multiple times.

instance Eq LockType

instance Show LockType

type V

= View

Type synonym for View.

instance HasFromAnyView Base V

data View

View for Base.

View

Field Type Description
instrument InstrumentKey Instrument being held.
account AccountKey Key of the account holding the assets.
amount Decimal Size of the holding.
lock Optional Lock When a contract is locked, contains the locking details.

instance Eq View

instance Show View

Functions

acquire
: Base -> Acquire -> Update (ContractId Base)
release
: Base -> Release -> Update (ContractId Base)
getLockers

: HasToInterface t Base => t -> Parties

Get the lockers of a holding.