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

# getAssetsByGroup

> OrbitFlare üzerinde DAS getAssetsByGroup ile bir Solana koleksiyonundaki her NFT'yi ve sıkıştırılmış NFT'yi listeleyin.

## Genel Bakış

`getAssetsByGroup`, bir gruptaki varlıkları listeler. Pratikte grup bir koleksiyondur: `groupKey: "collection"` değerini ve koleksiyon adresini `groupValue` olarak iletin. `showUnverifiedCollections` ayarlamadığınız sürece yalnızca doğrulanmış koleksiyon üyeleri döndürülür.

## Parametreler

<ResponseField name="groupKey" type="string" required>
  Grup türü. `collection` kullanın.
</ResponseField>

<ResponseField name="groupValue" type="string" required>
  Koleksiyon 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`, `showUnverifiedCollections`, `showCollectionMetadata`, `showInscription`. `displayOptions` olarak da kabul edilir.
</ResponseField>

## Yanıt

`last_indexed_slot`, `total`, `limit`, `page` veya `cursor` ve `items` ([varlık nesneleri](/tr/das-api/asset-object)) içeren bir liste.

## 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": "getAssetsByGroup",
  "params": {
    "groupKey": "collection",
    "groupValue": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w",
    "page": 1,
    "limit": 1
  }
}'
```

### Yanıt

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "last_indexed_slot": 457714577,
    "total": 1,
    "limit": 1,
    "page": 1,
    "items": [
      {
        "interface": "ProgrammableNFT",
        "id": "JEGruwYE13mhX2wi2MGrPmeLiVyZtbBptmVy9vG3pXRC",
        "content": {
          "json_uri": "https://madlads.s3.us-west-2.amazonaws.com/json/6867.json",
          "metadata": { "name": "Mad Lads #6867", "symbol": "MAD" }
        },
        "grouping": [
          { "group_key": "collection", "group_value": "J1S9H3QjnRtBbbuD4HjPV6RpRhwuk4zKbxsnCHuTgh9w" }
        ],
        "ownership": {
          "frozen": true,
          "delegated": true,
          "delegate": "FARqKAafAbgT25QcgiX5d1g6xpadgG7xymu5N6gSmp4x",
          "ownership_model": "single",
          "owner": "CxBhuJwhVgNMc7yjnRx3XFAsTnnbYDc2bhAGSaLBjNqZ"
        }
      }
    ]
  },
  "id": 1
}
```

Varlık nesnesi kısaltılmıştır. Tam bir örnek için [Varlık nesnesi](/tr/das-api/asset-object) sayfasına bakın.

### TypeScript

Bir koleksiyonun sahiplerini toplayın:

```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 getCollectionHolders(collection: string) {
  const holders = new Map<string, number>();
  let cursor: string | undefined;

  while (true) {
    const response = await fetch(RPC_URL, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'getAssetsByGroup',
        params: { groupKey: 'collection', groupValue: collection, limit: 1000, cursor },
      }),
    });
    const { result, error } = await response.json();
    if (error) throw new Error(error.message);

    for (const asset of result.items) {
      const owner = asset.ownership.owner;
      holders.set(owner, (holders.get(owner) ?? 0) + 1);
    }
    if (result.items.length < 1000) break;
    cursor = result.cursor;
  }

  return holders;
}
```

## Yaygın Hatalar

| Kod | Mesaj | Çözüm |
| - | - | - |
| -32602 | missing field `groupValue` | Hem `groupKey` hem de `groupValue` gönderin |
| -32602 | Pagination Error. Limit should not be greater than 1000. | 1.000 veya daha küçük bir `limit` 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.