import { AuthenticationTemplate, AuthenticationTemplateEntity, AuthenticationTemplateScenario, AuthenticationTemplateScenarioData, AuthenticationTemplateScenarioInput, AuthenticationTemplateScenarioOutput, AuthenticationTemplateScript, AuthenticationTemplateScriptLocking, AuthenticationTemplateScriptTested, AuthenticationTemplateScriptUnlocking, AuthenticationTemplateVariable } from './template-types'; /** * Parse an authentication template `scripts` object into its component scripts, * validating the shape of each script object. Returns either an error message * as a string or an object of cloned and sorted scripts. * * @param scripts - the `scripts` property of an `AuthenticationTemplate` */ export declare const parseAuthenticationTemplateScripts: (scripts: object) => string | { locking: { [id: string]: AuthenticationTemplateScriptLocking; }; other: { [id: string]: AuthenticationTemplateScript; }; tested: { [id: string]: AuthenticationTemplateScriptTested; }; unlocking: { [id: string]: AuthenticationTemplateScriptUnlocking; }; }; /** * Parse an authentication template entity `variables` object into its component * variables, validating the shape of each variable object. Returns either an * error message as a string or the cloned variables object. * * @param scripts - the `scripts` property of an `AuthenticationTemplate` */ export declare const parseAuthenticationTemplateVariable: (variables: object, entityId: string) => string | { [id: string]: AuthenticationTemplateVariable; }; /** * Parse an authentication template `entities` object into its component * entities, validating the shape of each entity object. Returns either an error * message as a string or the cloned entities object. * * @param scripts - the `scripts` property of an `AuthenticationTemplate` */ export declare const parseAuthenticationTemplateEntities: (entities: object) => string | { [id: string]: AuthenticationTemplateEntity; }; /** * Validate and clone an Authentication Template Scenario `data.hdKeys` object. * * @param hdKeys - the `data.hdKeys` object to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `scenario "test"` or * `'lockingBytecode.override' in output 2 of scenario "test"` */ export declare const parseAuthenticationTemplateScenarioDataHdKeys: (hdKeys: object, location: string) => string | AuthenticationTemplateScenarioData['hdKeys']; /** * Validate and clone an Authentication Template Scenario `data.keys` object. * * @param keys - the `data.keys` object to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `scenario "test"` or * `'lockingBytecode.override' in output 2 of scenario "test"` */ export declare const parseAuthenticationTemplateScenarioDataKeys: (keys: object, location: string) => string | AuthenticationTemplateScenarioData['keys']; /** * Validate and clone an Authentication Template Scenario `data` object. * * @param data - the `data` object to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `scenario "test"` or * `'lockingBytecode.override' in output 2 of scenario "test"` */ export declare const parseAuthenticationTemplateScenarioData: (data: object, location: string) => string | AuthenticationTemplateScenarioData; /** * Validate and clone an Authentication Template Scenario `transaction.inputs` * array. * * @param inputs - the `transaction.inputs` array to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `scenario "test"` */ export declare const parseAuthenticationTemplateScenarioTransactionInputs: (inputs: unknown, location: string) => undefined | string | AuthenticationTemplateScenarioInput[]; /** * Validate and clone an Authentication Template Scenario transaction output * `lockingBytecode` object. * * @param outputs - the `transaction.outputs[outputIndex].lockingBytecode` * object to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `output 2 in scenario "test"` */ export declare const parseAuthenticationTemplateScenarioTransactionOutputLockingBytecode: (lockingBytecode: object, location: string) => string | AuthenticationTemplateScenarioOutput['lockingBytecode']; /** * Validate and clone an Authentication Template Scenario `transaction.outputs` * array. * * @param outputs - the `transaction.outputs` array to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `of output 2 in scenario "test"` */ export declare const parseAuthenticationTemplateScenarioTransactionOutputs: (outputs: unknown, location: string) => undefined | string | AuthenticationTemplateScenarioOutput[]; /** * Validate and clone an Authentication Template Scenario `transaction` object. * * @param transaction - the `transaction` object to validate and clone * @param location - the location of the error to specify in error messages, * e.g. `of output 2 in scenario "test"` */ export declare const parseAuthenticationTemplateScenarioTransaction: (transaction: object, location: string) => string | AuthenticationTemplateScenario['transaction']; /** * Validate and clone an object of Authentication Template scenarios. * * @param scenarios - the scenarios object to validate and clone */ export declare const parseAuthenticationTemplateScenarios: (scenarios: object) => string | { [id: string]: AuthenticationTemplateScenario; }; /** * Parse and validate an authentication template, returning either an error * message as a string or a valid, safely-cloned `AuthenticationTemplate`. * * This method validates both the structure and the contents of a template: * - All properties and sub-properties are verified to be of the expected type. * - The ID of each entity, script, and scenario is confirmed to be unique. * - Script IDs referenced by entities and other scripts (via `unlocks`) are * confirmed to exist. * - The derivation paths of each HdKey are validated against each other. * * This method does not validate the BTL contents of scripts (by attempting * compilation, evaluate `AuthenticationTemplateScriptTest`s, or test scenario * generation. Unknown properties are ignored and excluded from the final * result. * * @param maybeTemplate - object to validate as an authentication template */ export declare const validateAuthenticationTemplate: (maybeTemplate: unknown) => string | AuthenticationTemplate; //# sourceMappingURL=template-validation.d.ts.map