Company valuation reports live under ocp.OpenCapTableReports.companyValuationReport. buildCreate only constructs { command, disclosedContracts } (requires FeaturedAppRight as a DisclosedContract). create, addObservers, and update call submitAndWaitForTransactionTree (or equivalent flows) and throw OcpContractError / OcpParseError when parsing transaction trees or contract arguments fails.
Setup
import { OcpClient } from '@open-captable-protocol/canton';
const ocp = new OcpClient({ ledger: canton.ledger });
Minimal example — build + submit yourself
const { command, disclosedContracts } = ocp.OpenCapTableReports.companyValuationReport.buildCreate({
companyId: COMPANY_ID,
companyValuation: '10000000', // or number → stringified
observers: [],
featuredAppRightContractDetails: FEATURED_APP_RIGHT_DISCLOSED_CONTRACT,
});
await canton.ledger.submitAndWaitForTransactionTree({ commands: [command], disclosedContracts });
Minimal example — submit inside SDK
const { contractId, updateId } = await ocp.OpenCapTableReports.companyValuationReport.create({
companyId: COMPANY_ID,
companyValuation: '5000000',
observers: [],
featuredAppRightContractDetails: FEATURED_APP_RIGHT_DISCLOSED_CONTRACT,
});
API
buildCreate(params) → CommandWithDisclosedContracts
companyId(required)companyValuation(required) —string | number(numbers coerced to string).observers(optional) — default[].featuredAppRightContractDetails(required) — fullDisclosedContractblob for cross-domain visibility.
Throws: OcpValidationError when the ledger client’s network is missing from reports-factory-contract-id.json (INVALID_FORMAT).
create(params)
Same params as buildCreate; submits with disclosed contracts and searches the transaction tree for the created CompanyValuationReport.
Throws: OcpContractError with RESULT_NOT_FOUND when the expected CreatedTreeEvent is missing.
addObservers(params)
companyValuationReportContractId(required)added(required) —string[]observer parties.
Loads the contract’s created event, reads system_operator from create arguments, submits AddObservers with actAs: [systemOperator], then resolves the successor contract id.
Throws: OcpContractError if events or create arguments are missing; OcpParseError if system_operator is absent (SCHEMA_MISMATCH); OcpContractError if the created event is not found in the tree.
update(params)
companyValuationReportContractId(required)newCompanyValuation(required) —string | number
Same acting-party discovery as addObservers, exercises SetCompanyValuation.
Throws: Same classes as addObservers plus OcpContractError when the update result node is missing.
Auth and disclosure
- Create requires whoever submits to be authorized on the ReportsFactory for your deployment, with FeaturedAppRight disclosed to the transaction.
- Add observers / update automatically use
system_operatorfrom the report’s create arguments asactAs; ensure your ledger token can act as that party.
See also
- Types: common —
Command,DisclosedContract. - Errors —
OcpContractError,OcpParseError,OcpValidationError.