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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Accounts

> Query account states, balances, and token holdings on Surfnet

Query account states, balances, token holdings, and program-specific storage data.

## getProgramAccounts

Get program accounts owned by a specific program ID.

Scans of large programs such as the Token program are fetched from the datasource. The public default datasource rejects them with `403 Forbidden`, so start Surfpool with a private RPC URL (`surfpool start --rpc-url <URL>`) to run this sample, or query a program with fewer accounts.

**Parameters**

<ParamField body="programId" type="string" required>
  The public key of the program, as a base-58 encoded string.
</ParamField>

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="dataSlice" type="object">
      The data slice configuration.

      <Expandable title="properties">
        <ParamField body="length" type="integer">
          The length of the data slice.
        </ParamField>

        <ParamField body="offset" type="integer">
          The offset of the data slice.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="encoding" type="&#x22;binary&#x22; | &#x22;base58&#x22; | &#x22;base64&#x22; | &#x22;jsonParsed&#x22; | &#x22;base64+zstd&#x22;">
      The encoding for the account data.
    </ParamField>

    <ParamField body="filters" type="array">
      Filters to apply to the program accounts. Each filter is a base58-encoded string representing an address or a specific filter type.
    </ParamField>

    <ParamField body="minContextSlot" type="integer">
      The minimum context slot for the account info.
    </ParamField>

    <ParamField body="sortResults" type="boolean">
      Whether to sort the results.
    </ParamField>

    <ParamField body="withContext" type="boolean">
      Whether to include the context in the response.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="result" type="array<RpcKeyedAccount>">
  getProgramAccounts - Returns program-owned accounts

  <Expandable title="properties" defaultOpen>
    <ResponseField name="account" type="object">
      <Expandable title="properties">
        <ResponseField name="data" type="array<string>">
          Account data
        </ResponseField>

        <ResponseField name="executable" type="boolean">
          Whether this account contains executable code
        </ResponseField>

        <ResponseField name="lamports" type="integer">
          Account balance in lamports
        </ResponseField>

        <ResponseField name="owner" type="string">
          Program that owns this account
        </ResponseField>

        <ResponseField name="rentEpoch" type="integer">
          Epoch at which this account will next owe rent
        </ResponseField>
      </Expandable>
    </ResponseField>

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

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getProgramAccounts",
    "params": [
      "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      {
        "commitment": "confirmed",
        "encoding": "base64",
        "dataSlice": {
          "offset": 0,
          "length": 0
        },
        "filters": [
          {
            "dataSize": 165
          }
        ],
        "withContext": true
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254448,
      "apiVersion": "4.2.1"
    },
    "value": [
      {
        "pubkey": "Ah241PLYdGWy2heWX42XfEWg8XtCvXDxtzTEfp3abgak",
        "account": {
          "lamports": 2039280,
          "data": [
            "",
            "base64"
          ],
          "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "executable": false,
          "rentEpoch": 0,
          "space": 165
        }
      }
    ]
  }
}
```

## getLargestAccounts

Returns the 20 largest accounts by lamport balance.

**Parameters**

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="filter" type="&#x22;circulating&#x22; | &#x22;nonCirculating&#x22;">
      The filter to apply to the largest accounts.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="array<RpcAccountBalance>">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="address" type="string" />

    <ResponseField name="lamports" type="integer" />
  </Expandable>
</ResponseField>

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getLargestAccounts",
    "params": [
      {
        "commitment": "confirmed",
        "filter": "circulating"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254448,
      "apiVersion": "4.2.1"
    },
    "value": [
      {
        "address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
        "lamports": 999999999999
      },
      {
        "address": "GmaDrppBC7P5ARKV8g3djiwP89vz1jLK23V2GBjuAEGB",
        "lamports": 5000000000
      }
    ]
  }
}
```

## getSupply

Returns information about the current token supply.

**Parameters**

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="excludeNonCirculatingAccountsList" type="boolean">
      Whether to exclude non-circulating accounts.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="circulating" type="integer" />

    <ResponseField name="nonCirculating" type="integer" />

    <ResponseField name="nonCirculatingAccounts" type="array<string>" />

    <ResponseField name="total" type="integer" />
  </Expandable>
