このページの内容
getBalance
現在のアカウントの残高を取得します。
メソッド
declare function getBalance(): Promise<BalanceInfo | number>;レスポンス
アカウント残高を返します。互換性のため、プロバイダーの型は数値の結果も許容します。フィールドにアクセスする前に結果の形式を確認してください。
type BalanceInfo = {
confirmed: number;
unconfirmed: number;
total: number
};例
const provider = (window.$onekey && window.$onekey.btc) || window.unisat;
const balance = await provider.getBalance();デモ
最終更新日