Check if the wallet owns a specific NFT
This function checks if a wallet own's any or a specific nft from a collection, you can pass collection address, wallet address & tokenId as an option parameter.
Try this feature
In the rapidly growing world of non-fungible tokens (NFTs), verifying the ownership of a particular NFT is crucial for creators, collectors, and traders alike. This guide introduces you to the operation of checking if a wallet owns a specific NFT, providing an efficient way to confirm the possession of unique digital assets. By leveraging this functionality, you can ensure the accuracy and authenticity of your NFT holdings, make well-informed decisions about buying, selling, or holding NFTs, and navigate the dynamic NFT landscape with greater confidence. Ultimately, this operation empowers you to manage your digital assets more effectively, fostering transparency and trust in your NFT transactions.
Use the TatumSDK (
@tatumcom/js
) to check, if the wallet is the owner.TypeScript
JavaScript
curl
1
// yarn add @tatumio/tatum
2
import {TatumSDK, Network, Ethereum} from '@tatumio/tatum'
3
4
const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
5
6
const isOwner: boolean = await tatum.nft.checkNftOwner({
7
tokenAddress: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d', // replace with your collection
8
tokenId: '1',
9
owner: '0x46efbaedc92067e6d60e84ed6395099723252496' // owner wallet
10
})
11
12
console.log(isOwner)
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 isOwner = await tatum.nft.checkNftOwner({
8
tokenAddress: "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d", // replace with your collection
9
tokenId: "1",
10
owner: "0x46efbaedc92067e6d60e84ed6395099723252496" // owner wallet
11
});
12
console.log(isOwner);
13
} catch (error) {
14
console.error("Error checking NFT owner:", error);
15
}
16
})();
17
18
19
// Expected outcome
20
// true
1
curl --location --request GET 'https://api.tatum.io/v4/data/owners/address?tokenAddress=0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d&tokenId=1&chain=ethereum&address=0x46efbaedc92067e6d60e84ed6395099723252496'
1
interface GetTokenOwner {
2
/**
3
* Token ID
4
*/
5
tokenId: string
6
/**
7
* Token contract address
8
*/
9
tokenAddress: string
10
/**
11
* Owner address of the NFT token
12
*/
13
owner: string
14
}
1
interface ResponseDto<boolean> {
2
/**
3
* Actual payload of the response - true or false result
4
*/
5
data: boolean
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
}
Network | Support |
---|---|
Ethereum / Ethereum Sepolia / Ethereum Goerli
BNB Smart Chain / BNB Smart Chain Testnet
Celo / Celo Alfajores
Polygon / Polygon Mumbai | NFTs (BAYC,...)
ERC-1155 Tokens |
Last modified 8d ago