.. _module-splice-testing-apps-tradingapp-19891: Splice.Testing.Apps.TradingApp ============================== An example of how to build an OTC trading app for multi\-leg standard token trades\. Used as part of the testing infrastructure to test the DvP workflows based on the token standard\. Templates --------- .. _type-splice-testing-apps-tradingapp-otctrade-80775: **template** `OTCTrade `_ Signatory\: venue, tradingParties transferLegs .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - venue - `Party `_ - * - transferLegs - `TextMap `_ TransferLeg - * - tradeCid - `ContractId `_ `OTCTradeProposal `_ - * - createdAt - `Time `_ - * - prepareUntil - `Time `_ - * - settleBefore - `Time `_ - + **Choice** Archive Controller\: venue, tradingParties transferLegs Returns\: () (no fields) + .. _type-splice-testing-apps-tradingapp-otctradecancel-34465: **Choice** `OTCTrade_Cancel `_ Controller\: venue Returns\: `TextMap `_ (`Optional `_ Allocation\_CancelResult) .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - allocationsWithContext - `TextMap `_ (`ContractId `_ Allocation, ExtraArgs) - + .. _type-splice-testing-apps-tradingapp-otctradesettle-9210: **Choice** `OTCTrade_Settle `_ Controller\: venue Returns\: `TextMap `_ Allocation\_ExecuteTransferResult .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - allocationsWithContext - `TextMap `_ (`ContractId `_ Allocation, ExtraArgs) - + **interface instance** AllocationRequest **for** `OTCTrade `_ .. _type-splice-testing-apps-tradingapp-otctradeproposal-78093: **template** `OTCTradeProposal `_ Signatory\: approvers .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - venue - `Party `_ - * - tradeCid - `Optional `_ (`ContractId `_ `OTCTradeProposal `_) - * - transferLegs - `TextMap `_ TransferLeg - * - approvers - \[`Party `_\] - Parties that have approved the proposal + **Choice** Archive Controller\: approvers Returns\: () (no fields) + .. _type-splice-testing-apps-tradingapp-otctradeproposalaccept-97549: **Choice** `OTCTradeProposal_Accept `_ Controller\: approver Returns\: `ContractId `_ `OTCTradeProposal `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - approver - `Party `_ - + .. _type-splice-testing-apps-tradingapp-otctradeproposalinitiatesettlement-54617: **Choice** `OTCTradeProposal_InitiateSettlement `_ Controller\: venue Returns\: `ContractId `_ `OTCTrade `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - prepareUntil - `Time `_ - * - settleBefore - `Time `_ - + .. _type-splice-testing-apps-tradingapp-otctradeproposalreject-13148: **Choice** `OTCTradeProposal_Reject `_ Controller\: trader Returns\: () .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - trader - `Party `_ - Functions --------- .. _function-splice-testing-apps-tradingapp-tradeallocations-16894: `tradeAllocations `_ \: SettlementInfo \-\> `TextMap `_ TransferLeg \-\> `TextMap `_ AllocationSpecification .. _function-splice-testing-apps-tradingapp-tradingparties-11886: `tradingParties `_ \: `TextMap `_ TransferLeg \-\> `Set `_ `Party `_ .. _function-splice-testing-apps-tradingapp-require-88127: `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\. .. _function-splice-testing-apps-tradingapp-maketraderef-67526: `makeTradeRef `_ \: `ContractId `_ `OTCTradeProposal `_ \-\> Reference .. _function-splice-testing-apps-tradingapp-ziptextmaps-57279: `zipTextMaps `_ \: `TextMap `_ a \-\> `TextMap `_ b \-\> `TextMap `_ (`Optional `_ a, `Optional `_ b) .. _function-splice-testing-apps-tradingapp-fortextmapwithkey-78275: `forTextMapWithKey `_ \: `Applicative `_ f \=\> `TextMap `_ a \-\> (`Text `_ \-\> a \-\> f b) \-\> f (`TextMap `_ b)