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

# Dapatkan Saldo Dompet

> Ambil saldo token dan kepemilikan SOL untuk alamat dompet Solana.

Setiap permintaan dikenai biaya **100 kredit**.

## Parameter Permintaan

<ParamField body="wallet" type="string" required default="GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz">
  Alamat dompet Solana (dikodekan dengan base58)
</ParamField>

<ParamField body="page" type="number" default="1">
  Nomor halaman untuk paginasi (indeks dimulai dari 1)
</ParamField>

<ParamField body="limit" type="number" default="100">
  Jumlah maksimum token per halaman
</ParamField>

<ParamField body="showZeroBalance" type="boolean" default="false">
  Sertakan token dengan saldo nol
</ParamField>

<ParamField body="showNative" type="boolean" default="true">
  Sertakan SOL native dalam hasil
</ParamField>

<ParamField body="showNfts" type="boolean" default="false">
  Sertakan NFT dalam hasil (maks. 100, hanya halaman pertama)
</ParamField>


## OpenAPI

````yaml id/openapi/wallet-api/openapi.yaml GET /v1/wallet/{wallet}/balances
openapi: 3.0.3
info:
  title: Wallet API
  description: >
    REST API berkinerja tinggi untuk mengkueri data dompet Solana, termasuk
    saldo, riwayat transaksi, transfer, dan informasi identitas.


    ## Autentikasi


    Semua permintaan memerlukan kunci API yang diteruskan sebagai:

    - Parameter kueri: `?api-key=YOUR_API_KEY`

    - Header: `X-Api-Key: YOUR_API_KEY`
  version: 1.0.0
  contact:
    name: Dukungan API
    url: https://helius.dev
servers:
  - url: https://api.helius.xyz
    description: Server produksi
security:
  - ApiKeyQuery: []
  - ApiKeyHeader: []
tags:
  - name: Identitas
    description: Cari identitas dompet dan alamat yang dikenal
  - name: Saldo
    description: Kueri saldo token dan NFT
  - name: Riwayat
    description: Riwayat transaksi dan perubahan saldo
  - name: Transfer
    description: Aktivitas transfer token
  - name: Pendanaan
    description: Informasi pendanaan dompet
