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

# Get on-chain balance

> Returns the current on-chain wallet balance, broken down by confirmation status. The `trusted_spendable_sat` field is the sum of `confirmed_sat` and `trusted_pending_sat`—the balance that can be safely spent without risk of double-spend.



## OpenAPI

````yaml https://gitlab.com/ark-bitcoin/bark/-/raw/master/bark-rest/openapi.json get /api/v1/onchain/balance
openapi: 3.1.0
info:
  title: barkd REST API
  description: >-
    A simple REST API for barkd, a wallet daemon for integrating bitcoin
    payments into your app over HTTP. Supports self-custodial Lightning, Ark,
    and on-chain out of the box.


    barkd is a long-running daemon best suited for always-on or
    high-connectivity environments like nodes, servers, desktops, and
    point-of-sale terminals.


    All endpoints return JSON. Amounts are denominated in satoshis.
  contact:
    name: Second Team
    email: hello@second.tech
  license:
    name: MIT
    identifier: MIT
  version: 0.1.4
servers: []
security:
  - bearer: []
tags:
  - name: boards
    description: Move on-chain bitcoin onto the Ark protocol.
  - name: exits
    description: Move bitcoin back on-chain without server cooperation.
  - name: fees
    description: Estimate fees for wallet operations before executing them.
  - name: lightning
    description: Create Lightning invoices and track receives.
  - name: onchain
    description: Manage barkd's on-chain bitcoin wallet.
  - name: wallet
    description: Manage Ark balances and VTXOs, send payments via Ark, LN, and on-chain.
  - name: bitcoin
    description: Query bitcoin network data.
  - name: notifications
    description: Receive real-time notifications from barkd.
paths:
  /api/v1/onchain/balance:
    get:
      tags:
        - onchain
      summary: Get on-chain balance
      description: >-
        Returns the current on-chain wallet balance, broken down by confirmation
        status. The `trusted_spendable_sat` field is the sum of `confirmed_sat`
        and `trusted_pending_sat`—the balance that can be safely spent without
        risk of double-spend.
      operationId: onchain_balance
      responses:
        '200':
          description: Returns the on-chain balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnchainBalance'
components:
  schemas:
    OnchainBalance:
      type: object
      required:
        - total_sat
        - trusted_spendable_sat
        - immature_sat
        - trusted_pending_sat
        - untrusted_pending_sat
        - confirmed_sat
      properties:
        confirmed_sat:
          type: integer
          format: int64
          description: Confirmed and immediately spendable balance
          minimum: 0
        immature_sat:
          type: integer
          format: int64
          description: All coinbase outputs not yet matured
          minimum: 0
        total_sat:
          type: integer
          format: int64
          description: All of them combined.
          minimum: 0
        trusted_pending_sat:
          type: integer
          format: int64
          description: Unconfirmed UTXOs generated by a wallet tx
          minimum: 0
        trusted_spendable_sat:
          type: integer
          format: int64
          description: >-
            Get sum of trusted_pending and confirmed coins.


            This is the balance you can spend right now that shouldn't get
            canceled via another party

            double spending it.
          minimum: 0
        untrusted_pending_sat:
          type: integer
          format: int64
          description: Unconfirmed UTXOs received from an external wallet
          minimum: 0
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: AuthToken
      description: Base64url-encoded auth token

````