GithubHelp home page GithubHelp logo

johntitus / node.liqui.io Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 17.0 15 KB

An unofficial Node.js wrapper for the Liqui crypto-currency exchange.

License: MIT License

JavaScript 100.00%
api bitcoin cryptocurrency

node.liqui.io's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node.liqui.io's Issues

Selling arguments are bugged. Project still active?

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

Disadvantages in Api

  1. Please return to the methods real errors.
  2. The "trades" method does not have a "limit" parameter
    https://liqui.io/api

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.

tradeHistory not working

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.

Handling of datetime/timestamp params broken

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.