Code Monkey home page Code Monkey logo

gdax-scala's Introduction

gdax-scala

An unofficial Scala client for the Coinbase GDAX API.

Codix

(This is a work-in-progress, and I will improve docs soon. In the meantime, I suggest reading through Sample.scala for a demo on how to use it.)

Getting started

You will need Scala (naturally) and sbt installed. This has a single dependency, scalaj-http, which should be fetched by sbt. To run do

sbt run

GDAX consists of public and private (or authenticated) APIs.

To obtain the public endpoint methods do

  val pubclient = api.Client.public()

To obtain the private endpoint methods you need to use your API credentials. E.g. to get them from the environment you could do

  val authclient = api.Client.authenticated(
    sys.env("APIKEY"),
    sys.env("APISECRET"),
    sys.env("APIPASSPHRASE")
  )

All the API methods are Future based and asynchronous. They are generally called in the following manner:

pubclient.productOrderBook(
	id = "id,
	level = "2"
).onComplete {
	case Success(resp) => { println(resp) }
	case Failure(e) => e.printStackTrace
}

Public API Methods

pubclient.products().onComplete { ... }

pubclient.productTicker(id: String).onComplete { ... }

pubclient.productTrades(id : String).onComplete { ... }

pubclient.productStats(id : String).onComplete { ... }

pubclient.currencies().onComplete { ... }

pubclient.time().onComplete { ... }

Private API Methods

authclient.accounts().onComplete { ... }

authclient.account(id: String).onComplete { ... }

authclient.accountHistory(id: String, params: Map[String, String] = null).onComplete { ... }

authclient.accountHolds(id: String).onComplete { ... }

authclient.getOrders(params: Map[String, String] = null).onComplete { ... }

authclient.getOrder(id: String).onComplete { ... }

authclient.placeOrder(json: Map[String, Any]).onComplete { ... }

authclient.cancelOrder(id: String).onComplete { ... }

authclient.deposit(amount: String, coinbaseAccountId: String).onComplete { ... }

authclient.withdraw(amount: String, coinbaseAccountId: String).onComplete { ... }

gdax-scala's People

Contributors

traptoy avatar

Stargazers

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