Documentation Index
Fetch the complete documentation index at: https://cantonfoundation-add-app-development-module-579.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Utility template for proxying token standard choices so that featured app markers are created when using extra parties for operating an app.
You can either use this template directly, or copy the code under a different package name and a different module name.
Note: use the WalletUserProxy if you are building a wallet app and want your users to create featured app markers for you.
Templates
template DelegateProxy
A proxy for a delegate to create featured app markers jointly with using token standard workflows. The delegate is given full control over the creation of the markers.
This is for example useful when using one or more parties for app operation purposes. Using this proxy allows the operational parties to properly attribute their activity to the featured app, which is represented by the app provider party.
Signatory: provider
| Field | Type | Description |
|---|
| provider | Party | The app provider whose featured app right should be used |
| delegate | Party | The delegate interacting with the token standard workflow |
-
Choice Archive
Controller: provider
Returns: ()
(no fields)
-
Choice DelegateProxy_AllocationFactory_Allocate
Controller: delegate
Returns: ProxyResult AllocationInstructionResult
| Field | Type | Description |
|---|
| cid | ContractId AllocationFactory | |
| proxyArg | ProxyArg AllocationFactory_Allocate | |
-
Choice DelegateProxy_Allocation_Withdraw
Controller: delegate
Returns: ProxyResult Allocation_WithdrawResult
| Field | Type | Description |
|---|
| cid | ContractId Allocation | |
| proxyArg | ProxyArg Allocation_Withdraw | |
-
Choice DelegateProxy_TransferFactory_Transfer
Controller: delegate
Returns: ProxyResult TransferInstructionResult
| Field | Type | Description |
|---|
| cid | ContractId TransferFactory | |
| proxyArg | ProxyArg TransferFactory_Transfer | |
-
Choice DelegateProxy_TransferInstruction_Accept
Controller: delegate
Returns: ProxyResult TransferInstructionResult
| Field | Type | Description |
|---|
| cid | ContractId TransferInstruction | |
| proxyArg | ProxyArg TransferInstruction_Accept | |
-
Choice DelegateProxy_TransferInstruction_Reject
Controller: delegate
Returns: ProxyResult TransferInstructionResult
| Field | Type | Description |
|---|
| cid | ContractId TransferInstruction | |
| proxyArg | ProxyArg TransferInstruction_Reject | |
-
Choice DelegateProxy_TransferInstruction_Withdraw
Controller: delegate
Returns: ProxyResult TransferInstructionResult
| Field | Type | Description |
|---|
| cid | ContractId TransferInstruction | |
| proxyArg | ProxyArg TransferInstruction_Withdraw | |
Data Types
data ProxyArg arg
Generic argument to the proxy choices.
ProxyArg
| Field | Type | Description |
|---|
| choiceArg | arg | The argument to the choice that the delegate is exercising. |
| featuredAppRightCid | ContractId FeaturedAppRight | The featured app right contract of the provider. |
| beneficiaries | [AppRewardBeneficiary] | The beneficiaries for the activity marker. |
instance Eq arg => Eq (ProxyArg arg)
instance Show arg => Show (ProxyArg arg)
instance GetField βbeneficiariesβ (ProxyArg arg) [AppRewardBeneficiary]
instance GetField βchoiceArgβ (ProxyArg arg) arg
instance GetField βfeaturedAppRightCidβ (ProxyArg arg) (ContractId FeaturedAppRight)
instance GetField βproxyArgβ DelegateProxy_AllocationFactory_Allocate (ProxyArg AllocationFactory_Allocate)
instance GetField βproxyArgβ DelegateProxy_Allocation_Withdraw (ProxyArg Allocation_Withdraw)
instance GetField βproxyArgβ DelegateProxy_TransferFactory_Transfer (ProxyArg TransferFactory_Transfer)
instance GetField βproxyArgβ DelegateProxy_TransferInstruction_Accept (ProxyArg TransferInstruction_Accept)
instance GetField βproxyArgβ DelegateProxy_TransferInstruction_Reject (ProxyArg TransferInstruction_Reject)
instance GetField βproxyArgβ DelegateProxy_TransferInstruction_Withdraw (ProxyArg TransferInstruction_Withdraw)
instance SetField βbeneficiariesβ (ProxyArg arg) [AppRewardBeneficiary]
instance SetField βchoiceArgβ (ProxyArg arg) arg
instance SetField βfeaturedAppRightCidβ (ProxyArg arg) (ContractId FeaturedAppRight)
instance SetField βproxyArgβ DelegateProxy_AllocationFactory_Allocate (ProxyArg AllocationFactory_Allocate)
instance SetField βproxyArgβ DelegateProxy_Allocation_Withdraw (ProxyArg Allocation_Withdraw)
instance SetField βproxyArgβ DelegateProxy_TransferFactory_Transfer (ProxyArg TransferFactory_Transfer)
instance SetField βproxyArgβ DelegateProxy_TransferInstruction_Accept (ProxyArg TransferInstruction_Accept)
instance SetField βproxyArgβ DelegateProxy_TransferInstruction_Reject (ProxyArg TransferInstruction_Reject)
instance SetField βproxyArgβ DelegateProxy_TransferInstruction_Withdraw (ProxyArg TransferInstruction_Withdraw)
data ProxyResult r
Generic result of the proxy choices.
ProxyResult
| Field | Type | Description |
|---|
| markerResult | FeaturedAppRight_CreateActivityMarkerResult | |
| choiceResult | r | |
instance GetField βchoiceResultβ (ProxyResult r) r
instance GetField βmarkerResultβ (ProxyResult r) FeaturedAppRight_CreateActivityMarkerResult
instance SetField βchoiceResultβ (ProxyResult r) r
instance SetField βmarkerResultβ (ProxyResult r) FeaturedAppRight_CreateActivityMarkerResult
instance HasExercise DelegateProxy DelegateProxy_AllocationFactory_Allocate (ProxyResult AllocationInstructionResult)
instance HasExercise DelegateProxy DelegateProxy_Allocation_Withdraw (ProxyResult Allocation_WithdrawResult)
instance HasExercise DelegateProxy DelegateProxy_TransferFactory_Transfer (ProxyResult TransferInstructionResult)
instance HasExercise DelegateProxy DelegateProxy_TransferInstruction_Accept (ProxyResult TransferInstructionResult)
instance HasExercise DelegateProxy DelegateProxy_TransferInstruction_Reject (ProxyResult TransferInstructionResult)
instance HasExercise DelegateProxy DelegateProxy_TransferInstruction_Withdraw (ProxyResult TransferInstructionResult)
instance HasFromAnyChoice DelegateProxy DelegateProxy_AllocationFactory_Allocate (ProxyResult AllocationInstructionResult)
instance HasFromAnyChoice DelegateProxy DelegateProxy_Allocation_Withdraw (ProxyResult Allocation_WithdrawResult)
instance HasFromAnyChoice DelegateProxy DelegateProxy_TransferFactory_Transfer (ProxyResult TransferInstructionResult)
instance HasFromAnyChoice DelegateProxy DelegateProxy_TransferInstruction_Accept (ProxyResult TransferInstructionResult)
instance HasFromAnyChoice DelegateProxy DelegateProxy_TransferInstruction_Reject (ProxyResult TransferInstructionResult)
instance HasFromAnyChoice DelegateProxy DelegateProxy_TransferInstruction_Withdraw (ProxyResult TransferInstructionResult)
instance HasToAnyChoice DelegateProxy DelegateProxy_AllocationFactory_Allocate (ProxyResult AllocationInstructionResult)
instance HasToAnyChoice DelegateProxy DelegateProxy_Allocation_Withdraw (ProxyResult Allocation_WithdrawResult)
instance HasToAnyChoice DelegateProxy DelegateProxy_TransferFactory_Transfer (ProxyResult TransferInstructionResult)
instance HasToAnyChoice DelegateProxy DelegateProxy_TransferInstruction_Accept (ProxyResult TransferInstructionResult)
instance HasToAnyChoice DelegateProxy DelegateProxy_TransferInstruction_Reject (ProxyResult TransferInstructionResult)
instance HasToAnyChoice DelegateProxy DelegateProxy_TransferInstruction_Withdraw (ProxyResult TransferInstructionResult)
Functions
exerciseProxyChoice
: HasExercise t ch r => DelegateProxy -> ContractId t -> ProxyArg ch -> Update (ProxyResult r)Shared code to execute the proxied choice.
require
: CanAssert m => Text -> Bool -> m ()Check whether a required condition is true. If itβs not, abort the transaction with a message saying that the requirement was not met.