diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/lib/bitcoin/client.js b/lib/bitcoin/client.js index 5fb6944..18fa52e 100644 --- a/lib/bitcoin/client.js +++ b/lib/bitcoin/client.js @@ -48,14 +48,16 @@ var bitcoinAPI = { //===----------------------------------------------------------------------===// // Client +// Either pass in 4 arguments, or a single object with host, port, user, pass //===----------------------------------------------------------------------===// -function Client(host, port, user, pass) { - this.host = host; - this.port = port; - this.user = user; - this.pass = pass; - - this.rpc = new rpc.Client(port, host, user, pass); +function Client() { + var args = [].slice.call(arguments); + this.host = args[0].host || args[0]; + this.port = args[0].port || args[1]; + this.user = args[0].user || args[2]; + this.pass = args[0].pass || args[3]; + + this.rpc = new rpc.Client(this.port, this.host, this.user, this.pass); }