OCP Canton SDK
Quickstart
Install @open-captable-protocol/canton, wire OcpClient from Canton clients, and read an issuer in OCF shape.
Install
npm install @open-captable-protocol/canton
Peer dependency (pin versions to the semver range npm prints):
@fairmint/canton-node-sdk— Ledger / Validator / Scan clients injected intoOcpClient
Optional sibling package @fairmint/open-captable-protocol-daml-js supplies generated DAML/JSON types referenced by converters.
Minimal example
FeaturedAppRight contracts travel as DisclosedContract payloads from Canton’s JSON API (same schema the DAML Ledger expects during submission):
import { Canton } from '@fairmint/canton-node-sdk';
import type { DisclosedContract } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
import { OcpClient, toContractId, toPartyId } from '@open-captable-protocol/canton';
const canton = new Canton({ network: 'localnet' });
const ocp = new OcpClient({
ledger: canton.ledger,
validator: canton.validator,
});
const featuredAppRight: DisclosedContract = {
templateId: 'REPLACE_WITH_TEMPLATE_ID',
contractId: 'REPLACE_WITH_CONTRACT_ID',
createdEventBlob: 'REPLACE_WITH_CREATED_EVENT_BLOB',
synchronizerId: 'REPLACE_WITH_SYNCHRONIZER_ID',
};
ocp.context.setFeaturedAppRight(featuredAppRight);
ocp.context.setIssuerParty(toPartyId('REPLACE_WITH_ISSUER_PARTY'));
const { data: issuer } = await ocp.OpenCapTable.issuer.get({
contractId: toContractId('REPLACE_WITH_ISSUER_CONTRACT_ID'),
});
console.log(issuer.object_type); // ISSUER
REPLACE_* markers highlight deployment-specific identifiers — obtain real disclose payloads from ledger queries or your onboarding service.
The validator client is optional for read-only Ledger work but required for PaymentStreams helpers that pull wallet / disclosed contracts through Validator APIs (Reference · PaymentStreams row).
Where next
| Topic | Link |
|---|---|
| Task recipes (batches / streams / reports) | Workflow recipes |
| Searchable namespaces | Reference |
| Contributor testing & ADR links | Guides |
Deep wiki content: ocp-canton-sdk wiki.