Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
add returnLendingHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Brownworth authored and Anders Brownworth committed May 25, 2017
1 parent 41a98f0 commit 5690d1f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ Example response:

{"provided":[{"id":75073,"currency":"LTC","rate":"0.00020000","amount":"0.72234880","range":2,"autoRenew":0,"date":"2015-05-10 23:45:05","fees":"0.00006000"},{"id":74961,"currency":"LTC","rate":"0.00002000","amount":"4.43860711","range":2,"autoRenew":0,"date":"2015-05-10 23:45:05","fees":"0.00006000"}],"used":[{"id":75238,"currency":"BTC","rate":"0.00020000","amount":"0.04843834","range":2,"date":"2015-05-10 23:51:12","fees":"-0.00000001"}]}

### returnLendingHistory(start, end, limit, callback)

Returns up to "limit" closed loans within the "start" and "end" unix timestamps. (unix timestamps are expressed as numbers such as `1495681818`)

Example response:

[{"id":352149451,"currency":"XMR","rate":"0.00000410","amount":"0.08077792","duration":"0.02410000","interest":"0.00000001","fee":"0.00000000","earned":"0.00000001","open":"2017-05-25 02:30:24","close":"2017-05-25 03:05:08"},{"id":352147612,"currency":"XRP","rate":"0.00005506","amount":"197.21610000","duration":"0.00200000","interest":"0.00002150","fee":"-0.00000322","earned":"0.00001828","open":"2017-05-25 03:00:22","close":"2017-05-25 03:03:14"}]

### toggleAutoRenew(orderNumber, callback)

Toggles the autoRenew setting on an active loan, specified by "orderNumber". If successful, "message" will indicate the new autoRenew setting.
Expand Down
12 changes: 11 additions & 1 deletion lib/poloniex.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = (function() {
nonce = require('nonce')();

// Constants
var version = '0.0.6',
var version = '0.0.7',
PUBLIC_API_URL = 'https://poloniex.com/public',
PRIVATE_API_URL = 'https://poloniex.com/tradingApi',
USER_AGENT = 'poloniex.js ' + version;
Expand Down Expand Up @@ -357,6 +357,16 @@ module.exports = (function() {
return this._private('returnActiveLoans', {}, callback);
},

returnLendingHistory: function(start, end, limit, callback) {
var parameters = {
start: start,
end: end,
limit: limit
};

return this._private('returnLendingHistory', parameters, callback);
},

toggleAutoRenew: function(orderNumber, callback) {
return this._private('toggleAutoRenew', {orderNumber: orderNumber}, callback);
}
Expand Down

0 comments on commit 5690d1f

Please sign in to comment.