dethcrypto / dethcrypto/TypeChain

DRY up and re-export EventOptions?

Open
#790 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

When targeting web3, I notice the following block in all my contract `.ts` files:

````ts
import type {
Callback,
PayableTransactionObject,
NonPayableTransactionObject,
BlockType,
ContractEventLog,
BaseContract,
} from "./types";
export interface EventOptions {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
}
````

The import lines are all there, whether used or not, and it seems like EventOptions should be added to that list and defined just once, in 'types' (unless I'm missing something).

However, because the type of EventOptions in this context (unexpectedly) **differs from** the EventOptions type importable from 'web3-eth-contract', I am importing the type from one of the contract files and it would be a breaking change to move this without re-exporting that specific type from the contract file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.