Hello, I do have a question about getting metadata for fungible tokens and NFT and how to differentiate those two from metadata.
When I query the portfolio of a Solana Account, I get the following results:
{
âtokensâ: [
{
âassociatedTokenAddressâ: â3Ws33UgketGZfLwGGPEg1sD1uH1ZjJrXmPVxjRoqTc7Câ,
âmintâ: âDWMReZQxRDjPKxnCnbXn6e4hTqQ8gs7jzR4nMWZGxfAâ,
âamountRawâ: â5â,
âamountâ: â5â,
âdecimalsâ: â0â
},
{
âassociatedTokenAddressâ: â9R5xbsE9TfhAq1rsKoMo9riitJvkiX1gUxDTpUjUN5M7â,
âmintâ: âCTtAWM28Vid6y9USt13jqjhpCL5SkW1aDztuc9jekaFDâ,
âamountRawâ: â1â,
âamountâ: â1â,
âdecimalsâ: â0â
},
{
âassociatedTokenAddressâ: â552bwnuy1JDB4g4kpgUtXMNTBF3BEAqDGtXkkrdrM31kâ,
âmintâ: âDomrvXriy3Mncv7bP8LX8rhZjWRGgZGcs9dws8HnMedxâ,
âamountRawâ: â1â,
âamountâ: â1â,
âdecimalsâ: â0â
}
],
ânftsâ: [
{
âassociatedTokenAddressâ: â4BaK2BieESfiVxzXuKwfQXV9zfpEK9AG782WtQJUsmJLâ,
âmintâ: âE9GsTE8EChwkyMUBBY2Mp2nygbZz4j5UaHSooXhJu8Tfâ,
âamountRawâ: â1â,
âamountâ: â1â,
âdecimalsâ: â0â
}
],
ânativeBalanceâ: {
âlamportsâ: â147945720â,
âsolanaâ: â0.14794572â
}
}
Obviously, this result only tells me limited info about fungible tokens and nft.
To get more info to know what this account is actually holding, I tried the following url:
- For Fungible Token:
https://solana-gateway.moralis.io/nft/mainnet/DWMReZQxRDjPKxnCnbXn6e4hTqQ8gs7jzR4nMWZGxfA/metadata
{
âmintâ: âDWMReZQxRDjPKxnCnbXn6e4hTqQ8gs7jzR4nMWZGxfAâ,
âstandardâ: âmetaplexâ,
ânameâ: âMagicedenâ,
âsymbolâ: âNFTNOTIFâ,
âmetaplexâ: {
âmetadataUriâ: âhttps://juptechpromotion.net/meta.json?q=085b5dea6362eaa8f5f7e93ba5ea8152â,
âupdateAuthorityâ: â11X9tANzt8wd4dae4evom2zC6RxeL4fe1j7dm3M28PAâ,
âsellerFeeBasisPointsâ: 100,
âprimarySaleHappenedâ: 0,
âownersâ: [
{
âaddressâ: â11X9tANzt8wd4dae4evom2zC6RxeL4fe1j7dm3M28PAâ,
âverifiedâ: 1,
âshareâ: 100
}
],
âisMutableâ: true,
âmasterEditionâ: false
}
}
- For NFT:
https://solana-gateway.moralis.io/nft/mainnet/E9GsTE8EChwkyMUBBY2Mp2nygbZz4j5UaHSooXhJu8Tf/metadata
{
âmintâ: âE9GsTE8EChwkyMUBBY2Mp2nygbZz4j5UaHSooXhJu8Tfâ,
âstandardâ: âmetaplexâ,
ânameâ: âFroots #2333â,
âsymbolâ: âFRTSâ,
âmetaplexâ: {
âmetadataUriâ: âhttps://arweave.net/Olk00fZpaFHv2OwZJlBMjuh0O7KNfYTXRmT_jKHy90Mâ,
âupdateAuthorityâ: â9HKgcjgZDRLTitAkr8Xp3XWopeqQ2NJxuHv9iAdqCMqRâ,
âsellerFeeBasisPointsâ: 500,
âprimarySaleHappenedâ: 1,
âownersâ: [
{
âaddressâ: â6Lff4TP4DRQ61vnvhRkdt9zzSeUju4mYMr5qZQNEiCZtâ,
âverifiedâ: 1,
âshareâ: 0
},
{
âaddressâ: â5VSCvdUxX4F5SEMRW31H1UexgjpnhsiKJEb2QFQv7YXeâ,
âverifiedâ: 0,
âshareâ: 92
},
{
âaddressâ: â4JEsS44q2S1XNLLwHB2ix5JHziyqU7jBte5Sewcg4StAâ,
âverifiedâ: 0,
âshareâ: 5
},
{
âaddressâ: âBCmuwKiY9yvBfjDAEbN3oYvMAaQU9VU3F7bmFEce2NF9â,
âverifiedâ: 0,
âshareâ: 3
}
],
âisMutableâ: true,
âmasterEditionâ: false
}
}
I got 2 questions for the above:
-
The query (API) itself is under nft, as you can see in the url, but I am still able to get metadata for a fungible token - as far as I know (correct me if I am wrong), an NFT is a mint account with zero decimals and whose supply will never exceed one - so maybe categorization for this API is somewhat misleading, if I can use this API for a normal fungible token?
-
Which attribute from the metadata can I use to differentiate NFT from FT with 100% accuracy? I suppose I can use âprimarySaleHappenedâ (whatever has this field as 1 is an NFT), but not sure if it can be 100% guaranteed.
Much thanks in advance, I am relatively new to this field, so please correct me if I am misunderstanding anything!