Explorer

Get Portfolio NFTs

Learn how to retrieve NFT portfolio information using the Okto SDK.

The getPortfolioNFT function retrieves the list of NFTs in the authenticated user's portfolio.

Available on

Ethereum
Ethereum
Polygon
Polygon
Solana
Solana
Aptos
Aptos
Avalanche
Avalanche
Arbitrum
Arbitrum
BSC
BSC
Fantom
Fantom
Linea
Linea
Metis
Metis
Optimism
Optimism
Base
Base
Polygon Amoy
Polygon Amoy

To enable these chains for your application, please configure them in the Okto Dashboard.

Not available on

Base Sepolia
Base Sepolia
HyperEVM Testnet
HyperEVM Testnet

Example

using System;
using System.Threading.Tasks;
using UnityEngine;
//This is an independent script which calls GetNftPotfolio() Api
namespace OktoSDK
{
    public class Portfolio : MonoBehaviour
    {
        public async Task<List<UserNFTBalance>> GetPortfolioNFT(OktoClient oc)
        {
            Loader.ShowLoader();
 
            try
            {
                return await BffClientRepository.GetPortfolioNft();
            }
            catch (Exception error)
            {
                CustomLogger.LogError($"Failed to retrieve orders: {error}");
                throw;
            }
        }
    }
}

Note

For error handling:

Method Overview

MethodDescription
async getPortfolioNFTGet NFT portfolio information

Get Portfolio NFT

async getPortfolioNFT(oktoClient: OktoClient) retrieves the user's NFT portfolio information.

Parameters

ParameterTypeDescriptionRequired
oktoClientOktoClientInstance of OktoClient obtained from OktoClient.csYes

Response

Success Response

Field NameTypeDescription
nftsTask<List<UserNFTBalance>>Array of user's NFT balances