Skip to main content

Standard transfers

Out of the box, the SDK supports connecting a Canton wallet, resolving instruments and accounts, and submitting transfers between parties. This covers the majority of DeFi use cases: payments, settlements, and asset movement across Canton participants.

Multi-leg swap offers

A multi-leg swap offer describes everything two parties agree to exchange in one coordinated settlement flow. Instead of submitting independent transfers, the creator defines the assets each side must provide, the intended receivers, and the settlement deadline in a single offer. This structure supports simple token-for-token swaps and exchanges with multiple assets on either side. A common use case is Delivery versus Payment (DvP): one party delivers a tokenized asset while the other provides the corresponding payment.
DvP reduces settlement risk by coordinating delivery and payment. For example, the creator can deliver five tokenized bonds while the acceptor pays 100 units of a cash instrument under the same swap terms.
The offer contains three groups of legs: Each leg identifies its receiver, instrument, decimal amount, and unique leg ID. settleBefore sets the settlement deadline, and acceptorPartyId restricts who can accept the offer. createSwapOffer() submits the offer for wallet approval and returns its transaction ID. It does not accept or settle the offer; those steps happen through the subsequent wallet and settlement flow.
partyId is the creator. acceptorPartyId is the only party allowed to accept the offer. Use decimal strings for leg amounts and an ISO 8601 timestamp for settleBefore.

Message signing

Use signMessage() to request a wallet signature for an application message. Pass a party ID when a specific account must sign it.
Call signMessage() from a user gesture because it opens the wallet approval popup.

Sign and execute custom DAML commands

Use signAndExecute() when your transaction is not covered by a high-level SDK method such as send() or createSwapOffer(). It lets your dApp submit custom operations against DAML templates and choices supported by the connected wallet. Your dApp builds one or more DAML commands, such as CreateCommand or ExerciseCommand, and serializes them into commandsJson. The wallet displays the supplied note, asks the selected party to approve the operation, signs the command set, and submits it for execution. This method is intended for custom contract workflows implemented for your integration. Use a unique commandId for each submission and include any disclosed contracts required to authorize the commands.
Parameters

Example

Submitting a CreateCommand for a custom template:
Example of disclosed_contracts payload:

Custom transaction types

Canton’s smart contract model (DAML) allows for arbitrarily complex workflows — multi-party agreements, conditional transfers, bespoke financial instruments. If your application requires transaction types beyond standard transfers, the SDK can be extended to support them. This involves aligning on your contract and workflow requirements with the Cantor8 team, who will implement the corresponding support on the C8 backend.

Discuss custom integration

Contact the C8 team at integrations@cantor8.io to scope custom transaction support for your application.