Odak modu

Introduction to Solana Part 2

Displaying NFTs

What good is an NFT if you can’t show it off! In this lesson, we’re going to help you shake that money-maker (assuming your NFT is a money-maker) by displaying it in a wallet and then displaying it in the Candy Machine.

You might be wondering what the point if this is. Imagine your friend mints a cool Pepe NFT from your collection on your website. They mint a lot of pepe-related stuff so they have dozens of NFTs in their wallet. How are they supposed to know which one is from your collection? You gotta show them!

You'll remember from week 1 that everything we want is stored in accounts. Meaning you can just fetch their NFTs using just the wallet address, but it's a lot more work.

Instead, we'll use the Metaplex SDK which makes it as simple as an API call. Here's what it'll look like:

You've got the usual Metaplex setup stuff, but we're using walletAdapterIdentity instead of keypairIdentity for our connection since we don't want their keypair lol. Once we've done that we can just use the Metaplex object to call the findAllByOwner method.

Here's what the NFT data for a single NFT would look like printed onto the console, we care mainly about the uri field:

Btw there's a also bunch of other ways you can fetch NFTs:

Let's write some code!

Background Pattern
Birlikte öğrenelim

Sektörde en çok aranan yazılım becerilerini kazan

Yapay zeka desteği, birebir mentörlük saatleri, canlı dersler ve senin için özel hazırlanmış içeriklerle eksiklerini tamamla, düzenli geri bildirimler al ve öğrenme sürecini en verimli hale getir.

Yunus Emre Kabakcı

Patika+ mezunu

Patika+ Fullstack Web Development Bootcamp mezunumuz Yunus Emre,

3 ay içinde Katar’dan aldığı teklif ile, global bir şirket olan Pavo Group’da işe başladı!


“İçerik zenginliği, mentor desteği, ileriye dönük bir network sağlaması ve dünyada en çok tercih edilen frameworkler üzerinden bir eğitim veriyor olması Patika+’ı tercih etmemin temel sebepleri oldu!“

Yorumlar

Yorum yapabilmek için derse kayıt olmalısın!