Added a (hacky) way to get TypeScript to support the Contract meta-class functions.
This commit is contained in:
parent
d701995bc0
commit
2aa2a38e37
@ -9,7 +9,22 @@ import { hexDataLength, hexDataSlice, isHexString } from '../utils/bytes';
|
||||
import { defineReadOnly, jsonCopy, shallowCopy } from '../utils/properties';
|
||||
import { poll } from '../utils/web';
|
||||
|
||||
import { BigNumber, EventDescription, EventFilter, Listener, Log, MinimalProvider, ParamType, Signer, TransactionRequest, TransactionResponse } from '../utils/types';
|
||||
import {
|
||||
Signer,
|
||||
MinimalProvider,
|
||||
|
||||
BigNumber,
|
||||
|
||||
ContractFunction,
|
||||
EventDescription,
|
||||
EventFilter,
|
||||
ParamType,
|
||||
|
||||
Listener,
|
||||
Log,
|
||||
TransactionRequest,
|
||||
TransactionResponse
|
||||
} from '../utils/types';
|
||||
|
||||
import * as errors from '../utils/errors';
|
||||
|
||||
@ -201,10 +216,12 @@ export class Contract {
|
||||
readonly provider: MinimalProvider;
|
||||
|
||||
readonly estimate: Bucket<(...params: Array<any>) => Promise<BigNumber>>;
|
||||
readonly functions: Bucket<(...params: Array<any>) => Promise<any>>;
|
||||
readonly functions: Bucket<ContractFunction>;
|
||||
|
||||
readonly filters: Bucket<(...params: Array<any>) => EventFilter>;
|
||||
|
||||
readonly [name: string]: ContractFunction | any;
|
||||
|
||||
readonly addressPromise: Promise<string>;
|
||||
|
||||
// This is only set if the contract was created with a call to deploy
|
||||
|
@ -304,6 +304,8 @@ export interface TransactionDescription {
|
||||
///////////////////////////////
|
||||
// Contract
|
||||
|
||||
export type ContractFunction = (...params: Array<any>) => Promise<any>;
|
||||
|
||||
export type EventFilter = {
|
||||
address?: string;
|
||||
topics?: Array<string>;
|
||||
|
Loading…
Reference in New Issue
Block a user