Skip to content

Commit

Permalink
Release 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobranco committed Jul 21, 2022
1 parent 05bfb79 commit 3886ffc
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 12 deletions.
46 changes: 38 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
# Changelog

## [3.0.0](https://github.com/ruimarinho/bitcoin-core/tree/3.0.0) (2019-09-27)
## [3.1.0](https://github.com/ruimarinho/bitcoin-core/tree/3.1.0) (2022-07-21)

[Full Changelog](https://github.com/ruimarinho/bitcoin-core/compare/v2.3.0...3.0.0)
[Full Changelog](https://github.com/ruimarinho/bitcoin-core/compare/v3.0.0...3.1.0)

**Implemented enhancements:**

- Add support for bitcoin@0.19.0 RPC methods [\#123](https://github.com/ruimarinho/bitcoin-core/pull/123) ([sskender](https://github.com/sskender))

**Fixed bugs:**

- Handle non-JSON response [\#126](https://github.com/ruimarinho/bitcoin-core/pull/126) ([andrewda](https://github.com/andrewda))

**Merged pull requests:**

- Add support for GitHub actions tests [\#131](https://github.com/ruimarinho/bitcoin-core/pull/131) ([pedrobranco](https://github.com/pedrobranco))
- Update json-bigint@^1.0.0 [\#130](https://github.com/ruimarinho/bitcoin-core/pull/130) ([rabm2k7](https://github.com/rabm2k7))
- Added support for default wallet functions in multiwallet environment [\#117](https://github.com/ruimarinho/bitcoin-core/pull/117) ([wleev](https://github.com/wleev))

## [v3.0.0](https://github.com/ruimarinho/bitcoin-core/tree/v3.0.0) (2019-09-27)

[Full Changelog](https://github.com/ruimarinho/bitcoin-core/compare/v2.3.0...v3.0.0)

**Implemented enhancements:**

- Remove bluebird dependency and callbacks support [\#87](https://github.com/ruimarinho/bitcoin-core/pull/87) ([pedrobranco](https://github.com/pedrobranco))

## [v2.3.0](https://github.com/ruimarinho/bitcoin-core/tree/v2.3.0) (2019-09-27)
Expand Down Expand Up @@ -39,11 +57,14 @@

[Full Changelog](https://github.com/ruimarinho/bitcoin-core/compare/v2.0.0...v2.1.0)

**Merged pull requests:**
**Fixed bugs:**

- Add support for json extension in rest endpoint [\#78](https://github.com/ruimarinho/bitcoin-core/pull/78) ([pedrobranco](https://github.com/pedrobranco))
- Fix response log obfuscation [\#64](https://github.com/ruimarinho/bitcoin-core/pull/64) ([pedrobranco](https://github.com/pedrobranco))
- Fix obfuscator with named parameters [\#62](https://github.com/ruimarinho/bitcoin-core/pull/62) ([pedrobranco](https://github.com/pedrobranco))

**Merged pull requests:**

- Add support for json extension in rest endpoint [\#78](https://github.com/ruimarinho/bitcoin-core/pull/78) ([pedrobranco](https://github.com/pedrobranco))
- Add support for multiwallet [\#45](https://github.com/ruimarinho/bitcoin-core/pull/45) ([ruimarinho](https://github.com/ruimarinho))

## [v2.0.0](https://github.com/ruimarinho/bitcoin-core/tree/v2.0.0) (2017-11-27)
Expand Down Expand Up @@ -77,24 +98,33 @@

[Full Changelog](https://github.com/ruimarinho/bitcoin-core/compare/v1.0.0...v1.1.0)

**Merged pull requests:**
**Implemented enhancements:**

- Add support for bitcoind 0.13 [\#18](https://github.com/ruimarinho/bitcoin-core/pull/18) ([ruimarinho](https://github.com/ruimarinho))
- Improve RPC documentation [\#12](https://github.com/ruimarinho/bitcoin-core/pull/12) ([ruimarinho](https://github.com/ruimarinho))

**Merged pull requests:**

- Simplify Docker setup [\#14](https://github.com/ruimarinho/bitcoin-core/pull/14) ([ruimarinho](https://github.com/ruimarinho))
- Update babel-eslint@6.0.0 [\#13](https://github.com/ruimarinho/bitcoin-core/pull/13) ([ruimarinho](https://github.com/ruimarinho))
- Improve RPC documentation [\#12](https://github.com/ruimarinho/bitcoin-core/pull/12) ([ruimarinho](https://github.com/ruimarinho))

## [v1.0.0](https://github.com/ruimarinho/bitcoin-core/tree/v1.0.0) (2016-03-06)

[Full Changelog](https://github.com/ruimarinho/bitcoin-core/compare/bd98d0a89faae6ddafc71cf547f387c9c74490b1...v1.0.0)

**Merged pull requests:**
**Implemented enhancements:**

- Add a better changelog sed [\#10](https://github.com/ruimarinho/bitcoin-core/pull/10) ([ruimarinho](https://github.com/ruimarinho))
- Use async/await on tests [\#9](https://github.com/ruimarinho/bitcoin-core/pull/9) ([ruimarinho](https://github.com/ruimarinho))
- Fix Docker hosts in CI environment [\#8](https://github.com/ruimarinho/bitcoin-core/pull/8) ([ruimarinho](https://github.com/ruimarinho))
- Minor process improvements [\#7](https://github.com/ruimarinho/bitcoin-core/pull/7) ([ruimarinho](https://github.com/ruimarinho))
- Call `done\(\)` when testing callbacks [\#6](https://github.com/ruimarinho/bitcoin-core/pull/6) ([ruimarinho](https://github.com/ruimarinho))
- Allow extra ips in docker-compose.yml [\#5](https://github.com/ruimarinho/bitcoin-core/pull/5) ([ruimarinho](https://github.com/ruimarinho))

**Fixed bugs:**

- Call `done()` when testing callbacks [\#6](https://github.com/ruimarinho/bitcoin-core/pull/6) ([ruimarinho](https://github.com/ruimarinho))

**Merged pull requests:**

- Add support for 0.12 [\#4](https://github.com/ruimarinho/bitcoin-core/pull/4) ([ruimarinho](https://github.com/ruimarinho))
- Add new 0.12 version methods [\#3](https://github.com/ruimarinho/bitcoin-core/pull/3) ([pedrobranco](https://github.com/pedrobranco))
12 changes: 11 additions & 1 deletion dist/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const promisify = fn => (...args) => new Promise((resolve, reject) => {
class Client {
constructor({
agentOptions,
allowDefaultWallet = false,
headers = false,
host = 'localhost',
logger = (0, _debugnyan.default)('bitcoin-core'),
Expand All @@ -74,6 +75,7 @@ class Client {
}

this.agentOptions = agentOptions;
this.allowDefaultWallet = allowDefaultWallet;
this.auth = (password || username) && {
pass: password,
user: username
Expand Down Expand Up @@ -166,10 +168,18 @@ class Client {
});
}

let uri = '/';

if (multiwallet && this.wallet) {
uri = `/wallet/${this.wallet}`;
} else if (multiwallet && !this.wallet && this.allowDefaultWallet) {
uri = '/wallet/';
}

return this.parser.rpc((await this.request.postAsync({
auth: _lodash.default.pickBy(this.auth, _lodash.default.identity),
body: JSON.stringify(body),
uri: `${multiwallet && this.wallet ? `/wallet/${this.wallet}` : '/'}`
uri
})));
}
/**
Expand Down
17 changes: 17 additions & 0 deletions dist/src/logging/request-obfuscator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,23 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* Map all methods to lowercase.
*/
const lowercaseMethods = (0, _lodash.mapKeys)(_methods.default, (value, key) => key.toLowerCase());
/**
* Helper.
*/

const isJSON = data => {
try {
JSON.parse(data);
return true;
} catch (e) {
return false;
}
};
/**
* Obfuscate the response body.
*/


function obfuscateResponseBody(body, method) {
const fn = (0, _lodash.get)(lowercaseMethods[method], 'obfuscate.response');

Expand Down Expand Up @@ -57,6 +70,10 @@ function obfuscateResponse(request, instance) {
return;
}

if (!isJSON(request.body)) {
return;
}

request.body = JSON.parse(request.body);
const requestBody = JSON.parse(instance.body);

Expand Down
22 changes: 20 additions & 2 deletions dist/src/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ var _default = {
generate: {
category: 'generating',
features: {
multiwallet: '>=0.15.0'
multiwallet: '>=0.15.0 <0.19.0'
},
version: '>=0.11.0'
version: '>=0.11.0 <0.19.0'
},
generateToAddress: {
category: 'generating',
Expand Down Expand Up @@ -237,6 +237,13 @@ var _default = {
},
version: '>=0.3.18'
},
getBalances: {
category: 'wallet',
features: {
multiwallet: '>=0.19.0'
},
version: '>=0.19.0'
},
getBestBlockHash: {
category: 'blockchain',
version: '>=0.9.0'
Expand All @@ -249,6 +256,10 @@ var _default = {
category: 'blockchain',
version: '>=0.1.0'
},
getBlockFilter: {
category: 'blockchain',
version: '>=0.19.0'
},
getBlockHash: {
category: 'blockchain',
version: '>=0.6.0'
Expand Down Expand Up @@ -714,6 +725,13 @@ var _default = {
},
version: '>=0.3.22'
},
setWalletFlag: {
category: 'wallet',
features: {
multiwallet: '>=0.19.0'
},
version: '>=0.19.0'
},
signMessage: {
category: 'wallet',
features: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitcoin-core",
"version": "3.0.0",
"version": "3.1.0",
"description": "A modern Bitcoin Core REST and RPC client.",
"keywords": [
"bitcoin",
Expand Down

0 comments on commit 3886ffc

Please sign in to comment.