EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

How to get a list of my assets (NFTs)? #1060

Open CiFrameVladislavB opened 2 years ago

bradlhart commented 2 years ago

That depends on how atomicassets has their smart contract setup. Wax and atomicassets might have guides to assist in this.

BattleBlockz commented 2 years ago

Your going to either need to use the atomicassets module if your using something like react or create your fetch to their api and grab the assets based on collection name and the users name.

I'm guessing you already have the login part figured out as well as showing/storing the persons username (ie. ab1123.wam). Api link looks something like this

`https://wax.api.atomicassets.io/atomicassets/v1/assets?owner=${accountName}&collection_name=${collection}&page=1&limit=100&order=desc&sort=asset_id``

Where as the account name would be the persons username and the collection name you can set to whatever collection you want to show. It's best to put the fetch into it's own file such as a config.js and just import it into the "nft showcase" page that you are trying to view the assets on. To keep things clean create a styled wrapper for the cards such as cardwrap.js.

The cardwrap.js would basically be a styled div that organizes what data is displayed. After fetching from the api the info to grab in most cases are data.name, rarity, and data.img.

Honestly with as many dev's there are in the eos/wax space I can't believe more aren't open to teaching others :p

macke89 commented 2 years ago

@BattleBlockz Thank you