dethcrypto / dethcrypto/TypeChain

explicit contract method args

Open
#871 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

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

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.