Add Caching/Limits to Contract Calls
See original GitHub issueWith useContractCall
and useContractCalls
it’s mentioned the data is updated every block.
This approach can get expensive when paying for a node service (Infura/Alchemy)
Any discussions for adding caching or limiting fetches?
Personally, I’ve been using react-query to wrap my contract call and had a lot of success.
Would be great to add at a minimum the ability to limit refetches and/or also the ability cache requests and only refetch if certain parameters in the state have been met i.e. a certain function has been called/broadcast/confirmed or another state change in the application.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Contract to Contract calls and an ABI come to Algorand
The AVM now supports Contract to Contract calling and grouped inner ... Algorand added the ability for smart contracts to issue “inner ...
Read more >Calling a smart contract from JavaScript
In this tutorial we'll see how to call a smart contract function from JavaScript. First is reading the state of a smart contract...
Read more >Call Smart Contract From Another Smart Contract
In this developer tutorial, learn how to call a smart contract from another smart contract in an EVM environment using Solidity.
Read more >Calling functions of other contracts on Solidity
It is used to encode contract calls for the EVM and to read data out of transactions. There is a clear specification of...
Read more >Contracts Calling Arbitrary Functions
In this post, I'll show how smart contracts can use low-level message ... To enable making arbitrary function calls, I'm going to use...
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
Interesting, we could add
CallOptions
withrefreshFrequency
parameter:With options like:
eachBlock
,everyBlock(n)
,never
Application configuration could include
defaultRefreshFrequency
.eachBlock
could be a function, returns true or false for given multicall and block.That sounds like a great place to start.
BTW great library! Really liking it so far - very easy to use.