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.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.
Templates
template OTCTrade
Signatory: venue, tradingParties transferLegs
- Choice Archive Controller: venue, tradingParties transferLegs Returns: () (no fields)
Choice OTCTrade_CancelController: venue Returns: TextMap (Optional Allocation_CancelResult)
Field Type Description allocationsWithContext TextMap (ContractId Allocation, ExtraArgs) Choice OTCTrade_SettleController: venue Returns: TextMap Allocation_ExecuteTransferResult
Field Type Description allocationsWithContext TextMap (ContractId Allocation, ExtraArgs) - interface instance AllocationRequest for OTCTrade
template OTCTradeProposal
Signatory: approvers
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)
Choice OTCTradeProposal_AcceptController: approver Returns: ContractId OTCTradeProposal
Field Type Description approver Party Choice OTCTradeProposal_InitiateSettlementController: venue Returns: ContractId OTCTrade Choice OTCTradeProposal_RejectController: trader Returns: ()
Field Type Description trader Party
Functions
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.
makeTradeRef
: ContractId OTCTradeProposal -> Reference
forTextMapWithKey
: Applicative f => TextMap a -> (Text -> a -> f b) -> f (TextMap b)