import { DecodedLogEntryEvent, LogTopic, TransactionReceipt } from "web3";
import { Address, Hash, SchemePermissions } from "./commonTypes";
import { ContractWrapperFactory } from "./contractWrapperFactory";
/**
 * Abstract base class for all Arc contract wrapper classes
 *
 * Example of how to define a wrapper:
 *
 * ```
 * import { ContractWrapperBase } from "../contractWrapperBase";
 * import { ContractWrapperFactory } from "../contractWrapperFactory";
 *
 * export class AbsoluteVoteWrapper extends ContractWrapperBase {
 *   [ wrapper properties and methods ]
 * }
 *
 * export const AbsoluteVote = new ContractWrapperFactory("AbsoluteVote", AbsoluteVoteWrapper);
 * ```
 */
export declare abstract class ContractWrapperBase {
    private solidityContract;
    /**
     * The wrapper factor class providing static methods `at(someAddress)`, `new()` and `deployed()`.
     */
    abstract factory: ContractWrapperFactory<any>;
    /**
     * The name of the contract.
     */
    abstract name: string;
    /**
     * A more friendly name for the contract.
     */
    abstract friendlyName: string;
    /**
     * The address of the contract
     */
    readonly address: Address;
    /**
     * The underlying truffle contract object.  Use this to access
     * parts of the contract that aren't accessible via the wrapper.
     */
    contract: any;
    /**
     * ContractWrapperFactory constructs this
     * @param solidityContract The json contract truffle artifact
     */
    constructor(solidityContract: any);
    /**
     * Initialize from a newly-migrated instance.
     * This will migrate a new instance of the contract to the net.
     * @returns this
     */
    hydrateFromNew(...rest: Array<any>): Promise<any>;
    /**
     * Initialize from a given address on the current network.
     * @param address of the deployed contract
     * @returns this
     */
    hydrateFromAt(address: string): Promise<any>;
    /**
     * Initialize as it was migrated by Arc.js on the current network.
     * @returns this
     */
    hydrateFromDeployed(): Promise<any>;
    /**
     * Call setParameters on this.contract.
     * Returns promise of ArcTransactionDataResult<Hash> where Result is the parameters hash.
     *
     * @param {any} params -- parameters as the contract.setParameters function expects them.
     */
    setParameters(...params: Array<any>): Promise<ArcTransactionDataResult<Hash>>;
    /**
     * Given a hash, returns the associated parameters as an object.
     * @param paramsHash
     */
    getParameters(paramsHash: Hash): Promise<any>;
    /**
     * Given an avatar address, returns the schemes parameters hash
     * @param avatarAddress
     */
    getSchemeParametersHash(avatarAddress: Address): Promise<Hash>;
    /**
     * Given a hash, returns the associated parameters as an array, ordered by the order
     * in which the parameters appear in the contract's Parameters struct.
     * @param paramsHash
     */
    getParametersArray(paramsHash: Hash): Promise<Array<any>>;
    /**
     * Returns the controller associated with the given avatar
     * @param avatarAddress
     */
    getController(avatarAddress: Address): Promise<any>;
    protected _setParameters(functionName: string, ...params: Array<any>): Promise<ArcTransactionDataResult<Hash>>;
    /**
     * Returns this scheme's permissions.
     * @param avatarAddress
     */
    protected _getSchemePermissions(avatarAddress: Address): Promise<SchemePermissions>;
    protected _getSchemeParameters(avatarAddress: Address): Promise<any>;
    /**
     * Returns a function that creates an EventFetcher<TArgs>.
     * For subclasses to use to create their event handlers.
     * This is identical to what you get with Truffle, except that
     * the result param of the callback is always guaranteed to be an array.
     *
     * Example:
     *
     *    public NewProposal = this.eventWrapperFactory<NewProposalEventResult>("NewProposal");
     *    const event = NewProposal(...);
     *    event.get(...).
     *
     * @type TArgs - name of the event args (EventResult) interface, like NewProposalEventResult
     * @param eventName - Name of the event like "NewProposal"
     */
    protected createEventFetcherFactory<TArgs>(eventName: string): EventFetcherFactory<TArgs>;
    protected validateStandardSchemeParams(params: StandardSchemeParams): void;
    /**
     * Wrap code that creates a transaction in the given transaction event. This is a helper
     * just for the common case of generating a single transaction.
     * @param functionName Should look like [contractName].[functionName]
     * @param options Options that will be passed to the contract function being invoked
     * @param generateTx Callback that will invoke the contract function
     */
    protected wrapTransactionInvocation(functionName: string, options: any, generateTx: () => Promise<TransactionReceiptTruffle>): Promise<ArcTransactionResult>;
    protected logContractFunctionCall(functionName: string, params?: any): void;
}
/**
 * The bundle of logs, TransactionReceipt and other information as returned by Truffle after invoking
 * a contract function that causes a transaction.
 */
