Skip to content

getBalance

getBalance(config, address): Promise<number>

Gets the balance of an address accumulated from UTXOs

Import

ts
import { getBalance } from "@midl-xyz/midl-js-core";

Example

ts
const balance = await getBalance(config, "bc1q...");
console.log(balance);

Parameters

NameTypeDescription
configConfigThe configuration object
addressstringThe address to get the balance of

Returns

Promise<number>

The balance in satoshis