peerchemist / trotter

Trotter does abstraction on creation of NFT tokens on multiple evm-based blockchain networks.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

/token/{tokenId} endopoint does not return all relevant information #2

Closed peerchemist closed 3 years ago

peerchemist commented 3 years ago

There is no explanation on which network is this NFT created on and what is the creation txid. Also it does not report it's current owner.

{ "success": true, "message": "", "data": { "nftID": 5, "name": "Test", "ipfsHash": "QmPGgNiy3AWeB9DbLDe2gDq3yNpvHWJtJjVqLh63CqNjm7", "price": "1", "author": "Testko Test", "about": "This is test.", "properties": "", "statement": "This is legit." } }

peerchemist commented 3 years ago

It should also return txid and current owner.

image

peerchemist commented 3 years ago

This is the final warning, either start thinking about this with logic and understanding or leave the job. Ask yourself what is needed to display when you query a list of all tokens. Imagine you are doing a app which is displaying this for a customer, or admin in admin interface. They must see who owns the token, they must see on which network it runs and what is the creation txid.

You should have understood by now that NFT object is always the same, it is the same upon creation. It is the same upon reading it, it is the same when listing it. It is always the same.

You should make a class (or an object) NFT which always has the same attributes. Then use that object to record or interpret the NFT object in every situation. That would force you to always have the same attributes.

peerchemist commented 3 years ago

Check attributes of this object here, it's in python and for a different protocol, but it is super similar.

https://github.com/PeerAssets/pypeerassets/blob/master/pypeerassets/protocol.py#L58

bigchiano commented 3 years ago

The data in that image is a representation of one card and each card has different editions. the solution to showing owners address is if we fetch and return all editions of each card which will result in duplicate nftIDs in the response array. i am not sure that is what we want as it will result in duplicate images on the frontend but i can make it easier by adding a key called owners which will contain a list of people that own editions of each nft card is that okay? do i go ahead?