Important: archiveFullCapTable ships as a @open-captable-protocol/canton package-level export. It wires together CapTableBatch, classifyIssuerCapTables, and archiveCapTable for automation (explorer routes, Canton CLI teardown, replication swaps). OcpClient does not mount it under OpenCapTable.capTable—import it beside your OcpClient wiring.
Deletion traffic uses issuer credentials, while archiving uses system_operator (two ledger clients, two Canton identities):
import { archiveFullCapTable } from '@open-captable-protocol/canton';
const result = await archiveFullCapTable(deleteClient, archiveClient, issuerPartyId, {
capTableContractId: 'CURRENT_CAP_TABLE_CID',
entities,
}, { systemOperatorPartyId: 'OPTIONAL Cached operator' });
console.log(result.archiveUpdateId, result.deletedEntityCount);
entities is a Map<OcfEntityType, Set<string>> enumerating IDs your offline diff believes still exist (issuer entries ignored—they cannot be **delete**d through UpdateCapTable anyway). The sweep runs batched delete loops until exhaustion, rotates updatedCapTableCid, then calls archiveCapTable.
Throws OcpContractError with CONTRACT_NOT_FOUND / SCHEMA_MISMATCH when Canton context cannot reconcile a single CapTable row on the pinned package path.
Returns
{
archiveUpdateId: string;
deletedEntityCount: number;
}
Options
ArchiveFullCapTableOptions.systemOperatorPartyId — skips an extra Canton round trip when callers already cached system_operator from classification.current.systemOperatorPartyId.