MCPcopy Create free account
hub / github.com/NoteProtocol/NoteWallet / getBalance

Function getBalance

src/wallet.ts:177–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176 // Get Satoshi balance of the current account
177 async getBalance(): Promise<{
178 mainAddress: IBalance;
179 tokenAddress: IBalance;
180 }> {
181 const walletBalace = await this.fetchWalletBalace();
182 const tokenBalance = await this.urchain.balance(
183 this.currentAccount.tokenAddress!.scriptHash
184 );
185 return {
186 mainAddress: walletBalace,
187 tokenAddress: tokenBalance,
188 };
189 }
190
191 // Get balance of all accounts
192 async fetchWalletBalace() {

Callers

nothing calls this directly

Calls 1

balanceMethod · 0.45

Tested by

no test coverage detected