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

# getTokenAccountsByDelegate

> Returns all SPL Token accounts by approved Delegate.

### Parameters

<ParamField query="chainId" type="string" default="solana-devnet" required>
  Unique identifier for a blockchain network.
</ParamField>

<ParamField body="id" type="number" default={1} required>
  Request identifier used to match responses.
</ParamField>

<ParamField body="jsonrpc" type="string" default="2.0" required>
  JSON-RPC version.
</ParamField>

<ParamField body="method" type="string" default="getTokenAccountsByDelegate" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={["4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",{"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"encoding":"jsonParsed"}]} placeholder="[&#x22;4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T&#x22;,{&#x22;programId&#x22;:&#x22;TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA&#x22;},{&#x22;encoding&#x22;:&#x22;jsonParsed&#x22;}]" required>
  Parameters for method getTokenAccountsByDelegate: \[delegateAddress, filter, config]

  Positional parameters for <code>getTokenAccountsByDelegate</code>:

  <ul>
    <li><code>params\[0]</code>: Pubkey of the account delegate (base-58 encoded).</li>
    <li><code>params\[1]</code>: Filter object specifying either mint or programId (exactly one required).</li>
    <li><code>params\[2]</code>: Optional configuration object.</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="array">
  Array of token accounts owned by delegate.

  <Expandable title="items">
    <ResponseField name="items[]" type="object">
      Token account object.

      <Expandable title="properties">
        <ResponseField name="pubkey" type="string">
          Account Pubkey (base-58 encoded).
        </ResponseField>

        <ResponseField name="account" type="object">
          Token account data object.

          <Expandable title="properties">
            <ResponseField name="lamports" type="integer">
              Number of lamports assigned to this account.
            </ResponseField>

            <ResponseField name="owner" type="string">
              Pubkey of the program that owns this account (base-58 encoded).
            </ResponseField>

            <ResponseField name="data" type="oneOf">
              Encoded data as \[data, encoding] tuple.

              <Expandable title="variants">
                <ResponseField name="variant1" type="array">
                  Encoded data as \[data, encoding] tuple.

                  <Expandable title="items">
                    <ResponseField name="items[]" type="oneOf">
                      <Expandable title="variants">
                        <ResponseField name="variant1" type="string" />

                        <ResponseField name="variant2" type="string" />
                      </Expandable>
                    </ResponseField>
                  </Expandable>
                </ResponseField>

                <ResponseField name="variant2" type="object">
                  Token state data in JSON format (if jsonParsed encoding).
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="executable" type="boolean">
              True if the account contains a program (strictly read-only).
            </ResponseField>

            <ResponseField name="rentEpoch" type="integer">
              Epoch when this account will next owe rent.
            </ResponseField>

            <ResponseField name="space" type="integer">
              Data size of the account in bytes.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --request POST \
    --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=solana-devnet \
    --header 'content-type: application/json' \
    --data '{
      "id": 1,
      "jsonrpc": "2.0",
      "method": "getTokenAccountsByDelegate",
      "params": [
        "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
        {
          "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
        },
        {
          "encoding": "jsonParsed"
        }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": []
  }
  ```
</ResponseExample>
