Fetch Wallet Contents
Fetch contents of your user’s wallets to build a whitelabel wallet experience
Crossmint’s Smart Wallet SDK is headless by design, enabling you to fine tune the customer experience.
The SDK provides several functions to simplify the process of embedding the wallet in your app, including fetching the assets for display.
The fetch wallet contents API combines several indexers under the hood to enable the highest uptime, lowest latency experience when displaying your user’s assets — all with a single, reliable vendor integration.
In the Crossmint console, create an API key with the wallets:nfts.read
scope. This scope supports both client-side and server-side API keys. Ensure you pick right type of API key for your implementation and never use a server-side key in the client-side of your application.
Fetching NFTs
The SDK includes a client side utility function to fetch the NFTs. Simply pass the address and chain you’d like to retreive the NFTs for. There is also a server-side API that can fetch NFTs for a given wallet address.
import { EVMSmartWallet } from "@crossmint/client-sdk-smart-wallet";
function getNFTs(wallet: EVMSmartWallet) {
return await wallet.nfts();
}