Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Cryptopia.prototype.privateRequest = function(method, params, callback)
var uri = this.privateApiPath + "/" + method
var url = this.server + "/" + uri

var nonce = Math.floor(new Date().getTime() / 1000)
var nonce = Math.floor(new Date().getTime() / 1000) - Math.floor(Math.random() * 100);
var md5 = crypto.createHash("md5").update( JSON.stringify( params ) ).digest()
var requestContentBase64String = md5.toString("base64")
var signature = this.api_key + "POST" + encodeURIComponent( url ).toLowerCase() + nonce + requestContentBase64String
Expand Down Expand Up @@ -282,12 +282,11 @@ Cryptopia.prototype.getAccountRecords = function getAccountRecords(callback, sym
}, callback)
}

Cryptopia.prototype.getTradeHistory = function getTradeHistory(callback, symbol, since)
{
this.privateRequest("trade_history", {
symbol: symbol,
since: since
}, callback)
Cryptopia.prototype.getTradeHistory = function getTradeHistory(callback, market)
{
this.privateRequest("GetTradeHistory", {
Market: market
}, callback);
}

Cryptopia.prototype.getOrderHistory = function getOrderHistory(callback, symbol, status, current_page, page_length)
Expand Down