Skip to content

Reference

buildUpdateCapTableCommand — non-fluent UpdateCapTable builder

Stateless helper compiling creates/edits/deletes into a Single ExerciseCommand for UpdateCapTable when CapTableBatch.execute is not invoked.

buildUpdateCapTableCommand materializes CommandWithDisclosedContracts (ExerciseCommand + disclosures) identical to chaining CapTableBatch, minus executing submission. Typical use cases:

  1. Fuse UpdateCapTable with unrelated DAML command[] payloads inside Canton submitAndWait utilities that expect raw Command objects.
  2. Property-test payloads without constructing LedgerJsonApiClient (pass actAs: [] inside CapTableBatch).
import { buildUpdateCapTableCommand } from '@open-captable-protocol/canton';

const payload = buildUpdateCapTableCommand(
  {
    capTableContractId,
    capTableContractDetails: optionalTemplateHints,
  },
  {
    creates: [{ type: 'stakeholder', data: OCF_SHAPE }],
    edits: [{ type: 'stockClass', data: STOCK_CLASS_SHAPE }],
    deletes: [{ type: 'document', id: 'doc_id' }],
  },
);
await submitSomewhere(payload.command /* + disclosed */);

Signature notes

  • Parameters mirror CapTableBatch: params inherits capTableContractId + optional capTableContractDetails; operations lists typed tuples for creates/edits/deletes.
  • Under the hood allocates new CapTableBatch({ ...params, actAs: [] }, null), so execute is impossible— build only.

Throws match CapTableBatch: OcpValidationError (issuer, empty queue, undefined payload).



Source