dapperlabs/nba-smart-contracts

Ability to Search for Active Sales of a Specific Moment

Closed this issue · 3 comments

The SaleCollection provides access to all of the moments that a specific user has listed, and MomentListed can be used to retrieve all of the recently listed moments by any user, however it does not appear that there is any way to retrieve all of the for-sale moments of a specific play.

I suppose that a developer could repeatedly check for new MomentListed, MomentWithdrawn, and MomentPurchased events, and use those to update their own database of all the moments that are currently for sale, though that would be tedious and only accurate to the point that they launched their code.

Am I missing an already-existing function to retrieve all of the listed moments in a specific play, or is there any plan to add this endpoint in the future?

The Top Shot graphQL API might provide this as an endpoint, but this is currently not possible on-chain because user's sales are all stored in their accounts. There is no central record of sales on chain, which is kind of a feature, not a bug. We don't think it should necessarily be possible to query all of this on-chain. It is certainly possible to add something like this, but we would need a lot more discussion and convincing before adding it

Is there any documentation available on the graphQL API?