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
OcpClientconstructed withledgerand, forutils.buildPaymentContext*, avalidatorclient (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
- Factory
- Proposed stream
- Active stream
- Change proposals
- Party migration
- Utils (disclosure & payment context)
Errors
Several utilities throw OcpValidationError (unknown network / missing factory disclosure) or OcpContractError (proposal contract not found). See utils and individual action pages.
See also
- CantonPayments — airdrops.