Module Daml.Finance.Interface.Holding.Base

Interfaces

interface Base

Base interface for a holding.

  • Choice Acquire

    Lock a contract.

    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

    (no fields)

  • Choice GetView

    Retrieves the interface view.

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

    Unlock a locked contract.

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

    Implementation of the Acquire choice.

  • Method asDisclosure : I

    Conversion to Disclosure interface.

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

    Implementation of the Release choice.

Typeclasses

class Implementation t => HasImplementation t where

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 Transferable "asBase" 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)))

type Implementation t

= (HasToInterface t I, Implementation t)

Type constraint for requiring templates to implement Holding along with Disclosure.

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

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

: HasToInterface t Base => t -> Parties

Get the lockers of a holding.