> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getAssetsByOwner

> List every NFT, compressed NFT, MPL Core asset and token a Solana wallet owns, with SOL balance and USD prices, using DAS getAssetsByOwner on OrbitFlare.

## Overview

`getAssetsByOwner` lists the assets held by a wallet. By default it returns NFTs, compressed NFTs and MPL Core assets. Add `showFungible` to include fungible tokens with balances and USD prices, and `showNativeBalance` to add the wallet's SOL balance. Together they give a full portfolio in one call.

## Parameters

<ResponseField name="ownerAddress" type="string" required>
  The wallet address (base-58).
</ResponseField>

<ResponseField name="page" type="number">
  Page number, starting at 1. See [Pagination](/das-api/pagination).
</ResponseField>

<ResponseField name="limit" type="number">
  Results per page. Maximum and default 1,000.
</ResponseField>

<ResponseField name="cursor" type="string">
  Cursor from a previous response.
</ResponseField>

<ResponseField name="before" type="string">
  Return assets with IDs before this one.
</ResponseField>

<ResponseField name="after" type="string">
  Return assets with IDs after this one.
</ResponseField>

<ResponseField name="sortBy" type="object">
  `{ "sortBy": "id" | "created" | "updated" | "recent_action" | "none", "sortDirection": "asc" | "desc" }`
</ResponseField>

<ResponseField name="options" type="object">
  [Display options](/das-api/display-options): `showFungible`, `showNativeBalance`, `showUnverifiedCollections`, `showCollectionMetadata`, `showInscription`. Also accepted as `displayOptions`.
</ResponseField>

## Response

<ResponseField name="result" type="object">
  <Expandable title="result fields">
    <ResponseField name="last_indexed_slot" type="number">
      Most recent slot the index has processed.
    </ResponseField>

    <ResponseField name="total" type="number">
      Number of items in this page.
    </ResponseField>

    <ResponseField name="limit" type="number">
      Page size used.
    </ResponseField>

    <ResponseField name="page" type="number">
      Page number, when paging by page.
    </ResponseField>

    <ResponseField name="cursor" type="string">
      Cursor for the next page, when paging by cursor.
    </ResponseField>

    <ResponseField name="items" type="array">
      [Asset objects](/das-api/asset-object).
    </ResponseField>

    <ResponseField name="nativeBalance" type="object">
      With `showNativeBalance`: `lamports`, `price_per_sol` and `total_price` (USD).
    </ResponseField>
  </Expandable>
</ResponseField>

## Code Examples

### Request

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAssetsByOwner",
  "params": {
    "ownerAddress": "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY",
    "page": 1,
    "limit": 100,
    "options": {
      "showFungible": true,
      "showNativeBalance": true
    }
  }
}'
```

### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "last_indexed_slot": 457714577,
    "total": 100,
    "limit": 100,
    "page": 1,
    "nativeBalance": {
      "lamports": 1328527472954,
      "price_per_sol": 101.5,
      "total_price": 134845.54
    },
    "items": [
      {
        "interface": "FungibleToken",
        "id": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "token_info": {
          "symbol": "USDC",
          "balance": 2500000,
          "decimals": 6,
          "token_program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "price_info": {
            "price_per_token": 1.0,
            "total_price": 2.5,
            "currency": "USDC"
          }
        }
      }
    ]
  },
  "id": 1
}
```

Values are illustrative and the asset object is shortened. See [Asset object](/das-api/asset-object) for every field.

### TypeScript

```typescript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
const RPC_URL = 'https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY';

async function getPortfolio(owner: string) {
  const response = await fetch(RPC_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'getAssetsByOwner',
      params: {
        ownerAddress: owner,
        page: 1,
        limit: 1000,
        options: { showFungible: true, showNativeBalance: true },
      },
    }),
  });
  const { result, error } = await response.json();
  if (error) throw new Error(error.message);

  const nfts = result.items.filter((a: any) => a.ownership.ownership_model === 'single');
  const tokens = result.items.filter((a: any) => a.ownership.ownership_model === 'token');
  const tokenUsd = tokens.reduce(
    (sum: number, t: any) => sum + (t.token_info?.price_info?.total_price ?? 0),
    0,
  );

  return {
    nfts,
    tokens,
    solUsd: result.nativeBalance?.total_price ?? 0,
    tokenUsd,
  };
}
```

## Common Errors

| Code | Message | Solution |
| - | - | - |
| -32602 | Pubkey Validation Err: ... is invalid | Pass a valid base-58 wallet address |
| -32602 | Pagination Error. Limit should not be greater than 1000. | Use a `limit` of 1,000 or less |
| -32602 | Pagination Error. Only one pagination parameter supported per query. | Use only one of `page`, `cursor` or `before`/`after` |
| -32602 | Pagination Sorting Error | Cursors and ranges need `sortBy: "id"`; use `page` with other sorts |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.