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

# getTokenAccounts

> OrbitFlare üzerinde DAS getTokenAccounts ile SPL Token ve Token-2022 hesaplarını sahibe veya mint'e göre sayfalama ile listeleyin.

## Genel Bakış

`getTokenAccounts`, token hesaplarını sahibe, mint'e veya her ikisine göre filtreleyerek listeler. Bir tokenin tüm sahiplerinde sayfa sayfa gezinmek için mint'e göre, bir cüzdanın token hesaplarını listelemek için sahibe göre filtreleyin. [getProgramAccounts](/tr/rpc/methods/getProgramAccounts) yönteminden farklı olarak sayfalama yapar; bu nedenle milyonlarca sahibi olan mint'lerde de çalışır.

`showZeroBalance` ayarlamadığınız sürece sıfır bakiyeli hesaplar dahil edilmez.

## Parametreler

`owner` ve `mint` parametrelerinden en az birini iletin.

<ResponseField name="owner" type="string">
  Sahip cüzdan (base-58). `ownerAddress` olarak da kabul edilir.
</ResponseField>

<ResponseField name="mint" type="string">
  Token mint'i (base-58). `mintAddress` olarak da kabul edilir.
</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">
  Bundan önce gelen hesapları döndürür.
</ResponseField>

<ResponseField name="after" type="string">
  Bundan sonra gelen hesapları döndürür.
</ResponseField>

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

## Yanıt

<ResponseField name="result" type="object">
  <Expandable title="result alanları">
    <ResponseField name="total" type="number">
      Bu sayfadaki hesap 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="token_accounts" type="array">
      <Expandable title="token hesabı alanları">
        <ResponseField name="address" type="string">
          Token hesabı adresi.
        </ResponseField>

        <ResponseField name="mint" type="string">
          Mint adresi.
        </ResponseField>

        <ResponseField name="owner" type="string">
          Sahip cüzdan.
        </ResponseField>

        <ResponseField name="amount" type="number">
          Temel birim cinsinden bakiye.
        </ResponseField>

        <ResponseField name="delegate" type="string | null">
          Ayarlanmışsa temsilci.
        </ResponseField>

        <ResponseField name="delegated_amount" type="number">
          Temsilcinin transfer edebileceği miktar.
        </ResponseField>

        <ResponseField name="close_authority" type="string | null">
          Ayarlanmışsa kapatma yetkilisi.
        </ResponseField>

        <ResponseField name="frozen" type="boolean">
          Hesabın dondurulmuş olup olmadığı.
        </ResponseField>

        <ResponseField name="token_extensions" type="object">
          Mevcut olduğunda Token-2022 hesap uzantıları.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Kod Örnekleri

### Bir mint'in sahipleri

```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": "getTokenAccounts",
  "params": {
    "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "page": 1,
    "limit": 2
  }
}'
```

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "total": 2,
    "limit": 2,
    "page": 1,
    "token_accounts": [
      {
        "address": "1113odRAP5wXa8n7NFVBG53XrqWeDrViZu5rSiSsVA3",
        "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "owner": "HJNr4feTNiDn59RCL1pYoARXMFoBEQSmAY7R7Cm21z9T",
        "amount": 170812,
        "delegate": null,
        "delegated_amount": 0,
        "close_authority": null,
        "frozen": false
      },
      {
        "address": "11NCSQ2Bm6UZdtDqBeHFcos5eFXT1kJ3jG29qKJCWU",
        "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "owner": "FRPPBdG4sYCH7EnTMeKFSVLsfzfEUo4PQ1wWCUkzzmuv",
        "amount": 1804811,
        "delegate": null,
        "delegated_amount": 0,
        "close_authority": null,
        "frozen": false
      }
    ]
  },
  "id": 1
}
```

### Bir tokenin tüm sahiplerini sayma

```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 countHolders(mint: string) {
  const owners = new Set<string>();
  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: 'getTokenAccounts',
        params: { mint, limit: 1000, cursor },
      }),
    });
    const { result, error } = await response.json();
    if (error) throw new Error(error.message);

    for (const account of result.token_accounts) owners.add(account.owner);
    if (result.token_accounts.length < 1000) break;
    cursor = result.cursor;
  }

  return owners.size;
}
```

## Yaygın Hatalar

| Kod | Mesaj | Çözüm |
| - | - | - |
| -32602 | Validation Error: Pass 'owner', 'mint' or both (also accepted as 'ownerAddress' and 'mintAddress') | `owner`, `mint` veya her ikisini gönderin |
| -32602 | Validation Error: Invalid pubkey ... | Geçerli base-58 adresleri iletin |
| -32602 | Pagination Error. Limit should not be greater than 1000. | 1.000 veya daha küçük bir `limit` kullanın |


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