Skip to main content

getAssetsByOwner

Returns the list of assets given an owner address.

info

Infura does not currently support params as a JSON object. Instead, parameters must be passed as a positional array, following the exact order defined in the method's specification. This may differ from some other providers, where parameters are typically wrapped in an object containing key/value pairs.

Parameters

  • ownerAddress: (string) [required] - The base58 encoded public key of the owner of the assets.
  • sortBy: (object) [optional] - Sorting criteria for the results:
    • sortBy - The field to sort by. Possible values: created, updated, recent_action, id, none.
    • sortDirection - The sort direction. Possible values: asc, desc.
  • limit: (number) [optional] - The maximum number of assets to retrieve.
  • page: (number) [optional] - The index of the page to retrieve.
  • before: (string) [optional] - Retrieve assets before the specified ID.
  • after: (string) [optional] - Retrieve assets after the specified ID.

Returns

result - An object containing the following fields:

  • total - The total number of assets matching the query.
  • limit - The maximum number of assets returned in this response.
  • items - An array of asset objects. Each asset object contains:
    • interface - The interface type of the asset. Return types include: V1_NFT, V1_PRINT, LEGACY_NFT, V2_NFT, FungibleAsset, FungibleToken, Custom, Identity, Executable, ProgrammableNFT.
    • id - The ID of the asset.
    • content - An object containing the metadata and content information:
      • $schema - The schema URI.
      • json_uri - The URI pointing to the asset's JSON metadata.
      • files - List of associated files with uri, mime, and optional contexts.
      • metadata - An object containing the metadata information:
        • name - The name of the asset.
        • symbol - The symbol of the asset.
        • description - A description of the asset.
        • attributes - List of attributes with trait_type and value.
        • token_standard - The token standard of the asset.
    • ownership - An object containing the ownership details:
      • owner - The owner's public key.
      • frozen - Whether the asset is frozen.
      • delegated - Whether the asset is delegated.
      • delegate - The delegate's public key.
      • ownership_model - The ownership model, for example single or token.
    • compression - An object containing the asset compression details:
      • eligible - Whether the asset is eligible for compression.
      • compressed - Whether the asset is compressed.
      • data_hash - The data hash of the asset.
      • creator_hash - The creator hash of the asset.
      • asset_hash - The asset hash.
      • tree - The Merkle tree ID.
      • seq - The sequence number.
      • leaf_id - The leaf ID.
    • royalty - An object containing the royalty details:
      • royalty_model - The royalty model (creators, fanout, or single).
      • target - The target address for royalties.
      • percent - The royalty percentage.
      • basis_points - The royalty in basis points.
      • primary_sale_happened - Whether the primary sale has occurred.
      • locked - Whether the royalty is locked.
    • creators - List of creators:
      • address - The creator's public key.
      • share - The creator's share percentage.
      • verified - Whether the creator is verified.
    • grouping - Grouping details:
      • group_key - The group key (for example, collection).
      • group_value - The group value.
    • uses - An object containing the usage details:
      • use_method - The usage method (burn, multiple, or single).
      • remaining - The remaining uses.
      • total - The total uses.
    • mutable - Whether the asset is mutable.
    • burnt - Whether the asset is burnt.

Example

Replace <YOUR-API-KEY> with your API key.

Request

curl https://solana-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getAssetsByOwner", "params": ["4cbnLyRoowAXtxLN6sEYrdYTFUkzodRyNFG7g4FKWBBA", {"sortBy": "created", "sortDirection": "desc"}, 50, 1, null, null]}'

Response

{
"jsonrpc": "2.0",
"result": {
"total": 46,
"limit": 50,
"page": 1,
"items": [
{
"interface": "V1_NFT",
"id": "6rZXazDDvM8RU1UDwunkqdhw1nXVFWRuk2Dh1ThJYLTH",
"content": {
"$schema": "https://schema.metaplex.com/nft1.0.json",
"json_uri": "https://cloudflare-ipfs.com/ipfs/QmctZUaANofFr1BLgWQchwjcUMYEX2ZSx2LpDSHSRtQj5m",
"files": [],
"metadata": {
"name": "Key",
"symbol": "",
"token_standard": "NonFungible"
},
"links": {}
},
"authorities": [
{
"address": "9NFLyt33NWcidPYbPyVW7yWpAM1RKepNVMYAhCSpSM3w",
"scopes": [
"full"
]
}
],
"compression": {
"eligible": false,
"compressed": true,
"data_hash": "5ZUYsZn64hubvRVCpnVxX9iBmEbEt1N8v5kbtoSS3L2K",
"creator_hash": "8i3JU72aZtimFTFFQtZCGkzrnLbibBDYVycCn3yrKc5e",
"asset_hash": "37fJAak3P8dFCJX4HijBtqEG6PjoXr74g86xaW4bPfjB",
"tree": "EpGN5mjMwAdWAQHZSHrjGcB7zewEw2KrRezZchSq9W6B",
"seq": 238234,
"leaf_id": 225357
},
"grouping": [
{
"group_key": "collection",
"group_value": "BZNai1KJr17myQUUSfcU6FGHxtp4UwMPawkszXmihyiJ"
}
],
"royalty": {
"royalty_model": "creators",
"target": null,
"percent": 0,
"basis_points": 0,
"primary_sale_happened": false,
"locked": false
},
"creators": [
{
"address": "HeUwVyLufyPMiUnRe6Fo9iUvSBXtFYszAkG6q2WLCikD",
"share": 100,
"verified": false
}
],
"ownership": {
"frozen": false,
"delegated": false,
"delegate": null,
"ownership_model": "single",
"owner": "4cbnLyRoowAXtxLN6sEYrdYTFUkzodRyNFG7g4FKWBBA"
},
"supply": {
"print_max_supply": 0,
"print_current_supply": 0,
"edition_nonce": null
},
"mutable": true,
"burnt": false
},
...
]
},
"id": 1
}