import { TransactionContextCommon } from '../transaction/transaction-types'; import { CompilationData, Scenario } from './compiler-types'; import { AuthenticationTemplateScenario, AuthenticationTemplateScenarioData } from './template-types'; /** * The contents of an `AuthenticationTemplateScenario` without the `name` and * `description`. */ export declare type ScenarioDefinition = Pick; declare type RequiredTwoLevels = { [P in keyof T]-?: Required; }; /** * All scenarios extend the default scenario, so the `data`, `transaction` (and * all `transaction` properties), and `value` properties are guaranteed to be * defined in an extended scenario definition. */ export declare type ExtendedScenarioDefinition = Required> & RequiredTwoLevels> & Required>; /** * Given a compilation environment, generate the default scenario which is * extended by all the environments scenarios. * * For details on default scenario generation, see * `AuthenticationTemplateScenario.extends`. * * @param environment - the compilation environment from which to generate the * default scenario */ export declare const generateDefaultScenarioDefinition: , "sha256" | "sha512" | "ripemd160" | "createAuthenticationProgram" | "entityOwnership" | "lockingScriptTypes" | "opcodes" | "scenarios" | "scripts" | "secp256k1" | "sourceScriptIds" | "unlockingScripts" | "unlockingScriptTimeLockTypes" | "variables" | "vm">, TransactionContext>(environment: Environment) => string | ExtendedScenarioDefinition; /** * Extend the `data` property of a scenario definition with values from a parent * scenario definition. Returns the extended value for `data`. * * @param parentData - the scenario `data` which is extended by the child * scenario * @param childData - the scenario `data` which may override values from the * parent scenario */ export declare const extendScenarioDefinitionData: (parentData: NonNullable, childData: NonNullable) => { keys?: { privateKeys?: { [variableId: string]: string; } | undefined; } | { privateKeys: { [x: string]: string; }; } | undefined; hdKeys?: { addressIndex?: number | undefined; hdPublicKeys?: { [entityId: string]: string; } | undefined; hdPrivateKeys?: { [entityId: string]: string; } | undefined; } | { hdPublicKeys?: { [entityId: string]: string; } | { [x: string]: string; } | undefined; hdPrivateKeys?: { [entityId: string]: string; } | { [x: string]: string; } | undefined; addressIndex?: number | undefined; } | undefined; bytecode?: { [fullIdentifier: string]: string; } | { [x: string]: string; } | undefined; currentBlockHeight?: number | undefined; currentBlockTime?: number | undefined; }; /** * Extend a child scenario definition with values from a parent scenario * definition. Returns the extended values for `data`, `transaction`, and * `value`. * * @param parentScenario - the scenario which is extended by the child scenario * @param childScenario - the scenario which may override values from the parent * scenario */ export declare const extendScenarioDefinition: (parentScenario: ParentScenarioType, childScenario: AuthenticationTemplateScenario) => ParentScenarioType extends ExtendedScenarioDefinition ? ExtendedScenarioDefinition : Pick; /** * Generate the full scenario which is extended by the provided scenario * identifier. Scenarios for which `extends` is `undefined` extend the default * scenario for the provided compilation environment. * * @param scenarioId - the identifier of the scenario for from which to select * the extended scenario * @param environment - the compilation environment from which to generate the * extended scenario * @param sourceScenarioIds - an array of scenario identifiers indicating the * path taken to arrive at the current scenario - used to detect and prevent * cycles in extending scenarios (defaults to `[]`) */ export declare const generateExtendedScenario: , "sha256" | "sha512" | "ripemd160" | "createAuthenticationProgram" | "entityOwnership" | "lockingScriptTypes" | "opcodes" | "scenarios" | "scripts" | "secp256k1" | "sourceScriptIds" | "unlockingScripts" | "unlockingScriptTimeLockTypes" | "variables" | "vm">, TransactionContext>({ environment, scenarioId, sourceScenarioIds, }: { environment: Environment; scenarioId?: string | undefined; sourceScenarioIds?: string[] | undefined; }) => string | ExtendedScenarioDefinition; /** * Derive standard `CompilationData` properties from an extended scenario * definition. * @param definition - a scenario definition which has been extended by the * default scenario definition */ export declare const extendedScenarioDefinitionToCompilationData: (definition: ScenarioDefinition & Required>) => CompilationData; /** * Extend a `CompilationData` object with the compiled result of the bytecode * scripts provided by a `AuthenticationTemplateScenarioData`. * * @param compilationData - the compilation data to extend * @param environment - the compilation environment in which to compile the * scripts * @param scenarioDataBytecodeScripts - the `data.bytecode` property of an * `AuthenticationTemplateScenarioData` */ export declare const extendCompilationDataWithScenarioBytecode: , "sha256" | "sha512" | "ripemd160" | "createAuthenticationProgram" | "entityOwnership" | "lockingScriptTypes" | "opcodes" | "scenarios" | "scripts" | "secp256k1" | "sourceScriptIds" | "unlockingScripts" | "unlockingScriptTimeLockTypes" | "variables" | "vm">, TransactionContext>({ compilationData, environment, scenarioDataBytecodeScripts, }: { compilationData: CompilationData; environment: Environment; scenarioDataBytecodeScripts: NonNullable; }) => string | CompilationData; /** * Generate a scenario given a compilation environment. If neither `scenarioId` * or `unlockingScriptId` are provided, the default scenario for the compilation * environment will be generated. * * Returns either the full `CompilationData` for the selected scenario or an * error message (as a `string`). * * @param scenarioId - the ID of the scenario to generate – if `undefined`, the * default scenario * @param unlockingScriptId - the ID of the unlocking script under test by this * scenario – if `undefined` but required by the scenario, an error will be * produced * @param environment - the compilation environment from which to generate the * scenario */ export declare const generateScenarioCommon: , "sha256" | "sha512" | "ripemd160" | "createAuthenticationProgram" | "entityOwnership" | "lockingScriptTypes" | "opcodes" | "scenarios" | "scripts" | "secp256k1" | "sourceScriptIds" | "unlockingScripts" | "unlockingScriptTimeLockTypes" | "variables" | "vm">>({ environment, scenarioId, unlockingScriptId, }: { environment: Environment; scenarioId?: string | undefined; unlockingScriptId?: string | undefined; }) => Scenario | string; export {}; //# sourceMappingURL=scenarios.d.ts.map