Skip to content

Reference

Types — OcfObject output union

Every Ocf*Output type adds a readonly object_type discriminant; OcfObject is the exhaustive union used for narrowing after reads.

output.ts defines OcfIssuerOutput, OcfStakeholderOutput, transaction outputs like OcfStockIssuanceOutput, and dozens of other WithObjectType<..., 'TX_…'> aliases. The OcfObject union aggregates:

  • Objects — issuer, stakeholder, stock classes, plans, vesting terms, valuations, documents, financing
  • Issuances / transfers / cancellations / exercises / conversions / acceptances / retractions / repricing
  • Adjustments & splits — authorized shares, ratio adjustments, stock class splits, plan pool adjustments
  • Plan security legacy aliases (TX_PLAN_SECURITY_*)
  • Other — repurchase, consolidation, reissuance
  • Vesting — start, event, acceleration
  • Stakeholder events — relationship & status changes

Pattern

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

function label(entity: OcfObject) {
  switch (entity.object_type) {
    case 'ISSUER':
      return entity.legal_name;
    case 'STAKEHOLDER':
      return entity.name.legal_name;
    default:
      return entity.id;
  }
}

object_type literals match OCF enums (ISSUER, TX_STOCK_ISSUANCE, …).

See also

  • common.mdContractResult<T> where T is typically an Ocf*Output.

Source