.. _module-splice-wallet-payment-75803: Splice.Wallet.Payment ===================== Templates --------- .. _type-splice-wallet-payment-acceptedapppayment-18193: **template** `AcceptedAppPayment `_ Signatory\: sender, provider, map (\\ r \-\> (DA\.Internal\.Record\.getField @\"receiver\" r)) amuletReceiverAmounts .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - sender - `Party `_ - * - amuletReceiverAmounts - \[`ReceiverAmuletAmount `_\] - * - provider - `Party `_ - * - dso - `Party `_ - * - lockedAmulet - `ContractId `_ LockedAmulet - * - round - Round - The round in which the locked amulet was created, added as an extra field so we can avoid ingesting locked amulets\. * - reference - `ContractId `_ `AppPaymentRequest `_ - The contract id of the original payment request to correlate it\. Note that the contract will no longer be active\. + .. _type-splice-wallet-payment-acceptedapppaymentcollect-62282: **Choice** `AcceptedAppPayment_Collect `_ Controller\: signatory this Returns\: `AcceptedAppPayment_CollectResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - context - AppTransferContext - + .. _type-splice-wallet-payment-acceptedapppaymentexpire-51092: **Choice** `AcceptedAppPayment_Expire `_ Controller\: sender Returns\: `AcceptedAppPayment_ExpireResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - context - AppTransferContext - + .. _type-splice-wallet-payment-acceptedapppaymentreject-83760: **Choice** `AcceptedAppPayment_Reject `_ Controller\: map (\\ r \-\> (DA\.Internal\.Record\.getField @\"receiver\" r)) amuletReceiverAmounts Returns\: `AcceptedAppPayment_RejectResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - context - AppTransferContext - + **Choice** Archive Controller\: sender, provider, map (\\ r \-\> (DA\.Internal\.Record\.getField @\"receiver\" r)) amuletReceiverAmounts Returns\: () (no fields) .. _type-splice-wallet-payment-apppaymentrequest-31524: **template** `AppPaymentRequest `_ Signatory\: sender, appPaymentRequest\_receivers this, provider .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - sender - `Party `_ - The party that should pay\. * - receiverAmounts - \[`ReceiverAmount `_\] - Pairs of (party, amount) requesting to be paid\. * - provider - `Party `_ - The app provider; receives usage rewards\. * - dso - `Party `_ - The DSO party of the amulet that should be used to make the payment\. * - expiresAt - `Time `_ - When the payment request expires\. * - description - `Text `_ - Human readable description of the reason / good for which the payment is requested\. + .. _type-splice-wallet-payment-apppaymentrequestaccept-83530: **Choice** `AppPaymentRequest_Accept `_ Controller\: sender, walletProvider Returns\: `AppPaymentRequest_AcceptResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - inputs - \[TransferInput\] - * - context - PaymentTransferContext - * - walletProvider - `Party `_ - + .. _type-splice-wallet-payment-apppaymentrequestexpire-10515: **Choice** `AppPaymentRequest_Expire `_ Controller\: actor Returns\: `AppPaymentRequest_ExpireResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - actor - `Party `_ - + .. _type-splice-wallet-payment-apppaymentrequestreject-66391: **Choice** `AppPaymentRequest_Reject `_ Controller\: sender Returns\: `AppPaymentRequest_RejectResult `_ (no fields) + .. _type-splice-wallet-payment-apppaymentrequestwithdraw-31618: **Choice** `AppPaymentRequest_Withdraw `_ Controller\: appPaymentRequest\_receivers this Returns\: `AppPaymentRequest_WithdrawResult `_ (no fields) + **Choice** Archive Controller\: sender, appPaymentRequest\_receivers this, provider Returns\: () (no fields) .. _type-splice-wallet-payment-terminatedapppayment-49143: **template** `TerminatedAppPayment `_ Instead of just archiving payments (e\.g\. when the request is accepted) we create an TerminatedAppPayment contract\. This allows the coordinating workflow to archive its own contracts once the app\-payment workflow terminated\. Signatory\: sender, provider, receivers .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - sender - `Party `_ - * - provider - `Party `_ - * - receivers - \[`Party `_\] - * - reference - `ContractId `_ `AppPaymentRequest `_ - + **Choice** Archive Controller\: sender, provider, receivers Returns\: () (no fields) Data Types ---------- .. _type-splice-wallet-payment-acceptedapppaymentcollectresult-5751: **data** `AcceptedAppPayment_CollectResult `_ .. _constr-splice-wallet-payment-acceptedapppaymentcollectresult-53822: `AcceptedAppPayment_CollectResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - receiverAmulets - \[(`Party `_, `ContractId `_ Amulet)\] - **instance** `GetField `_ \"receiverAmulets\" `AcceptedAppPayment_CollectResult `_ \[(`Party `_, `ContractId `_ Amulet)\] **instance** `SetField `_ \"receiverAmulets\" `AcceptedAppPayment_CollectResult `_ \[(`Party `_, `ContractId `_ Amulet)\] **instance** `HasExercise `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Collect `_ `AcceptedAppPayment_CollectResult `_ **instance** `HasFromAnyChoice `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Collect `_ `AcceptedAppPayment_CollectResult `_ **instance** `HasToAnyChoice `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Collect `_ `AcceptedAppPayment_CollectResult `_ .. _type-splice-wallet-payment-acceptedapppaymentexpireresult-93793: **data** `AcceptedAppPayment_ExpireResult `_ .. _constr-splice-wallet-payment-acceptedapppaymentexpireresult-95234: `AcceptedAppPayment_ExpireResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - amulet - AmuletCreateSummary (`ContractId `_ Amulet) - **instance** `GetField `_ \"amulet\" `AcceptedAppPayment_ExpireResult `_ (AmuletCreateSummary (`ContractId `_ Amulet)) **instance** `SetField `_ \"amulet\" `AcceptedAppPayment_ExpireResult `_ (AmuletCreateSummary (`ContractId `_ Amulet)) **instance** `HasExercise `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Expire `_ `AcceptedAppPayment_ExpireResult `_ **instance** `HasFromAnyChoice `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Expire `_ `AcceptedAppPayment_ExpireResult `_ **instance** `HasToAnyChoice `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Expire `_ `AcceptedAppPayment_ExpireResult `_ .. _type-splice-wallet-payment-acceptedapppaymentrejectresult-56853: **data** `AcceptedAppPayment_RejectResult `_ .. _constr-splice-wallet-payment-acceptedapppaymentrejectresult-75142: `AcceptedAppPayment_RejectResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - amulet - AmuletCreateSummary (`ContractId `_ Amulet) - **instance** `GetField `_ \"amulet\" `AcceptedAppPayment_RejectResult `_ (AmuletCreateSummary (`ContractId `_ Amulet)) **instance** `SetField `_ \"amulet\" `AcceptedAppPayment_RejectResult `_ (AmuletCreateSummary (`ContractId `_ Amulet)) **instance** `HasExercise `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Reject `_ `AcceptedAppPayment_RejectResult `_ **instance** `HasFromAnyChoice `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Reject `_ `AcceptedAppPayment_RejectResult `_ **instance** `HasToAnyChoice `_ `AcceptedAppPayment `_ `AcceptedAppPayment_Reject `_ `AcceptedAppPayment_RejectResult `_ .. _type-splice-wallet-payment-apppaymentrequestacceptresult-82387: **data** `AppPaymentRequest_AcceptResult `_ .. _constr-splice-wallet-payment-apppaymentrequestacceptresult-79598: `AppPaymentRequest_AcceptResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - acceptedPayment - `ContractId `_ `AcceptedAppPayment `_ - * - senderChangeAmulet - `Optional `_ (`ContractId `_ Amulet) - **instance** `GetField `_ \"acceptedPayment\" `AppPaymentRequest_AcceptResult `_ (`ContractId `_ `AcceptedAppPayment `_) **instance** `GetField `_ \"senderChangeAmulet\" `AppPaymentRequest_AcceptResult `_ (`Optional `_ (`ContractId `_ Amulet)) **instance** `SetField `_ \"acceptedPayment\" `AppPaymentRequest_AcceptResult `_ (`ContractId `_ `AcceptedAppPayment `_) **instance** `SetField `_ \"senderChangeAmulet\" `AppPaymentRequest_AcceptResult `_ (`Optional `_ (`ContractId `_ Amulet)) **instance** `HasExercise `_ `AppPaymentRequest `_ `AppPaymentRequest_Accept `_ `AppPaymentRequest_AcceptResult `_ **instance** `HasFromAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Accept `_ `AppPaymentRequest_AcceptResult `_ **instance** `HasToAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Accept `_ `AppPaymentRequest_AcceptResult `_ .. _type-splice-wallet-payment-apppaymentrequestexpireresult-63922: **data** `AppPaymentRequest_ExpireResult `_ .. _constr-splice-wallet-payment-apppaymentrequestexpireresult-76475: `AppPaymentRequest_ExpireResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - terminatedAppPayment - `ContractId `_ `TerminatedAppPayment `_ - **instance** `GetField `_ \"terminatedAppPayment\" `AppPaymentRequest_ExpireResult `_ (`ContractId `_ `TerminatedAppPayment `_) **instance** `SetField `_ \"terminatedAppPayment\" `AppPaymentRequest_ExpireResult `_ (`ContractId `_ `TerminatedAppPayment `_) **instance** `HasExercise `_ `AppPaymentRequest `_ `AppPaymentRequest_Expire `_ `AppPaymentRequest_ExpireResult `_ **instance** `HasFromAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Expire `_ `AppPaymentRequest_ExpireResult `_ **instance** `HasToAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Expire `_ `AppPaymentRequest_ExpireResult `_ .. _type-splice-wallet-payment-apppaymentrequestrejectresult-75838: **data** `AppPaymentRequest_RejectResult `_ .. _constr-splice-wallet-payment-apppaymentrequestrejectresult-65943: `AppPaymentRequest_RejectResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - terminatedAppPayment - `ContractId `_ `TerminatedAppPayment `_ - **instance** `GetField `_ \"terminatedAppPayment\" `AppPaymentRequest_RejectResult `_ (`ContractId `_ `TerminatedAppPayment `_) **instance** `SetField `_ \"terminatedAppPayment\" `AppPaymentRequest_RejectResult `_ (`ContractId `_ `TerminatedAppPayment `_) **instance** `HasExercise `_ `AppPaymentRequest `_ `AppPaymentRequest_Reject `_ `AppPaymentRequest_RejectResult `_ **instance** `HasFromAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Reject `_ `AppPaymentRequest_RejectResult `_ **instance** `HasToAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Reject `_ `AppPaymentRequest_RejectResult `_ .. _type-splice-wallet-payment-apppaymentrequestwithdrawresult-19567: **data** `AppPaymentRequest_WithdrawResult `_ .. _constr-splice-wallet-payment-apppaymentrequestwithdrawresult-24638: `AppPaymentRequest_WithdrawResult `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - terminatedAppPayment - `ContractId `_ `TerminatedAppPayment `_ - **instance** `GetField `_ \"terminatedAppPayment\" `AppPaymentRequest_WithdrawResult `_ (`ContractId `_ `TerminatedAppPayment `_) **instance** `SetField `_ \"terminatedAppPayment\" `AppPaymentRequest_WithdrawResult `_ (`ContractId `_ `TerminatedAppPayment `_) **instance** `HasExercise `_ `AppPaymentRequest `_ `AppPaymentRequest_Withdraw `_ `AppPaymentRequest_WithdrawResult `_ **instance** `HasFromAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Withdraw `_ `AppPaymentRequest_WithdrawResult `_ **instance** `HasToAnyChoice `_ `AppPaymentRequest `_ `AppPaymentRequest_Withdraw `_ `AppPaymentRequest_WithdrawResult `_ .. _type-splice-wallet-payment-paymentamount-12698: **data** `PaymentAmount `_ .. _constr-splice-wallet-payment-paymentamount-44729: `PaymentAmount `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - amount - `Decimal `_ - * - unit - `Unit `_ - **instance** `Eq `_ `PaymentAmount `_ **instance** `Ord `_ `PaymentAmount `_ **instance** `Show `_ `PaymentAmount `_ **instance** `GetField `_ \"amount\" `PaymentAmount `_ `Decimal `_ **instance** `GetField `_ \"amount\" `ReceiverAmount `_ `PaymentAmount `_ **instance** `GetField `_ \"paymentAmount\" :ref:`SubscriptionPayData ` `PaymentAmount `_ **instance** `GetField `_ \"unit\" `PaymentAmount `_ `Unit `_ **instance** `SetField `_ \"amount\" `PaymentAmount `_ `Decimal `_ **instance** `SetField `_ \"amount\" `ReceiverAmount `_ `PaymentAmount `_ **instance** `SetField `_ \"paymentAmount\" :ref:`SubscriptionPayData ` `PaymentAmount `_ **instance** `SetField `_ \"unit\" `PaymentAmount `_ `Unit `_ .. _type-splice-wallet-payment-receiveramount-43100: **data** `ReceiverAmount `_ .. _constr-splice-wallet-payment-receiveramount-91649: `ReceiverAmount `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - receiver - `Party `_ - * - amount - `PaymentAmount `_ - **instance** `Eq `_ `ReceiverAmount `_ **instance** `Ord `_ `ReceiverAmount `_ **instance** `Show `_ `ReceiverAmount `_ **instance** `GetField `_ \"amount\" `ReceiverAmount `_ `PaymentAmount `_ **instance** `GetField `_ \"receiver\" `ReceiverAmount `_ `Party `_ **instance** `GetField `_ \"receiverAmounts\" `AppPaymentRequest `_ \[`ReceiverAmount `_\] **instance** `SetField `_ \"amount\" `ReceiverAmount `_ `PaymentAmount `_ **instance** `SetField `_ \"receiver\" `ReceiverAmount `_ `Party `_ **instance** `SetField `_ \"receiverAmounts\" `AppPaymentRequest `_ \[`ReceiverAmount `_\] .. _type-splice-wallet-payment-receiveramulet-61330: **data** `ReceiverAmulet `_ .. _constr-splice-wallet-payment-receiveramulet-72427: `ReceiverAmulet `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - receiver - `Party `_ - * - lockedAmulet - `ContractId `_ LockedAmulet - **instance** `Eq `_ `ReceiverAmulet `_ **instance** `Show `_ `ReceiverAmulet `_ **instance** `GetField `_ \"lockedAmulet\" `ReceiverAmulet `_ (`ContractId `_ LockedAmulet) **instance** `GetField `_ \"receiver\" `ReceiverAmulet `_ `Party `_ **instance** `SetField `_ \"lockedAmulet\" `ReceiverAmulet `_ (`ContractId `_ LockedAmulet) **instance** `SetField `_ \"receiver\" `ReceiverAmulet `_ `Party `_ .. _type-splice-wallet-payment-receiveramuletamount-72096: **data** `ReceiverAmuletAmount `_ .. _constr-splice-wallet-payment-receiveramuletamount-97653: `ReceiverAmuletAmount `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - receiver - `Party `_ - * - amuletAmount - `Decimal `_ - **instance** `Eq `_ `ReceiverAmuletAmount `_ **instance** `Ord `_ `ReceiverAmuletAmount `_ **instance** `Show `_ `ReceiverAmuletAmount `_ **instance** `GetField `_ \"amuletAmount\" `ReceiverAmuletAmount `_ `Decimal `_ **instance** `GetField `_ \"amuletReceiverAmounts\" `AcceptedAppPayment `_ \[`ReceiverAmuletAmount `_\] **instance** `GetField `_ \"receiver\" `ReceiverAmuletAmount `_ `Party `_ **instance** `SetField `_ \"amuletAmount\" `ReceiverAmuletAmount `_ `Decimal `_ **instance** `SetField `_ \"amuletReceiverAmounts\" `AcceptedAppPayment `_ \[`ReceiverAmuletAmount `_\] **instance** `SetField `_ \"receiver\" `ReceiverAmuletAmount `_ `Party `_ .. _type-splice-wallet-payment-unit-67175: **data** `Unit `_ .. _constr-splice-wallet-payment-usdunit-55511: `USDUnit `_ .. _constr-splice-wallet-payment-amuletunit-84830: `AmuletUnit `_ .. _constr-splice-wallet-payment-extunit-45462: `ExtUnit `_ Extension constructor to work around the current lack of upgrading for variants in Daml 3\.0\. Will serve as the default value in a containing record in case of an extension\. **instance** `Eq `_ `Unit `_ **instance** `Ord `_ `Unit `_ **instance** `Show `_ `Unit `_ **instance** `GetField `_ \"unit\" `PaymentAmount `_ `Unit `_ **instance** `SetField `_ \"unit\" `PaymentAmount `_ `Unit `_ Functions --------- .. _function-splice-wallet-payment-paymentamounttoamulet-10099: `paymentAmountToAmulet `_ \: `Party `_ \-\> OpenMiningRound \-\> `PaymentAmount `_ \-\> `Update `_ `Decimal `_ .. _function-splice-wallet-payment-receiveramounttoamuletreceiveramount-72316: `receiverAmountToAmuletReceiverAmount `_ \: `Party `_ \-\> OpenMiningRound \-\> `ReceiverAmount `_ \-\> `Update `_ `ReceiverAmuletAmount `_ .. _function-splice-wallet-payment-apppaymentrequestreceivers-97989: `appPaymentRequest_receivers `_ \: `AppPaymentRequest `_ \-\> \[`Party `_\] .. _function-splice-wallet-payment-unzipreceiveramulets-38827: `unzipReceiverAmulets `_ \: \[`ReceiverAmulet `_\] \-\> (\[`Party `_\], \[`ContractId `_ LockedAmulet\]) .. _function-splice-wallet-payment-mkreceiveroutput-26465: `mkReceiverOutput `_ \: `ReceiverAmuletAmount `_ \-\> TransferOutput