Utility.Registry.Holding.V0.Holding

Templates

template Holding

Implementation of a transferable and fungible holding.

Signatory: registrar, owner, getLockers this

Field

Type

Description

operator

Party

Operator of the holding.

provider

Party

Provider of the holding.

registrar

Party

Registrar of the holding.

owner

Party

Owner of the holding.

instrument

InstrumentIdentifier

Instrument of the holding.

label

Text

Label of the holding.

amount

Decimal

Number of units of the holding.

lock

Optional Lock

Optional lock for the holding.

  • Choice Archive

    Controller: registrar, owner, getLockers this

    Returns: ()

    (no fields)

  • Choice Holding_Lock

    Locks this holding, restricting further actions.

    Controller: registrar, owner, lockers

    Returns: Holding_Lock_Result

    Field

    Type

    Description

    lockers

    Parties

    Parties that restrict actions.

    context

    Text

    Context for the lock.

  • Choice Holding_Merge

    Merges this holding with multiple other holdings into a single consolidated holding.

    Controller: registrar

    Returns: Holding_Merge_Result

    Field

    Type

    Description

    holdingCids

    [ContractId Holding]

    The holdings to merge.

  • Choice Holding_Split

    Splits this holding into smaller holdings based on specified amounts.

    Controller: registrar

    Returns: Holding_Split_Result

    Field

    Type

    Description

    amounts

    [Decimal]

    The quantities to split the holding by.

  • Choice Holding_Transfer

    Transfers ownership of the this holding to a new owner within the same registrar.

    Controller: registrar, owner, newOwner

    Returns: Holding_Transfer_Result

    Field

    Type

    Description

    newOwner

    Party

    The new owner.

    newLabel

    Text

    The new label for the holding.

  • Choice Holding_Unlock

    Unlocks this holding.

    Controller: getLockers this

    Returns: Holding_Unlock_Result

    (no fields)

Data Types

data Holding_Lock_Result

Result of Holding_Lock.

Holding_Lock_Result

Field

Type

Description

holdingCid

ContractId Holding

Locked holding.

data Holding_Merge_Result

Result of a call to Holding_Merge.

Holding_Merge_Result

Field

Type

Description

holdingCid

ContractId Holding

The merged holding.

data Holding_Split_Result

Result of a call to Holding_Split.

Holding_Split_Result

Field

Type

Description

splitCids

[ContractId Holding]

The split holdings.

remaining

Optional (ContractId Holding)

The remaining holding (if any).

data Holding_Transfer_Result

Result of Holding_Transfer.

Holding_Transfer_Result

Field

Type

Description

holdingCid

ContractId Holding

Transferred holding.

data Holding_Unlock_Result

Result of Holding_Unlock.

Holding_Unlock_Result

Field

Type

Description

holdingCid

ContractId Holding

Unlocked holding.

data Lock

Locking details, representing parties that lock the contract and the context of the lock.

Lock

Field

Type

Description

lockers

Parties

Parties locking the contract.

context

Text

Reason for the lock held by the locking parties.

Functions

isValidLock

: Optional Lock -> Bool

Validates a lock.

getLockers

: Holding -> Parties

Retrieves the lockers of a holding.

mustBeUnlocked

: CanAssert m => Holding -> m ()

Asserts that the holding is unlocked.

mustBeLocked

: CanAssert m => Holding -> m ()

Asserts that the holding is locked.

assertHolding

: CanAssert m => Holding -> Party -> Party -> Party -> Party -> InstrumentIdentifier -> Decimal -> Text -> Optional Lock -> m ()

Asserts that the holding matches the provided expected values.