update readme and changelog with new features

This commit is contained in:
freewil 2014-03-12 15:55:40 -07:00
parent 491fc3576d
commit 4324d1c177
2 changed files with 11 additions and 4 deletions

View File

@ -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'

View File

@ -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);
});