Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor({
agentOptions,
headers = false,
host = 'localhost',
logger = debugnyan('bitcoin-core'),
network = 'mainnet',
password,
port,
ssl = false,
timeout = 30000,
username,
version,
wallet
} = {}) {
if (!_.has(networks, network)) {
throw new Error(`Invalid network name "${network}"`, { network });
}
this.agentOptions = agentOptions;
this.auth = (password || username) && { pass: password, user: username };
this.hasNamedParametersSupport = false;