I am trying to implement so logic to ensure smart contract (SC) validation upon certain conditions - which are derived from the end-users transaction history.
If I parameterise the SC and take the users address or public key hash (pkh) how can I look up the last N transactions to/sent from that address.
I need to be able to do this within the mkValidator logic.
Example:
mkValidator :: pkh -> () -> () -> () -> Bool
mkValidator pkh _ _ _
| pkh last transaction was to the specified user = True
| otherwise = False
I am attempting to make some free and opensource code for the community that tackle a fundamental problem in the Cardano protocol (i.e. it scales with the number of users) so I am attempting to stay away from blockfrost and other paid API services.