Take JPG store as an example. When someone lists an NFT for sale there, or when someone buys an NFT there, a smart contract governs that transaction.
Can sql queries against the db-sync generated blockchain data "see" that? I'd like to write sql queries against the db-sync data that show the most recent transaction involving a particular smart contract, but I'm not sure what to query for...
UPDATE:
Here is a call to opencnft's free api which allows me to know the most recent transactions involving a particular NFT policy, sorted by date. If I want to simple replicate that by using sql queries against db-sync, that's also something I am interested in:
https://api.opencnft.io/1/#/Policy/PublicController_getPolicyTx
However...that makes the NFT policy the focus of the query, whereas I am also looking for a query that would find the same resulting transaction had occurred but with the Smart Contract being used as the criteria I am querying on.
So in plain language - there are two generalized queries I am hoping to create as a basis and launching pad for other queries?
select the latest transaction 'Smart Contract X' was involved in, and the assets involved in that transaction.
select the latest transaction 'Policy Id X' was involved in and any Smart Contracts and/or other assets involved in the transaction.
...sort of like looking for the same thing but from two different perspectives in terms of the criteria and tables involved in building the query?
db-sync
?