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

# GetTokenAccountsByDelegate

## getTokenAccountsByDelegate RPC Method

Returns all SPL Token accounts by approved Delegate.

<div className="grid grid-cols-2 gap-1 mt-2">
  <div className="col-span-1">
    #### Parameters

    `string` **required**\
    Pubkey of account delegate to query

    * Base-58 encoded string

    `object` **optional**\
    A JSON object with one of the following fields:

    * `mint: <string>` - Pubkey of the specific token Mint
      * Base-58 encoded string
    * `programId: <string>` - Pubkey of the Token program that owns the accounts
      * Base-58 encoded string

    `object` **optional**\
    Configuration object containing the following fields:

    **commitment** `string` **optional**\
    The level of commitment desired when querying state

    **minContextSlot** `number` **optional**\
    The minimum slot that the request can be evaluated at

    **dataSlice** `object` **optional**\
    Request a slice of the account's data

    * `length: <usize>` - number of bytes to return
    * `offset: <usize>` - byte offset from which to start reading

    **encoding** `string` **optional**\
    Encoding format for Account data

    * Default: not specified

    **Allowed Encoding Values:**

    * `base58`
    * `base64`
    * `base64+zstd`
    * `jsonParsed`

    #### Data Slicing Note

    Data slicing is only available for `base58`, `base64`, or `base64+zstd` encodings.
  </div>

  <div className="col-span-1">
    #### Code Sample

    ```bash theme={"system"}
    curl https://rpc.testnet.soo.network/rpc \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getTokenAccountsByDelegate",
      "params": [
        "5ThJTCxpdn54bk3gBAWKZS4K9ogHEX56WooYbXQDnm3Q",
        {
          "mint": "BESTc6u4kKPDrdAXHTKPgCm9bwBzDn2Nq9g4gk1Ld3P4"
        },
        {
          "commitment": "finalized",
          "encoding": "jsonParsed"
        }
      ]
    }'
    ```

    #### Response

    ```json theme={"system"}
    {
      "jsonrpc": "2.0",
      "result": {
        "context": {
          "slot": 369624
        },
        "value": [
          {
            "pubkey": "BESTc6u4kKPDrdAXHTKPgCm9bwBzDn2Nq9g4gk1Ld3P4",
            "account": {
              "lamports": 1000000,
              "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
              "data": {
                "program": "spl-token",
                "parsed": {
                  "info": {
                    "tokenAmount": {
                      "amount": "1000000",
                      "decimals": 6,
                      "uiAmount": 1.0,
                      "uiAmountString": "1.0"
                    }
                  }
                }
              },
              "executable": false,
              "rentEpoch": 123,
              "space": 165
            }
          }
        ]
      },
      "id": 1
    }
    ```
  </div>
</div>

#### Result Details

The result is an RpcResponse JSON object with `value` as an array of account objects:

* `pubkey: <string>`
  * Account Pubkey as a base-58 encoded string
  * Uniquely identifies the token account

* `account: <object>`
  * Detailed account information:
    * `lamports: <u64>` - Number of lamports in the account
    * `owner: <string>` - Pubkey of the program owning the account
    * `data: <object>` - Token state data
    * `executable: <bool>` - Indicates if the account contains a program
    * `rentEpoch: <u64>` - Epoch when rent is next due
    * `space: <u64>` - Size of the account data

#### Additional Notes

* When using `jsonParsed` encoding, expect a Token Balances Structure
* `tokenAmount` provides detailed token balance information
* Optional `delegatedAmount` may be present in the parsed data
