QubicTypeScript

getBalance

Returns the QU balance and transfer history for a Qubic identity, with numeric fields as bigint.

Signature

live.getBalance(identity, opts?): Promise<Result<QubicBalance, QubicRpcError>>

Purpose

Fetch the current balance and epoch-level transfer totals for an identity. All amounts are returned as bigint to preserve precision.

import { toIdentity } from "@qubic.org/types"

const result = await live.getBalance(
  toIdentity("CFBMEMZOIDEXQAUXYYSZIURADQLAPWPMNJXQSNVQZAHYVOPYUKKJBJUCTVJL")
)
if (!result.ok) throw result.error

console.log(result.value.balance)           // bigint QU amount
console.log(result.value.validForTick)      // tick at which the balance was valid

Parameters

NameTypeDescription
identitystring60-character Qubic identity
optsRequestOptionsOptional per-request overrides (signal, fetch)

Returns

Result<QubicBalance, QubicRpcError> — balance and transfer history for the identity.

FieldTypeDescription
idstringThe identity
balancebigintCurrent QU balance
validForTicknumberTick at which this balance was computed
latestIncomingTransferTicknumberMost recent incoming transfer tick
latestOutgoingTransferTicknumberMost recent outgoing transfer tick
incomingAmountbigintTotal QU received in this epoch
outgoingAmountbigintTotal QU sent in this epoch
numberOfIncomingTransfersnumberCount of incoming transfers
numberOfOutgoingTransfersnumberCount of outgoing transfers

On this page