From 8b6a490b0bb1b097704ecc05e8176cf7bbd902d3 Mon Sep 17 00:00:00 2001 From: John Williamson Date: Fri, 3 Apr 2020 14:21:47 +1000 Subject: [PATCH] added method return --- packages/web3-eth-contract/types/index.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/web3-eth-contract/types/index.d.ts b/packages/web3-eth-contract/types/index.d.ts index 336f15fc487..b922a7f13a9 100644 --- a/packages/web3-eth-contract/types/index.d.ts +++ b/packages/web3-eth-contract/types/index.d.ts @@ -46,7 +46,9 @@ export class Contract { deploy(options: DeployOptions): ContractSendMethod; - methods: any; + methods: { + [key: string]: ContractSendMethod; + }; once( event: string, @@ -89,6 +91,11 @@ export interface ContractSendMethod { callback?: (err: Error, transactionHash: string) => void ): PromiEvent; + call( + options?: CallOptions, + callback?: (err: Error, result: any) => void + ): Promise; + estimateGas( options: EstimateGasOptions, callback?: (err: Error, gas: number) => void @@ -108,6 +115,12 @@ export interface ContractSendMethod { encodeABI(): string; } +export interface CallOptions { + from?: string; + gasPrice?: string; + gas?: number; +} + export interface SendOptions { from: string; gasPrice?: string;