import { LibraryEntity, ParamEntity } from '.'; import { StaticEntity } from './compilerWrapper'; import { ABICoder, Arguments, FunctionCall, Script, State, Struct, SupportedParamType, ScryptType, TypeResolver, StructEntity, ABIEntity, OpCode, CompileResult, AliasEntity } from './internal'; import { Library, ScryptTypeResolver } from './scryptTypes'; export interface TxContext { tx?: any; inputIndex?: number; inputSatoshis?: number; opReturn?: string; opReturnHex?: string; } export declare type VerifyError = string; export interface VerifyResult { success: boolean; error?: VerifyError; } export interface ContractDescription { version: number; compilerVersion: string; buildType: string; contract: string; md5: string; stateProps: Array; structs: Array; library: Array; alias: Array; abi: Array; asm: string; hex: string; file: string; sources: Array; sourceMap: Array; } export declare type AsmVarValues = { [key: string]: string; }; export declare type StepIndex = number; export declare class AbstractContract { static contractName: string; static abi: ABIEntity[]; static asm: string; static abiCoder: ABICoder; static opcodes?: OpCode[]; static file: string; static structs: StructEntity[]; static stateProps: Array; static types: Record; static asmContract: boolean; static statics: Array; static resolver: ScryptTypeResolver; constructor(...ctorParams: SupportedParamType[]); [key: string]: any; scriptedConstructor: FunctionCall; calls: Map; asmArgs: AsmVarValues | null; asmTemplateArgs: Map; statePropsArgs: Arguments; firstCall: boolean; get lockingScript(): Script; private _txContext?; set txContext(txContext: TxContext); get txContext(): TxContext; get typeResolver(): TypeResolver; get resolver(): ScryptTypeResolver; replaceAsmVars(asmVarValues: AsmVarValues): void; static findSrcInfo(interpretStates: any[], opcodes: OpCode[], stepIndex: number, opcodesIndex: number): OpCode | undefined; getTypeClassByType(type: string): typeof ScryptType; /** * @param states an object. Each key of the object is the name of a state property, and each value is the value of the state property. * @returns a locking script that includes the new states. If you only provide some but not all state properties, other state properties are not modified when calculating the locking script. */ getNewStateScript(states: Record): Script; run_verify(unlockingScriptASM: string, txContext?: TxContext, args?: Arguments): VerifyResult; private _dataPart; set dataPart(dataInScript: Script | undefined); get dataPart(): Script | undefined; setDataPart(state: State | string, isStateHex?: boolean): void; get codePart(): Script; get codeHash(): string; static getAsmVars(contractAsm: any, instAsm: any): AsmVarValues | null; arguments(pubFuncName: string): Arguments; ctorArgs(): Arguments; static fromASM(asm: string): AbstractContract; static fromHex(hex: string): AbstractContract; static fromTransaction(hex: string, outputIndex?: number): AbstractContract; static isStateful(contract: AbstractContract): boolean; } export declare function buildContractClass(desc: CompileResult | ContractDescription): typeof AbstractContract; /** * @deprecated use buildTypeClasses * @param desc CompileResult or ContractDescription */ export declare function buildStructsClass(desc: CompileResult | ContractDescription): Record; export declare function buildLibraryClass(desc: CompileResult | ContractDescription): Record; export declare function buildTypeClasses(descOrClas: CompileResult | ContractDescription | typeof AbstractContract): Record; export declare function buildTypeResolverFromDesc(desc: CompileResult | ContractDescription): TypeResolver; export declare function buildTypeResolver(contract: string, alias: AliasEntity[], structs: StructEntity[], library: LibraryEntity[], statics: StaticEntity[]): TypeResolver; export declare function buildScryptTypeResolver(desc: CompileResult | ContractDescription): ScryptTypeResolver;