From 4324d1c17771c3edd439b034ddfc1e637b9eefe7 Mon Sep 17 00:00:00 2001 From: freewil Date: Wed, 12 Mar 2014 15:55:40 -0700 Subject: [PATCH] update readme and changelog with new features --- Changelog.md | 5 +++++ Readme.md | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 4d1c582..43bc9a1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ # node-bitcoin changelog +## v2.1.0 (unreleased) +* remove `deprecate` dependency +* add request timeout option (defaults to 5000ms) +* add 3rd parameter to callbacks: response headers + ## v2.0.1 (2014/01/08) * default `host` to 'localhost'; `port` to '8332' diff --git a/Readme.md b/Readme.md index 4f57994..a45c55c 100644 --- a/Readme.md +++ b/Readme.md @@ -16,18 +16,20 @@ object, or you may call the API directly using the `cmd` method. ### Create client ```js +// all config options are optional var client = new bitcoin.Client({ host: 'localhost', port: 8332, user: 'username', - pass: 'password' + pass: 'password', + timeout: 5000 }); ``` ### Get balance across all accounts with minimum confirmations of 6 ```js -client.getBalance('*', 6, function(err, balance) { +client.getBalance('*', 6, function(err, balance, resHeaders) { if (err) return console.log(err); console.log('Balance:', balance); }); @@ -35,7 +37,7 @@ client.getBalance('*', 6, function(err, balance) { ### Getting the balance directly using `cmd` ```js -client.cmd('getbalance', '*', 6, function(err, balance){ +client.cmd('getbalance', '*', 6, function(err, balance, resHeaders){ if (err) return console.log(err); console.log('Balance:', balance); }); @@ -51,7 +53,7 @@ for (var i = 0; i < 10; ++i) { params: ['myaccount'] }); } -client.cmd(batch, function(err, address) { +client.cmd(batch, function(err, address, resHeaders) { if (err) return console.log(err); console.log('Address:', address); });