Skip to content

Reference

PaymentStreams.proposedPaymentStream

Approve, start, edit, withdraw, or change party on a ProposedPaymentStream. Start carries LockFundsInput (amulet inputs + payment context) and returns CommandWithDisclosedContracts for submission.

While a stream is proposed, stakeholders exercise approval, the payer starts by locking Amulet funds (LockFundsInput), or either side may edit, withdraw, or run change party flows. Most builders return Command except approve and start, which return CommandWithDisclosedContracts with an empty disclosed list—pair with validator-built disclosure from utils when your submission requires it.

Receiver

ocp.PaymentStreams.proposedPaymentStream

buildApproveCommand

  • proposedPaymentStreamContractId (required)
  • actor (required)

Returns: CommandWithDisclosedContractsProposedPaymentStream_Approve.

buildStartPaymentStreamCommand

  • proposedPaymentStreamContractId (required)
  • lockFundsInput (required)LockFundsInput:
    • amuletInputsstring[] contract ids
    • amountToLock — decimal string
    • paymentContext{ amuletRulesCid, openMiningRoundCid, featuredAppRight: string | null } (use utils.buildPaymentContext / buildPaymentContextWithAmulets)

Returns: CommandWithDisclosedContractsProposedPaymentStream_StartPaymentStream.

buildEditPaymentStreamProposalCommand

  • proposedPaymentStreamContractId (required)
  • actor (required)
  • changes (required)PaymentStreamProposalChanges: optional partial updates (payer, recipient, recipientProvider, amounts, times, prepayWindow, observers, etc.—see source).
  • description (optional)

Returns: Command.

buildChangePartyCommand

  • proposedPaymentStreamContractId (required)
  • partyType (required)'Payer' | 'Recipient' | 'Processor'
  • oldParty, newParty (required)

Returns: CommandProposedPaymentStream_ChangeParty.

buildWithdrawCommand

  • proposedPaymentStreamContractId (required)
  • actor (required)
  • description (optional) — passed as null if omitted

Returns: CommandProposedPaymentStream_Withdraw.

Errors

These builders are thin wrappers; ledger errors apply at submit. For payment context assembly see OcpValidationError on buildPaymentContextWithAmulets when the payer has no amulets or insufficient balance (utils).

See also

Source