GithubHelp home page GithubHelp logo

node-poloniex-unofficial's Introduction

Tyler's GitHub statsTyler's top languages

node-poloniex-unofficial's People

Contributors

devluxg avatar gitter-badger avatar kevineastwood avatar tylerfilla avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node-poloniex-unofficial's Issues

returnTradeHistory give an empty list

Hi,
when i use this :
poloniex-unofficial 1.1.1

poloTrading.returnTradeHistory("BTC_NOTE", (Date.now() - (3600*24*7*1000)), Date.now(), (err,response) => {
        if (err) {
            // Log error message
            console.log("An error occurred: " + err.msg);
        } else {
            console.log(response);
        }
      });

there is no error.
I get an empty list : []
but i bougth some "NOTE" this 4 days.

Do I have a mistake ?
I use your javascript lib with 'browserify', this work :

  • push
  • returnCompleteBalances

I haven't used the others function for now.

Expose seq number in push wrapper orderTrade

The seq number delivered by the order book and trade push API feed is delivered in another package than normal data and is not exposed to the user. The seq number can be used to correlate changes in trade data with order book snapshots obtained from the public API. As a feature, expose the seq number.

Return monetary values as strings

Poloniex sporadically returns monetary values as a healthy mix of numbers and strings, and even uses numbers where strings are documented and vice-versa. This is all fine and dandy when the data is in JSON form, but when deserialized by JSON.parse(), I believe this may be cause for concern if the value is particularly large. Those astronomical orders on DIEM come to mind here.

Option 1

I am aware of a particular JSON parsing solution called json-bigint which offers a JSONbig.parse() function and converts all numbers to bignumber.js numbers, but this isn't particularly desirable. At the very least, we must add another dependency, but the code change would simply be a 3 character addition.

Option 2

One could also regex the raw JSON string for any monetary values and surround them in quotes. I think this would be a more direct solution to the problem, but must match a set of specific cases. Maybe we could "generalize" the matcher to get all decimal point-containing numbers. The result would be easily integrated into the already-string-number-handling codebase.

Right now, I'm leaning toward option 2.

Edit: Even if I'm concerned about nothing, I still want there to be some consistency. This change would probably have to be opt-in so the user knows what to expect.

=> is not Javascript syntax

Hello,

Trying to run this in Node.js, recent version, "=>" in leui of simply writing 'function' for callbacks is causing the code to not execute, this may be because "=>" is not valid Javascript.

Alternative method to unsubscribe from a push feed?

As it stands, returning true from a push API callback signals to Autobahn|JS to unsubscribe from the respective feed. Alternatively, it might be useful to unsubscribe when an error is thrown from the callback.

Connection delay causing Autobahn|JS error

Using two push API wrapper functions consecutively makes Autobahn|JS cry.

Exhibit A

var polo = require("poloniex-unofficial");
var push = polo.api("push");

push.orderTrade("BTC_ETH", (err, data) => {
    console.log("1: " + data);
});

push.orderTrade("BTC_ETH", (err, data) => {
    console.log("2: " + data);
});

This yields the following error:
"connection already open (or opening)"

Adding an arbitrary delay to the second call fixes it:

// snip snip

setTimeout(function() {
    push.orderTrade("BTC_ETH", (err, data) => {
        console.log("2: " + data);
    });
}, 2000);

Hypothesis: If one does not leave enough delay between two push API wrapper function calls, the second call will see the connection as established, but the WAMP session as closed, and will therefore try to establish a new connection over an existing one, yielding the error.

Staging for 1.1.0 release

Feature development for the upcoming 1.1.0 release is complete. In lieu of a well-defined release procedure, here is the plan.

Final adjustments (no new features) will be made on branch staging-1.1.0. During the staging period (defined by the lifetime of this branch), new features and fixes to said features will occur on master as usual. Adjustments and fixes made on the staging branch will continuously be merged to master as appropriate. After the staging period, the staging branch will be removed and the project version will be incremented from 1.1.0-SNAPSHOT to 1.1.0 and the repository tagged as such. Immediately after tagging, the version will be incremented to 1.1.1-SNAPSHOT in preparation for future developments. Finally, code from the tagged commit will be published to npm.

Edit: Tagging and version increments will take place on the staging branch to maintain feature separation.

Cannot read property 'error' of null on bodyObj.error

Hi!

I found a bug! :D

.../src/node_modules/poloniex-unofficial/lib/api/trading.js:89
            if (bodyObj.error) {
                       ^

TypeError: Cannot read property 'error' of null
    at Request._callback (/Users/polyclick/Repos/polyclick/filthy-rich/src/node_modules/poloniex-unofficial/lib/api/trading.js:89:24)
    at Request.self.callback (/Users/polyclick/Repos/polyclick/filthy-rich/src/node_modules/request/request.js:187:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/Users/polyclick/Repos/polyclick/filthy-rich/src/node_modules/request/request.js:1044:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/Users/polyclick/Repos/polyclick/filthy-rich/src/node_modules/request/request.js:965:12)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:975:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Probably doing a check if bodyObj is null would be enough. I wish I knew what happend there in detail but I didn't have my debug proxy open so I can't see what Poloniex is retuning and wether this should be handled in an other way.

promise api

Hi,
i can see the promise functions in github v 1.1.2
but not in the installed node with npm of the library in the "api" directory.
during install i see this :
โ””โ”€โ”€ [email protected] extraneous

problem using trading api

i got this error:
Uncaught Poloniex: Nonce must be greater than 1474538171128001. You provided 1474639997036.

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.