Utility.Credential.App.V0.Types
Data Types
data BalanceState
The state of the balances on the credential. All accounting is done in CC.
Field
Type
Description
currentDepositAmountCc
Current amount of locked CC held as part of the credential.
totalCredentialFeesPaidCc
Total credential fees charged on this credential and paid to the issuer.
totalDistributedCc
Total distribution to the user (includes deposit top ups).
totalPaidOutCc
Total distribution paid out to the user.
totalUserDepositCc
Total amount deposited by the user.
data BillingContext
Context retrieved from the ledger to be used for executing a billing cycle.
Field
Type
Description
now
Time as of which the billing cycle is executed.
amuletRulesCid
The contract-id of the amulet rules to use for billing.
openRoundCid
The contract-id of the open round to user for billing.
openRound
The data of the open round used for billing. Mostly used to fetch the coin price.
featuredTransferContext
Transfer context to use for making a CC transfer as a featured app.
unfeaturedTransferContext
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.
feeComputationContext
Context to use when computing fees.
data BillingCycleParams
Parameters that determine the execution of a specific billing cycle.
Field
Type
Description
amuletPrice
Price of the CC in USD at the time of the billing cycle.
credentialFeeCc
Amount of CC to be charged as the credential fee.
newBilledUntil
The time until which the credential will be paid for.
depositExpiresAt
Time when the lock on the deposit expires.
data BillingParams
Configuration for the credential billing.
Field
Type
Description
feePerDayUsd
The daily fee for the credential in USD.
billingPeriodMinutes
Duration between the times where the credential fee is charged on a pro-rata basis (expressed in minutes).
depositTargetAmountUsd
Target deposit amount (in USD). This is used when the user tops up their deposit, and when the issuer distributes coin and adjusts the holder’s deposit.
data BillingState
Information about the state of the billing process.
Field
Type
Description
createdAt
When this credential was created.
status
The current status of the billing operation.
lastBilledAt
Ledger time when this credential was last billed. This is mostly used for reference, not for the calculation of the actual billing amount.
billedUntil
The time until which the credential is paid for. A credential is billed in integer multiples of the billing period, i.e.,
billedUntil = createdAt + N x billingPeriod
.lastBilledInRound
The CC round that was used for the last billing.
totalCcFeesPaidIssuerCc
Total amount of CC holding and transfer fees paid by the issuer for this credential.
totalCcFeesPaidHolderCc
Total amount of CC holding and transfer fees paid by the holder for this credential.
data BillingStatus
The status of a billing operation.
The billing operation was successful.
data RatePerDay
Functions
- validateBillingParams
: BillingParams -> Bool
Validate the billing parameters.