2020-01-08 03:58:04 +03:00
|
|
|
import { Fragment, Indexed, Interface, JsonFragment, Result } from "@ethersproject/abi";
|
2019-05-15 01:48:48 +03:00
|
|
|
import { Block, BlockTag, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
|
|
|
|
import { Signer } from "@ethersproject/abstract-signer";
|
|
|
|
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
|
|
|
|
import { BytesLike } from "@ethersproject/bytes";
|
2021-03-30 22:22:45 +03:00
|
|
|
import { AccessList, AccessListish } from "@ethersproject/transactions";
|
2019-05-15 01:48:48 +03:00
|
|
|
export interface Overrides {
|
|
|
|
gasLimit?: BigNumberish | Promise<BigNumberish>;
|
|
|
|
gasPrice?: BigNumberish | Promise<BigNumberish>;
|
2021-06-24 09:13:06 +03:00
|
|
|
maxFeePerGas?: BigNumberish | Promise<BigNumberish>;
|
|
|
|
maxPriorityFeePerGas?: BigNumberish | Promise<BigNumberish>;
|
2019-05-15 01:48:48 +03:00
|
|
|
nonce?: BigNumberish | Promise<BigNumberish>;
|
2021-03-30 22:22:45 +03:00
|
|
|
type?: number;
|
|
|
|
accessList?: AccessListish;
|
2021-10-16 09:29:27 +03:00
|
|
|
customData?: Record<string, any>;
|
2019-05-15 01:48:48 +03:00
|
|
|
}
|
|
|
|
export interface PayableOverrides extends Overrides {
|
|
|
|
value?: BigNumberish | Promise<BigNumberish>;
|
|
|
|
}
|
|
|
|
export interface CallOverrides extends PayableOverrides {
|
|
|
|
blockTag?: BlockTag | Promise<BlockTag>;
|
|
|
|
from?: string | Promise<string>;
|
|
|
|
}
|
2020-06-01 12:04:12 +03:00
|
|
|
export interface PopulatedTransaction {
|
|
|
|
to?: string;
|
|
|
|
from?: string;
|
|
|
|
nonce?: number;
|
|
|
|
gasLimit?: BigNumber;
|
|
|
|
gasPrice?: BigNumber;
|
|
|
|
data?: string;
|
|
|
|
value?: BigNumber;
|
|
|
|
chainId?: number;
|
2021-03-30 22:22:45 +03:00
|
|
|
type?: number;
|
|
|
|
accessList?: AccessList;
|
2021-06-24 09:13:06 +03:00
|
|
|
maxFeePerGas?: BigNumber;
|
|
|
|
maxPriorityFeePerGas?: BigNumber;
|
2021-10-16 09:29:27 +03:00
|
|
|
customData?: Record<string, any>;
|
2020-06-01 12:04:12 +03:00
|
|
|
}
|
2019-05-15 01:48:48 +03:00
|
|
|
export declare type EventFilter = {
|
|
|
|
address?: string;
|
2020-05-30 04:27:59 +03:00
|
|
|
topics?: Array<string | Array<string>>;
|
2019-05-15 01:48:48 +03:00
|
|
|
};
|
2020-05-30 04:27:59 +03:00
|
|
|
export declare type ContractFunction<T = any> = (...args: Array<any>) => Promise<T>;
|
2019-05-15 01:48:48 +03:00
|
|
|
export interface Event extends Log {
|
|
|
|
event?: string;
|
|
|
|
eventSignature?: string;
|
2020-01-08 03:58:04 +03:00
|
|
|
args?: Result;
|
2020-04-17 04:59:53 +03:00
|
|
|
decodeError?: Error;
|
2019-05-15 01:48:48 +03:00
|
|
|
decode?: (data: string, topics?: Array<string>) => any;
|
|
|
|
removeListener: () => void;
|
|
|
|
getBlock: () => Promise<Block>;
|
|
|
|
getTransaction: () => Promise<TransactionResponse>;
|
|
|
|
getTransactionReceipt: () => Promise<TransactionReceipt>;
|
|
|
|
}
|
|
|
|
export interface ContractReceipt extends TransactionReceipt {
|
|
|
|
events?: Array<Event>;
|
|
|
|
}
|
|
|
|
export interface ContractTransaction extends TransactionResponse {
|
|
|
|
wait(confirmations?: number): Promise<ContractReceipt>;
|
|
|
|
}
|
2019-05-24 02:13:44 +03:00
|
|
|
declare class RunningEvent {
|
|
|
|
readonly tag: string;
|
|
|
|
readonly filter: EventFilter;
|
|
|
|
private _listeners;
|
|
|
|
constructor(tag: string, filter: EventFilter);
|
|
|
|
addListener(listener: Listener, once: boolean): void;
|
|
|
|
removeListener(listener: Listener): void;
|
|
|
|
removeAllListeners(): void;
|
|
|
|
listeners(): Array<Listener>;
|
|
|
|
listenerCount(): number;
|
|
|
|
run(args: Array<any>): number;
|
|
|
|
prepareEvent(event: Event): void;
|
2020-04-17 04:59:53 +03:00
|
|
|
getEmit(event: Event): Array<any>;
|
2019-05-24 02:13:44 +03:00
|
|
|
}
|
2021-03-30 22:22:45 +03:00
|
|
|
export declare type ContractInterface = string | ReadonlyArray<Fragment | JsonFragment | string> | Interface;
|
|
|
|
export declare class BaseContract {
|
2019-05-15 01:48:48 +03:00
|
|
|
readonly address: string;
|
|
|
|
readonly interface: Interface;
|
|
|
|
readonly signer: Signer;
|
|
|
|
readonly provider: Provider;
|
2020-05-30 04:27:59 +03:00
|
|
|
readonly functions: {
|
|
|
|
[name: string]: ContractFunction;
|
|
|
|
};
|
|
|
|
readonly callStatic: {
|
|
|
|
[name: string]: ContractFunction;
|
|
|
|
};
|
|
|
|
readonly estimateGas: {
|
|
|
|
[name: string]: ContractFunction<BigNumber>;
|
|
|
|
};
|
|
|
|
readonly populateTransaction: {
|
2020-06-01 12:04:12 +03:00
|
|
|
[name: string]: ContractFunction<PopulatedTransaction>;
|
2020-05-30 04:27:59 +03:00
|
|
|
};
|
|
|
|
readonly filters: {
|
|
|
|
[name: string]: (...args: Array<any>) => EventFilter;
|
|
|
|
};
|
2020-03-12 21:14:50 +03:00
|
|
|
readonly resolvedAddress: Promise<string>;
|
2019-05-15 01:48:48 +03:00
|
|
|
readonly deployTransaction: TransactionResponse;
|
2020-05-30 04:27:59 +03:00
|
|
|
_deployedPromise: Promise<Contract>;
|
|
|
|
_runningEvents: {
|
|
|
|
[eventTag: string]: RunningEvent;
|
|
|
|
};
|
|
|
|
_wrappedEmits: {
|
|
|
|
[eventTag: string]: (...args: Array<any>) => void;
|
|
|
|
};
|
2020-06-01 12:04:12 +03:00
|
|
|
constructor(addressOrName: string, contractInterface: ContractInterface, signerOrProvider?: Signer | Provider);
|
2019-05-15 01:48:48 +03:00
|
|
|
static getContractAddress(transaction: {
|
|
|
|
from: string;
|
|
|
|
nonce: BigNumberish;
|
|
|
|
}): string;
|
|
|
|
static getInterface(contractInterface: ContractInterface): Interface;
|
|
|
|
deployed(): Promise<Contract>;
|
|
|
|
_deployed(blockTag?: BlockTag): Promise<Contract>;
|
|
|
|
fallback(overrides?: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
connect(signerOrProvider: Signer | Provider | string): Contract;
|
|
|
|
attach(addressOrName: string): Contract;
|
|
|
|
static isIndexed(value: any): value is Indexed;
|
2019-05-24 02:13:44 +03:00
|
|
|
private _normalizeRunningEvent;
|
|
|
|
private _getRunningEvent;
|
|
|
|
_checkRunningEvents(runningEvent: RunningEvent): void;
|
2020-04-17 04:59:53 +03:00
|
|
|
_wrapEvent(runningEvent: RunningEvent, log: Log, listener: Listener): Event;
|
2019-05-15 01:48:48 +03:00
|
|
|
private _addEventListener;
|
|
|
|
queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise<Array<Event>>;
|
2019-05-24 02:13:44 +03:00
|
|
|
on(event: EventFilter | string, listener: Listener): this;
|
|
|
|
once(event: EventFilter | string, listener: Listener): this;
|
2019-05-15 01:48:48 +03:00
|
|
|
emit(eventName: EventFilter | string, ...args: Array<any>): boolean;
|
|
|
|
listenerCount(eventName?: EventFilter | string): number;
|
|
|
|
listeners(eventName?: EventFilter | string): Array<Listener>;
|
2019-05-24 02:13:44 +03:00
|
|
|
removeAllListeners(eventName?: EventFilter | string): this;
|
|
|
|
off(eventName: EventFilter | string, listener: Listener): this;
|
|
|
|
removeListener(eventName: EventFilter | string, listener: Listener): this;
|
2019-05-15 01:48:48 +03:00
|
|
|
}
|
2021-03-30 22:22:45 +03:00
|
|
|
export declare class Contract extends BaseContract {
|
|
|
|
readonly [key: string]: ContractFunction | any;
|
|
|
|
}
|
2019-05-15 01:48:48 +03:00
|
|
|
export declare class ContractFactory {
|
|
|
|
readonly interface: Interface;
|
|
|
|
readonly bytecode: string;
|
|
|
|
readonly signer: Signer;
|
|
|
|
constructor(contractInterface: ContractInterface, bytecode: BytesLike | {
|
|
|
|
object: string;
|
|
|
|
}, signer?: Signer);
|
2020-06-01 12:04:12 +03:00
|
|
|
getDeployTransaction(...args: Array<any>): TransactionRequest;
|
2019-05-15 01:48:48 +03:00
|
|
|
deploy(...args: Array<any>): Promise<Contract>;
|
|
|
|
attach(address: string): Contract;
|
|
|
|
connect(signer: Signer): ContractFactory;
|
|
|
|
static fromSolidity(compilerOutput: any, signer?: Signer): ContractFactory;
|
|
|
|
static getInterface(contractInterface: ContractInterface): Interface;
|
|
|
|
static getContractAddress(tx: {
|
|
|
|
from: string;
|
|
|
|
nonce: BytesLike | BigNumber | number;
|
|
|
|
}): string;
|
|
|
|
static getContract(address: string, contractInterface: ContractInterface, signer?: Signer): Contract;
|
|
|
|
}
|
|
|
|
export {};
|
2021-01-19 13:22:54 +03:00
|
|
|
//# sourceMappingURL=index.d.ts.map
|