passabilities / crypto-exchange

Pulls together list of crypto exchanges to interact with their API's in a uniform fashion.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No issue

incompletude opened this issue · comments

It is hard to say how amazing this library is.

Maybe I can help.

Best,

Thanks @incompletude! I'm trying to make it as clean and easy to use as possible. Any help is welcome! I am in the middle of reformatting how the exchanges' API keys are read to allow creating multiple instances with different keys. Should have something pushed in a couple hours.

I'm implementing getOrders and cancelOrder for Polo following your code. Is it useful?

Yes thats great. A minor change will need to be made after I push up my changes. I'll give you a ping once that is complete. Go ahead a submit a PR in the meantime and it can easily be rebased with changes.

Ok I have pushed my new changes. you should be able to rebase and only have to update the places you called plnx to this.plnx. See #8

I think you broke the count parameter in depth.

Everything seems to be working on my end. Where exactly are you running into trouble?

Still not sure. Just got the new version.

  1. works

var { poloniex } = require('crypto-exchange')

  1. poloniex is not a constructor

const Exchanges = require('crypto-exchange')
let poloniex = new Exchanges.poloniex({
key: 'a',
secret: 'b'
})

is npm up to date?

> const { poloniex } = require('crypto-exchange')
undefined
> new poloniex({key: '', secret: ''})
Poloniex { plnx: Poloniex { _getPrivateHeaders: [Function] } }

> const Exchanges = require('crypto-exchange')
undefined
> new Exchanges.poloniex({key: '', secret: ''})
Poloniex { plnx: Poloniex { _getPrivateHeaders: [Function] } }

That's odd, both ways seem to be working correctly.

I'm using npm. It is not up to date. Git package works. Sorry the confusion. Saw 1.1.0 and tought it was a new release. Just checked, the 1.1.0 is 5 days old.

Ahh yes my bad! I have not published the recent change to npm just yet.

I just released v2.0.0 with the new breaking changes to npm

Just found. 'use strict', count is not definied at readline.js:982.

poloniex.depth('BTC_USDT', count = 1)
    .then(data => {
        console.log(data)
    })

Hi, everyone! ) You might want to also checkout my ccxt library, it's in js / python / php, supporting 70 exchanges now. I'm interested in all sorts of related coding and development, therefore I watch progress of this repo closely in case we might exchange some underground knowledge, if you don't mind. Thanks!

@kroitor I've checked out your library and it is very impressive! I love that it supports many exchanges and 3 languages, just seems a little too chaotic. I just wanted to have a nice clean, uniform package. I started this at first as a work project but decided to take it public as well.

Have you had any trouble integrating foreign markets?

Yeah, some of them imply too hard KYC & AML rules and don't want to allow everyone, so we had troubles with keys, but our userbase is very helpful, we can get keys for testing from there.

Also, had some deep trouble translating docs in foreign languages (they are not very clean in what they mean), had to experiment from time to time to make signatures work. We will soon push all that to a knowlegdebase of common and known market caveats for developers to know where there may be a pitfall.

We're basically trying to build an all-covering kb about cryptotrading and add access to as many exchange markets as possible.

hey this project is absolutely awesome. I'll try and use it on a upcoming project of mine, for a ledger. Is it possible to call more than 1 pair at a time? Like, if i want to get prices for 4 pairs on poloniex, do i have to make 4 calls, or can it be a promise all kind of thing to get all 4 at once?

Also if i need to fetch from several exchanges, it's done one at a time? Imagine something like blockfolio, how can i get a refresh of all my assets in one go? diferent pairs and diferent exchanges?

Thanks for this!! And if you need any help count me in!

Yes right now you will have to make 4 different requests and which return promises so you can use those in a subsequent Promise.all() call to make sure you get them all back at the same time. That would be a great feature to add though.

@passabilities I'm developing a nodejs prompt cross exchange dashboard where you can watch the market and manage orders using shortcuts. A few more days and it is ready to go. I will submit the methods I'm adding to your library in a week or two.

@kroitor Also found the library quite impressive. Would be amazing to have getOpenOrders and cancelOrder at the unified API. I also think the docs and the api itself are a little messy, but the support is so broad I'm not sure this is avoidable at all. Nothing to worry about, some reading helps (took my a while to find out that loadProducts was necessary). Thank you for developing.

@talvasconcelos take a look at the most recent changes v2.1.0.

@passabilities man, this seems very "promissing"... but i read on Poloniex API that if you make more than 6 calls per second they may ban your IP, have experienced any problems?

What i want to achieve is something similar to blockfolio, where a user inputs their trades and i want to get info on those trades to update price, changes, volume, chart, etc... if the user has like trades in 10 coins/pairs it's 10 API calls right? I'm still trying to figure out how to acomplish this. If the server does the calls and pushes to frontend, or once user logs in the calls are made from frontend/client directly. Or maybe have server do the calls in a cron and store them in database.

But you're making an awesome job man, congrats!

@talvasconcelos

Look for throttle at http://underscorejs.org/.

Creates and returns a new, throttled version of the passed function, that, when invoked repeatedly, will only actually call the original function at most once per every wait milliseconds. Useful for rate-limiting events that occur faster than you can keep up with

Not sure if the best way, but you can create a method and a queue of pairs to update with a last call property. Use a recursive method and throttle. When not throttled, this method should figure out the next pair to update based on the last call property, and call a request method, updating the last call property.

@talvasconcelos I really haven't run into any issues. I have a bot I wrote in python calling this that grabs the ticker and depth of many pairs on multiple exchanges at once and again nothing has happened. In general you should be fine but I would not be ridiculous with it. I It would be nice to incorporate the streaming feed from exchanges that offer it to get live updates without making any requests