getWalletNFTs

Get all NFTs currently owned by the given wallet address.

How to use getWalletNFTs method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getWalletNFTs method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

ParameterTypeDescription

walletAddress*

string

The wallet address of the owner

contractAddress

string

The contract address for the NFT contract

pageSize

number

Maximum number of records to be retrieved in one page (max 100, default 25)

pageKey

string

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

ParameterTypeDescription

count

number

Number of records returned in the current page

nextPageKey

string

Key used to get the next page of results

nfts

array<object>

array of NFT objects (see the getNFT method for more details)

This API is paginated, response items are ordered descending by:

  • blockNumber

  • transferIndex

Example Request and Result for getWalletNFTs

In this section, you can find an illustrative example of a request made to retrieve all NFTs currently owned by the given wallet address using the getWalletNFTs method.

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Returns all NFTs currently owned by a wallet.

GET https://starknet-mainnet.blastapi.io/<project_id>/builder/getWalletNFTs?

Query Parameters

NameTypeValue

walletAddress

string

0x031c0b3ce1e629066ff59578f212a1bd2db6efda0788d718fb5303df90292772

contractAddress

string

0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af

pageSize

number

2
{
  "count": 2,
  "nextPageKey": "MmM3NjZiOTg0M2UyOjE3MTIzMTYyMzQ6NTQ4MzM5OjEzOjU1MzI1NQ",
  "nfts": [
    {
      "contractAddress": "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",
      "contractName": "Starknet.id",
      "contractSymbol": "ID",
      "contractType": "erc721",
      "tokenId": "210947509068",
      "minterAddress": "0x06cd83db8e123c38aaf0ea5d0104672d0a49b6a8c3d4f31ae82552a265cb9f02",
      "mintBlockNumber": 88044,
      "mintTimestamp": 1687472989,
      "mintTransactionHash": "0x02856a495e28feceb7a3195226890a564d7a50335d77c04724326af081704e89",
      "numberOfTokens": "1",
      "numberOfOwners": "1",
      "ownerAddress": "0x031c0b3ce1e629066ff59578f212a1bd2db6efda0788d718fb5303df90292772",
      "walletBalance": {
        "contractAddress": "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",
        "contractType": "erc721",
        "tokenId": "210947509068",
        "walletAddress": "0x031c0b3ce1e629066ff59578f212a1bd2db6efda0788d718fb5303df90292772",
        "tokenBalance": "1"
      },
      "tokenUri": "https://api.starknet.id/uri?id=210947509068",
      "tokenMetadata": "{\"name\":\"siansa.stark\",\"description\":\"This token represents an identity on StarkNet.\",\"image\":\"https://starknet.id/api/identicons/210947509068\",\"expiry\":1719008989,\"attributes\":[{\"trait_type\":\"Subdomain\",\"value\":[\"yes\"]},{\"trait_type\":\"Domain expiry\",\"value\":[\"Jun 21, 2024\"]},{\"trait_type\":\"Domain expiry timestamp\",\"value\":[\"1719008989\"]}]}",
      "name": "siansa.stark",
      "description": "This token represents an identity on StarkNet.",
      "attributes": [
        {
          "traitType": "Subdomain",
          "value": [
            "yes"
          ]
        },
        {
          "traitType": "Domain expiry",
          "value": [
            "Jun 21, 2024"
          ]
        },
        {
          "traitType": "Domain expiry timestamp",
          "value": [
            "1719008989"
          ]
        }
      ],
      "externalLink": null,
      "imageUrl": "https://starknet.id/api/identicons/210947509068",
      "animationUrl": null,
      "cachedImage": {
        "mimetype": "image/svg+xml",
        "size": 4435,
        "url": "https://builder-assets.blastapi.io/7324d49f89e378fddcc76adfcbd8875acbcdaeac"
      },
      "cachedThumbnail": {
        "mimetype": "image/png",
        "size": 18244,
        "url": "https://builder-assets.blastapi.io/540bb257cb38797eed461a50e88aae95844edfa3"
      }
    },
    {
      "contractAddress": "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",
      "contractName": "Starknet.id",
      "contractSymbol": "ID",
      "contractType": "erc721",
      "tokenId": "971073452936",
      "minterAddress": "0x011b187c20522ae2f54eaff922de6c7c8c905a32c07deb60cebdd8c888ec736b",
      "mintBlockNumber": 244325,
      "mintTimestamp": 1695207602,
      "mintTransactionHash": "0x0634f06d629c004ade6e40920980e8b83dea78bf2fad420a2d35844edfdecda6",
      "numberOfTokens": "1",
      "numberOfOwners": "1",
      "ownerAddress": "0x031c0b3ce1e629066ff59578f212a1bd2db6efda0788d718fb5303df90292772",
      "walletBalance": {
        "contractAddress": "0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",
        "contractType": "erc721",
        "tokenId": "971073452936",
        "walletAddress": "0x031c0b3ce1e629066ff59578f212a1bd2db6efda0788d718fb5303df90292772",
        "tokenBalance": "1"
      },
      "tokenUri": "https://api.starknet.id/uri?id=971073452936",
      "tokenMetadata": "{\"name\":\"bkmouse.stark\",\"description\":\"This token represents an identity on StarkNet.\",\"image\":\"https://starknet.id/api/identicons/971073452936\",\"expiry\":1709982002,\"attributes\":[{\"trait_type\":\"Subdomain\",\"value\":[\"yes\"]},{\"trait_type\":\"Domain expiry\",\"value\":[\"Mar 09, 2024\"]},{\"trait_type\":\"Domain expiry timestamp\",\"value\":[\"1709982002\"]}]}",
      "name": "bkmouse.stark",
      "description": "This token represents an identity on StarkNet.",
      "attributes": [
        {
          "traitType": "Subdomain",
          "value": [
            "yes"
          ]
        },
        {
          "traitType": "Domain expiry",
          "value": [
            "Mar 09, 2024"
          ]
        },
        {
          "traitType": "Domain expiry timestamp",
          "value": [
            "1709982002"
          ]
        }
      ],
      "externalLink": null,
      "imageUrl": "https://starknet.id/api/identicons/971073452936",
      "animationUrl": null,
      "cachedImage": null,
      "cachedThumbnail": null
    }
  ]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getWalletNFTs?walletAddress=0x031c0b3ce1e629066ff59578f212a1bd2db6efda0788d718fb5303df90292772&contractAddress=0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af&pageSize=2 \
-H 'Content-Type: application/json' \

Last updated