dethcrypto / dethcrypto/TypeChain

Type union in getEvent instead of overload

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

Description

If there was a single `getEvent(a: "Name1"|...|"EventN") : EventFragment` (instead of an [overload](https://github.com/dethcrypto/TypeChain/blob/0c2b42c756777e69074c2e6283bcff9be8aa9c5f/packages/target-ethers-v5/src/codegen/index.ts#L374)), Typescript would accept things like

```typescript
declare const evt : "Name1" | "Name2";
getEvent(evt);
```

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.