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

    Function normalizeDeprecatedOcfFields

    • Automatically normalize deprecated fields in OCF data based on entity type.

      This function is designed to be called by the SDK internally when processing OCF data, making deprecated field handling transparent to end-users.

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • entityType: string

        The OCF entity type (e.g., 'stockPlan')

      • data: T

        The OCF data that may contain deprecated fields

      • options: { context?: string; emitWarnings?: boolean } = {}

        Optional configuration

      Returns NormalizedOcfDataResult<T>

      The normalized data with deprecated fields converted to current format

        // SDK automatically normalizes deprecated fields
      const result = normalizeDeprecatedOcfFields('stockPlan', {
      id: 'plan-1',
      stock_class_id: 'sc-1', // deprecated, automatically converted
      plan_name: 'Equity Plan',
      });
      // result.data.stock_class_ids === ['sc-1']