Custom block number
See original GitHub issueLove the library, thank you for sharing!
Is there any way to request information from a specific block number? this example code gets your token balance from 4 days ago compared to now
const blocksAgo = n => provider.getBlockNumber().then(b => b - n);
let blockNumber = await blocksAgo(30000);
const tokenContract = new Contract(tokenAddress, erc20Abi);
let balance1 = await tokenContract.balanceOf(address, 'latest');
console.log(`latestBalance: ${ethers.utils.formatEther(balance1)}`);
let balance2 = await tokenContract.balanceOf(address, blockNumber);
console.log(`prevBalance: ${ethers.utils.formatEther(balance2)}`);
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Custom call blocking | Home Phone - Ooma Support
Custom call blocking lets you create a list of phone numbers and caller-ID names that you simply don't want to hear from. You...
Read more >Create a custom block - Drupal
This way you can add any number of instances of the custom block anywhere on your site.
Read more >Design and Create a Custom Block - MATLAB & Simulink
Build a custom block using a Level-2 MATLAB S-function. ... The setup function initializes the number of input ports based on the values...
Read more >Define Blocks | Blockly - Google Developers
Blockly provides a number of built-in fields, including text inputs, color pickers, and images. You can also create your own fields. → More...
Read more >How to create a custom block - support? nTopology
Answer: This article uses a Custom Block to create our desired outcome. If you are new to using Custom Blocks, learn how to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
second this. i use moralis archive node to lookup historical data. im running out of requests because i cant use non-latest blocks for multicalls, is this option introduced in some branch that’s not released yet?
@joshstevens19 this sounds good, doesn’t need to be a global option. but atleast the functionality is there on a granular level for those who need it
awesome package btw, my favorite muticall package!
EDIT
forked the repo and this works for me now https://github.com/daryledesilva/ethereum-multicall/commit/017ad2c144c0ea1494bc3083f8f99cd61d6a7af3#diff-dce38be9bbc70841ebcc4df53e419e5635cc6d7acd355bc2c6093e8fbd24cf74R355-R356 if there’s an official fix ill use that next time 😃EDIT
so i just need to init 2 multicall instances (one using latest block, one using a nearest block to today minus 1 day)still better than nothing. max 2 calls atleast haha
Yes pass 0x0 it actually be really good if that logic was in that library balances you just sent if you wanted to do a PR to add this contract call to bring back the eth balances alongside the tokens that make that library even cooler !! If not il take a look when I get some time!
Thanks so much for your kind words dude!!! I try my best - I see your open source work as well mate so thank you as well! I have used your binance API which is just 🔥🔥🔥🔥
oh jeeeze that is not very nice way of them making you write this logic, much easier just passing addresses and getting it back.
Defo adding that contract call to get the eth value back in the balances multicall lib above will be a huge benefit as said welcome to do a PR for that if you wanted!!
thanks dude!!!