Hello all,
I have the following situation:
when clicking on a button in react, a user will have to execute a set of transaction, depending on a condition. This condition is based on the past execution of a blockchain transaction.
At the moment i see 2 options to solve this problem:
Option n1:
-> step1: for each new connected user, do a moralis apicall with useMoralisWeb3Api
on a contract to get the result of a view function, to check if this user executed the blockchain transaction.
Option n2:
-> build a table in Moralis Database, based on the past transaction events, of the user which executed the transaction in the past. Then, for each new connected user, do a query with useMoralisQuery
to check if this user executed the blockhain transaction in the past.
What’s the best practice in this case? API call or database query? The result is very important and have to be without error, the response time or other consideration don’t matter.