</ResponseField>

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getSupply",
    "params": [
      {
        "commitment": "confirmed",
        "excludeNonCirculatingAccountsList": true
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254622,
      "apiVersion": "4.2.1"
    },
    "value": {
      "total": 0,
      "circulating": 0,
      "nonCirculating": 0,
      "nonCirculatingAccounts": []
    }
  }
}
```

## getTokenLargestAccounts

Returns the largest accounts for a given token mint.

**Parameters**

<ParamField body="mint" type="string" required>
  The public key of the token mint, as a base-58 encoded string.
</ParamField>

<ParamField body="commitment" type="object">
  The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="array<RpcTokenAccountBalance>">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="address" type="string" />

    <ResponseField name="amount" type="string">
      Token amount as string
    </ResponseField>

    <ResponseField name="decimals" type="integer">
      Number of decimals
    </ResponseField>

    <ResponseField name="uiAmount" type="number">
      Human readable amount as float
    </ResponseField>

    <ResponseField name="uiAmountString" type="string">
      Human readable amount as string
    </ResponseField>
  </Expandable>
</ResponseField>

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenLargestAccounts",
    "params": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      {
        "commitment": "confirmed"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254448,
      "apiVersion": "4.2.1"
    },
    "value": [
      {
        "address": "Ah241PLYdGWy2heWX42XfEWg8XtCvXDxtzTEfp3abgak",
        "amount": "1000000000",
        "decimals": 6,
        "uiAmount": 1000,
        "uiAmountString": "1000"
      }
    ]
  }
}
```

## getTokenAccountsByOwner

Returns all SPL Token accounts by owner.

Run the `surfnet_setTokenAccount` sample first to create a USDC token account for this owner; otherwise the list is empty.

**Parameters**

<ParamField body="owner" type="string" required>
  The public key of the account owner, as a base-58 encoded string.
</ParamField>

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="dataSlice" type="object">
      The data slice configuration.

      <Expandable title="properties">
        <ParamField body="length" type="integer">
          The length of the data slice.
        </ParamField>

        <ParamField body="offset" type="integer">
          The offset of the data slice.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="encoding" type="&#x22;binary&#x22; | &#x22;base58&#x22; | &#x22;base64&#x22; | &#x22;jsonParsed&#x22; | &#x22;base64+zstd&#x22;">
      The encoding for the account data.
    </ParamField>

    <ParamField body="minContextSlot" type="integer">
      The minimum context slot for the account info.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="array<RpcKeyedAccount>">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="account" type="object">
      <Expandable title="properties">
        <ResponseField name="data" type="array<string>">
          Account data
        </ResponseField>

        <ResponseField name="executable" type="boolean">
          Whether this account contains executable code
        </ResponseField>

        <ResponseField name="lamports" type="integer">
          Account balance in lamports
        </ResponseField>

        <ResponseField name="owner" type="string">
          Program that owns this account
        </ResponseField>

        <ResponseField name="rentEpoch" type="integer">
          Epoch at which this account will next owe rent
        </ResponseField>
      </Expandable>
    </ResponseField>

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

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenAccountsByOwner",
    "params": [
      "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
      {
        "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      },
      {
        "commitment": "confirmed",
        "encoding": "jsonParsed"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254702,
      "apiVersion": "4.2.1"
    },
    "value": [
      {
        "pubkey": "Ah241PLYdGWy2heWX42XfEWg8XtCvXDxtzTEfp3abgak",
        "account": {
          "lamports": 2039280,
          "data": {
            "program": "spl-token",
            "parsed": {
              "type": "account",
              "info": {
                "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "owner": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
                "tokenAmount": {
                  "uiAmount": 1000,
                  "decimals": 6,
                  "amount": "1000000000",
                  "uiAmountString": "1000"
                },
                "state": "initialized",
                "isNative": false
              }
            },
            "space": 165
          },
          "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "executable": false,
          "rentEpoch": 0,
          "space": 165
        }
      }
    ]
  }
}
```

## getTokenAccountsByDelegate

Returns all SPL Token accounts by delegate.

Returns accounts whose `delegate` is the given address; the list is empty unless you have delegated a token account to it (see `surfnet_setTokenAccount`).

**Parameters**

<ParamField body="delegate" type="string" required>
  The public key of the delegate, as a base-58 encoded string.
</ParamField>

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="dataSlice" type="object">
      The data slice configuration.

      <Expandable title="properties">
        <ParamField body="length" type="integer">
          The length of the data slice.
        </ParamField>

        <ParamField body="offset" type="integer">
          The offset of the data slice.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="encoding" type="&#x22;binary&#x22; | &#x22;base58&#x22; | &#x22;base64&#x22; | &#x22;jsonParsed&#x22; | &#x22;base64+zstd&#x22;">
      The encoding for the account data.
    </ParamField>

    <ParamField body="minContextSlot" type="integer">
      The minimum context slot for the account info.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="array<RpcKeyedAccount>">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="account" type="object">
      <Expandable title="properties">
        <ResponseField name="data" type="array<string>">
          Account data
        </ResponseField>

        <ResponseField name="executable" type="boolean">
          Whether this account contains executable code
        </ResponseField>

        <ResponseField name="lamports" type="integer">
          Account balance in lamports
        </ResponseField>

        <ResponseField name="owner" type="string">
          Program that owns this account
        </ResponseField>

        <ResponseField name="rentEpoch" type="integer">
          Epoch at which this account will next owe rent
        </ResponseField>
      </Expandable>
    </ResponseField>

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

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenAccountsByDelegate",
    "params": [
      "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
      {
        "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
      },
      {
        "commitment": "confirmed",
        "encoding": "jsonParsed"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254448,
      "apiVersion": "4.2.1"
    },
    "value": []
  }
}
```

