import { FunctionFragmentView } from '../FunctionFragmentView'; import { CollectionData } from '../collection'; import { WidgetExecutionConfiguration } from '../types'; import { ExecutionResult } from './ExecutionResult'; import { ExecutionContext } from './types'; import { DisplayResult } from './util'; interface ExecutableFunctionConfiguration { contractId: string; fragmentView: FunctionFragmentView; context: ExecutionContext; } export declare class WidgetExecutor { #private; readonly supportedChains: Set; private readonly functions; private readonly _transactionSimulator; private readonly contractAddresses; private signer; private provider; constructor(collectionData: CollectionData, execution: WidgetExecutionConfiguration); /** * Sets the signer to use for signed transactions. * @param signer */ setSigner(signer: EthersTypes.Signer): void; setActiveChainId(chainId: number): void; get activeChainId(): number; getExecutionContext(index: number): ExecutionContext; get functionViews(): readonly FunctionFragmentView[]; /** * Runs a static call on the contract. This is only supported for * constant (read-only) functions. * * @param func */ readFunction(func: ExecutableFunctionConfiguration): Promise; /** * Executes a transaction on the contract. This is only supported for * mutable and payable functions. * @param func */ executeFunction(func: ExecutableFunctionConfiguration): Promise; /** * Executes all functions on the widget. When the function is read-only, the result * is returned. When the function is mutable, the transaction receipt is returned. */ execute(): Promise>; /** * Simulates all functions on the widget. When the function is read-only, the result * is derived by making a static call to the contract. When the function is mutable, * the transaction is simulated in the bundle. * * Important note: The read-only calls are not simulated. They are executed directly * on the contract. This is because the simulation API does not support static calls. */ simulate(): Promise>; /** * Simulates a single function on the widget. When the function is read-only, an error * is thrown because the simulation API does not support static calls. When the * function is mutable or payable, the transaction is simulated and the transaction * receipt is returned. * * @param func The function to simulate */ simulateFunction(func: ExecutableFunctionConfiguration): Promise; private getProvider; private prepareExecutableCall; private simulateFunctions; } export {};