Skip to content

Reference

PaymentStreams — lifecycle overview

Factory-rooted recurring payment streams on Canton—proposal on the PaymentStreamFactory, stakeholder approval and Start with locked Amulet funds, then active-stream payments and amendments. Validator-backed helpers expose AmuletRules, mining round, and FeaturedAppRight disclosure for submissions.

ocp.PaymentStreams command builders follow the DAML lifecycle: paymentStreamFactory creates a ProposedPaymentStream from a known factory contract id; proposedPaymentStream approves, edits, withdraws, changes party, and starts the stream with a LockFundsInput; activePaymentStream processes days of payments (with optional processor skip / activity marker), free trials, cancellations, refunds, archival, change-party, fund management, and locked-amulet replacement; paymentStreamChangeProposal approves / applies / rejects on-chain amendments; partyMigrationProposal handles migration flows after a migration proposal exists. Many choices return CommandWithDisclosedContracts with an empty disclosed list from the builder—the actual disclosure you need at submit time usually comes from utils.buildPaymentContext / buildPaymentContextWithAmulets (validator) or getFactoryDisclosedContracts / getProposedPaymentStreamDisclosedContracts (ledger).

Prerequisites

  • OcpClient constructed with ledger and, for utils.buildPaymentContext*, a validator client (new OcpClient({ ledger: canton.ledger, validator: canton.validator })).

Minimal sketch

const create = ocp.PaymentStreams.paymentStreamFactory.buildCreatePaymentStreamProposalCommand({
  factoryContractId: FACTORY_CONTRACT_ID,
  actor: PAYER_PARTY,
  paymentStreamProposal: PAYMENT_STREAM_PROPOSAL_INPUT,
});
await ocp.createBatch({ actAs: [PAYER_PARTY] }).addBuiltCommand(create).submitAndWaitForTransactionTree();

Topic pages

Errors

Several utilities throw OcpValidationError (unknown network / missing factory disclosure) or OcpContractError (proposal contract not found). See utils and individual action pages.

See also

Source