Utility.Commercials.V0.Model.CommercialAgreement

Templates used for payment of fees for using the Utility.

Templates

template CommercialAgreement

A commercial agreement that describes the fees that the user will pay for using the Utility.

Signatory: operator, user

Field

Type

Description

operator

Party

App operator.

user

Party

App user.

feeReceiver

Party

The party that will receive the fee for using the Utility services.

lockedAmuletCids

[ContractId LockedAmulet]

Coins locked to the operator which are used to pay fees.

currentLockedAmuletAmountCc

Decimal

Current amount of locked CC held as part of the commercial agreement.

utilityFees

UtilityFees

The fee that the user will pay for using the Utility services.

dso

Party

Reference to the DSO party (Decentralized Synchronizer Operations).

Data Types

data CommercialAgreement_Bill_Result

Result of CommercialAgreement_Bill.

CommercialAgreement_Bill_Result

Field

Type

Description

commercialAgreementCid

ContractId CommercialAgreement

The updated commercial agreeement after billing.

data CommercialAgreement_LockCoin_Result

Result of CommercialAgreement_LockCoin_Result.

CommercialAgreement_LockCoin_Result

Field

Type

Description

commercialAgreementCid

ContractId CommercialAgreement

The updated commercial agreeement after locking coin.

data CommercialAgreement_Modify_Result

Result of CommercialAgreement_Modify.

CommercialAgreement_Modify_Result

Field

Type

Description

commercialAgreementCid

ContractId CommercialAgreement

The modified commercial agreeement.

data CommercialAgreement_Revoke_Result

Result of CommercialAgreement_Revoke.

CommercialAgreement_Revoke_Result

Field

Type

Description

unlockedDeposit

[ContractId Amulet]

The unlocked deposit.

Functions

unlockCoins

: AppTransferContext -> ContractId LockedAmulet -> Update (ContractId Amulet)

Unlock an existing deposit and return the unlocked coins.

unlockDeposit

: AppTransferContext -> ContractId LockedAmulet -> Update TransferInput

Unlock an existing deposit and return the coin as InputAmulet for a transfer.

minutesToRelTime

: Int -> RelTime

Convert a number of minutes to a RelTime.

verifyAmulet

: Party -> ContractId Amulet -> Update Decimal

Verify the DSO party of a given Amulet and return the amount.

verifyAmulets

: Party -> [ContractId Amulet] -> Update Decimal

Verify a list of Amulets and return the total amount.

fetchAndValidateBillingContext

: Party -> Party -> AppTransferContext -> Update BillingContext

Fetch the billing context components from the ledger and validate them.