Coder Social home page Coder Social logo

binance.ex's People

Contributors

amacgregor avatar asmodehn avatar ccjr avatar cdesch avatar cinderella-man avatar dependabot[bot] avatar dvcrn avatar gilacost avatar jakuj avatar juanpabloaj avatar luizparreira avatar mikaak avatar rupurt avatar voleoo 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  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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

binance.ex's Issues

Add `GET /api/v1/klines` endpoint

I started writing a wrapper around Binance's API to get historical data, and stumbled upon this repo. Would you be interested if I implemented the endpoint here?

Setup publish to hex through CI

While migrating from travis to github ci, I forgot the auto-publish to hex.

Add a new CI step to publish to hex when there is a new tag

`:exvcr` configuration issues

Currently, when using the master branch, I have this warning when running tests

$ mix test
Compiling 17 files (.ex)
Generated binance app
You have configured application :exvcr in your configuration file,
but the application is not available.

This usually means one of:

  1. You have not added the application as a dependency in a mix.exs file.

  2. You are configuring an application that does not really exist.

Please ensure :exvcr exists or remove the configuration.

...........................

Finished in 7.1 seconds
27 tests, 0 failures

Randomized with seed 257469

On my elixir setup, this can be fixed by removing the applications: section in the MixProject in mix.exs
More info on this topic : https://www.amberbit.com/blog/2017/9/22/elixir-applications-vs-extra_applications-guide/

Also :exvcr commands are not accessible simply

$ mix vcr.check
Compiling 17 files (.ex)
Generated binance app
** (Mix) The task "vcr.check" could not be found

This can be fixed by allowing the dependency to be used in the :dev environment as well.

Not sure if there will be unintended side effects to these changes however ?

The PR is there #45

Public CI

Do you have any preference for a public CI? e.g. CircleCI, Travis etc...

Support for multiple API keys

First of all, thank you a lot for creating this wrapper! It helps me a lot.

I'm making an application that acts on behalf of multiple users. Currently api key and secret are global, stored in config. I'd love to be able to make requests using different credentials.

If I'll find time I'll try to create a PR, but just wanted to create an issue to let you know such feature would be very useful :)

Compile -> Runtime Configuration ?

Hi everyone, I am opening this issue to start a conversation regarding compiled / runtime configuration.

Few reasons for this :

  • I wanted to test the behaviour of the code when the endpoint is not reachable, with bypass, but the endpoint is currently set at compile time, and cannot be changed while tests are running.
  • I wanted to test authenticated/anonymous requests, but the apikey/secret is currently set at compile time, and, just like the endpoint, cannot be changed at runtime.
  • I want to have my apikey/secret in a file in user's home, not in a config.exs (danger of accidental commit). I plan to use vapor to configure processes on application startup.
  • I want to use binance.ex in a multiprocess app...
  1. adding a private function to the module where we call Application.get_env(), instead of a module tag would make it changeable at runtime. Although not practical it would work fine in monoprocess situations (only one configuration possible) and would allow testing different configurations.

  2. Would be better: functions need more parameters for tests (or user code) to be able to change endpoint/apikey/secret on call which will make this code usable in a multiprocess situation (one process can connect to one account, another to a different account for instance, they would crash independently, etc.).

Regarding 2., in my specific usecase, I am currently thinking to have one process for public requests, another one for authenticated requests (only this process would be started with apikey and secret). Call rates will be different, public requests can probably be cached for a short time (don't modify the real world), authenticated clients can crash and respawn independently, etc.

Adding these parameters to functions can make the API more complex, so we should think about how to do this without degrading the dev experience...

I see a couple of options:

  • pass a datastructure to all api functions, such as :
%Binance.Connection{ endpoint: _, apikey: _ , secret: _ }
  • have an agent holding that "connection" data, configurable at runtime, and providing the same api.
  • there are probably other options, but I am not sure which one would be "simple and intuitive enough" for devs here. Python async http clients have "session" concept that may also be useful here: https://docs.aiohttp.org/en/stable/#client-example

What do you think about 1. ? I can do a quick PR, if this is something you are interested in.

What do you think about 2. ?

Also, let me know of any other issue that would be useful that would be useful to work on and fall into this "configuration" topic. I am currently working on this on my code, so I can probably contribute something similar here.

Cheers !

:crypto.hmac/3 removed in OTP 24

I'm using Elixir 1.12.0 (compiled with Erlang/OTP 24) and get the following error:

(UndefinedFunctionError) function :crypto.hmac/3 is undefined or private

According to https://erlang.org/doc/apps/crypto/new_api.html hmac/3 and hmac/4 have been deprecated in 23.0 and removed in OTP 24.0. The replacement would be mac/3 or mac4.

If it's important to maintain backward compatibility below 22.1 I suspect something like Kernel.function_exported?(:crypto, :mac, 3) could be used to determine which function to use (although I have no idea if this is standard practice).

Happy to submit a pull request!

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.