Comparing version 1.0.1 to 1.0.2
@@ -17,6 +17,7 @@ var querystring = require("querystring"); | ||
var Bitstamp = function(key, secret, client_id) { | ||
var Bitstamp = function(key, secret, client_id, timeout) { | ||
this.key = key; | ||
this.secret = secret; | ||
this.client_id = client_id; | ||
this.timeout = timeout || 5000; | ||
@@ -27,2 +28,3 @@ _.bindAll(this); | ||
Bitstamp.prototype._request = function(method, path, data, callback, args) { | ||
var timeout = this.timeout; | ||
var options = { | ||
@@ -66,3 +68,3 @@ host: 'www.bitstamp.net', | ||
req.on('socket', function (socket) { | ||
socket.setTimeout(5000); | ||
socket.setTimeout(timeout); | ||
socket.on('timeout', function() { | ||
@@ -74,3 +76,2 @@ req.abort(); | ||
req.end(data); | ||
} | ||
@@ -77,0 +78,0 @@ |
@@ -14,3 +14,4 @@ var Bitstamp = require('./bitstamp.js'); | ||
var client_id = 'your-bitstamp-user-id'; | ||
var privateBitstamp = new Bitstamp(key, secret, client_id); | ||
var timeout = 10000; | ||
var privateBitstamp = new Bitstamp(key, secret, client_id, timeout); | ||
@@ -34,2 +35,2 @@ // commented out for your protection | ||
// privateBitstamp.transfer_to_main(amount, currency, subAccount, console.log); | ||
// privateBitstamp.transfer_from_main(amount, currency, subAccount, console.log); | ||
// privateBitstamp.transfer_from_main(amount, currency, subAccount, console.log); |
{ | ||
"name": "bitstamp", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Bitstamp REST API wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,9 +7,10 @@ # Bitstamp | ||
var Bitstamp = require('bitstamp'); | ||
var bitstamp = new Bitstamp; | ||
```javascript | ||
var Bitstamp = require('bitstamp'); | ||
var bitstamp = new Bitstamp(); | ||
bitstamp.transactions('btcusd', function(err, trades) { | ||
console.log(trades); | ||
}); | ||
bitstamp.transactions('btcusd', function(err, trades) { | ||
console.log(trades); | ||
}); | ||
``` | ||
## 0.3.0 - June 2016 update | ||
@@ -39,2 +40,2 @@ | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12296
274
40