bfx-api-node-rest
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -33,3 +33,3 @@ <a name="RESTv2"></a> | ||
* [.movements(ccy, start, end, limit, cb)](#RESTv2+movements) ⇒ <code>Promise</code> | ||
* [.ledgers(ccy, start, end, limit, cb)](#RESTv2+ledgers) ⇒ <code>Promise</code> | ||
* [.ledgers(filters, start, end, limit, cb)](#RESTv2+ledgers) ⇒ <code>Promise</code> | ||
* [.orderHistory(symbol, start, end, limit, cb)](#RESTv2+orderHistory) ⇒ <code>Promise</code> | ||
@@ -399,3 +399,3 @@ * [.orderTrades(symbol, start, end, limit, orderID, cb)](#RESTv2+orderTrades) ⇒ <code>Promise</code> | ||
### resTv2.ledgers(ccy, start, end, limit, cb) ⇒ <code>Promise</code> | ||
### resTv2.ledgers(filters, start, end, limit, cb) ⇒ <code>Promise</code> | ||
**Kind**: instance method of [<code>RESTv2</code>](#RESTv2) | ||
@@ -407,3 +407,3 @@ **Returns**: <code>Promise</code> - p | ||
| --- | --- | --- | --- | | ||
| ccy | <code>string</code> | | i.e. ETH | | ||
| filters | <code>Object</code> | | i.e. { ccy: 'ETH', category: 28 } | | ||
| start | <code>number</code> | <code></code> | | | ||
@@ -410,0 +410,0 @@ | end | <code>number</code> | | | |
@@ -695,3 +695,3 @@ 'use strict' | ||
/** | ||
* @param {string?} ccy - i.e. ETH | ||
* @param {Object or string?} if Object { ccy: 'ETH', category: 28 } | ||
* @param {number?} start | ||
@@ -704,3 +704,8 @@ * @param {number?} end | ||
*/ | ||
ledgers (ccy, start = null, end = Date.now(), limit = 25, cb) { | ||
ledgers (filters, start = null, end = Date.now(), limit = 25, cb) { | ||
const parseFilters = (sent) => { | ||
if (typeof sent === 'string') return { ccy: sent } | ||
return sent || {} | ||
} | ||
const { ccy, category } = parseFilters(filters) | ||
const url = ccy | ||
@@ -710,3 +715,5 @@ ? `/auth/r/ledgers/${ccy}/hist` | ||
return this._makeAuthRequest(url, { start, end, limit }, cb, LedgerEntry) | ||
return this._makeAuthRequest(url, { | ||
start, end, limit, category | ||
}, cb, LedgerEntry) | ||
} | ||
@@ -713,0 +720,0 @@ |
{ | ||
"name": "bfx-api-node-rest", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Official Bitfinex REST v1 & v2 API interfaces", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
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
130124
2301