Asset Manager
Asset Manager is a tool embedded directly to Admin Console that allows you to quickly upload and manage your assets in the game to U2U IPFS server. And then can later on be used in your NFT as tokenUri
Note: You can still upload dynamically by calling API
Dynamic upload by API
-
First, you need to login to our CMS portal (https://cms-stg.layerg.xyz/dashboard) and get the API key and its secret
-
Next, on LayerG runtime, you need to login using the API key to get the access token
POST https://agg-dev.layerg.xyz/api/auth/login
Sample body:
{
"apiKey": "your_api_key",
"apiKeyID": "your_api_id"
}
And then use the token as the Bearer token for remaining requests
- Upload assets to IPFS
POST https://agg-dev.layerg.xyz/api/common/upload-ipfs
Sample body:
TYPE: form-data
- files: files
- Create a new asset
POST https://agg-dev.layerg.xyz/api/assets/create
Sample body:
{
"name": "GZW #21",
"description": "NFT Game Zombie Weapon",
"tokenId": "21", // Large decimal number as string
"collectionId": "57d7c98c-bf73-4480-b487-76609a0be1c1", // Reference to the Collection ID // Optional: Defaults to 1 if not provided
"media": {
"IPFSUrl": "https://agg-dev.layerg.xyz/api/common/ipfs-serve?ipfsPath=ipfs://ipfs/QmZTnwD6jGXEFHyYtwnne6NXJkJuicwjUseNwYozzLf8FA/zombie.png"
},
"metadata": {
"metadata": {
"attributes": [
{ "trait_type": "id", "value": "21" },
{ "trait_type": "image", "value": "https://agg-dev.layerg.xyz/api/common/ipfs-serve?ipfsPath=ipfs://ipfs/QmZTnwD6jGXEFHyYtwnne6NXJkJuicwjUseNwYozzLf8FA/zombie.png" }
]
}
}
}
Admin console
Collection list
Create a new collection
Link contract
Collection detail
After having a contract linked, you can public collection directly to LayerG marketplace and URI is generated for your NFT contract to use. The uri will follow this format:
https://agg-dev.layerg.xyz/api/assets/{contractAddress}/{tokenId}
Note: After collection is linked to one contract, it cannot be changed.
Upload metadata for assets
Note: This can be only triggered once if you already have a contract linked.