/// import type { Algodv2, CompileOut } from "algosdk"; import type { ASCCache, PyASCCache, SCParams } from "../types"; export declare const tealExt = ".teal"; export declare const pyExt = ".py"; export declare const lsigExt = ".lsig"; export declare class CompileOp { algocl: Algodv2; pyCompile: PyCompileOp; cacheAssured: boolean; constructor(algocl: Algodv2); /** Gets the TEAL compiled result from artifacts cache and compiles the code if necessary. * Will throw an exception if the source file doesn't exists. * @param filename: name of the TEAL code in `/assets` directory. * (Examples: `mysc.teal, security/rbac.teal`) * MUST have a .teal, .lsig or .py extension * @param force: if true it will force recompilation even if the cache is up to date. * @param scTmplParams: Smart contract template parameters (used only when compiling PyTEAL to TEAL) */ ensureCompiled(filename: string, force?: boolean, scTmplParams?: SCParams): Promise; readTealAndHash(filename: string): [string, number]; readArtifact(filename: string): Promise; callCompiler(code: string): Promise; compile(filename: string, tealCode: string, tealHash: number): Promise; writeFile(filename: string, content: string): void; } export declare class PyCompileOp { compileOp: CompileOp; constructor(compileOp: CompileOp); /** * Description : returns compiled teal code from pyTeal file * @param filename : name of the PyTeal code in `/assets` directory. * Examples : [ gold.py, asa.py] * MUST have .py extension * @param force : if true it will force recompilation even if the cache is up to date. * @param scTmplParams: Smart contract template parameters (used only when compiling PyTEAL to TEAL) */ ensureCompiled(filename: string, force?: boolean, scTmplParams?: SCParams): Promise; readArtifact(filename: string): Promise; /** * Description: Runs a subprocess to execute python script * @param filename : python filename in assets folder * @param scInitParam : Smart contract initialization parameters. */ private runPythonScript; /** * Description: returns TEAL code using pyTeal compiler * @param filename : python filename in assets folder * @param scInitParam : Smart contract initialization parameters. */ compilePyTeal(filename: string, scInitParam?: string): string; }