Airstack provides an AI solution for you to build GraphQL queries to fulfill your use case easily. You can find the AI prompt of each query in the demo's caption or title for yourself to try.
Get A Certain Version of ERC6551 Accounts
You can use the Accounts API to fetch certain version of the ERC6551 accounts, e.g. all v.0.3.1 ERC6551 accounts:
{"data": {"Accounts": {"Account": [ {"address": {"addresses": [// ERC6551 account address"0xfcdb9fa208a44dcbf44bee781a843e3a110e5a6d" ] },// Sapienz NFT's token ID & image that owned the ERC6551 account"nft": {"tokenId":"5016","contentValue": {"image": { "medium": "https://assets.airstack.xyz/image/nft/5kd+4a7IJ5/FRcsd89DlfK94FmP9mMPaWE6lJEEFcv8k7Uysylj9VPfwtBG/4Coqfgt+T8NjIvnl3Ens3pPcpg==/medium.aaf"
} } } },// Other v0.3.1 ERC6551 accounts on Sapienz NFT ] } }}
Get A Certain Version of ERC6551 Accounts Owned By A User
You can use the TokenBalances API to fetch certain version of the ERC6551 accounts owned by a user, e.g. all v.0.3.1 ERC6551 accounts owned by 0xjw.eth:
Try Demo
Code
queryMyQuery { TokenBalances( input: {filter: { # Owner of ERC6551 accountsowner: {_eq: "0xjw.eth"}, # Filter out only ERC721 NFTstokenType: {_eq: ERC721} },blockchain: ethereum,limit: 200 } ) { TokenBalance { tokenNfts { erc6551Accounts( input: {filter: { # set registry to v.0.3.1registry: {_eq: "0x000000006551c19487814612e58FE06813775758"} } } ) { address { addresses } nft { address tokenId token { name } contentValue { image { medium } } } } } } }}
{"data": {"TokenBalances": {"TokenBalance": [ {"tokenNfts": {"erc6551Accounts": [ {"address": {"addresses": [// This is the ERC6551 account address of the NFT"0xb5307cb1ae1385f64de8442d5d48ff86479f4f8c" ] },"nft": {"address":"0x26727ed4f5ba61d3772d1575bca011ae3aef5d36","tokenId":"0","token": {"name":"Sapienz" },"contentValue": {"image": { "medium": "https://assets.airstack.xyz/image/nft/5kd+4a7IJ5/FRcsd89DlfK94FmP9mMPaWE6lJEEFcv89IrV05wFbp2CuATN2RB0a/medium.gif"
} } } } ] } }, {"tokenNfts": {"erc6551Accounts": [] // This NFT has no ERC6551 accounts } },// Other ERC721 NFTs that is owned by 0xjw.eth ] } }}
Developer Support
If you have any questions or need help regarding fetching certain versions of ERC6551 token bound accounts data, please join our Airstack's Telegram group.