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

Doesn't support call by blockTag #24

Open
lily-57blocks opened this issue Sep 30, 2021 · 1 comment
Open

Doesn't support call by blockTag #24

lily-57blocks opened this issue Sep 30, 2021 · 1 comment

Comments

@lily-57blocks
Copy link

async function lpTokenUsd(currentBlock) { await multiCallProvider.init(); const oneLPAmount = BigNumber.from(10).pow(18); const calculateBlocks = 10; const priceCalls = []; for (let i = 1; i < calculateBlocks; i += 1) { const block = currentBlock - i; priceCalls.push( swapPool.calc_withdraw_one_coin(oneLPAmount, 0, { blockTag: block }) ); } const result = await multiCallProvider.all(priceCalls); console.log(result : ${JSON.stringify(result)}); }

run above function will get error:
Error: types/values length mismatch (count={"types":2,"values":3}, value={"types":[{"name":"_token_amount","type":"uint256","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"uint256","_isParamType":true},{"name":"i","type":"int128","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"int128","_isParamType":true}],"values":[{"type":"BigNumber","hex":"0x0de0b6b3a7640000"},0,{"blockTag":11135382}]}, code=INVALID_ARGUMENT, version=abi/5.4.1)

Once I removed the blockTag, it will work and return result.

@hung-pelith
Copy link

hung-pelith commented Feb 15, 2022

Here's our fork withblockTag FYI.

https://www.npmjs.com/package/@pelith/ethers-multicall

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

2 participants