Skip to content

Commit

Permalink
Merge pull request #2939 from geigerzaehler/contract-options-typescript
Browse files Browse the repository at this point in the history
Fix TypeScript 'ContractOptions' interface
  • Loading branch information
nivida committed Jul 16, 2019
2 parents f2ac320 + f6d9792 commit 02a251d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- miner.startMining fixed (#2877)
- Subscription type definitions fixed (#2919)
- ``ContractOptions`` type definitions corrected (#2939)

16 changes: 10 additions & 6 deletions packages/web3-eth-contract/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import BN = require('bn.js');
import {provider} from 'web3-providers';
import {AbiInput, AbiOutput, AbiItem} from 'web3-utils';
import {PromiEvent} from 'web3-core';
import {PromiEvent, Web3ModuleOptions} from 'web3-core';

export class Contract {
constructor(
Expand Down Expand Up @@ -94,11 +94,15 @@ export interface EstimateGasOptions {
value?: number | string | BN;
}

export interface ContractOptions {
from: string;
gasPrice: string;
gas: number;
data: string;
export interface ContractOptions extends Web3ModuleOptions {
// Sender to use for contract calls
from?: string;
// Gas price to use for contract calls
gasPrice?: string;
// Gas to use for contract calls
gas?: number;
// Contract code
data?: string;
}

export interface EventOptions {
Expand Down

0 comments on commit 02a251d

Please sign in to comment.