> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# Splice.Util.FeaturedApp.DelegateProxy

> Documentation for Splice.Util.FeaturedApp.DelegateProxy

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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) | The app provider whose featured app right should be used |
> | delegate | [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) | 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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) AllocationFactory | |
>   | proxyArg | ProxyArg AllocationFactory\_Allocate | |
>
> * **Choice** DelegateProxy\_Allocation\_Withdraw
>
>   Controller: delegate
>
>   Returns: ProxyResult Allocation\_WithdrawResult
>
>   | Field | Type | Description |
>   | - | - | - |
>   | cid | [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) Allocation | |
>   | proxyArg | ProxyArg Allocation\_Withdraw | |
>
> * **Choice** DelegateProxy\_TransferFactory\_Transfer
>
>   Controller: delegate
>
>   Returns: ProxyResult TransferInstructionResult
>
>   | Field | Type | Description |
>   | - | - | - |
>   | cid | [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) TransferFactory | |
>   | proxyArg | ProxyArg TransferFactory\_Transfer | |
>
> * **Choice** DelegateProxy\_TransferInstruction\_Accept
>
>   Controller: delegate
>
>   Returns: ProxyResult TransferInstructionResult
>
>   | Field | Type | Description |
>   | - | - | - |
>   | cid | [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) TransferInstruction | |
>   | proxyArg | ProxyArg TransferInstruction\_Accept | |
>
> * **Choice** DelegateProxy\_TransferInstruction\_Reject
>
>   Controller: delegate
>
>   Returns: ProxyResult TransferInstructionResult
>
>   | Field | Type | Description |
>   | - | - | - |
>   | cid | [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) TransferInstruction | |
>   | proxyArg | ProxyArg TransferInstruction\_Reject | |
>
> * **Choice** DelegateProxy\_TransferInstruction\_Withdraw
>
>   Controller: delegate
>
>   Returns: ProxyResult TransferInstructionResult
>
>   | Field | Type | Description |
>   | - | - | - |
>   | cid | [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) 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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) FeaturedAppRight | The featured app right contract of the provider. |
> > | beneficiaries | \[AppRewardBeneficiary] | The beneficiaries for the activity marker. |
>
> **instance** [Eq](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-classes-eq-22713) arg => [Eq](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-classes-eq-22713) (ProxyArg arg)
>
> **instance** [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) arg => [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) (ProxyArg arg)
>
> **instance** GetField "beneficiaries" (ProxyArg arg) \[AppRewardBeneficiary]
>
> **instance** GetField "choiceArg" (ProxyArg arg) arg
>
> **instance** GetField "featuredAppRightCid" (ProxyArg arg) ([ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) 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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) 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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) DelegateProxy DelegateProxy\_AllocationFactory\_Allocate (ProxyResult AllocationInstructionResult)
>
> **instance** [HasExercise](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) DelegateProxy DelegateProxy\_Allocation\_Withdraw (ProxyResult Allocation\_WithdrawResult)
>
> **instance** [HasExercise](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) DelegateProxy DelegateProxy\_TransferFactory\_Transfer (ProxyResult TransferInstructionResult)
>
> **instance** [HasExercise](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) DelegateProxy DelegateProxy\_TransferInstruction\_Accept (ProxyResult TransferInstructionResult)
>
> **instance** [HasExercise](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) DelegateProxy DelegateProxy\_TransferInstruction\_Reject (ProxyResult TransferInstructionResult)
>
> **instance** [HasExercise](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) DelegateProxy DelegateProxy\_TransferInstruction\_Withdraw (ProxyResult TransferInstructionResult)
>
> **instance** [HasFromAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasfromanychoice-81184) DelegateProxy DelegateProxy\_AllocationFactory\_Allocate (ProxyResult AllocationInstructionResult)
>
> **instance** [HasFromAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasfromanychoice-81184) DelegateProxy DelegateProxy\_Allocation\_Withdraw (ProxyResult Allocation\_WithdrawResult)
>
> **instance** [HasFromAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasfromanychoice-81184) DelegateProxy DelegateProxy\_TransferFactory\_Transfer (ProxyResult TransferInstructionResult)
>
> **instance** [HasFromAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasfromanychoice-81184) DelegateProxy DelegateProxy\_TransferInstruction\_Accept (ProxyResult TransferInstructionResult)
>
> **instance** [HasFromAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasfromanychoice-81184) DelegateProxy DelegateProxy\_TransferInstruction\_Reject (ProxyResult TransferInstructionResult)
>
> **instance** [HasFromAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasfromanychoice-81184) DelegateProxy DelegateProxy\_TransferInstruction\_Withdraw (ProxyResult TransferInstructionResult)
>
> **instance** [HasToAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hastoanychoice-82571) DelegateProxy DelegateProxy\_AllocationFactory\_Allocate (ProxyResult AllocationInstructionResult)
>
> **instance** [HasToAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hastoanychoice-82571) DelegateProxy DelegateProxy\_Allocation\_Withdraw (ProxyResult Allocation\_WithdrawResult)
>
> **instance** [HasToAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hastoanychoice-82571) DelegateProxy DelegateProxy\_TransferFactory\_Transfer (ProxyResult TransferInstructionResult)
>
> **instance** [HasToAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hastoanychoice-82571) DelegateProxy DelegateProxy\_TransferInstruction\_Accept (ProxyResult TransferInstructionResult)
>
> **instance** [HasToAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hastoanychoice-82571) DelegateProxy DelegateProxy\_TransferInstruction\_Reject (ProxyResult TransferInstructionResult)
>
> **instance** [HasToAnyChoice](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hastoanychoice-82571) DelegateProxy DelegateProxy\_TransferInstruction\_Withdraw (ProxyResult TransferInstructionResult)

## Functions

exerciseProxyChoice
: [HasExercise](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-template-functions-hasexercise-70422) t ch r => DelegateProxy -> [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) t -> ProxyArg ch -> [Update](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-update-68072) (ProxyResult r)

Shared code to execute the proxied choice.

require
: [CanAssert](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-assert-canassert-67323) m => [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) -> [Bool](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-bool-66265) -> 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.
