import { Address } from '../address'; import { Eth } from '../eth'; import { EventLog, LogRequest } from '../formatters'; import { Subscription } from '../subscriptions'; import { Data } from '../types'; import { ContractAbi } from './abi'; import { Tx } from './tx'; import { TxDeploy } from './tx-deploy'; export interface ContractOptions { from?: Address; gasPrice?: string | number; gas?: number; } interface ContractDefinition { methods: any; events?: any; eventLogs?: any; } export declare type EventSubscriptionFactory> = (options?: object, callback?: (err: Error, result: Result, subscription: Subscription) => void) => Subscription; declare type Events = T extends ContractDefinition ? Extract : string; declare type GetEventLog> = T extends ContractDefinition ? T['eventLogs'][P] : EventLog; declare type GetContractMethods = T extends ContractDefinition ? T['methods'] : { [key: string]: (...args: any[]) => Tx; }; declare type GetContractEvents = T extends ContractDefinition ? T['events'] & { allEvents: EventSubscriptionFactory]>; } : { [key: string]: EventSubscriptionFactory; }; /** * Should be called to create new contract instance * * @method Contract * @constructor * @param {Array} jsonInterface * @param {String} address * @param {Object} options */ export declare class Contract { private eth; private contractAbi; address?: Address | undefined; private defaultOptions; readonly methods: GetContractMethods; readonly events: GetContractEvents; private linkTable; constructor(eth: Eth, contractAbi: ContractAbi, address?: Address | undefined, defaultOptions?: ContractOptions); link(name: string, address: Address): void; deployBytecode(data: Data, ...args: any[]): TxDeploy; once>(event: Event, options: { filter?: object; topics?: string[]; }, callback: (err: any, res: GetEventLog, sub: any) => void): any; getPastEvents>(event: Event, options: LogRequest): Promise[]>; getPastEvents(event: 'allevents', options: LogRequest): Promise[]>; private on; private executorFactory; private buildMethods; private buildEvents; private getLogOptions; } export {};