()
| 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() { |