Search
K
Links

Get all NFTs the wallet holds

This function helps you to fetch all the NFT's a wallet holds, all you have to do is pass the address to the function parameter and chain while initialising the sdk.
The world of non-fungible tokens (NFTs) has witnessed exponential growth, attracting artists, collectors, and investors alike. As users accumulate various NFTs across multiple blockchain networks, it becomes crucial to manage and track their digital collections. This guide introduces you to the operation of obtaining all NFTs associated with a particular address, offering you a comprehensive snapshot of your NFT holdings. By leveraging this functionality, you can effectively monitor your NFT collection, verify ownership, and assess the value of your digital assets. Ultimately, this operation empowers you to take full control of your unique digital assets and manage them with greater ease and efficiency.

How to get NFTs on a wallet in the Ethereum network

Use the TatumSDK (@tatumio/tatum) to get a balance of the wallet.
TypeScript
JavaScript
curl
1
// yarn add @tatumio/tatum
2
import {TatumSDK, Network, Ethereum, ResponseDto, NftAddressBalance} from '@tatumio/tatum'
3
4
const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
5
6
const balance: ResponseDto<NftAddressBalance[]> = await tatum.nft.getBalance({
7
addresses: ['0x727EA45B2EB6abb2badD3dC7106d146E0Dc0450d'], // replace with your address
8
})
9
10
console.log(balance.data)
1
// Install with: npm install @tatumio/tatum
2
const { TatumSDK, Network } = require("@tatumio/tatum");
3
4
(async () => {
5
try {
6
const tatum = await TatumSDK.init({ network: Network.ETHEREUM });
7
const balance = await tatum.nft.getBalance({
8
addresses: ['0x727EA45B2EB6abb2badD3dC7106d146E0Dc0450d'], // replace with your address
9
});
10
console.log(balance.data);
11
} catch (error) {
12
console.error("Error fetching NFT balance:", error);
13
}
14
})();
1
curl --location --request GET 'https://api.tatum.io/v4/data/balances?chain=ethereum&addresses=0x727EA45B2EB6abb2badD3dC7106d146E0Dc0450d'
Expected Response
[
{
"address": "0x727ea45b2eb6abb2badd3dc7106d146e0dc0450d",
"balance": "2
",
"chain": "ethereum-mainnet",
"lastUpdatedBlockNumber": 14086122,
"metadata": {
"description": "# ***\"Sometimes I swear I can see .... | Joey Camacho ]*",
"external_url": "https://punkscomic.com",
"image": "ipfs://QmS21WhH94jBnYompXHD1SxS6Gw2bY8E81sTYRktWrYa7a/JUPITER.mp4",
"name": "MetaHero Universe: Jupiter DAO Token"
},
"metadataURI": "ipfs://QmR9PokA9rnKKUF1uLtZyHYEhExqQU1Z7t8AbovMBxND4U/5",
"tokenAddress": "0x7deb7bce4d360ebe68278dee6054b882aa62d19c",
"tokenId": "5",
"type": "multitoken"
}
]

Request interface

1
interface AddressBalanceDetails {
2
/**
3
* List of addresses to check.
4
*/
5
addresses: string[]
6
/**
7
* Optional page size. If not specified, the default page size is used, which is 10.
8
*/
9
pageSize?: number
10
/**
11
* Optional page number. If not specified, the first page is returned.
12
*/
13
page?: number
14
}

Response interface

1
interface ResponseDto<T> {
2
/**
3
* Actual payload of the response
4
*/
5
data: T
6
/**
7
* Status of the response
8
*/
9
status: Status
10
/**
11
* In case of ERROR status, this field contains the error message and detailed description
12
*/
13
error?: ErrorWithMessage
14
}
15
16
interface NftAddressBalance {
17
/**
18
* Balance of the address.
19
*/
20
balance: string
21
/**
22
* Blockchain network
23
*/
24
chain: string
25
/**
26
* Token ID
27
*/
28
tokenId: string
29
/**
30
* Token contract address
31
*/
32
tokenAddress: string
33
/**
34
* Token type. Either 'nft' (ERC-721) or 'multitoken' (ERC-1155)
35
*/
36
type: 'nft' | 'multitoken'
37
/**
38
* Token URI
39
*/
40
metadataURI: string
41
/**
42
* Token metadata
43
*/
44
metadata?: {
45
name: string
46
description: string
47
image: string
48
[metadataKey: string]: unknown
49
}
50
/**
51
* Block number of the last balance update.
52
*/
53
lastUpdatedBlock: number
54
}

Supported blockchain networks

Network
Support
Ethereum / Ethereum Sepolia / Ethereum Goerli BNB Smart Chain / BNB Smart Chain Testnet Celo / Celo Alfajores Polygon / Polygon Mumbai
Multiple addresses per 1 invocation NFTs (BAYC,...) ERC-1155 Tokens
© Tatum Technology, LLC