Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 02a251d

Browse files
authored
Merge pull request #2939 from geigerzaehler/contract-options-typescript
Fix TypeScript 'ContractOptions' interface
2 parents f2ac320 + f6d9792 commit 02a251d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7171

7272
- miner.startMining fixed (#2877)
7373
- Subscription type definitions fixed (#2919)
74+
- ``ContractOptions`` type definitions corrected (#2939)
7475

packages/web3-eth-contract/types/index.d.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import BN = require('bn.js');
2121
import {provider} from 'web3-providers';
2222
import {AbiInput, AbiOutput, AbiItem} from 'web3-utils';
23-
import {PromiEvent} from 'web3-core';
23+
import {PromiEvent, Web3ModuleOptions} from 'web3-core';
2424

2525
export class Contract {
2626
constructor(
@@ -94,11 +94,15 @@ export interface EstimateGasOptions {
9494
value?: number | string | BN;
9595
}
9696

97-
export interface ContractOptions {
98-
from: string;
99-
gasPrice: string;
100-
gas: number;
101-
data: string;
97+
export interface ContractOptions extends Web3ModuleOptions {
98+
// Sender to use for contract calls
99+
from?: string;
100+
// Gas price to use for contract calls
101+
gasPrice?: string;
102+
// Gas to use for contract calls
103+
gas?: number;
104+
// Contract code
105+
data?: string;
102106
}
103107

104108
export interface EventOptions {

0 commit comments

Comments
 (0)