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.
The response from getEventsByContractId
The contract ID (for error messages)
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); Copy
const eventsResponse = await client.getEventsByContractId({ contractId });const createArg = extractCreateArgument(eventsResponse, contractId);
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.