ocp.CantonPayments groups Amulet-era airdrop flows: a feature-rich Airdrop template (create → join → configure → execute) and a lighter SimpleAirdrop (create → execute with transfer preapprovals, optional archive). Every builder returns a Canton Command except airdrop.buildJoinAirdropCommand, which pairs command with disclosedContracts so the joiner can prove the airdrop contract state.
Minimal pattern
import { OcpClient } from '@open-captable-protocol/canton';
const ocp = new OcpClient({ ledger: canton.ledger /* , validator */ });
const createCmd = ocp.CantonPayments.airdrop.buildCreateAirdropCommand({
config: AIRDROP_CONFIG,
observers: OPTIONAL_OBSERVER_PARTIES,
});
await ocp.createBatch({ actAs: [OPERATOR_PARTY] }).addCommand(createCmd).submitAndWaitForTransactionTree();
Use the ledger party that may act as the sender / operator implied by each choice. Execution steps need current Amulet mining round, rules contract, and input amulet contract IDs from your environment (validator or prior reads)—see the airdrop and simple-airdrop pages.
Topic pages
- Full Airdrop —
buildCreateAirdropCommand, config updates, observers, join (disclosed), execute. - SimpleAirdrop — create, execute with
transferPreapprovalCid, archive.
Errors
Pure builders in this extension do not throw Ocp* errors; validation happens on the participant when you submit. PaymentStreams helpers such as getFactoryDisclosedContracts do throw OcpValidationError (see payment stream utils).
See also
- OcpClient — client setup and batching.
- Payment Streams — recurring payments lifecycle.