authorizeIssuer walks the Canton JSON API ledger, targeting the OCP Factory (AuthorizeIssuer choice). You provide the issuer party to whitelist; optionally override factory templateId/contractId for staging overlays. Canton responses must expose a CreatedTreeEvent for IssuerAuthorization—otherwise OcpContractError (RESULT_NOT_FOUND) halts enrichment.
Returned payload extends DisclosedContract (issuerAuthorizationContractId, blobs, synchronizerId, Canton transactionTree) enabling downstream issuer.buildCreate.
Import and receiver
import { OcpClient, toPartyId } from '@open-captable-protocol/canton';
const auth = await ocp.OpenCapTable.issuerAuthorization.authorize({
issuer: toPartyId('issuer::staging'),
});
console.log(auth.contractId); // issuerAuthorizationContractId usable for disclosures
console.log(auth.updateId);
Need a factory? On mainnet and devnet the factory is pre-deployed. For localnet or custom networks, call
createFactoryfirst — see the Quickstart for the setup flow.
Parameters
You can configure the OCP Factory on new OcpClient({ ledger, factory: { contractId, templateId } }). Resolution order is: per-call factoryContractId / factoryTemplateId (highest priority) → client-level factory → bundled network config (mainnet / devnet). On localnet or other custom networks, set factory on OcpClient instead of passing factory coordinates on every authorize() call.
| Field | Requirement | Notes |
|---|---|---|
| issuer | Required Canton party (string) | Recipient you plan to CreateCapTable. |
| factoryContractId / factoryTemplateId | Optional pair | Must accompany each other — otherwise OcpValidationError. If omitted, the SDK uses the client-level factory (if set), else factoryContractIdData keyed by client.getNetwork() (staging vs prod overlays). Unsupported network with no factory configured ⇒ OcpValidationError (INVALID_FORMAT). |
Returns
Promise<AuthorizeIssuerResult> — DisclosedContract (issuerAuthorizationContractId + createdEventBlob) plus Canton transactionTree. Use contractId / createdEventBlob / templateId** for **IssuerAuthorization** disclosures powering **issuer.buildCreate`.
Throws OcpContractError if IssuerAuthorization creation event missing (AuthorizeIssuer success but ledger introspection mismatched expectations).
Auth & Canton requirements
Submission uses Canton credentials attached to OcpClient.ledger; ensure factory admins authorize AuthorizeIssuer.