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

# getTokenAccountBalance

> SPLトークンアカウントのトークン残高を返します。

## リクエストパラメータ

<ParamField body="address" type="string" required>
  残高情報を問い合わせるSolana SPLトークンアカウントのアドレス（base-58エンコードされた文字列）。
</ParamField>

<ParamField body="commitment" type="string">
  リクエストのコミットメントレベル。

  * `confirmed`
  * `finalized`
  * `processed`
</ParamField>


## OpenAPI

````yaml ja/openapi/rpc-http/getTokenAccountBalance.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    適切な小数点形式と人間が読みやすい量で、ファンジブル トークンとNFTの残高にアクセスするための高速で信頼性の高いSolana
    SPLトークン残高取得API。
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: メインネット RPC エンドポイント
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC エンドポイント
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getTokenAccountBalance
      description: >-
        任意のSolanaトークンアカウントから適切な小数点形式のSPLトークン残高を取得します。この基本的なAPIは、ファンジブルトークンの残高、NFT保有、およびその他のSPLトークンデータへのアクセスを提供し、正確な表示のためにトークン固有の小数点以下の桁数をサポートしています。生の残高と書式設定された残高の両方を人間が読みやすい金額で返すため、ウォレット、DeFiアプリケーション、取引所、およびユーザーにトークン残高を表示する必要があるすべてのサービスにとって重要です。
      operationId: getTokenAccountBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: JSON-RPC プロトコル バージョン。
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: リクエストの一意の識別子。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTokenAccountBalance
                  description: 呼び出すRPCメソッドの名前。
                  example: getTokenAccountBalance
                  default: getTokenAccountBalance
                params:
                  type: array
                  description: トークンアカウント残高を照会するためのパラメーター。
                  default:
                    - 3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          トークンアカウントの残高情報を照会するための、Base-58 エンコードされたSolana
                          SPLトークンアカウントアドレス。
                        example: 3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa
                      - type: object
                        description: 構成オプション。
                        properties:
                          commitment:
                            type: string
                            description: リクエストのコミットメントレベル。
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
      responses:
        '200':
          description: トークンアカウント残高の取得に成功しました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC プロトコル バージョン。
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: リクエストと一致する識別子。
                    example: '1'
                  result:
                    type: object
                    description: コンテキストとトークンアカウント残高の詳細。
                    properties:
                      context:
                        type: object
                        description: レスポンスのコンテキスト。
                        properties:
                          slot:
                            type: integer
                            description: データがフェッチされたスロット。
                            example: 1114
                      value:
                        type: object
                        description: トークンアカウント残高の詳細。
                        properties:
                          amount:
                            type: string
                            description: 小数点以下の形式なしの、文字列整数としての生のSolanaトークン残高。
                            example: '9864'
                          decimals:
                            type: integer
                            description: 適切な表示形式のためにトークンのミントによって定義された小数点以下の桁数。
                            example: 2
                          uiAmount:
                            type: number
                            description: 適切な小数点形式の、人間が読みやすいSolanaトークン残高 (非推奨)。
                            example: 98.64
                          uiAmountString:
                            type: string
                            description: 適切な小数点以下の桁数を持つトークン残高の標準的な文字列表現。
                            example: '98.64'
              examples:
                default:
                  $ref: '#/components/examples/getTokenAccountBalanceResponse'
        '400':
          description: 悪いリクエスト - 無効なリクエストパラメータまたは形式の誤ったリクエスト。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 無効なパラメータ
                id: '1'
        '401':
          description: 認証されていない - 無効または欠落している API キー。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 認証されていません
                id: '1'
        '429':
          description: リクエストが多すぎます - レート制限が超過しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: リクエストが多すぎます
                id: '1'
        '500':
          description: 内部サーバーエラー - サーバーでエラーが発生しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部エラー
                id: '1'
        '503':
          description: サービスが利用できません - サービスは一時的に利用できません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: サービスが利用できません
                id: '1'
        '504':
          description: ゲートウェイタイムアウト - リクエストがタイムアウトしました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: ゲートウェイタイムアウト
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  examples:
    getTokenAccountBalanceResponse:
      value:
        jsonrpc: '2.0'
        id: '1'
        result:
          context:
            slot: 1114
          value:
            amount: '9864'
            decimals: 2
            uiAmount: 98.64
            uiAmountString: '98.64'
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: JSON-RPC プロトコル バージョン。
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: エラーコード。
              example: -32602
            message:
              type: string
              description: エラーメッセージ。
            data:
              type: object
              description: エラーに関する追加データ。
        id:
          type: string
          description: リクエストと一致する識別子。
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Helius
        APIキー。無料で[ダッシュボード](https://dashboard.helius.dev/api-keys)から取得できます。

````