/v2/app/nft/listTokens
This API lists all tokens that the user owns, including compressed NFTs on Solana. You can filter the output for a list of collections or get all tokens that the user owns. The API only returns tokens for transactions that have been successfully mined on the blockchain and doesn't include any pending NFT transactions.
Once the NFT transaction(mint or transfer) succeeds on the blockchain, it can take a few seconds for the API to return the updated list.
Response
The response will be a JSON object with a list of tokens
.
{
"status": "SUCCESS",
"tokens": [
{
"collection": "0x9686f48c324e252399f41e7149c6b75308d5a737",
"name": "Metakeep_NFT",
"symbol": "MTKNFT",
"token": "1234",
"tokenMetadata": {
"name": "Kittie #1234",
"description": "My first NFT cat",
"image": "https://c.tenor.com/13FWU4hPOZEAAAAd/bitcoin-satoshi.gif"
}
},
{
"collection": "0x9686f48c324e252399f41e7149c6b75308d5a737",
"name": "Metakeep_NFT1",
"symbol": "MTKNFT1",
"token": "4567",
"tokenMetadata": {
"name": "Kittie #4567",
"description": "My second NFT cat",
"image": "https://c.tenor.com/13FWU4hPOZEAAAAd/bitcoin-satoshi.gif"
}
}
],
"totalCount": "2",
"paginationToken": ""
}
{
"status": "SUCCESS",
"tokens": [
{
"collection": "AzZm9ELiNexkS1APLvxEgUDfzxuNz4YtFmKBc45MxWag",
"name": "Test",
"token": "2YbEubNiTzbLpibZEqrjUzm6QSbazNbW29mE8FuEfmBo",
"tokenMetadata": {
"name": "Test",
"image": "https://dev.updg8.com/imgdata/AzZm9ELiNexkS1APLvxEgUDfzxuNz4YtFmKBc45MxWag"
}
},
{
"collection": "FwQYHtaz5PCdZ7shZRazFikjbLEr4icj1wKLT9rwdhw3",
"name": "Blocksmith",
"token": "7FauhnntcA7Zmmc6uS1x9HEX6RPLu7P65pExhqwVh77d",
"tokenMetadata": {
"name": "Blocksmith",
"image": "https://dev.updg8.com/imgdata/7FauhnntcA7Zmmc6uS1x9HEX6RPLu7P65pExhqwVh77d"
}
}
],
"totalCount": "2"
}
Here's the description of the fields in the response:
collection
: The collection ID of the token. Note that this can be missing on Solana.name
: The name of the collection.symbol
: The symbol of the collection.token
: The token identifier. This is the mint address on Solana and the token ID on Ethereum.tokenMetadata
: The token metadata that contains the name, symbol, image, and attributes of the token.totalCount
: The total number of tokens that the user owns.paginationToken
: Pagination token for the next page of results. This will be missing if there are no more results.
Response pagination
The response will return max 50 tokens at a time.
If the user has more than 50 tokens, the developer must make multiple requests to get all the tokens. The response will have a pagination token
which can be used to get the next set of tokens. Once the response does not have a pagination token
, it means that all the tokens have been returned.
Provide a list of collections for the best performance
Trying to get all tokens for a user can be slow and causes poor user experience. We recommend that you only get the tokens for the collections you need. For example, if you only need the tokens for the
CryptoPunks
collection, you can use thecollections
parameter to get only the tokens for that collection.
Api Error Status
You can find error status returned by the api here.
Ā© Copyright 2024, Passbird Research Inc.