paths:
  /v1/wallet/{wallet}/balances:
    get:
      tags:
        - Saldo
      summary: Dapatkan saldo dompet
      description: >
        Ambil saldo token dan NFT untuk suatu dompet. **Paginasi dilakukan
        secara manual** - API mengembalikan hingga 100 token per permintaan.


        Hasil diurutkan berdasarkan nilai USD secara menurun. Token yang
        memiliki data harga ditampilkan terlebih dahulu, diikuti token tanpa
        harga.


        **Paginasi:** Gunakan parameter `page` untuk mengambil halaman tambahan.
        Respons menyertakan `pagination.hasMore`

        untuk menunjukkan apakah tersedia hasil lainnya. Setiap permintaan
        melakukan satu panggilan API dan menggunakan 100 kredit.
      operationId: getWalletBalances
      parameters:
        - $ref: '#/components/parameters/WalletAddress'
        - name: page
          in: query
          description: Nomor halaman untuk paginasi (dimulai dari 1)
          schema:
            type: integer
            minimum: 1
            default: 1
          example: 1
        - name: limit
          in: query
          description: Jumlah maksimum token per halaman
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
          example: 100
        - name: showZeroBalance
          in: query
          description: Sertakan token dengan saldo nol
          schema:
            type: boolean
            default: false
        - name: showNative
          in: query
          description: Sertakan SOL native dalam hasil
          schema:
            type: boolean
            default: true
        - name: showNfts
          in: query
          description: Sertakan NFT dalam hasil (maks. 100, hanya halaman pertama)
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Saldo dompet berhasil diambil
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalancesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    WalletAddress:
      name: wallet
      in: path
      required: true
      description: Alamat dompet Solana (dikodekan dengan base58)
      schema:
        type: string
        pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
        default: GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz
      example: GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz
  schemas:
    BalancesResponse:
      type: object
      properties:
        balances:
          type: array
          items:
            $ref: '#/components/schemas/TokenBalance'
          description: >
            Array saldo token untuk halaman saat ini, termasuk SOL native.

            Jika showNative=true, SOL muncul sebagai elemen pertama dengan
            alamat mint So11111111111111111111111111111111111111112.

            Token lainnya diurutkan berdasarkan nilai USD (menurun).
        nfts:
          type: array
          items:
            $ref: '#/components/schemas/Nft'
          description: >-
            Array kepemilikan NFT (hanya disertakan jika showNfts=true, maks.
            100, hanya halaman pertama)
        totalUsdValue:
          type: number
          description: >-
            Total nilai saldo dalam USD pada halaman ini (bukan total nilai
            portofolio)
          example: 217.98
        pagination:
          type: object
          description: >-
            Metadata paginasi. Pengguna harus meminta halaman tambahan secara
            manual menggunakan parameter page.
          properties:
            page:
              type: integer
              description: Nomor halaman saat ini
              example: 1
            limit:
              type: integer
              description: Jumlah item per halaman
              example: 100
            hasMore:
              type: boolean
              description: >-
                Bernilai true jika tersedia hasil lainnya. Naikkan parameter
                page untuk mengambil halaman berikutnya.
              example: true
          required:
            - page
            - limit
            - hasMore
      required:
        - balances
        - totalUsdValue
        - pagination
    TokenBalance:
      type: object
      properties:
        mint:
          type: string
          description: Alamat mint token
          example: So11111111111111111111111111111111111111112
        symbol:
          type: string
          nullable: true
          description: Simbol token
          example: SOL
        name:
          type: string
          nullable: true
          description: Nama token
          example: Solana
        balance:
          type: number
          description: Saldo token (disesuaikan dengan jumlah desimal)
          example: 1.5
        decimals:
          type: integer
          description: Jumlah tempat desimal
          example: 9
        pricePerToken:
          type: number
          nullable: true
          description: Harga per token dalam USD
          example: 145.32
        usdValue:
          type: number
          nullable: true
          description: Total nilai kepemilikan dalam USD
          example: 217.98
        logoUri:
          type: string
          nullable: true
          description: URL gambar logo token
          example: https://example.com/sol-logo.png
        tokenProgram:
          type: string
          enum:
            - spl-token
            - token-2022
          description: >-
            Jenis program token (spl-token untuk versi lama, token-2022 untuk
            standar baru)
          example: spl-token
      required:
        - mint
        - balance
        - decimals
        - tokenProgram
    Nft:
      type: object
      properties:
        mint:
          type: string
          description: Alamat mint NFT
          example: 7Xq8wXyXVqfBPPqVJjPDwG9zN5wCVxBYZ6z7vPYBzr6F
        name:
          type: string
          nullable: true
          description: Nama NFT
          example: Degen Ape
        imageUri:
          type: string
          nullable: true
          description: URI gambar NFT
          example: https://example.com/nft.png
        collectionName:
          type: string
          nullable: true
          description: Nama koleksi
          example: Degen Ape Academy
        collectionAddress:
          type: string
          nullable: true
          description: Alamat koleksi
          example: DegN1dXmU2uYa4n7U9qTh7YNYpK4u8L9qXx7XqYqJfGH
        compressed:
          type: boolean
          description: Apakah ini merupakan NFT terkompresi
          example: false
      required:
        - mint
        - compressed
    Error:
      type: object
      properties:
        error:
          type: string
          description: Pesan kesalahan
          example: Alamat dompet tidak valid
        code:
          type: integer
          description: Kode status HTTP
          example: 400
        details:
          type: string
          description: Detail kesalahan tambahan
          example: '''invalid-address'' bukan alamat Solana yang valid'
      required:
        - error
        - code
  responses:
    BadRequest:
      description: Parameter permintaan tidak valid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Alamat dompet tidak valid
            code: 400
            details: '''invalid-address'' bukan alamat Solana yang valid'
    Unauthorized:
      description: Kunci API tidak ada atau tidak valid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              Kunci API diperlukan. Teruskan melalui ?api-key=xxx atau header
              X-Api-Key
            code: 401
    RateLimited:
      description: Batas laju terlampaui.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: RATE_LIMIT_EXCEEDED
            code: 429
            details: Terlalu banyak permintaan. Coba lagi setelah 2 detik.
    InternalError:
      description: >-
        Kesalahan server sementara. Dapat dicoba ulang dengan backoff
        eksponensial.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_ERROR
            code: 500
            details: Terjadi kesalahan yang tidak terduga. Silakan coba lagi.
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: Kunci API yang diteruskan sebagai parameter kueri
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Kunci API yang diteruskan dalam header permintaan

````