Return metadata in collection query
In the nft module, four queries are provided, namely NFTInfo, NFTsByOwner, Metadata, Collection.
- In
NFTInfo, the NFTidis provided in the request, andnftand NFTmetadataare provided as the response
https://github.com/bitsongofficial/go-bitsong/blob/84691c819214a1f9b9dd844ea2b49b7ccc8ece1b/proto/bitsong/nft/v1beta1/query.proto#L33-L39
- In
NFTByOwner, theowneris provided in the request, and anftlist together with a NFTmetadatalist are provided as the response
https://github.com/bitsongofficial/go-bitsong/blob/84691c819214a1f9b9dd844ea2b49b7ccc8ece1b/proto/bitsong/nft/v1beta1/query.proto#L42-L49
- In
Metadata, the metadatacoll_idandidare provided in the request, and themetadataare provided as the response All these queries provide the metadata set. This is important since NFTs without metadata are missing a lot of information.
https://github.com/bitsongofficial/go-bitsong/blob/84691c819214a1f9b9dd844ea2b49b7ccc8ece1b/proto/bitsong/nft/v1beta1/query.proto#L52-L60
For this reason, it seems strange that in Collection, id is provided in the request, and collection together with a nft list are provided as a response, without a NFT metadata list.
https://github.com/bitsongofficial/go-bitsong/blob/84691c819214a1f9b9dd844ea2b49b7ccc8ece1b/proto/bitsong/nft/v1beta1/query.proto#L63-L69
IMHO, the metadata should be returned together with the nft list.
What do you think about it?
I think we can add metadata info on collection query.
Moreover, I would change the method name from Collection to NFTByCollection.
For sure these modifications affect these lines
https://github.com/bitsongofficial/go-bitsong/blob/84691c819214a1f9b9dd844ea2b49b7ccc8ece1b/x/nft/keeper/grpc_query.go#L84-L101