|
|
@ -23,10 +23,6 @@ function _createProposalOpts(opts, signingKey) { |
|
|
|
return opts; |
|
|
|
}; |
|
|
|
|
|
|
|
function _getUrl(path) { |
|
|
|
return BASE_URL + path; |
|
|
|
}; |
|
|
|
|
|
|
|
function _parseError(body) { |
|
|
|
if (_.isString(body)) { |
|
|
|
try { |
|
|
@ -58,6 +54,7 @@ function API(opts) { |
|
|
|
this.storage = opts.storage; |
|
|
|
this.verbose = !!opts.verbose; |
|
|
|
this.request = request || opts.request; |
|
|
|
this.baseUrl = opts.baseUrl || BASE_URL; |
|
|
|
if (this.verbose) { |
|
|
|
log.level = 'debug'; |
|
|
|
} |
|
|
@ -112,7 +109,7 @@ API.prototype._doRequest = function(method, url, args, data, cb) { |
|
|
|
if (data.signingPrivKey) |
|
|
|
reqSignature = _signRequest(method, url, args, data.signingPrivKey); |
|
|
|
|
|
|
|
var absUrl = _getUrl(url); |
|
|
|
var absUrl = this.baseUrl + url; |
|
|
|
var args = { |
|
|
|
headers: { |
|
|
|
'x-identity': data.copayerId, |
|
|
|