## getAccountInfo

Returns detailed information about an account given its public key.

**Parameters**

<ParamField body="pubkey" type="string" required>
  The public key of the account to query, as a base-58 encoded string.
</ParamField>

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="dataSlice" type="object">
      The data slice configuration.

      <Expandable title="properties">
        <ParamField body="length" type="integer">
          The length of the data slice.
        </ParamField>

        <ParamField body="offset" type="integer">
          The offset of the data slice.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="encoding" type="&#x22;binary&#x22; | &#x22;base58&#x22; | &#x22;base64&#x22; | &#x22;jsonParsed&#x22; | &#x22;base64+zstd&#x22;">
      The encoding for the account data.
    </ParamField>

    <ParamField body="minContextSlot" type="integer">
      The minimum context slot for the account info.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="data" type="array<string>">
      Account data
    </ResponseField>

    <ResponseField name="executable" type="boolean">
      Whether this account contains executable code
    </ResponseField>

    <ResponseField name="lamports" type="integer">
      Account balance in lamports
    </ResponseField>

    <ResponseField name="owner" type="string">
      Program that owns this account
    </ResponseField>

    <ResponseField name="rentEpoch" type="integer">
      Epoch at which this account will next owe rent
    </ResponseField>
  </Expandable>
</ResponseField>

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": [
      "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
      {
        "commitment": "confirmed",
        "encoding": "base64"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254783,
      "apiVersion": "4.2.1"
    },
    "value": {
      "lamports": 2000000,
      "data": [
        "",
        "base64"
      ],
      "owner": "11111111111111111111111111111111",
      "executable": false,
      "rentEpoch": 0,
      "space": 0
    }
  }
}
```

## getBlockCommitment

Returns commitment levels for a given block (slot).

**Parameters**

<ParamField body="block" type="integer" required>
  The slot to query for block commitment.
</ParamField>

**Result**

<ResponseField name="commitment" type="array" />

<ResponseField name="totalStake" type="integer" />

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBlockCommitment",
    "params": [
      0
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "commitment": [
      0,
      0,
      0
    ],
    "totalStake": 0
  }
}
```

## getMultipleAccounts

Returns account information for multiple public keys in a single call.

**Parameters**

<ParamField body="pubkeys" type="array[string]" required>
  An array of public keys to query, as base-58 encoded strings.
