import { mvc } from './utils'; import { AbstractContract, TxContext, VerifyResult, AsmVarValues } from './contract'; import { SupportedParamType, ScryptTypeResolver } from './scryptTypes'; import { ABIEntity, ParamEntity } from './compilerWrapper'; export declare type Script = mvc.Script; export declare type FileUri = string; /** * Configuration for a debug session. */ export interface DebugConfiguration { type: 'scrypt'; request: 'launch'; internalConsoleOptions: 'openOnSessionStart'; name: string; program: string; constructorArgs: SupportedParamType[]; pubFunc: string; pubFuncArgs: SupportedParamType[]; asmArgs?: AsmVarValues; txContext?: any; } export interface DebugLaunch { version: '0.2.0'; configurations: DebugConfiguration[]; } export interface Argument { name: string; type: string; value: SupportedParamType; } export declare type Arguments = Argument[]; export declare class FunctionCall { methodName: string; readonly contract: AbstractContract; readonly args: Arguments; private _unlockingScriptAsm?; private _lockingScriptAsm?; get unlockingScript(): Script | undefined; get lockingScript(): Script | undefined; init(asmVarValues: AsmVarValues): void; constructor(methodName: string, binding: { contract: AbstractContract; lockingScriptASM?: string; unlockingScriptASM?: string; args: Arguments; }); toASM(): string; toString(): string; toScript(): Script; toHex(): string; genLaunchConfig(txContext?: TxContext): FileUri; verify(txContext?: TxContext): VerifyResult; } export declare class ABICoder { abi: ABIEntity[]; resolver: ScryptTypeResolver; constructor(abi: ABIEntity[], resolver: ScryptTypeResolver); checkArgs(contractname: string, funname: string, params: ParamEntity[], ...args: SupportedParamType[]): void; encodeConstructorCall(contract: AbstractContract, asmTemplate: string, ...args: SupportedParamType[]): FunctionCall; parseStateHex(contract: AbstractContract, scriptHex: string): Arguments; encodeConstructorCallFromRawHex(contract: AbstractContract, asmTemplate: string, raw: string): FunctionCall; encodePubFunctionCall(contract: AbstractContract, name: string, args: SupportedParamType[]): FunctionCall; /** * build a FunctionCall by function name and unlocking script in hex. * @param contract * @param name name of public function * @param hex hex of unlocking script * @returns a FunctionCall which contains the function parameters that have been deserialized */ encodePubFunctionCallFromHex(contract: AbstractContract, name: string, hex: string): FunctionCall; encodeParams(args: SupportedParamType[], paramsEntitys: ParamEntity[]): string; encodeParamArray(args: SupportedParamType[], arrayParam: ParamEntity): string; encodeParam(arg: SupportedParamType, paramEntity: ParamEntity): string; }