> ## 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

> OrbitFlare üzerinde DAS getAssetsByOwner ile bir Solana cüzdanının sahip olduğu her NFT'yi, sıkıştırılmış NFT'yi, MPL Core varlığını ve tokeni SOL bakiyesi ve USD fiyatlarıyla listeleyin.

## Genel Bakış

`getAssetsByOwner`, bir cüzdanın tuttuğu varlıkları listeler. Varsayılan olarak NFT'leri, sıkıştırılmış NFT'leri ve MPL Core varlıklarını döndürür. Değiştirilebilir tokenleri bakiyeleri ve USD fiyatlarıyla dahil etmek için `showFungible`, cüzdanın SOL bakiyesini eklemek için `showNativeBalance` ekleyin. Birlikte kullanıldıklarında tek bir çağrıda eksiksiz bir portföy sunarlar.

## Parametreler

<ResponseField name="ownerAddress" type="string" required>
  Cüzdan adresi (base-58).
</ResponseField>

<ResponseField name="page" type="number">
  1'den başlayan sayfa numarası. Bkz. [Sayfalama](/tr/das-api/pagination).
</ResponseField>

<ResponseField name="limit" type="number">
  Sayfa başına sonuç sayısı. Maksimum ve varsayılan değer 1.000.
</ResponseField>

<ResponseField name="cursor" type="string">
  Önceki bir yanıttan alınan imleç.
</ResponseField>

<ResponseField name="before" type="string">
  Kimliği bundan önce gelen varlıkları döndürür.
</ResponseField>

<ResponseField name="after" type="string">
  Kimliği bundan sonra gelen varlıkları döndürür.
</ResponseField>

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

<ResponseField name="options" type="object">
  [Görüntüleme seçenekleri](/tr/das-api/display-options): `showFungible`, `showNativeBalance`, `showUnverifiedCollections`, `showCollectionMetadata`, `showInscription`. `displayOptions` olarak da kabul edilir.
</ResponseField>

## Yanıt

<ResponseField name="result" type="object">
  <Expandable title="result alanları">
    <ResponseField name="last_indexed_slot" type="number">
      İndeksin işlediği en son slot.
    </ResponseField>

    <ResponseField name="total" type="number">
      Bu sayfadaki öğe sayısı.
    </ResponseField>

    <ResponseField name="limit" type="number">
      Kullanılan sayfa boyutu.
    </ResponseField>

    <ResponseField name="page" type="number">
      Sayfa numarasıyla sayfalama yapılırken sayfa numarası.
    </ResponseField>

    <ResponseField name="cursor" type="string">
      İmleçle sayfalama yapılırken sonraki sayfanın imleci.
    </ResponseField>

    <ResponseField name="items" type="array">
      [Varlık nesneleri](/tr/das-api/asset-object).
    </ResponseField>

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

## Kod Örnekleri

### İstek

```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
    }
  }
}'
```

### Yanıt

```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
}
```

Değerler örnek amaçlıdır ve varlık nesnesi kısaltılmıştır. Tüm alanlar için [Varlık nesnesi](/tr/das-api/asset-object) sayfasına bakın.

### 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,
  };
}
```

## Yaygın Hatalar

| Kod | Mesaj | Çözüm |
| - | - | - |
| -32602 | Pubkey Validation Err: ... is invalid | Geçerli bir base-58 cüzdan adresi iletin |
| -32602 | Pagination Error. Limit should not be greater than 1000. | 1.000 veya daha küçük bir `limit` kullanın |
| -32602 | Pagination Error. Only one pagination parameter supported per query. | `page`, `cursor` veya `before`/`after` seçeneklerinden yalnızca birini kullanın |
| -32602 | Pagination Sorting Error | İmleçler ve aralıklar `sortBy: "id"` gerektirir; diğer sıralamalarla `page` kullanın |


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