DERA chain docs
  • Introduction
  • NFT2.0
    • Introduction
    • Architecture
    • Concepts
      • Collection
      • NFT2.0
      • Data Registry
      • Derivative NFT
      • Derived Account
      • Token Bound Account (aka TBA)
    • Smart Contracts
      • Interfaces
        • Factory
        • Dynamicity
        • Derivability
        • Cross chain ability
      • Use cases
        • Create collection
        • Mint NFT2.0
        • Create Data registry
        • Write onchain data
        • Retrieve onchain data
        • Mint Derivative NFT2.0
        • Create TBA
    • SDK
      • Setup
        • Create Console Account
        • Manage API key
        • Set up metadata schema
        • Initialize the SDK
      • API reference
        • Get List Collection
        • Get List Collection By Owner
        • Get Collection Info
        • Get List NFT By Collection
        • Get List NFT By Owner
        • Get List Derivative NFT By Original
        • Get NFT Info
        • Get List Data Registry
        • Get Data Registry By Owner
        • Get Data Registry Info
        • Get NFT onchain data
        • Get NFT protocol-scoped onchain data
        • Get User Freemint Info
        • Get Claim Token Uri Info
        • Upload JSON Uri Data To IPFS
        • Generate Presigned URL To Upload Image (IPFS)
        • Utility Functions
    • App guide
      • NFT2Scan
        • Create Collection
        • Mint NFT2.0
        • Mint Derivative NFT2.0
      • NFT2Console
        • Create Dapp
        • Register data schema
        • Manage API keys
        • Manage onchain data
    • References
      • Links
  • Bridge
    • Introduction
    • Bridge Token
    • Bridge NFT
  • Staking
    • Introduction
    • Validate
    • Delegate
  • Smart Contracts
    • EVM compatibility
    • Hardhat
    • Foundry
    • Account Abstraction
    • SubQuery Indexer
    • SAFE multisign
  • Nodes & Validators
    • Run a Node
    • Become a Validator
Powered by GitBook
On this page
  • Request
  • Parameters
  • Response
  1. NFT2.0
  2. SDK
  3. API reference

Get List NFT By Owner

Request

In order to get list NFT of a wallet, SDK provides you with a getNFTsByOwner endpoint to do so

try {
  const mainnetClient = nft2Client.getNFT2ContractMultichain('mainnet');
 
  const { nfts, total } = await mainnetClient.getNFTsByOwner(
    "0x...",  // user wallet
    {
      limit: 20,
      offset: 0
    },
    [56, 43114]
  );
 
  console.log(nfts, total)
} catch (e) {
  console.error(e);
}

Parameters

  • ownerAddress (string): Wallet address of owner.

  • Pagination:

    • limit (number): Pagination limit.

    • offset (number): Pagination offset.

    • sort ({field: 'tokenId' | 'mintedAt'; order: 'DESC' | 'ASC'}): Optional. Default order ASC by tokenId.

    • filter ({isDerivative: false | true}): Optional. If true, get list derivative NFT of user. Default false.

  • chainIds: Which chains to get from.

Response

{
  nfts: Array<{
    name: string;
    description: string;
    tokenId: string;
    chainId: number;
    creatorAddress: string;
    ownerAddress: string;
    imageUrl: string;
    tokenUri: string;
    type: number;
    status: number;
    mintedAt: Date;
    openAt?: Date; // derivative only
    closeAt?: Date; // derivative only
    royalties: number;
    collection: Collection;
    original?: { // original NFT info, derivative only
      collectionAddress: string;
      tokenId: string;
    };
    dataRegistry?: {
      providerAddress: string;  // data registry address, derivative only
    };
  }>;
  total: number;
}
  1. Chain not supported:

Error: Cannot read property 'getNFTsByOwner' of undefined
PreviousGet List NFT By CollectionNextGet List Derivative NFT By Original

Last updated 7 months ago