binance-api-node
Advanced tools
Comparing version 0.4.1 to 0.4.3
@@ -202,2 +202,5 @@ 'use strict'; | ||
}, | ||
exchangeInfo: function exchangeInfo() { | ||
return publicCall('/v1/exchangeInfo'); | ||
}, | ||
@@ -204,0 +207,0 @@ book: book, |
@@ -111,3 +111,7 @@ 'use strict'; | ||
var open = tick.o, | ||
var startTime = tick.t, | ||
closeTime = tick.T, | ||
firstTradeId = tick.f, | ||
lastTradeId = tick.L, | ||
open = tick.o, | ||
high = tick.h, | ||
@@ -129,2 +133,6 @@ low = tick.l, | ||
symbol: symbol, | ||
startTime: startTime, | ||
closeTime: closeTime, | ||
firstTradeId: firstTradeId, | ||
lastTradeId: lastTradeId, | ||
open: open, | ||
@@ -131,0 +139,0 @@ high: high, |
{ | ||
"name": "binance-api-node", | ||
"version": "0.4.1", | ||
"version": "0.4.3", | ||
"description": "A node API wrapper for Binance", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
@@ -40,2 +40,3 @@ # binance-api-node [![build](https://img.shields.io/travis/HyperCubeProject/binance-api-node.svg?style=flat-square)](https://travis-ci.org/HyperCubeProject/binance-api-node) [![cover](https://img.shields.io/coveralls/HyperCubeProject/binance-api-node.svg?style=flat-square)](https://coveralls.io/github/HyperCubeProject/binance-api-node) [![bnb](https://img.shields.io/badge/binance-winner-yellow.svg?style=flat-square)](https://github.com/binance-exchange/binance-api-node) | ||
- [time](#time) | ||
- [exchangeInfo](#exchangeinfo) | ||
- [book](#book) | ||
@@ -96,2 +97,64 @@ - [candles](#candles) | ||
#### exchangeInfo | ||
Get the current exchange trading rules and symbol information. | ||
```js | ||
console.log(await client.exchangeInfo()) | ||
``` | ||
<details> | ||
<summary>Output</summary> | ||
```js | ||
{ | ||
"timezone": "UTC", | ||
"serverTime": 1508631584636, | ||
"rateLimits": [ | ||
{ | ||
"rateLimitType": "REQUESTS", | ||
"interval": "MINUTE", | ||
"limit": 1200 | ||
}, | ||
{ | ||
"rateLimitType": "ORDERS", | ||
"interval": "SECOND", | ||
"limit": 10 | ||
}, | ||
{ | ||
"rateLimitType": "ORDERS", | ||
"interval": "DAY", | ||
"limit": 100000 | ||
} | ||
], | ||
"exchangeFilters": [], | ||
"symbols": [{ | ||
"symbol": "ETHBTC", | ||
"status": "TRADING", | ||
"baseAsset": "ETH", | ||
"baseAssetPrecision": 8, | ||
"quoteAsset": "BTC", | ||
"quotePrecision": 8, | ||
"orderTypes": ["LIMIT", "MARKET"], | ||
"icebergAllowed": false, | ||
"filters": [{ | ||
"filterType": "PRICE_FILTER", | ||
"minPrice": "0.00000100", | ||
"maxPrice": "100000.00000000", | ||
"tickSize": "0.00000100" | ||
}, { | ||
"filterType": "LOT_SIZE", | ||
"minQty": "0.00100000", | ||
"maxQty": "100000.00000000", | ||
"stepSize": "0.00100000" | ||
}, { | ||
"filterType": "MIN_NOTIONAL", | ||
"minNotional": "0.00100000" | ||
}] | ||
}] | ||
} | ||
``` | ||
</details> | ||
#### book | ||
@@ -812,3 +875,3 @@ | ||
```js | ||
client.ws.partialDepth(tickers => { | ||
client.ws.allTickers(tickers => { | ||
console.log(tickers) | ||
@@ -892,4 +955,3 @@ }) | ||
Note that this method returns a promise returning a `clean` callback, that will clear | ||
the keep-alive interval and close the data stream. | ||
Note that this method returns a promise which will resolve the `clean` callback. | ||
@@ -896,0 +958,0 @@ <details> |
@@ -174,2 +174,3 @@ import crypto from 'crypto' | ||
time: () => publicCall('/v1/time').then(r => r.serverTime), | ||
exchangeInfo: () => publicCall('/v1/exchangeInfo'), | ||
@@ -176,0 +177,0 @@ book, |
@@ -65,2 +65,6 @@ import WebSocket from 'ws' | ||
const { | ||
t: startTime, | ||
T: closeTime, | ||
f: firstTradeId, | ||
L: lastTradeId, | ||
o: open, | ||
@@ -83,2 +87,6 @@ h: high, | ||
symbol, | ||
startTime, | ||
closeTime, | ||
firstTradeId, | ||
lastTradeId, | ||
open, | ||
@@ -85,0 +93,0 @@ high, |
@@ -23,2 +23,7 @@ import test from 'ava' | ||
test.serial('[REST] exchangeInfo', async t => { | ||
const res = await client.exchangeInfo() | ||
checkFields(t, res, ['timezone', 'serverTime', 'rateLimits', 'symbols']) | ||
}) | ||
test.serial('[REST] book', async t => { | ||
@@ -25,0 +30,0 @@ try { |
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
214660
1386
970