johntitus / node.liqui.io Goto Github PK
View Code? Open in Web Editor NEWAn unofficial Node.js wrapper for the Liqui crypto-currency exchange.
License: MIT License
An unofficial Node.js wrapper for the Liqui crypto-currency exchange.
License: MIT License
I found a bug here:
https://github.com/johntitus/node.liqui.io/blob/master/index.js#L148
The function currently says:
sell(pair, rate, amount){
if (!params || !params.pair || !params.rate || !params.amount){
return Promise.reject('Pair, rate, and amount are required');
} else {
params.type = 'sell';
return this._query('Trade', params);
}
};
But it should probably look like this:
sell(params){
if (!params || !params.pair || !params.rate || !params.amount){
return Promise.reject('Pair, rate, and amount are required');
} else {
params.type = 'sell';
return this._query('Trade', params);
}
};
The function arguments are invalid.
I'm happy to create a pull request, but seeing that there is an open PR let me first ask, is this still in development?
Thanks
Method trades
This method provides the information about the last trades. Additionally it accepts an optional GET-parameter limit, which indicates how many orders should be displayed (150 by default). The maximum allowable value is 2000.
if I liqui.tradeHistory(params).then(result => {console.log(result)});
I get back
Unhandled rejection (<{"success":0,"code":0,"error":"invalid...>, no stack trace).
In my test case I just do the following:
const Liqui = require('node.liqui.io');
then initialize Liqui with my key and secret , then I define params = {pair: 'btc_edg'} and then I do liqui.tradeHistory(params).then(result => {console.log(result)});
I do this directly from node in linux.
When passing a since
param into the TradeHistory API
example:
params = {
since: new Date('2018-01-01'),
}
liqui.tradeHistory(params).then( trades => {...
, the library fails with an error like this:
[..]/node_modules/node.liqui.io/index.js:58
value = this.getTimestamp(params[key])
^
TypeError: Cannot read property 'getTimestamp' of undefined
at [..]/node_modules/node.liqui.io/index.js:58:19
at Array.forEach (native)
at Liqui._query ([..]/node_modules/node.liqui.io/index.js:55:25)
at Liqui.tradeHistory ([..]/node_modules/node.liqui.io/index.js:215:15)
Perhaps that is supposed to be calling _getTimestamp()
instead?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.