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

    Function extractCreateArgument

    • Extract the createArgument from a contract events response.

      This helper provides consistent error handling for contract data extraction, replacing the duplicated pattern across get*AsOcf functions.

      Parameters

      • eventsResponse: ContractEventsResponse

        The response from getEventsByContractId

      • contractId: string

        The contract ID (for error messages)

      Returns unknown

      The createArgument from the contract's created event

      OcpParseError if the response is missing expected fields

      const eventsResponse = await client.getEventsByContractId({ contractId });
      const createArg = extractCreateArgument(eventsResponse, contractId);