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!