Skip to content

Instantly share code, notes, and snippets.

@johnpmitsch
Last active August 3, 2023 16:06
Show Gist options
  • Save johnpmitsch/63daa7d1c43b25ab865d7b718fd122ac to your computer and use it in GitHub Desktop.
Save johnpmitsch/63daa7d1c43b25ab865d7b718fd122ac to your computer and use it in GitHub Desktop.
QuickNode SDK snippet: get NFTs for a wallet
// 1. Go to https://auth.quicknode.com/signup
// 2. Spin up ethereum, sepolia, or polygon endpoint and add Token/NFT RPC API v2 add-on
// 3. npm/yarn install @quicknode/sdk in typescript or javascript project
// 4. Copy and paste code in project and replace endpointUrl and wallet value below
// 5. profit!
import Core from "@quicknode/sdk/core";
(async () => {
const core = new Core({
endpointUrl: "REPLACE_ME",
config: {
addOns: {
nftTokenV2: true,
},
},
});
const nfts = await core.client.qn_fetchNFTs({
wallet: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6",
})
nfts.assets.forEach((asset) => {
console.log(asset)
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment