flow-nft icon indicating copy to clipboard operation
flow-nft copied to clipboard

Listing view

Open bjartek opened this issue 3 years ago • 5 comments

Many solutions on flow today offer an listing for an NFT. This can be:

  • flowty offering a loan
  • schwap offering a schwap
  • nft storefront listing something for sale
  • .find listing a name for auction or sale

This list is not complete obviously. Just some examples.

I think it would be nice to have a common view for all of these cases where you can say that "this item is listed as X".

I do not have a implementation for this but I think it should be possible to specify

  • what FT type if any that is required
  • what item that is listed
  • what price that is required if any
  • a description of the sale
  • a url to where you can see the listing in a web ui

bjartek avatar Feb 04 '22 12:02 bjartek

Are you sure this should be a view? Seems like something that should be specific to the marketplaces. This seems like it could be more complicated than it is worth

joshuahannan avatar Mar 28 '22 20:03 joshuahannan

I made the issue so yes I think it makes sense.

There are various premutations of storefront, auctions, open bids and contracts based on the old markerplace (flovatar/versus). The ability for these to say "i am a listing for this NFT" is important to beeing able to browse and discover data without having to hardcode things.

However I can always create this as a view under the find umbrella, but I would rather it be shared.

bjartek avatar Mar 28 '22 21:03 bjartek

This would require putting a bunch of logic in the NFT contract code that has to know about marketplace listings and such, which seems out of the scope for what the NFT contract should know about.

joshuahannan avatar Mar 29 '22 17:03 joshuahannan

Maybe I did not make the issue clear enough, I am not saying that a Listing view should be implemented for an NFT. What I am arguing is that a it could be added as a view in the Storefront resource in https://github.com/onflow/nft-storefront/blob/main/contracts/NFTStorefront.cdc#L388 and in similar places.

Views and ViewResolvers are valid for any kind of resource on Flow, not just NFTs.

bjartek avatar Mar 29 '22 17:03 bjartek

If it isn't a view for NFTs, it probably shouldn't be in the MetadataViews contract. It could probably be defined in the storefront contract or somewhere else.

joshuahannan avatar Mar 31 '22 18:03 joshuahannan

Does it make sense to close this issue because it doesn't seem to make sense any more?

joshuahannan avatar Aug 30 '22 15:08 joshuahannan

It is ok for me to close it.

bjartek avatar Aug 31 '22 08:08 bjartek