Skip to content

Commit

Permalink
Merge pull request #2556 from ethereum/issue/2554
Browse files Browse the repository at this point in the history
EventOptions interface types updated
  • Loading branch information
nivida committed Mar 22, 2019
2 parents 2cfff78 + 17e5ba6 commit 0cb5562
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web3-eth-contract/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface ContractOptions {
}

export interface EventOptions {
filter: {};
filter?: {};
fromBlock?: number;
toBlock?: string | number;
topics?: any[];
Expand Down
3 changes: 3 additions & 0 deletions packages/web3-eth-contract/types/tests/contract-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ contract.getPastEvents('MyEvent', {
toBlock: 'latest'
});

// $ExpectType Promise<EventData[]>
contract.getPastEvents('MyEvent', {});

// $ExpectType Promise<EventData[]>
contract.getPastEvents('MyEvent', {
filter: {myIndexedParam: [20,23], myOtherIndexedParam: '0x123456789...'},
Expand Down

0 comments on commit 0cb5562

Please sign in to comment.