diff --git a/packages/web3-eth-contract/types/index.d.ts b/packages/web3-eth-contract/types/index.d.ts index 8d0bf0ed433..5cd53b008d9 100644 --- a/packages/web3-eth-contract/types/index.d.ts +++ b/packages/web3-eth-contract/types/index.d.ts @@ -103,7 +103,7 @@ export interface ContractOptions { } export interface EventOptions { - filter: {}; + filter?: {}; fromBlock?: number; toBlock?: string | number; topics?: any[]; diff --git a/packages/web3-eth-contract/types/tests/contract-test.ts b/packages/web3-eth-contract/types/tests/contract-test.ts index f2a2afbc216..5a19ed0fcdc 100644 --- a/packages/web3-eth-contract/types/tests/contract-test.ts +++ b/packages/web3-eth-contract/types/tests/contract-test.ts @@ -49,6 +49,9 @@ contract.getPastEvents('MyEvent', { toBlock: 'latest' }); +// $ExpectType Promise +contract.getPastEvents('MyEvent', {}); + // $ExpectType Promise contract.getPastEvents('MyEvent', { filter: {myIndexedParam: [20,23], myOtherIndexedParam: '0x123456789...'},