Skip to content

Reference

PaymentStreams.activePaymentStream

Process recurring payments and free trials, cancel, refund, propose changes, archive inactive streams, change party, and manage locked funds on ActivePaymentStream contracts.

An active stream represents funded, running payment obligations. Builders wrap choices on the ActivePaymentStream template (and related fund / lock helpers). buildProcessPaymentCommand returns CommandWithDisclosedContracts (often empty in the builder) and is the main day-forwarding payment path; supply a processingPeriod RelTime string (microseconds) and paymentContext from utils.

Receiver

ocp.PaymentStreams.activePaymentStream

Highlights

buildProcessPaymentCommand(params)

  • paymentStreamContractId (required) — Active stream contract id.
  • processingPeriod (required) — RelTime microseconds string; converted with relTimeToDAML.
  • paymentContext (required){ amuletRulesCid, openMiningRoundCid, featuredAppRight: string | null }.
  • skipProcessorPayment (optional) — default false.
  • activityMarkerFeaturedAppRightCid (optional) — default null.

Returns: CommandWithDisclosedContractsActivePaymentStream_ProcessPayment.

buildProcessFreeTrialCommand, buildCancelCommand, buildProposeChangesCommand, buildRefundCommand, buildArchiveInactivePaymentStreamCommand, buildChangePartyCommand

Each wraps a single DAML choice on ActivePaymentStream (or inactive archival):

  • CancelCancelPaymentStreamParams: paymentStreamContractId, actor, optional disregardAvailablePaidPeriod, description, openMiningRoundCid.
  • Others — see source files for full field lists (proposeChanges.ts, refund.ts, processFreeTrial.ts, archiveInactivePaymentStream.ts, changeParty.ts).

Fund management (also on namespace)

The extension re-exports buildAddFundsCommand, buildWithdrawFundsCommand, buildReplaceLockedAmuletCommand from sibling modules for locking / liquidity adjustments—see activePaymentStream/index.ts in the SDK.

Errors

Builders do not throw Ocp*. Ledger rules enforce balances, periods, and authorization.

Auth and disclosure

Processing payments usually requires submitting with the correct acting parties and attaching validator-derived disclosure for Amulet rules, mining round, and any featured-app-right contracts—assemble via ocp.PaymentStreams.utils.buildPaymentContext when using the recommended path.

See also

Source