Giter Site home page Giter Site logo

coinbase-java's Introduction

coinbase-java

A java wrapper around the coinbase REST APIs

Dependencies:

Supported APIs

  • Authentication
  • Get current user
  • list addresses (page, limit, and query support)
  • generate recieve address
  • buy
  • sell
  • list transactions
  • get transaction details
  • send money
  • request money
  • resend money request
  • cancel money request
  • complete money request
  • buttons

Usage:

All work is done via the CoinbaseApi class. You can construct an instance of this class one of three ways:

//Constructs an instance of CoinbaseApi using OAuth
CoinbaseApi api = new CoinbaseApi(clientId, clientSecret, redirectUrl);

//Constructs an instance of CoinbaseApi using and api key
CoinbaseApi api = new CoinbaseApi(apiKey);

//Constructs an instance of CoinbaseApi using OAuth, but providing an access token and refresh token up front
CoinbaseApi api = new CoinbaseApi(clientId, clientSecret, redirectUrl, accessToken, refreshToken);

OAuth: If you are using OAuth as your authentication mechanism, you will first need to authenticate. coinbase-java only supports coinbase's new three-legged OAuth and there are no plans to support their old, deprecated two-legged OAuth.

The first thing you need to do is generate an authentication URL. You can do this by calling:

String authUrl = api.generateOAuthUrl();

Then, the user will need to use this url to obtain an authentication code. Once the code is in hand, to authenticate, simply do

//get the auth code using the authUrl
if (api.authenticate(code)) {
    //auth success
} else {
    //auth failed
}

For information on coinbase's three-legged auth, see here.

HttpClient vs. HttpURLConnection By default, coinbase-java uses apache's HttpClient libraries for connections. If you are using a service such as Google App Engine that doesn't support these libraries or handles secure connections on its own, you can choose to use HttpURLConnection instead by doing

api.allowSecure(false);

coinbase-java's People

Contributors

jonbonazza avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jonbonazza

coinbase-java's Issues

variable price is not working

if i pass true for isVariablePrice in makeButton,it does not show any changes,price is still fixed and not-editable..

Shouldn't care about specific server type

Right now, It defaults to "non-google app engine", but it assumes non-google app engine means apache. We have a private data member for "apache" and accessor methods for isApache() and setApache(). The data member should be changed to "secure" and default to true. The methods should be changed to isSecure() and setSecure().

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.