export interface TransactionReceiptTruffle {
    logs: Array<any>;
    receipt: TransactionReceipt;
    transactionHash: Hash;
    /**
     * address of the transaction
     */
    tx: Address;
}
export declare class ArcTransactionResult {
    /**
     * the transaction result to be returned
     */
    tx: TransactionReceiptTruffle;
    constructor(tx: TransactionReceiptTruffle);
    /**
     * Returns a value from the transaction logs.
     * @param valueName - The name of the property whose value we wish to return
     * @param eventName - Name of the event in whose log we are to look for the value
     * @param index - Index of the log in which to look for the value, when eventName is not given.
     * Default is the index of the last log in the transaction.
     */
    getValueFromTx(valueName: string, eventName?: string, index?: number): any | undefined;
}
/**
 * Base or actual type returned by all contract wrapper methods that generate a transaction and initiate a proposal.
 */
export declare class ArcTransactionProposalResult extends ArcTransactionResult {
    /**
     * unique hash identifying a proposal
     */
    proposalId: string;
    constructor(tx: TransactionReceiptTruffle);
}
/**
 * Base or actual type returned by all contract wrapper methods that generate a transaction and any other result.
 */
export declare class ArcTransactionDataResult<TData> extends ArcTransactionResult {
    /**
     * The data result to be returned
     */
    result: TData;
    constructor(tx: TransactionReceiptTruffle, result: TData);
}
export declare type EventCallback<TArgs> = (err: Error, log: Array<DecodedLogEntryEvent<TArgs>>) => void;
/**
 * The generic type of every handler function that returns an event.  See this
 * web3 documentation article for more information:
 * https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events
 *
 * argsFilter - contains the return values by which you want to filter the logs, e.g.
 * {'valueA': 1, 'valueB': [myFirstAddress, mySecondAddress]}
 * By default all filter  values are set to null which means that they will match
 * any event of given type sent from this contract.  Default is {}.
 *
 * filterObject - Additional filter options.  Typically something like { from: "latest" }.
 * Note if you don't want Arc.js to suppress duplicate events, set `suppressDups` to false.
 *
 * callback - (optional) If you pass a callback it will immediately
 * start watching.  Otherwise you will need to call .get or .watch.
 */
export declare type EventFetcherFactory<TArgs> = (argFilter: any, filterObject: EventFetcherFilterObject, callback?: EventCallback<TArgs>) => EventFetcher<TArgs>;
export declare type EventFetcherHandler<TArgs> = (callback: EventCallback<TArgs>) => void;
/**
 * returned by EventFetcherFactory<TArgs> which is created by eventWrapperFactory.
 */
export interface EventFetcher<TArgs> {
    get: EventFetcherHandler<TArgs>;
    watch: EventFetcherHandler<TArgs>;
    stopWatching(): void;
}
/**
 * Haven't figured out how to export EventFetcherFilterObject that extends FilterObject from web3.
 * Maybe will be easier with web3 v1.0, perhaps using typescript's module augmentation feature.
 */
/**
 * Options supplied to `EventFetcherFactory` and thence to `get and `watch`.
 */
export interface EventFetcherFilterObject {
    fromBlock?: number | string;
    toBlock?: number | string;
    address?: string;
    topics?: Array<LogTopic>;
    /**
     * true to suppress duplicate events (see https://github.com/ethereum/web3.js/issues/398).
     * The default is true.
     */
    suppressDups?: boolean;
}
/**
 * Common scheme parameters for schemes that are able to create proposals.
 */
export interface StandardSchemeParams {
    /**
     * Hash of the voting machine parameters to use when voting on a proposal.
     */
    voteParametersHash: Hash;
    /**
     * Address of the voting machine to use when voting on a proposal.
     */
    votingMachineAddress: Address;
}
export { DecodedLogEntryEvent, TransactionReceipt } from "web3";
