Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ function decodeURL(str) {
var parts = auth.split(':');
var user = parts[0] ? decodeURIComponent(parts[0]) : null;
var pass = parts[1] ? decodeURIComponent(parts[1]) : null;
var path = parsedUrl.path;
var opts = {
host: hostname,
port: port,
protocol: protocol,
user: user,
pass: pass,
path: path
};
return opts;
}
Expand All @@ -38,6 +40,7 @@ function RpcClient(opts) {
this.protocol = opts.protocol === 'http' ? http : https;
this.batchedCalls = null;
this.disableAgent = opts.disableAgent || false;
this.path = opts.path || '/';

var isRejectUnauthorized = typeof opts.rejectUnauthorized !== 'undefined';
this.rejectUnauthorized = isRejectUnauthorized ? opts.rejectUnauthorized : true;
Expand Down Expand Up @@ -72,7 +75,7 @@ function rpc(request, callback) {

var options = {
host: self.host,
path: '/',
path: self.path,
method: 'POST',
port: self.port,
rejectUnauthorized: self.rejectUnauthorized,
Expand Down Expand Up @@ -243,6 +246,7 @@ RpcClient.callspec = {
signMessage: '',
signRawTransaction: '',
signRawTransactionWithWallet: 'str',
signRawTransactionWithKey: '',
stop: '',
submitBlock: '',
validateAddress: '',
Expand Down
35 changes: 7 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
{
"name": "bitcoind-rpc",
"description": "Bitcoin Client Library to connect to Bitcoin Core via RPC",
"version": "0.8.1",
"name": "bitcoind-rpc-zmaike",
"description": "Bitcoin Client Library to connect to Bitcoin Core via RPC. Forked from https://github.com/bitpay/bitcoind-rpc. Already submit a pull request to the origin project.",
"version": "0.8.2",
"author": {
"name": "Stephen Pair",
"email": "stephen@bitpay.com"
"name": "zmaike",
"email": "juxiez5@126.com"
},
"contributors": [
{
"name": "Jeff Garzik",
"email": "[email protected]"
},
{
"name": "Manuel Araoz",
"email": "[email protected]"
},
{
"name": "Matias Alejo Garcia",
"email": "[email protected]"
},
{
"name": "Braydon Fuller",
"email": "[email protected]"
}
],
"keywords": [
"bitcoin",
"rpc"
],
"repository": {
"type": "git",
"url": "https://github.com/bitpay/bitcoind-rpc"
"url": "https://github.com/zmaike/bitcoind-rpc"
},
"license": "MIT",
"main": "lib/index.js",
Expand All @@ -46,8 +28,5 @@
"mocha": "^2.1.0",
"sinon": "^1.12.2"
},
"bugs": {
"url": "https://github.com/bitpay/bitcoind-rpc/issues"
},
"homepage": "https://github.com/bitpay/bitcoind-rpc"
"homepage": "https://github.com/zmaike/bitcoind-rpc"
}