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.

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.

signAndExecute — arbitrary contracts

The SDK exposes a low-level method that lets your dApp sign and execute any DAML command supported by the connected wallet — including custom templates and choices defined for your integration.
signAndExecute(input: {
  note: string;
  partyId: string;
  commandId: string;
  commandsJson: string;
  disclosedContracts: string;
}): Promise<void>;
Parameters
FieldDescription
noteHuman-readable note shown to the user in the wallet UI.
partyIdThe party submitting the command.
commandIdUnique idempotency key for this submission (e.g. a UUID).
commandsJsonJSON-serialized array of DAML commands (CreateCommand, ExerciseCommand, etc.).
disclosedContractsJSON-serialized array of Contracts disclosed to the participant to authorize the command.

Example

Submitting a CreateCommand for a custom template:
const onSignAndExecuteClick = async () => {
  const input = {
    note: signAndExecuteMessage ?? "Hello from Cantor8 Wallet Connect SDK Demo",
    partyId: selectedAccount,
    commandId: crypto.randomUUID(),
    commandsJson: JSON.stringify([
      {
        CreateCommand: {
          templateId: "#splice-wallet:Splice.Wall..pprovalProposal",
          createArguments: {
            receiver: "9acf24..49ce9d",
            provider: "cantor8-digik-1::122..77f",
            expectedDso: "DSO::122..1a",
          },
        },
      },
    ]),
    disclosedContracts: "",
  };

  c8.signAndExecute(input).catch((e) =>
    console.log("error signing and executing", e, e.data)
  );
};
Example of disclosed_contracts payload:
"disclosed_contracts":
[
    {
        "templateId": "167da4910b0..c93056f2f3bcd",
        "contractId": "0060.77887563880cd00",
        "createdEventBlob": "CgMyLjES7wY..Wk/eLGNgpQNGrdDxjiLIpmGdEB4=",
        "synchronizerId": "global-domain::1220be58..881bb471a"
    }
],

Discuss custom integration

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