dethcrypto / dethcrypto/TypeChain
explicit contract method args
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 376
- PR merge metrics
- No merged PRs in 30d
Description
For clarity, lets focus on example of uniswapV2 contract.
We have there `swapExactETHForTokens` method with signature ;
```solidity
function swapExactETHForTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable returns (uint[] memory amounts);
```
after i run type-chain what i got is `Abi` interface with
```ts
swapExactETHForTokens: TypedContractMethod<
[
amountOutMin: BigNumberish,
path: AddressLike[],
to: AddressLike,
deadline: BigNumberish
],
[bigint[]],
"payable"
>;
```
thats great but I would like to be able to directly use
```typescript
[
amountOutMin: BigNumberish,
path: AddressLike[],
to: AddressLike,
deadline: BigNumberish
]
```
as separated type called lets say `swapExactEthForTokensArgs` or so.
Contributor guide
Assessment
This issue has not been assessed yet.