Is there a way to await a contractCall?
See original GitHub issuesomething like
const getMyData = async ()=>{
const [myData] = await useContractCall(...);
//use myData here
}
I mean the nice thing about hooks are that it rerenders the view if needed, but how can I access the data in my logic?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Why are there so many async and await in smart contract tests?
Not only on smart contract tests, but in Javascript and Nodejs, in general, is common to find many async/await function calls. The ...
Read more >Testing Solidity with Truffle and Async/Await | by Angello Pozo
The first is to get the deployed contract JavaScript object and sets it to the variable meta . Then it calls the function...
Read more >web3.eth.contracts.method await function never returns
A better way is to subscribe to either receipt , transactionHash or confirmation event, which is exposed by send . contract.methods.add(ipfsHash ...
Read more >await is not working with send method · Issue #2837 - GitHub
const response = await contract.methods.get().call(); should get the value that is returned by get method of smart contract in the response.
Read more >Call a Payable Solidity Function Using Ethers - vsupalov.com
A simple way to call a payable Solidity function, either from your tests or your dApp ... Contract(CONTRACT_ADDRESS, YOUR_ABI.abi, signer); let tx =...
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
alright. I just have to do it the react way; providing the useCall data to a child component as props. thx.
I mean it’s a solution, but why don’t you just show some loading screen while the data is getting fetched? You can simply check
if(!myData) return
and then in the componentif(!computedData) return <div>Loading...</div>