GithubHelp home page GithubHelp logo

acuityinnovations / binance.ex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dvcrn/binance.ex

3.0 3.0 3.0 374 KB

Elixir wrapper for the Binance public API

License: MIT License

Elixir 100.00%

binance.ex's Introduction

binance.ex

Build Status

Elixir wrapper for interacting with the Binance API.

Installation

  1. The package can be installed by adding binance to your list of dependencies in mix.exs:
def deps do
  [
    {:binance, "~> 1.0.2", github: "acuityinnovations/binance.ex", branch: "master"}
  ]
end
  1. Add :binance to your applications
def application do
  [applications: [:binance]]
end

Usage

Documentation to be updated.

Get all prices

iex> Binance.get_all_prices
{:ok,
 [%Binance.SymbolPrice{price: "0.07718300", symbol: "ETHBTC"},
  %Binance.SymbolPrice{price: "0.01675400", symbol: "LTCBTC"},
  %Binance.SymbolPrice{price: "0.00114690", symbol: "BNBBTC"},
  %Binance.SymbolPrice{price: "0.00655900", symbol: "NEOBTC"},
  %Binance.SymbolPrice{price: "0.00030000", symbol: "123456"},
  %Binance.SymbolPrice{price: "0.04754000", symbol: "QTUMETH"},
  %Binance.SymbolPrice{price: "0.00778500", symbol: "EOSETH"}
  ...]}

Binance API credentials could be passed to some APIs calls which require authentication/request signing like so:

config = %{access_keys: ["XXX_BINANCE_API_KEY", "XXX_BINANCE_SECRET_KEY"]}
Binance.get_account(config)

# or

Binance.Futures.create_order(%{symbol: "BTCUSDT", side: "SELL", type: "LIMIT", quantity: 0.005, price: 9000, time_in_force: "GTC"}, config)

in which, XXX_BINANCE_API_KEY and XXX_BINANCE_SECRET_KEY are ENV names that holds the values of your API and Secret keys respectively.

License

MIT

binance.ex's People

Contributors

sirius248 avatar dvcrn avatar trexnix avatar rupurt avatar seeurchin avatar quabongbay avatar acuityengineers avatar cinderella-man avatar ccjr avatar trungacuity avatar luizparreira avatar mikaak avatar quangacuity avatar

Stargazers

Ivor Paul avatar Ihor Katkov avatar  avatar

Watchers

πŸ‡ΊπŸ‡¦ Yuri Kovalov avatar James Cloos avatar Ihor Katkov avatar

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.