Hi all!
Iām looking for the best way to interact with a contract in react using the moralis sdk/api. Previously, one of the best ways Iāve interacted with a contract is with useDappsās useContractFunction hook, which allows me to pass a contract object (created from an ABI and address), and it returns the state of the transaction, and a function to āsendā the transaction, which I quite like.
Whatās the best way to do this with moralis? I know I can do something like:
const contract = new web3.eth.Contract(contractAbi, contractAddress);
And then make a raw call to the contract, but it looks like I might have to setup some custom subscriptions to listen for the transaction to finish.
Would it be my best play to:
- Just useUseDapp w/ Moralis (seems like they overlap a lotā¦)
- Setup my own custom event listeners & such
Let me know!