GithubHelp home page GithubHelp logo

voronchuk / kraken Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 6.0 16 KB

REST API wrapper to communicate with Kraken exchange.

License: MIT License

Elixir 100.00%
rest-api kraken kraken-exchange-api bitcoin genstage

kraken's Introduction

Kraken

REST API wrapper to communicate with the Kraken exchange.

The main difference from the other libs is the ability to pass authorization keys as optional params to requests, which is useful then you have multiple access users.

We also use GenStage to honour Kraken request limitations.

Hex docs

Installation

Add kraken to your list of dependencies in mix.exs:

def deps do
  [
    {:kraken, "~> 0.1.2"}
  ]
end

Usage

Refer Kraken API documentation for params, options and responses.

Sample public operations:

  • Kraken.API.get_asset_pairs(info: "info", pair: "XXBTZUSD")
  • Kraken.API.get_order_book(pair: "XXBTZUSD")
  • Kraken.API.get_recent_trades(pair: "XXBTZUSD")
  • Kraken.API.get_spread(pair: "XXBTZUSD")

Sample private operations:

  • Kraken.API.get_balance(api_key: "API_KEY", private_key: "PRIVATE_KEY")
  • Kraken.API.get_trade_balance(api_key: "API_KEY", private_key: "PRIVATE_KEY")
  • Kraken.API.get_open_orders(api_key: "API_KEY", private_key: "PRIVATE_KEY")
  • Kraken.API.get_closed_orders(api_key: "API_KEY", private_key: "PRIVATE_KEY")
  • Kraken.API.add_order(api_key: "API_KEY", private_key: "PRIVATE_KEY", pair: "XXBTZUSD", type: "buy", ordertype: "limit", price: 1, volume: 1, validate: "true", oflags: "post")

Tests

Use KRAKEN_API_KEY and KRAKEN_PRIVATE_KEY environment variables to set your test keys on exchange. No actual orders are executed during the tests, orders are executed in validation mode

Run mix test as usual.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2018 Vyacheslav Voronchuk

Restrictions

  • This library is in it's early beta, use on your own risk. Pull requests / reports / feedback are welcome.

kraken's People

Contributors

voronchuk avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.