Skip to main content

Aura NFT(ERC721) integration for wallet

It is recommend to use Horoscope, the interchain indexer for querying NFT data on Aura Network. Other interaction with the NFT contract can be executed by sending corresponding CosmWasm transaction to the network.

1. Querying NFT

Chose your API

You can choose indexer server to integrate with the wallet here

List all ERC721 asset of one address

It can be retrieved from the Horoscope like shown below:

curl 'https://indexer-v2.staging.aurascan.io/api/v2/graphql' \
-H 'content-type: application/json' \
--data-raw '
{"operationName":"MyQuery",
"variables":{"limit":10,"address":"0x5606b4ea93f696dd82ca983baf5723d00729f127"},
"query":"query MyQuery($address: String = \"\", $limit: Int = 10) {euphoria { erc721_token(where: {owner: {_eq: $address}}, limit: $limit) { id media_info }}}"}'

Detail of one ERC721 (NFT)

curl 'https://indexer-v2.staging.aurascan.io/api/v2/graphql' \
-H 'content-type: application/json' \
--data-raw '{
"operationName":"MyQuery",
"variables":{"limit":10,"address":"0x9f075deab9a7433f0a5541d235a57db1ca491e0a","token_id":"2"},
"query":"query MyQuery($address: String = \"\", $limit: Int = 10, $token_id: String = null) {\n euphoria { erc721_token( where: {erc721_contract_address: {_eq: $address}, token_id: {_eq: $token_id}} limit: $limit ) { id media_info token_id erc721_contract_address }\n }\n}"}'

Parse output

This is an output of get detail ERC721:

{
"code": 200,
"message": "Successful",
"data": {
"euphoria": {
"erc721_token": [
{
"id": 7,
"media_info": {
"onchain": {
"metadata": {
"name": "2",
"image": "ipfs://QmXVt7YXfwAXYPNMjaWF8udGrXt9sM7KtKptmvF6TJSvzC/2.jpg",
"attributes": [
{
"value": "spring",
"trait_type": "BACKGROUND"
},
{
"value": "Type C",
"trait_type": "SKIN"
},
{
"value": "5",
"trait_type": "CLUB"
},
{
"value": "tech suit",
"trait_type": "CLOTHES"
},
{
"value": "high tech",
"trait_type": "EYES"
},
{
"value": "sport visor",
"trait_type": "HEADWEAR"
}
],
"description": "Coffee painting is a unique art form that involves using coffee as a medium to create images and designs."
},
"token_uri": "https://ipfs-gw.dev.aura.network/ipfs/QmWSu1nxARKf7kPaQqFkHdfdYtWmDmfUr8RhLKoH4q42Wc/2"
},
"offchain": {
"image": {
"url": "https://nft.aurascan.io/ipfs/QmXVt7YXfwAXYPNMjaWF8udGrXt9sM7KtKptmvF6TJSvzC/2.jpg",
"file_path": "ipfs/QmXVt7YXfwAXYPNMjaWF8udGrXt9sM7KtKptmvF6TJSvzC/2.jpg",
"content_type": "image/jpeg"
},
"animation": {}
}
},
"token_id": "2",
"erc721_contract_address": "0x9f075deab9a7433f0a5541d235a57db1ca491e0a"
}
]
}
}
}

NFT metadata are saved on onchain field. Another offchain field are:

  • url: link AWS S3 for image/animation
  • file_path: file path in S3 storage
  • content_type: content type for that image/animation

2. Supported NFT Format

These following media types should be supported for displaying in the wallet:

TypeFile ExtensionExample
ImageJPGlink
ImagePNGlink
ImageGIFlink
VectorSVGlink
VideoMP4link
VideoWEBMlink
AudioMP3link
AudioWAVlink
AudioOGGlink
3DGLBlink