* Retrieve the total BCH balance of the contract by summing the satoshis of all UTXOs at the * contract's address. * * @returns The total balance in satoshis.
()
| 75 | * @returns The total balance in satoshis. |
| 76 | */ |
| 77 | async getBalance(): Promise<bigint> { |
| 78 | const utxos = await this.getUtxos(); |
| 79 | return utxos.reduce((acc, utxo) => acc + utxo.satoshis, 0n); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Retrieve all UTXOs (confirmed and unconfirmed) locked at the contract's address. |
no test coverage detected