![]() We're querying the contract balance every 500ms, so we're making a network request every 500ms. Example of naive polling, which doesn't work wellįor example, if you want to fetch the latest ERC20 token balance, the following piece of code (which might actually work), doesn't make sense: const contract = (ABI, '0x00.ff') Ĭonst balance = await ( '0x00.ff').call() ĭocument.querySelector( '#balance').textContent = balance Let's explore some of them, the use case is we want to constantly show the latest balance of an ERC20 token. As such, some patterns for making these requests start to appear. ![]() So all your JSONRPC requests require a network call.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |