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

> Mengembalikan saldo token dari akun SPL Token.

## Parameter Permintaan

<ParamField body="address" type="string" required>
  Alamat akun token SPL Solana yang akan dikueri untuk mendapatkan informasi saldo, sebagai string berkode base-58.
</ParamField>

<ParamField body="commitment" type="string">
  Tingkat komitmen untuk permintaan.

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


## OpenAPI

````yaml id/openapi/rpc-http/getTokenAccountBalance.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API pengambilan saldo token SPL Solana yang cepat dan andal untuk mengakses
    saldo token fungibel dan NFT dengan pemformatan desimal yang tepat serta
    jumlah yang mudah dibaca.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Endpoint RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Endpoint RPC Devnet
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getTokenAccountBalance
      description: >
        Ambil saldo token SPL dari akun token Solana apa pun dengan pemformatan
        desimal yang tepat.

        API penting ini menyediakan akses ke saldo token fungibel, kepemilikan
        NFT, dan data

        token SPL lainnya dengan dukungan jumlah angka desimal khusus token agar
        dapat ditampilkan secara akurat.

        Mengembalikan saldo mentah dan saldo yang telah diformat dengan jumlah
        yang mudah dibaca, yang sangat penting bagi

        dompet, aplikasi DeFi, bursa, dan layanan apa pun yang perlu menampilkan

        saldo token kepada pengguna.
      operationId: getTokenAccountBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Versi protokol JSON-RPC.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Pengidentifikasi unik untuk permintaan.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTokenAccountBalance
                  description: Nama metode RPC yang akan dipanggil.
                  example: getTokenAccountBalance
                  default: getTokenAccountBalance
                params:
                  type: array
                  description: Parameter untuk mengkueri saldo akun token.
                  default:
                    - 3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          Alamat akun token SPL Solana yang akan dikueri untuk
                          mendapatkan informasi saldo, dalam bentuk string yang
                          dienkode dengan base-58.
                        example: 3emsAVdmGKERbHjmGfQ6oZ1e35dkf5iYcS6U4CPKFVaa
                      - type: object
                        description: Opsi konfigurasi.
                        properties:
                          commitment:
                            type: string
                            description: Tingkat komitmen untuk permintaan.
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
      responses:
        '200':
          description: Saldo akun token berhasil diambil.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: Versi protokol JSON-RPC.
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Pengidentifikasi yang cocok dengan permintaan.
                    example: '1'
                  result:
                    type: object
                    description: Konteks dan detail saldo akun token.
                    properties:
                      context:
                        type: object
                        description: Konteks respons.
                        properties:
                          slot:
                            type: integer
                            description: Slot tempat data diambil.
                            example: 1114
                      value:
                        type: object
                        description: Detail saldo akun token.
                        properties:
                          amount:
                            type: string
                            description: >-
                              Saldo mentah token Solana sebagai string bilangan
                              bulat tanpa pemformatan desimal.
                            example: '9864'
                          decimals:
                            type: integer
                            description: >-
                              Jumlah angka desimal yang ditentukan oleh mint
                              token untuk pemformatan tampilan yang tepat.
                            example: 2
                          uiAmount:
                            type: number
                            description: >-
                              Saldo token Solana yang mudah dibaca dengan
                              pemformatan desimal yang tepat (tidak digunakan
                              lagi).
                            example: 98.64
                          uiAmountString:
                            type: string
                            description: >-
                              Representasi string kanonis dari saldo token
                              dengan jumlah angka desimal yang tepat.
                            example: '98.64'
              examples:
                default:
                  $ref: '#/components/examples/getTokenAccountBalanceResponse'
        '400':
          description: >-
            Permintaan Tidak Valid - Parameter permintaan tidak valid atau
            format permintaan salah.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Parameter tidak valid
                id: '1'
        '401':
          description: Tidak Diotorisasi - Kunci API tidak valid atau tidak ada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Tidak diotorisasi
                id: '1'
        '429':
          description: Terlalu Banyak Permintaan - Batas laju terlampaui.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Terlalu banyak permintaan
                id: '1'
        '500':
          description: Kesalahan Server Internal - Terjadi kesalahan pada server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Kesalahan internal
                id: '1'
        '503':
          description: Layanan Tidak Tersedia - Layanan untuk sementara tidak tersedia.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Layanan tidak tersedia
                id: '1'
        '504':
          description: Waktu Tunggu Gateway Habis - Waktu permintaan habis.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Waktu tunggu gateway habis
                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: Versi protokol JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Kode kesalahan.
              example: -32602
            message:
              type: string
              description: Pesan kesalahan.
            data:
              type: object
              description: Data tambahan tentang kesalahan.
        id:
          type: string
          description: Pengidentifikasi yang cocok dengan permintaan.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Kunci API Helius Anda. Anda dapat memperolehnya secara gratis di
        [dasbor](https://dashboard.helius.dev/api-keys).

````