getBalance

Get balance of current account.

Method

async function getBalance(): BalanceInfo

Response

the balance.

type BalanceInfo = { 
    confirmed: number; 
    unconfirmed: number; 
    total: number 
};

Example

const provider = (window.$onekey && window.$onekey.btc) || window.unisat;

const balance = async provider.getBalance();

Demo

Last updated