cavanmflynn / ethers-multicall

Make multiple Ethereum network requests in a single HTTP query. ethcall for ethers v5.
MIT License
224 stars 100 forks source link

How to add getAmountsOut? #47

Open ubuntutest opened 1 year ago

ubuntutest commented 1 year ago

I am using a custom ABI, I can use without problems balanceOf and symbol.

but if I try to use the getAmountOut function "function getAmountsOut (uint amountIn, address [] memory path) public view returns (uint [] memory amounts)"

I get the following error:

const error: any = new Error(message);
                           ^
Error: types/values length mismatch (count={"types":2,"values":0}, value={"types":[{"name":"amountIn","type":"uint256","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"uint256","_isParamType":true},{"name":"path","type":"address[]","indexed":null,"components":null,"arrayLength":-1,"arrayChildren":{"name":null,"type":"address","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"address","_isParamType":true},"baseType":"array","_isParamType":true}],"values":[]}, code=INVALID_ARGUMENT, version=abi/5.7.0)

which is the correct way?