Skip to content

Reference

Reference

API reference for @open-captable-protocol/canton.

Everything flows through one object — OcpClient. Instantiate it once with your Canton clients, then call methods to read or write cap table data.

import { OcpClient } from '@open-captable-protocol/canton';

const ocp = new OcpClient({ ledger: canton.ledger });

Reads return ContractResult<T>{ data, contractId } where data is a typed OCF object. Writes go through CapTableBatch — queue changes, execute atomically.


Setup & authorization

Before you can create a cap table, an issuer party must be registered with the OCP Factory.

createFactoryDeploy an OCP Factory on a new Canton network. Not needed on mainnet or devnet.
authorizeRegister an issuer party with the factory. Returns an IssuerAuthorization you pass to buildCreate.
withdrawRevoke an issuer’s authorization.
issuer.buildCreateBuild the command to create an Issuer + CapTable in one transaction.

Reading data

All getters take { contractId } and return ContractResult<T>{ data, contractId }.

Objects

document.getA document attached to the cap table.
issuer.getThe company — root of the cap table.
stakeholder.getAn individual or entity holding securities.
stockClass.getA class of stock (common, preferred, etc.).
stockLegendTemplate.getA stock legend template.
stockPlan.getAn equity incentive plan.
valuation.getA company valuation record.
vestingTerms.getVesting schedule terms.

Transactions — all follow the same get pattern.

convertibleAcceptance.getconvertibleCancellation.get
convertibleIssuance.getconvertibleTransfer.get
equityCompensationCancellation.getequityCompensationExercise.get
equityCompensationTransfer.getissuerAuthorizedSharesAdjustment.get
stakeholderStatusChangeEvent.getstockAcceptance.get
stockClassAuthorizedSharesAdjustment.getstockClassConversionRatioAdjustment.get
stockConsolidation.getstockConversion.get
stockPlanPoolAdjustment.getstockReissuance.get
stockTransfer.getvestingAcceleration.get
vestingStart.getwarrantAcceptance.get
warrantExercise.getwarrantIssuance.get

Writing data

Batch updates (CapTableBatch)Queue creates / edits / deletes and submit atomically. Covers capTable.update, CapTableBatch, and buildUpdateCapTableCommand.

Cap table lifecycle

capTable.classifyCheck if an issuer has an active cap table on the pinned package version.
capTable.getStateSnapshot of entity counts for a cap table.
capTable.archiveArchive the cap table and issuer (entity maps must be empty first).
archiveFullCapTableFull teardown — sweeps all entities then archives.
getSystemOperatorPartyIdResolve the system operator party for the current network.

Errors & utils

OcpError hierarchyOcpValidationError, OcpContractError, OcpNetworkError, OcpParseError.
TypesContractResult<T>, branded IDs, OCF output discriminants — usually inferred by TypeScript.
ValidationEntity validators, field guards, Zod schemas — use before submitting.
OCF data & conversionsType guards, metadata, comparison, DAML↔OCF conversions.
Cap table state & syncOCF manifest extraction, replication diffs, transaction helpers.

Transport details (auth, HTTP, retries) are handled by @fairmint/canton-node-sdk — see the Canton Node SDK wiki.