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

node-kraken-api

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-kraken-api - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

31

index.d.ts
/// <reference types="node" />
import * as qs from "querystring";
import * as http from "http";
import { Emitter } from "ts-ev";
import WebSocket from "ws";
export declare const _USER_AGENT = "node-kraken-api/1.0.0";
export declare const _USER_AGENT = "node-kraken-api/2.0.0";
export declare const _REST_HOSTNAME = "api.kraken.com";

@@ -328,27 +328,2 @@ export declare const _WS_PUB_HOSTNAME = "ws.kraken.com";

type FirstParam<T extends (...args: any[]) => any> = Parameters<T> extends [] ? void : Parameters<T>[0];
class Emitter<Internal extends {
[event: string]: (...args: any[]) => any;
}, External extends {
[event: string]: (...args: any[]) => any;
} = {}> {
private _evdata;
private _running;
private _opqueue;
constructor();
on<Ev extends string & (keyof Internal | keyof External)>(event: Ev, listener: Ev extends keyof Internal ? Internal[Ev] : Ev extends keyof External ? External[Ev] : never, options?: {
filter?: Ev extends keyof Internal ? (...args: Parameters<Internal[Ev]>) => boolean : Ev extends keyof External ? (...args: Parameters<External[Ev]>) => boolean : never;
protect?: boolean;
}): this;
once<Ev extends string & (keyof Internal | keyof External)>(ev: Ev, cb: Ev extends keyof Internal ? Internal[Ev] : Ev extends keyof External ? External[Ev] : never, options?: {
filter?: Ev extends keyof Internal ? (...args: Parameters<Internal[Ev]>) => boolean : Ev extends keyof External ? (...args: Parameters<External[Ev]>) => boolean : never;
protect?: boolean;
}): this;
once<Ev extends string & (keyof Internal | keyof External)>(ev: Ev, options?: {
filter?: Ev extends keyof Internal ? (...args: Parameters<Internal[Ev]>) => boolean : Ev extends keyof External ? (...args: Parameters<External[Ev]>) => boolean : never;
}): Promise<Ev extends keyof Internal ? Parameters<Internal[Ev]> : Ev extends keyof External ? Parameters<External[Ev]> : never>;
off<Ev extends string & (keyof Internal | keyof External)>(ev: Ev, cb: Ev extends keyof Internal ? Internal[Ev] : Ev extends keyof External ? External[Ev] : never): this;
off<Ev extends string & (keyof Internal | keyof External)>(ev: Ev): this;
off(): this;
emit<Ev extends string & (keyof Internal | keyof External)>(event: Ev, ...data: Ev extends keyof Internal ? Parameters<Internal[Ev]> : Ev extends keyof External ? Parameters<External[Ev]> : never): this;
}
type Time = {

@@ -1314,3 +1289,3 @@ unixtime?: number | null;

};
signedQuery: (input: Readonly<qs.ParsedUrlQueryInput>) => qs.ParsedUrlQueryInput & {
signedQuery: (input: Readonly<NodeJS.Dict<any>>) => NodeJS.Dict<any> & {
otp?: string;

@@ -1317,0 +1292,0 @@ };

@@ -35,8 +35,9 @@ "use strict";

exports._hidePrivates = exports._CountTrigger = exports._request = exports._sendRequest = exports._prepareRequest = exports._BinaryReceiver = exports._UTF8Receiver = exports._Authenticator = exports.Kraken = exports._GENNONCE = exports._REST_VERSION = exports._WS_PRIV_HOSTNAME = exports._WS_PUB_HOSTNAME = exports._REST_HOSTNAME = exports._USER_AGENT = void 0;
const qs = __importStar(require("querystring"));
const url_1 = require("url");
const https = __importStar(require("https"));
const ts_ev_1 = require("ts-ev");
const crc_1 = require("crc");
const crypto_1 = __importDefault(require("crypto"));
const ws_1 = __importDefault(require("ws"));
exports._USER_AGENT = "node-kraken-api/1.0.0";
exports._USER_AGENT = "node-kraken-api/2.0.0";
exports._REST_HOSTNAME = "api.kraken.com";

@@ -388,110 +389,2 @@ exports._WS_PUB_HOSTNAME = "ws.kraken.com";

Kraken.WSAPIError = WSAPIError;
class Emitter {
constructor() {
this._evdata = {};
this._running = false;
this._opqueue = [];
_hidePrivates(this);
}
on(event, listener, options) {
const op = () => {
const cbs = this._evdata[event];
const opts = Object.assign({ once: false }, options);
if (cbs)
cbs.set(listener, opts);
else
this._evdata[event] = new Map([[listener, opts]]);
};
if (!this._running)
op();
else
this._opqueue.push(op);
return this;
}
once(ev, cbOrOptions, options) {
if (typeof cbOrOptions === "function") {
const op = () => {
const cbs = this._evdata[ev];
const opts = Object.assign({ once: true }, options);
if (cbs)
cbs.set(cbOrOptions, opts);
else
this._evdata[ev] = new Map([[cbOrOptions, opts]]);
};
if (!this._running)
op();
else
this._opqueue.push(op);
return this;
}
else {
return new Promise((resolve) => {
const op = () => {
const cbs = this._evdata[ev];
const opts = Object.assign(Object.assign({ once: true }, cbOrOptions), { protect: true });
const shim = ((...data) => resolve(data));
if (cbs)
cbs.set(shim, opts);
else
this._evdata[ev] = new Map([[shim, opts]]);
};
if (!this._running)
op();
else
this._opqueue.push(op);
});
}
}
off(ev, cb) {
const op = () => {
if (ev !== undefined && cb !== undefined) {
const cbs = this._evdata[ev];
if (cbs) {
cbs.delete(cb);
if (cbs.size === 0)
delete this._evdata[ev];
}
}
else if (ev !== undefined) {
const cbs = this._evdata[ev];
if (cbs) {
const todel = [];
cbs.forEach(({ protect }, cb) => {
if (!protect)
todel.push(cb);
});
todel.forEach((cb) => cbs.delete(cb));
if (cbs.size === 0)
delete this._evdata[ev];
}
}
else {
Object.keys(this._evdata).forEach((ev) => this.off(ev));
}
};
if (!this._running)
op();
else
this._opqueue.push(op);
return this;
}
emit(event, ...data) {
var _a;
this._running = true;
(_a = this._evdata[event]) === null || _a === void 0 ? void 0 : _a.forEach(({ once, filter }, cb) => {
if (filter ? filter(...data) : true) {
cb(...data);
if (once)
this.off(event, cb);
}
});
if (this._opqueue.length) {
this._opqueue.forEach((op) => op());
this._opqueue = [];
}
this._running = false;
return this;
}
}
Kraken.Emitter = Emitter;
let WS;

@@ -573,3 +466,3 @@ (function (WS) {

})(Book = WS.Book || (WS.Book = {}));
class Connection extends Emitter {
class Connection extends ts_ev_1.Emitter {
constructor(hostname, gettimeout) {

@@ -610,3 +503,6 @@ super();

}
}, { protect: true, filter: (o) => o.reqid === reqid });
}, {
protect: true,
filter: (args) => args[0].reqid === reqid,
});
this.write(JSON.stringify(Object.assign(Object.assign({}, request), { reqid })));

