New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kraken-api

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kraken-api - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

19

kraken.js

@@ -128,12 +128,15 @@ var request = require('request');

var req = request.post(options, function(error, response, body) {
if(error) {
throw new Error('Error in server response: ' + JSON.stringify(error));
}
else if(typeof callback === 'function') {
if(typeof callback === 'function') {
if (error) {
callback.call(self, new Error('Error in server response: ' + JSON.stringify(error)));
}
var data;
try {
callback.call(self, JSON.parse(body));
data = JSON.parse(body);
} catch(e) {
return callback.call(self, new Error('Could not understand response from server: ' + body));
}
catch(e) {
throw new Error('Could not understand response from server.');
}
callback.call(self, null, data);
}

@@ -140,0 +143,0 @@ });

{
"name": "kraken-api",
"version": "0.0.9",
"version": "0.1.0",
"description": "kraken.com API client library for NodeJS",

@@ -5,0 +5,0 @@ "keywords": [

@@ -1,3 +0,3 @@

npm-kraken-api
==============
Node Kraken
===========

@@ -13,11 +13,36 @@ NodeJS Client Library for the Kraken (kraken.com) API

```javascript
var kraken = require('kraken-api');
var client = new kraken('api_key', 'api_secret');
var KrakenClient = require('kraken-api');
var kraken = new KrakenClient('api_key', 'api_secret');
// Display user's balance
client.api('Balance', null, function(response) {
console.log('Balances:', response.result);
kraken.api('Balance', null, function(error, data) {
if (error) {
console.log(error);
} else {
console.log(data.result);
}
});
// Get Ticker Info
kraken.api('Ticker', {"pair": 'XBTCXLTC'}, function(error, data) {
if (error) {
console.log(error);
} else {
console.log(data.result);
}
});
```
**Update:**
As of version 0.1.0, the callback passed to the *api* function conforms to the Node.js standard of
```javascript
function(error, data) {
// ...
}
```
Thanks to @tehsenaus and @petermrg for pointing this out.
Credit:

@@ -24,0 +49,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc