Open Cap Table Protocol Canton SDK - v0.2.84
    Preparing search index...

    Type Alias BuildCreateOcfObjectCommandFunction

    BuildCreateOcfObjectCommandFunction: (
        params: CreateOcfObjectParams,
    ) => CommandWithDisclosedContracts[]

    Builds command(s) for creating OCF objects based on their object_type.

    This function inspects the object_type field in the OCF data and routes to the appropriate buildCreate*Command function. If previousContractId is provided, it will also build an archive command for the old contract.

    Returns an array of commands and their disclosed contracts that can be used in a batch or executed directly.

    Note: ISSUER object_type is not supported as it has different input requirements. Use client.issuer.buildCreateIssuerCommand() directly for creating issuers.

    Type Declaration

      // Create new object
    const commands = client.buildCreateOcfObjectCommand({
    issuerContractId: 'issuer-contract-id',
    featuredAppRightContractDetails: featuredAppRight,
    issuerParty: 'party::issuer',
    ocfData: {
    object_type: 'STAKEHOLDER',
    id: 'stakeholder-1',
    name: { legal_name: 'John Doe' },
    stakeholder_type: 'INDIVIDUAL'
    }
    });

    // Archive old and create new
    const commands = client.buildCreateOcfObjectCommand({
    issuerContractId: 'issuer-contract-id',
    featuredAppRightContractDetails: featuredAppRight,
    issuerParty: 'party::issuer',
    previousContractId: 'old-contract-id',
    ocfData: { ... }
    });