.. _module-utility-credential-app-v0-types-81951: Utility.Credential.App.V0.Types =============================== Data Types ---------- .. _type-utility-credential-app-v0-types-balancestate-38086: **data** `BalanceState `_ The state of the balances on the credential\. All accounting is done in CC\. .. _constr-utility-credential-app-v0-types-balancestate-26995: `BalanceState `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - currentDepositAmountCc - `Decimal `_ - Current amount of locked CC held as part of the credential\. * - totalCredentialFeesPaidCc - `Decimal `_ - Total credential fees charged on this credential and paid to the issuer\. * - totalDistributedCc - `Decimal `_ - Total distribution to the user (includes deposit top ups)\. * - totalPaidOutCc - `Decimal `_ - Total distribution paid out to the user\. * - totalUserDepositCc - `Decimal `_ - Total amount deposited by the user\. .. _type-utility-credential-app-v0-types-billingcontext-813: **data** `BillingContext `_ Context retrieved from the ledger to be used for executing a billing cycle\. .. _constr-utility-credential-app-v0-types-billingcontext-5768: `BillingContext `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - now - `Time `_ - Time as of which the billing cycle is executed\. * - amuletRulesCid - `ContractId `_ `AmuletRules `_ - The contract\-id of the amulet rules to use for billing\. * - 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\. * - feeComputationContext - `TransferContext `_ - Context to use when computing fees\. .. _type-utility-credential-app-v0-types-billingcycleparams-96836: **data** `BillingCycleParams `_ Parameters that determine the execution of a specific billing cycle\. .. _constr-utility-credential-app-v0-types-billingcycleparams-27661: `BillingCycleParams `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - amuletPrice - `Decimal `_ - Price of the CC in USD at the time of the billing cycle\. * - credentialFeeCc - `Decimal `_ - Amount of CC to be charged as the credential fee\. * - newBilledUntil - `Time `_ - The time until which the credential will be paid for\. * - depositExpiresAt - `Time `_ - Time when the lock on the deposit expires\. .. _type-utility-credential-app-v0-types-billingparams-7107: **data** `BillingParams `_ Configuration for the credential billing\. .. _constr-utility-credential-app-v0-types-billingparams-98000: `BillingParams `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - feePerDayUsd - `RatePerDay `_ - The daily fee for the credential in USD\. * - billingPeriodMinutes - `Int `_ - Duration between the times where the credential fee is charged on a pro\-rata basis (expressed in minutes)\. * - depositTargetAmountUsd - `Decimal `_ - 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\. .. _type-utility-credential-app-v0-types-billingstate-25045: **data** `BillingState `_ Information about the state of the billing process\. .. _constr-utility-credential-app-v0-types-billingstate-25540: `BillingState `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - createdAt - `Time `_ - When this credential was created\. * - status - `BillingStatus `_ - The current status of the billing operation\. * - lastBilledAt - `Time `_ - Ledger time when this credential was last billed\. This is mostly used for reference, not for the calculation of the actual billing amount\. * - billedUntil - `Time `_ - 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 - `Round `_ - The CC round that was used for the last billing\. * - totalCcFeesPaidIssuerCc - `Decimal `_ - Total amount of CC holding and transfer fees paid by the issuer for this credential\. * - totalCcFeesPaidHolderCc - `Decimal `_ - Total amount of CC holding and transfer fees paid by the holder for this credential\. .. _type-utility-credential-app-v0-types-billingstatus-10111: **data** `BillingStatus `_ The status of a billing operation\. .. _constr-utility-credential-app-v0-types-success-59752: `Success `_ The billing operation was successful\. .. _constr-utility-credential-app-v0-types-failure-68987: `Failure `_ The billing operation failed\. .. list-table:: :widths: 15 10 30 :header-rows: 1 * - 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\. .. _type-utility-credential-app-v0-types-rateperday-94364: **data** `RatePerDay `_ A rate per day\. .. _constr-utility-credential-app-v0-types-rateperday-64677: `RatePerDay `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - rate - `Decimal `_ - The daily rate\. Functions --------- .. _function-utility-credential-app-v0-types-validatebillingparams-76269: `validateBillingParams `_ \: `BillingParams `_ \-\> `Bool `_ Validate the billing parameters\.