import { ContractParamValue, FragmentDisplayData } from './types'; export declare class FunctionFragmentView { private readonly _functionFragment; private readonly _displayData; private _contractInterface; private readonly _generatedCounts; private readonly _values; constructor(functionFragment: EthersTypes.FunctionFragment, contractInterface: EthersTypes.Interface); /** * @returns The contract interface for this function fragment */ get contractInterface(): EthersTypes.Interface; /** * Returns the flat array structure that can be used to render the * inputs of the function fragment. It handles nested structures and * arrays and enables you to focus on the rendering logic. */ get displayData(): FragmentDisplayData; /** * @returns The FunctionFragment for the backing function for this view */ get functionFragment(): EthersTypes.FunctionFragment; /** * Encodes the inputs of the function fragment into a call data string. * This can be used to call the function on the contract. */ encodeFunctionData(): string; /** * Sets the value for the input at the given path. * @param path * @param value */ setValue(path: string, value: ContractParamValue): void; /** * Returns the value for the input at the given path. * @param path */ getValue(path: string): ContractParamValue; /** * Adds an element to the dynamic array at the given index in the display data. * @param arrayDefinitionIndex The index of the array definition in the display data */ addArrayItem(arrayDefinitionIndex: number): void; /** * Deletes an element from the dynamic array at the given index in the display data. * The item to delete is selected by the indexToDelete parameter. * * @param arrayDefinitionIndex The index of the array definition in the display data * @param indexToDelete The index of the item to delete in the dynamic array */ deleteArrayItem(arrayDefinitionIndex: number, indexToDelete: number): void; /** * Generate the display data for the inputs of this function fragment. * The display data is a flat array structure that can be used to render * the inputs of the function fragment. It handles nested structures and * arrays and enables you to focus on the rendering logic. */ private generateInputDisplayData; private initializeDisplayDataValues; /** * Computes the contract arguments for this function fragment. It uses the * values set for the inputs to compute the arguments. If a value is not set * for an input, it throws an error. * @private */ private computeContractArguments; private computeArgument; /** * Transforms the param type into a flat array structure that can be used to render * the inputs of the function fragment. It handles nested structures and * arrays and enables you to focus on the rendering logic. * @param paramType * @param values * @param indent * @param path * @param pathOverride * @param extraParams * @private */ private transformParamTypeToDisplayData; /** * Deletes the values for the given path and all the sub-paths of the path. * @param path * @private */ private deleteValuesForPath; /** * Replaces the values for the given path and all the sub-paths of the path. If the * deleteReplaced parameter is true, it deletes the replaced values. * * @param path * @param newPath * @param deleteReplaced * @private */ private replaceValuesForPath; /** * Returns the input param at the given sub-path. * * @param subPath * @private */ private getInputParamAtPath; /** * Modifies the array elements at the given index in the display data. It adds the * given count of elements to the array. If the count is negative, it deletes the * elements from the end of the array. * * @param arrayDefinitionIndex * @param countToAdd * @private */ private modifyArrayElements; }