Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
client.getBalance('BTC', { address: holderAddress }, (err, data) => {
assert.equal(err, null, err);
assert(data.utxos.length > 0, `address (${holderAddress}) has not sent or received any bitcoins. Please request funds from the faucet (https://coinfaucet.eu/en/btc-testnet/) and try again.`);
data.utxos.some((u) => {
if (u.value >= 10000 && u.height > 0 && u.index !== undefined) {
utxo = u;
return true;
}
});
assert(utxo !== undefined, `Unable to find an output with value >=10000 for address ${holderAddress}`);
done();
});
});