@@ -632,3 +528,6 @@ });

};
this.on("dict", l, { protect: true, filter: (o) => o.reqid === reqid });
this.on("dict", l, {
protect: true,
filter: (args) => args[0].reqid === reqid,
});
this.write(JSON.stringify(Object.assign(Object.assign({}, request), { reqid })));

@@ -768,3 +667,3 @@ });

WS.Connection = Connection;
class Subscriber extends Emitter {
class Subscriber extends ts_ev_1.Emitter {
constructor(con, name, payloadDistributor, options) {

@@ -852,9 +751,9 @@ super();

WS.Subscriber = Subscriber;
class Subscription extends Emitter {
class Subscription extends ts_ev_1.Emitter {
constructor(con, reqid, pair) {
super();
this._isstatus = (dict) => {
return (dict.event === "subscriptionStatus" &&
dict.reqid === this.status.reqid &&
dict.pair === this.status.pair);
this._isstatus = (args) => {
return (args[0].event === "subscriptionStatus" &&
args[0].reqid === this.status.reqid &&
args[0].pair === this.status.pair);
};

@@ -886,4 +785,4 @@ this._onstatus = (status) => {

protect: true,
filter: (arr) => arr[arr.length - 2] === this.status.channelName &&
(this.status.pair ? arr[arr.length - 1] === this.status.pair : true),
filter: (args) => args[0][args[0].length - 2] === this.status.channelName &&
(this.status.pair ? args[0][args[0].length - 1] === this.status.pair : true),
});

@@ -1081,4 +980,4 @@ }

const postdata = options
? qs.stringify(auth.signedQuery(Object.assign(Object.assign({}, options), { nonce })))
: qs.stringify(auth.signedQuery({ nonce }));
? new url_1.URLSearchParams(auth.signedQuery(Object.assign(Object.assign({}, options), { nonce }))).toString()
: new url_1.URLSearchParams(auth.signedQuery({ nonce })).toString();
const headers = auth.signedHeaders(path, postdata, nonce);

@@ -1102,3 +1001,3 @@ return {

const method = "POST";
const postdata = qs.stringify(Object.assign(Object.assign({}, options), { nonce }));
const postdata = new url_1.URLSearchParams(Object.assign(Object.assign({}, options), { nonce })).toString();
return {

@@ -1105,0 +1004,0 @@ requestOptions: {

13

package.json
{
"name": "node-kraken-api",
"version": "1.0.0",
"version": "2.0.0",
"description": "a typed REST/WS Node.JS client for the Kraken cryptocurrency exchange",

@@ -45,11 +45,12 @@ "license": "MIT",

"dependencies": {
"ws": "^8.2.2",
"crc": "^3.8.0"
"crc": "^3.8.0",
"ts-ev": "^0.3.0",
"ws": "^8.2.2"
},
"devDependencies": {
"typescript": "^4.4.3",
"@types/ws": "^7.4.7",
"@jpcx/testts": "^0.4.0",
"@types/crc": "^3.4.0",
"@types/node": "^16.9.1",
"@jpcx/testts": "^0.4.0"
"@types/ws": "^7.4.7",
"typescript": "^4.4.3"
},

@@ -56,0 +57,0 @@ "optionalDependencies": {

@@ -1,5 +0,13 @@

# node-kraken-api
[![](https://github.com/jpcx/node-kraken-api/blob/2.0.0/assets/logo.png)](#)
[![NPM](https://nodei.co/npm/node-kraken-api.png)](https://nodei.co/npm/node-kraken-api/)
![](https://img.shields.io/github/issues/jpcx/node-kraken-api)
![](https://img.shields.io/github/forks/jpcx/node-kraken-api)
![](https://img.shields.io/github/stars/jpcx/node-kraken-api)
![](https://img.shields.io/npm/dm/node-kraken-api)
![](https://img.shields.io/librariesio/dependents/npm/node-kraken-api)
![](https://img.shields.io/github/license/jpcx/node-kraken-api)
![](https://img.shields.io/librariesio/github/jpcx/node-kraken-api?label=dev-dependencies)
[![](https://nodei.co/npm/node-kraken-api.png?mini=true)](https://www.npmjs.com/package/node-kraken-api)
## About

@@ -23,6 +31,13 @@

### MIGRATION NOTICE 0.4.1 -> 1.0.0 [BREAKING]:
[CHANGELOG](https://github.com/jpcx/node-kraken-api/blob/2.0.0/CHANGELOG.md) | [Synopsis](#synopsis) | [Usage](#usage) | [Code](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts) |
| --- | --- | --- | --- |
### 0.4.1 MIGRATION NOTICE:
The entire project has been completely rewritten using TypeScript and many features have changed.
If you're upgrading, please review the changes and upgrade guide below.
<details>
#### Added

@@ -37,95 +52,145 @@

- Custom response parsing
- _To ensure type consistency, it is best to leave parsing to the user._
- Ratelimiting
- _The aim of this API is to maximize clear and accurate communication with the server._
- retryCt setting
- _This was originally included due to the occasional nonce and timeout error._
- _To reduce this possibility, increase your API key nonce window and the `.timeout` setting._
- REST syncing
- _With the introduction of the WebSocket connection, REST syncing is no longer required for many data sources._
- _For all other sources, simply use an asynchronous loop._
- Method name settings
- _Previously, settings were used to differentiate between public and private methods rather than requiring the user to specify for each call._
- _Instead, named requests are provided to hard-code these differences._
- Direct construction using `module.exports()`
- _Changed to class export for modern standards._
#### Changed
- `.call()`: renamed to `.request()`.
- `.setOTP()`: removed; OTP is now provided using a user-supplied generator.
- `.call()`: replaced by `.request()`
- _`.request()` now accepts four arguments: `endpoint`, `options`, `public`|`private`, `utf8`|`binary`._
- `.setOTP()`: replaced by the `.genotp` setting.
- Errors have changed to named classes. Please review [the synopsis](https://github.com/jpcx/node-kraken-api/blob/2.0.0/README.md#synopsis).
## Synopsis
#### Upgrade Guide
1. Replace all calls to `.call()` with the corresponding named method.
- _Make sure to view the expected response types; they have changed since 0.4.1._
- _Alternatively, use `.request()`:_
- _`.call("Assets", { pair: "XXBTZUSD" }, (response) => ...);` -> `.request("Assets", { pair: "XXBTZUSD" }).then(...);`_
- _`.call("Balance").then(...);` -> `.request("Balance", "private").then(...);`_
2. Replace all sync instances with an async loop that requests every few seconds.
- _If you are syncing one of the endpoints provided by WS, use that instead._
3. Ensure that your REST calls are not being made too quickly.
- _Ratelimiting has been removed; you may encounter server errors if you were relying on the limiter._
- _See the rate limits [documentation](https://docs.kraken.com/rest/#section/Rate-Limits)._
4. Increase your api key nonce window if you're getting invalid nonce errors.
- _Calls may now be performed concurrently; 0.4.1 queued calls to guarantee nonce order._
5. Remove calls to `.setOTP()`; provide `.genotp` in the settings.
6. Review the error classes; if you were parsing errors you will need to update your catch statements.
- _Note: calls are no longer automatically retried `retryCt` times._
7. If you're constructing using module.exports (e.g. `const kraken = require('node-kraken-api')({...})`), you will need to use the `module.exports.Kraken` class instead: `import { Kraken } from "node-kraken-api"; const kraken = new Kraken({...});`
</details>
### 1.0.0 MIGRATION NOTICE:
Minor changes to the Emitter class.
<details>
#### Changed
- Kraken.Emitter moved to its [own package](https://github.com/jpcx/ts-ev) and improved; filters now pass on type assertion result to listeners.
- _This changed the signature for event filtering:_
- _`(...args: <type>[]) => boolean` -> `(args: [<type>, <type>, ...]) => args is [<subtype>, <subtype>, ...]`_
#### Removed
- Kraken.Emitter
</details>
## Synopsis <a name=synopsis />
### Methods
- [`.request()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L177)
- [`.time()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L193)
- [`.systemStatus()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L200)
- [`.assets()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L207)
- [`.assetPairs()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L229)
- [`.ticker()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L255)
- [`.ohlc()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L272)
- [`.depth()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L300)
- [`.trades()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L323)
- [`.spread()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L345)
- [`.getWebSocketsToken()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L368)
- [`.balance()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L375)
- [`.tradeBalance()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L382)
- [`.openOrders()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L399)
- [`.closedOrders()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L420)
- [`.queryOrders()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L457)
- [`.tradesHistory()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L482)
- [`.queryTrades()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L515)
- [`.openPositions()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L535)
- [`.ledgers()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L559)
- [`.queryLedgers()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L598)
- [`.tradeVolume()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L618)
- [`.addExport()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L638)
- [`.exportStatus()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L678)
- [`.retrieveExport()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L694)
- [`.removeExport()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L710)
- [`.addOrder()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L731)
- [`.cancelOrder()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L825)
- [`.cancelAll()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L841)
- [`.cancelAllOrdersAfter()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L849)
- [`.depositMethods()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L865)
- [`.depositAddresses()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L881)
- [`.depositStatus()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L905)
- [`.withdrawInfo()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L925)
- [`.withdrawStatus()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L973)
- [`.withdrawCancel()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L993)
- [`.walletTransfer()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1013)
- [`.stake()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1042)
- [`.unstake()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1067)
- [`.stakingAssets()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1089)
- [`.stakingPending()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1098)
- [`.stakingTransactions()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1107)
- [`.ws.ticker()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1132)
- [`.ws.ohlc()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1155)
- [`.ws.trade()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1178)
- [`.ws.spread()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1197)
- [`.ws.book()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1216)
- [`.ws.ownTrades()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1291)
- [`.ws.openOrders()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1316)
- [`.ws.addOrder()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1341)
- [`.ws.cancelOrder()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1395)
- [`.ws.cancelAll()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1411)
- [`.ws.cancelAllOrdersAfter()`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1431)
- [`.request()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L178)
- [`.time()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L194)
- [`.systemStatus()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L201)
- [`.assets()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L208)
- [`.assetPairs()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L230)
- [`.ticker()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L256)
- [`.ohlc()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L273)
- [`.depth()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L301)
- [`.trades()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L324)
- [`.spread()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L346)
- [`.getWebSocketsToken()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L369)
- [`.balance()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L376)
- [`.tradeBalance()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L383)
- [`.openOrders()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L400)
- [`.closedOrders()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L421)
- [`.queryOrders()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L458)
- [`.tradesHistory()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L483)
- [`.queryTrades()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L516)
- [`.openPositions()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L536)
- [`.ledgers()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L560)
- [`.queryLedgers()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L599)
- [`.tradeVolume()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L619)
- [`.addExport()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L639)
- [`.exportStatus()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L679)
- [`.retrieveExport()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L695)
- [`.removeExport()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L711)
- [`.addOrder()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L732)
- [`.cancelOrder()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L826)
- [`.cancelAll()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L842)
- [`.cancelAllOrdersAfter()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L850)
- [`.depositMethods()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L866)
- [`.depositAddresses()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L882)
- [`.depositStatus()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L906)
- [`.withdrawInfo()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L926)
- [`.withdrawStatus()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L974)
- [`.withdrawCancel()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L994)
- [`.walletTransfer()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1014)
- [`.stake()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1043)
- [`.unstake()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1068)
- [`.stakingAssets()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1090)
- [`.stakingPending()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1099)
- [`.stakingTransactions()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1108)
- [`.ws.ticker()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1133)
- [`.ws.ohlc()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1156)
- [`.ws.trade()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1179)
- [`.ws.spread()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1198)
- [`.ws.book()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1217)
- [`.ws.ownTrades()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1292)
- [`.ws.openOrders()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1317)
- [`.ws.addOrder()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1342)
- [`.ws.cancelOrder()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1396)
- [`.ws.cancelAll()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1412)
- [`.ws.cancelAllOrdersAfter()`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1432)
### Properties
- [`.ws`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1114)
- [`.ws.pub`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1118)
- [`.ws.priv`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1120)
- [`.ws`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1115)
- [`.ws.pub`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1119)
- [`.ws.priv`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1121)
### Classes
- [`Kraken`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L121)
- [`Kraken.InternalError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1454)
- [`Kraken.UnknownError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1461)
- [`Kraken.ArgumentError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1471)
- [`Kraken.SettingsError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1478)
- [`Kraken.JSONParseError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1485)
- [`Kraken.BufferParseError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1495)
- [`Kraken.HTTPRequestError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1505)
- [`Kraken.RESTAPIError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1521)
- [`Kraken.TimeoutError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1531)
- [`Kraken.WSAPIError`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1538)
- [`Kraken.Emitter`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L1618)
- [`Kraken.WS.Connection`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L4658)
- [`Kraken.WS.Subscriber`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L4950)
- [`Kraken.WS.Subscription`](https://github.com/jpcx/node-kraken-api/blob/1.0.0/index.ts#L5112)
- [`Kraken`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L122)
- [`Kraken.InternalError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1455)
- [`Kraken.UnknownError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1462)
- [`Kraken.ArgumentError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1472)
- [`Kraken.SettingsError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1479)
- [`Kraken.JSONParseError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1486)
- [`Kraken.BufferParseError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1496)
- [`Kraken.HTTPRequestError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1506)
- [`Kraken.RESTAPIError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1522)
- [`Kraken.TimeoutError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1532)
- [`Kraken.WSAPIError`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L1539)
- [`Kraken.WS.Connection`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L4335)
- [`Kraken.WS.Subscriber`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L4636)
- [`Kraken.WS.Subscription`](https://github.com/jpcx/node-kraken-api/blob/2.0.0/index.ts#L4798)
## Usage
## Usage <a name=usage />

@@ -271,15 +336,7 @@ ### Integration

**Justin Collier** - [jpcx](https://github.com/jpcx)
<a name=donate />
| [![](https://github.com/jpcx/node-kraken-api/blob/2.0.0/assets/xbt.png)](#donate) | [![](https://github.com/jpcx/node-kraken-api/blob/2.0.0/assets/ltc.png)](#donate) | [![](https://github.com/jpcx/node-kraken-api/blob/2.0.0/assets/eth.png)](#donate) | [![](https://github.com/jpcx/node-kraken-api/blob/2.0.0/assets/zec.png)](#donate) | [![](https://github.com/jpcx/node-kraken-api/blob/2.0.0/assets/xmr.png)](#donate)
| --- | --- | --- | --- | --- |
| <sup><sub>`XBT:`&nbsp;`bc1qnkturlnv4yufkc40k4ysxz4maak5mug7l820my`</sub></sup> | <sup><sub>`LTC:`&nbsp;`ltc1q9jnvesyffgysel7h4cttg7fscenaje2ka08qvc`</sub></sup> | <sup><sub>`ETH:`&nbsp;`0xD03c9c3027C6bBDDad31d183Ba07DA9db34ee641`</sub></sup> | <sup><sub>`ZEC:`&nbsp;`t1S9TJAa4uxtXdh8NJWJu8HKZ1MkCddp5sH`</sub></sup> | <sup><sub>`XMR:`&nbsp;`49UydqpjBjfPcYEV26jrruQwkCkW9VVFxXdmBwmarAVUPz6FSK2nLsRCdtQTMrFZ3NBy9aGrgGGhKZKCpApy5xBWA3GiBsn`</sub></sup> |
![BTC](https://github.com/jpcx/node-kraken-api/blob/1.0.0/assets/btc.png)&emsp;
![LTC](https://github.com/jpcx/node-kraken-api/blob/1.0.0/assets/ltc.png)&emsp;
![ETH](https://github.com/jpcx/node-kraken-api/blob/1.0.0/assets/eth.png)&emsp;
![XMR](https://github.com/jpcx/node-kraken-api/blob/1.0.0/assets/xmr.png)
```
bitcoin:bc1qnkturlnv4yufkc40k4ysxz4maak5mug7l820my
litecoin:ltc1q9jnvesyffgysel7h4cttg7fscenaje2ka08qvc
ethereum:0xD03c9c3027C6bBDDad31d183Ba07DA9db34ee641
monero:49UydqpjBjfPcYEV26jrruQwkCkW9VVFxXdmBwmarAVUPz6FSK2nLsRCdtQTMrFZ3NBy9aGrgGGhKZKCpApy5xBWA3GiBsn
```
Inspired by [npm-kraken-api](https://github.com/nothingisdead/npm-kraken-api) ([_nothingisdead_](https://github.com/nothingisdead)).

@@ -289,2 +346,2 @@

This project is licensed under the MIT License - see the [LICENSE](https://github.com/jpcx/node-kraken-api/blob/1.0.0/LICENSE) file for details
This project is licensed under the MIT License - see the [LICENSE](https://github.com/jpcx/node-kraken-api/blob/2.0.0/LICENSE) file for details
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