- Overview
- Setup
- Tutorials
- How Tos
- Reference
Utility.Credential.App.V0.Service.User¶
Templates¶
template UserService
Choice UserService\_AcceptFreeCredentialOffer
Accepts a credential offer (of a free credential) from an issuer.
Controller: user
Returns: CredentialOffer\_AcceptFree\_Result
Field
Type
Description
credentialOfferCid
The offer to accept.
Choice UserService\_AcceptPaidCredentialOffer
Accepts a credential offer (of a paid credential) from an issuer. Takes unlocked coins as input. Beware of contention. Retries may be required.
Controller: user
Returns: CredentialOffer\_AcceptPaid\_Result
Field
Type
Description
credentialOfferCid
The offer that the user accepts.
depositAmulets
Amulets to be locked as deposit.
appTransferContext
Canton Network transfer context required to perform locking.
Choice UserService\_AdjustBillingParams
Changes the parameters of a credential billing. This choice is disabled as of version
0.1.0of this package.Controller: user
Returns: CredentialBilling\_AdjustBillingParams\_Result
Field
Type
Description
credentialBillingCid
The credential billing that the user modifies.
billingParams
The new parameters of the credential billing.
Choice UserService\_BillingParamsAdjustmentRequest\_Accept
Accepts a billing parameters adjustment request.
Controller: user
Returns: BillingParamsAdjustmentRequest\_Accept\_Result
Field
Type
Description
requestCid
The billing adjustment request to accept. The
credentialIdmust match with one in the given credential billing.credentialBillingCid
The credential billing that the user modifies. The
credentialIdmust match with the one in the given adjustment request.
Choice UserService\_BillingParamsAdjustmentRequest\_Cancel
Cancels a billing parameters adjustment request.
Controller: user
Returns: BillingParamsAdjustmentRequest\_Cancel\_Result
Field
Type
Description
requestCid
The billing adjustment request to cancel.
Choice UserService\_CancelCredentialBilling
Cancels a credential billing.
Controller: user
Returns: CredentialBilling\_Cancel\_Result
Field
Type
Description
credentialBillingCid
The credential billing that the user cancels.
appTransferContext
Canton Network transfer context required to perform locking.
Choice UserService\_CancelCredentialOffer
Cancels a credential offer made to a holder.
Controller: user
Returns: CredentialOffer\_Cancel\_Result
Field
Type
Description
credentialOfferCid
The offer to cancel.
Choice UserService\_Distribute
Distributes coins to a credential holder. Takes unlocked coins as input. Beware of contention. Retries may be required.
Controller: user
Returns: CredentialBilling\_Distribute\_Result
Field
Type
Description
credentialBillingCid
Credential billing of the distribution recipient.
amountUsd
Amount to distribute (in USD).
coinCids
Coins to distribute.
appTransferContext
Coin transfer context.
Choice UserService\_DistributeAndAdjustDeposit
Distributes coins to and adjust / top up deposits for a credential holder. Takes unlocked coins as input. Beware of contention. Retries may be required.
Controller: user
Returns: CredentialBilling\_DistributeAndAdjustDeposit\_Result
Field
Type
Description
credentialBillingCid
Credential billing of the distribution recipient.
amountUsd
Amount to distribute (in USD).
coinCids
Coins to distribute.
appTransferContext
Coin transfer context.
Choice UserService\_DistributeAndAdjustDepositMulti
Distributes coins to and adjust / top up deposits for multiple credential holders. Takes unlocked coins as input. Beware of contention. Retries may be required.
Controller: user
Returns: UserService\_DistributeAndAdjustDepositMulti\_Result
Field
Type
Description
distributionSlices
{ref}
[DistributionSlice <type-utility-credential-app-v0-service-user-distributionslice-75622>]Distribution slices to distribute to.
amountUsd
Amount to distribute (in USD).
coinCids
Coins to distribute.
appTransferContext
Coin transfer context.
Choice UserService\_DistributeMulti
Distributes coins to multiple credential holders. Takes unlocked coins as input. Beware of contention. Retries may be required.
Controller: user
Returns: UserService\_DistributeMulti\_Result
Field
Type
Description
distributionSlices
{ref}
[DistributionSlice <type-utility-credential-app-v0-service-user-distributionslice-75622>]Distribution slices to distribute to.
amountUsd
Amount to distribute (in USD).
coinCids
Coins to distribute.
appTransferContext
Coin transfer context.
Choice UserService\_OfferFreeCredential
Offers a free credential.
Controller: user
Returns: UserService\_OfferFreeCredential\_Result
Field
Type
Description
holder
Holder of the credential.
id
Identifier of the credential.
description
Description of the credential.
claims
[Claim]
Claims contained in the credential.
Choice UserService\_OfferPaidCredential
Offers a paid credential.
Controller: user
Returns: UserService\_OfferPaidCredential\_Result
Field
Type
Description
holder
Holder of the credential.
id
Identifier of the credential.
description
Description of the credential.
claims
[Claim]
Claims contained in the credential.
billingParams
Billing parameters of the credential.
depositInitialAmountUsd
The amount of USD to be initially locked (as CC) as a deposit to cover fee payments.
Choice UserService\_RejectCredentialOffer
Rejects a credential offer from an issuer.
Controller: user
Returns: CredentialOffer\_Reject\_Result
Field
Type
Description
credentialOfferCid
The offer to reject.
reason
The reason for rejecting the offer.
Choice UserService\_RequestToAdjustBillingParams
Changes the parameters of a credential billing.
Controller: user
Returns: CredentialBilling\_RequestToAdjustBillingParams\_Result
Field
Type
Description
credentialBillingCid
The credential billing that the user modifies.
billingParams
The new parameters of the credential billing.
Choice UserService\_RevokeCredential
Revokes a (free or paid) credential.
Controller: user
Returns: Credential_Revoke_Result
Field
Type
Description
credentialCid
The credential that the user revokes.
Choice UserService\_RevokeCredentialAndCancelBilling
Revokes a paid credential and cancels the corresponding credential billing.
Controller: user
Returns: CredentialBilling\_Cancel\_Result
Field
Type
Description
credentialCid
The credential that the user revokes.
credentialBillingCid
The credential billing that the user cancels.
appTransferContext
Canton Network transfer context required to perform locking.
Choice UserService\_Terminate
Terminates the user service.
Controller: actor `oneOf` signatory this
Returns: UserService\_Terminate\_Result
Field
Type
Description
actor
Party initiating the termination of this agreement.
Choice UserService\_TopUp
Tops up a deposit for a paid credential. Takes unlocked coins as input. Beware of contention. Retries may be required.
Controller: user
Returns: CredentialBilling\_TopUp\_Result
Field
Type
Description
credentialBillingCid
Credential billing to top up.
amountUsd
Amount to top up (in USD).
coinCids
Coins to be locked as deposit for the top-up.
appTransferContext
Canton Network transfer context required to perform locking.
template UserServiceRequest
Choice UserServiceRequest\_Accept
Accepts a user service request.
Controller: operator
Returns: UserServiceRequest\_Accept\_Result
Field
Type
Description
dso
Reference to the DSO party (Decentralized Synchronizer Operations).
Choice UserServiceRequest\_Cancel
Cancels a user service request.
Controller: user
Returns: UserServiceRequest\_Cancel\_Result
(no fields)
Choice UserServiceRequest\_Reject
Rejects a user service request.
Controller: operator
Returns: UserServiceRequest\_Reject\_Result
(no fields)
Data Types¶
data DistributionSlice
Encapsulates the percentage of a distribution a particular holder (represented by a credential billing) will receive.
Field
Type
Description
credentialBillingCid
Credential billing of the recipient.
percentage
Percentage of the total distribution distributed to the recipient.
data UserServiceRequest\_Accept\_Result
Result of
UserServiceRequest_Accept.
UserServiceRequest\_Accept\_Result
Field
Type
Description
userServiceCid
The created
UserService.
data UserServiceRequest\_Cancel\_Result
Result of
UserServiceRequest_Cancel.
UserServiceRequest\_Cancel\_Result
(no fields)
data UserServiceRequest\_Reject\_Result
Result of
UserServiceRequest_Reject.
UserServiceRequest\_Reject\_Result
(no fields)
data UserService\_DistributeAndAdjustDepositMulti\_Result
Result of
UserService_DistributeAndAdjustDepositMulti.
UserService\_DistributeAndAdjustDepositMulti\_Result
Field
Type
Description
transferResults
The
TransferResultfor each distribution.
data UserService\_DistributeMulti\_Result
Result of
UserService_DistributeMulti.
UserService\_DistributeMulti\_Result
Field
Type
Description
transferResults
The
TransferResultfor each distribution.
data UserService\_OfferFreeCredential\_Result
Result of
UserService_OfferFreeCredential.
UserService\_OfferFreeCredential\_Result
Field
Type
Description
credentialOfferCid
The credential offer.
data UserService\_OfferPaidCredential\_Result
Result of
UserService_OfferPaidCredential.
UserService\_OfferPaidCredential\_Result
Field
Type
Description
credentialOfferCid
The credential offer.
data UserService\_Terminate\_Result
Result of
UserService_Terminate.
UserService\_Terminate\_Result
(no fields)