dethcrypto / dethcrypto/TypeChain

Generate interfaces for structs alongside existing struct types

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

Description

PR https://github.com/dethcrypto/TypeChain/pull/700 changed how struct types are generated. I've been importing these structs (before the properties were wrapped by `PromiseOrValue`) to help me type check inputs in hardhat tests.

Perhaps alongside the existing struct types you could provide an `interface` type also:

```
export interface Foo {
a: BigNumberish;
b: BigNumberish;
};

export type FooStruct = {
a: PromiseOrValue;
b: PromiseOrValue;
};

export type FooStructOutput = [BigNumber, BigNumber] & {
a: BigNumber;
b: BigNumber;
};
```

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.