buildUpdateCapTableCommand materializes CommandWithDisclosedContracts (ExerciseCommand + disclosures) identical to chaining CapTableBatch, minus executing submission. Typical use cases:
- Fuse
UpdateCapTablewith unrelated DAMLcommand[]payloads inside CantonsubmitAndWaitutilities that expect rawCommandobjects. - Property-test payloads without constructing
LedgerJsonApiClient(passactAs: []insideCapTableBatch).
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:paramsinheritscapTableContractId+ optionalcapTableContractDetails;operationslists typed tuples for creates/edits/deletes. - Under the hood allocates
new CapTableBatch({ ...params, actAs: [] }, null), soexecuteis impossible—buildonly.
Throws match CapTableBatch: OcpValidationError (issuer, empty queue, undefined payload).