</ParamField>

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="dataSlice" type="object">
      The data slice configuration.

      <Expandable title="properties">
        <ParamField body="length" type="integer">
          The length of the data slice.
        </ParamField>

        <ParamField body="offset" type="integer">
          The offset of the data slice.
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="encoding" type="&#x22;binary&#x22; | &#x22;base58&#x22; | &#x22;base64&#x22; | &#x22;jsonParsed&#x22; | &#x22;base64+zstd&#x22;">
      The encoding for the account data.
    </ParamField>

    <ParamField body="minContextSlot" type="integer">
      The minimum context slot for the account info.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="array<any>" />

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getMultipleAccounts",
    "params": [
      [
        "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
        "GmaDrppBC7P5ARKV8g3djiwP89vz1jLK23V2GBjuAEGB"
      ],
      {
        "commitment": "confirmed",
        "encoding": "base64"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254783,
      "apiVersion": "4.2.1"
    },
    "value": [
      {
        "lamports": 2000000,
        "data": [
          "",
          "base64"
        ],
        "owner": "11111111111111111111111111111111",
        "executable": false,
        "rentEpoch": 0,
        "space": 0
      },
      {
        "lamports": 5000000000,
        "data": [
          "",
          "base64"
        ],
        "owner": "11111111111111111111111111111111",
        "executable": false,
        "rentEpoch": 0,
        "space": 0
      }
    ]
  }
}
```

## getTokenAccountBalance

Returns the balance of a token account, given its public key.

The sample token account is the USDC account that `surfnet_setTokenAccount` creates for `83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri`; run that request first, otherwise the account is not found.

**Parameters**

<ParamField body="pubkey" type="string" required>
  The public key of the token account to query, as a base-58 encoded string.
</ParamField>

<ParamField body="commitment" type="object">
  The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="amount" type="string">
      Token amount as string
    </ResponseField>

    <ResponseField name="decimals" type="integer">
      Number of decimals
    </ResponseField>

    <ResponseField name="uiAmount" type="number">
      Human readable amount as float
    </ResponseField>

    <ResponseField name="uiAmountString" type="string">
      Human readable amount as string
    </ResponseField>
  </Expandable>
</ResponseField>

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenAccountBalance",
    "params": [
      "Ah241PLYdGWy2heWX42XfEWg8XtCvXDxtzTEfp3abgak",
      {
        "commitment": "confirmed"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254784,
      "apiVersion": "4.2.1"
    },
    "value": {
      "uiAmount": 1000,
      "decimals": 6,
      "amount": "1000000000",
      "uiAmountString": "1000"
    }
  }
}
```

## getTokenSupply

Returns the total supply of a token, given its mint address.

**Parameters**

<ParamField body="mint" type="string" required>
  The public key of the token mint, as a base-58 encoded string.
</ParamField>

<ParamField body="commitment" type="object">
  The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="amount" type="string">
      Token amount as string
    </ResponseField>

    <ResponseField name="decimals" type="integer">
      Number of decimals
    </ResponseField>

    <ResponseField name="uiAmount" type="number">
      Human readable amount as float
    </ResponseField>

    <ResponseField name="uiAmountString" type="string">
      Human readable amount as string
    </ResponseField>
  </Expandable>
</ResponseField>

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenSupply",
    "params": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      {
        "commitment": "confirmed"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254784,
      "apiVersion": "4.2.1"
    },
    "value": {
      "uiAmount": 7707412496.102412,
      "decimals": 6,
      "amount": "7707412496102412",
      "uiAmountString": "7707412496.102412"
    }
  }
}
```

## getBalance

Returns the balance for a given address.

**Parameters**

<ParamField body="pubkey" type="string" required>
  The public key of the account to query, as a base-58 encoded string.
</ParamField>

<ParamField body="config" type="object">
  Configuration object for the query.

  <Expandable title="properties" defaultOpen>
    <ParamField body="commitment" type="&#x22;processed&#x22; | &#x22;confirmed&#x22; | &#x22;finalized&#x22;">
      The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
    </ParamField>

    <ParamField body="minContextSlot" type="integer">
      The minimum context slot for the context.
    </ParamField>
  </Expandable>
</ParamField>

**Result**

<ResponseField name="context" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="apiVersion" type="string">
      The API version
    </ResponseField>

    <ResponseField name="slot" type="integer">
      The current slot
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="value" type="integer" />

```bash Request
curl http://127.0.0.1:8899 -s -X POST \
  -H "Content-Type: application/json" \
  -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBalance",
    "params": [
      "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
      {
        "commitment": "confirmed"
      }
    ]
  }
'
```

```json Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": {
      "slot": 457254783,
      "apiVersion": "4.2.1"
    },
    "value": 2000000
  }
}
```
