Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit contract method args #871

Open
pociej opened this issue Sep 19, 2023 · 0 comments
Open

explicit contract method args #871

pociej opened this issue Sep 19, 2023 · 0 comments

Comments

@pociej
Copy link

pociej commented Sep 19, 2023

For clarity, lets focus on example of uniswapV2 contract.
We have there swapExactETHForTokens method with signature ;

    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

  swapExactETHForTokens: TypedContractMethod<
    [
      amountOutMin: BigNumberish,
      path: AddressLike[],
      to: AddressLike,
      deadline: BigNumberish
    ],
    [bigint[]],
    "payable"
  >;

thats great but I would like to be able to directly use

    [
      amountOutMin: BigNumberish,
      path: AddressLike[],
      to: AddressLike,
      deadline: BigNumberish
    ]

as separated type called lets say swapExactEthForTokensArgs or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant