2018-07-31 01:59:52 +03:00
|
|
|
import { Indexed, Interface } from './interface';
|
|
|
|
import { BigNumber } from '../utils/bignumber';
|
|
|
|
import { Provider } from '../providers/abstract-provider';
|
|
|
|
import { Signer } from '../wallet/abstract-signer';
|
|
|
|
import { ParamType } from '../utils/abi-coder';
|
|
|
|
import { Block, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '../providers/abstract-provider';
|
|
|
|
export declare type ContractFunction = (...params: Array<any>) => Promise<any>;
|
|
|
|
export declare type EventFilter = {
|
|
|
|
address?: string;
|
|
|
|
topics?: Array<string>;
|
|
|
|
};
|
|
|
|
export interface Event extends Log {
|
|
|
|
args: Array<any>;
|
|
|
|
decode: (data: string, topics?: Array<string>) => any;
|
|
|
|
event: string;
|
|
|
|
eventSignature: string;
|
|
|
|
removeListener: () => void;
|
|
|
|
getBlock: () => Promise<Block>;
|
|
|
|
getTransaction: () => Promise<TransactionResponse>;
|
|
|
|
getTransactionReceipt: () => Promise<TransactionReceipt>;
|
|
|
|
}
|
2018-07-24 02:21:42 +03:00
|
|
|
interface Bucket<T> {
|
|
|
|
[name: string]: T;
|
|
|
|
}
|
|
|
|
export declare class Contract {
|
|
|
|
readonly address: string;
|
|
|
|
readonly interface: Interface;
|
|
|
|
readonly signer: Signer;
|
2018-07-31 01:59:52 +03:00
|
|
|
readonly provider: Provider;
|
2018-07-24 02:21:42 +03:00
|
|
|
readonly estimate: Bucket<(...params: Array<any>) => Promise<BigNumber>>;
|
|
|
|
readonly functions: Bucket<ContractFunction>;
|
|
|
|
readonly filters: Bucket<(...params: Array<any>) => EventFilter>;
|
|
|
|
readonly [name: string]: ContractFunction | any;
|
|
|
|
readonly addressPromise: Promise<string>;
|
|
|
|
readonly deployTransaction: TransactionResponse;
|
2018-08-27 14:42:26 +03:00
|
|
|
private _deployed;
|
2018-07-31 01:59:52 +03:00
|
|
|
constructor(addressOrName: string, contractInterface: Array<string | ParamType> | string | Interface, signerOrProvider: Signer | Provider);
|
2018-07-24 02:21:42 +03:00
|
|
|
deployed(): Promise<Contract>;
|
|
|
|
fallback(overrides?: TransactionRequest): Promise<TransactionResponse>;
|
2018-07-31 01:59:52 +03:00
|
|
|
connect(signerOrProvider: Signer | Provider): Contract;
|
2018-07-24 02:21:42 +03:00
|
|
|
attach(addressOrName: string): Contract;
|
|
|
|
deploy(bytecode: string, ...args: Array<any>): Promise<Contract>;
|
2018-07-31 01:59:52 +03:00
|
|
|
static isIndexed(value: any): value is Indexed;
|
2018-07-24 02:21:42 +03:00
|
|
|
private _events;
|
|
|
|
private _getEventFilter;
|
|
|
|
private _addEventListener;
|
|
|
|
on(event: EventFilter | string, listener: Listener): Contract;
|
|
|
|
once(event: EventFilter | string, listener: Listener): Contract;
|
|
|
|
addEventLisener(eventName: EventFilter | string, listener: Listener): Contract;
|
|
|
|
emit(eventName: EventFilter | string, ...args: Array<any>): boolean;
|
|
|
|
listenerCount(eventName?: EventFilter | string): number;
|
|
|
|
listeners(eventName: EventFilter | string): Array<Listener>;
|
|
|
|
removeAllListeners(eventName: EventFilter | string): Contract;
|
|
|
|
removeListener(eventName: any, listener: Listener): Contract;
|
|
|
|
}
|
|
|
|
export {};
|