Utility.Commercials.V0.Model.Types

Types used for the commercial agreement.

Data Types

data BillingContext

Context retrieved from the ledger to be used for executing a billing cycle.

BillingContext

Field

Type

Description

openRoundCid

ContractId OpenMiningRound

The contract-id of the open round to user for billing.

openRound

OpenMiningRound

The data of the open round used for billing. Mostly used to fetch the coin price.

featuredTransferContext

AppTransferContext

Transfer context to use for making a CC transfer as a featured app.

unfeaturedTransferContext

AppTransferContext

Transfer context to use for making a CC transfer as an unfeatured app. Used for CC transfers not considered to be eligible as featured transfers by the SVs.

data BillingCycleParams

Parameters that determine the execution of a specific billing cycle.

BillingCycleParams

Field

Type

Description

amuletPrice

Decimal

Price of the CC in USD at the time of the billing cycle.

feeAmountCc

Decimal

Amount of CC to be charged as the fee.

newBilledUntil

Time

The time until which the fee will be paid for.

depositExpiresAt

Time

Time when the lock on the deposit expires.

data BillingState

Information about the state of the billing process for a fee that is billed over adjacent time periods (from a given point in time until a later point in time, repeatedly).

BillingState

Field

Type

Description

status

BillingStatus

The current status of the billing operation.

lastBilledAt

Time

Ledger time when this fee was last billed.

billedUntil

Time

The time until which the fee is paid for. The fee is billed in integer multiples of the billing period, i.e., billedUntil = lastBilledAt + N x billingPeriod.

data BillingStatus

The status of a billing operation.

Success

The billing operation was successful.

Failure

The billing operation failed.

Field

Type

Description

reason

Text

The reason for the failure, expected to be communicated to involved parties in the billing operation.

context

Text

Additional information on why the billing failed.

New

No billing operation has been performed yet because this is a new contract.

data EventBillingState

Information about the state of the billing process for a specific event (e.g. a collateral transaction).

EventBillingState

Field

Type

Description

status

BillingStatus

The current status of the billing operation.

lastBilledAt

Time

Ledger time when this fee was last billed. This is mostly used for reference, not for the calculation of the actual billing amount.

lastBilledOffset

Int

Ledger offset when this fee was last billed. This is mostly used for reference, not for the calculation of the actual billing amount.

data FixedFee

Configuration of a fixed fee, billed at a regular interval.

FixedFee

Field

Type

Description

feePerDayUsd

RatePerDay

The daily fee in USD.

billingPeriodMinutes

Int

Duration between the times where the fee is charged on a pro-rata basis (expressed in minutes).

data RatePerDay

A rate per day.

RatePerDay

Field

Type

Description

rate

Decimal

The daily rate.

data UtilityFees

The fees that the user will pay for using the Utility services. The fees are denominated in USD but will be charged in CC at the official FX rate of the Canton Network.

UtilityFees

Field

Type

Description

credentialBillingFeeUsd

Optional Decimal

The fee that the user will pay for each credential billing that the operator performs on the user’s behalf.

baseFee

Optional FixedFee

The base fee that the user will pay to use the Utility. This field is available starting from version 0.1.0 of this package.