com.github.kevinstl.coinbase.java.client
Class CoinbaseClient

java.lang.Object
  extended by com.github.kevinstl.coinbase.java.client.CoinbaseClient

@Component
public class CoinbaseClient
extends java.lang.Object


Field Summary
static java.lang.String ACCOUNT_CHANGES
           
static java.lang.String ADDRESSES
           
static java.lang.String AUTHORIZATION
           
static java.lang.String BALANCE
           
static java.lang.String BUYS
           
static java.lang.String CANCEL_REQUEST
           
static java.lang.String COMPLETE_REQUEST
           
static java.lang.String CONTACTS
           
static java.lang.String CURRENCIES
           
static java.lang.String EXCHANGE_RATES
           
static java.lang.String FORWARD_SLASH
           
static java.lang.String GENERATE_RECEIVE_ADDRESS
           
static java.lang.String INVALID_API_KEY
           
static java.lang.String OAUTH
           
static java.lang.String OAUTH_APPLICATIONS
           
static java.lang.String ORDERS
           
static java.lang.String PAYMENT_METHODS
           
static java.lang.String PRICES_BUY
           
static java.lang.String PRICES_HISTORICAL
           
static java.lang.String PRICES_SELL
           
static java.lang.String PRICES_SPOT_RATE
           
static java.lang.String RECEIVE_ADDRESS
           
static java.lang.String REQUEST_MONEY
           
static java.lang.String RESEND_REQUEST
           
static java.lang.String SEND_MONEY
           
static java.lang.String TOKENS
           
static java.lang.String TRANSACTIONS
           
static java.lang.String TRANSFERS
           
static java.lang.String USERS
           
 
Constructor Summary
CoinbaseClient()
           
 
Method Summary
 BuyResponse buy(BuyRequest buyRequest)
           
protected  void checkResponseForAuthenticationError(java.lang.String responseString)
           
 java.lang.String deleteTransactionsCancelRequest(java.lang.String transactionId)
           
 java.lang.String generateReceiveAddress()
           
 java.lang.String getAccountChanges()
           
 java.lang.String getAddresses()
           
 java.lang.String getAuthorization()
           
 java.lang.String getBalance()
           
 CoinbaseAuthenticatedHttpClient getCoinbaseAuthenticatedHttpClient()
           
 java.lang.String getContacts()
           
 java.lang.String getCurrencies()
           
 java.lang.String getCurrentUser()
           
 java.lang.String getExchangeRates()
           
 java.lang.String getIndividualRecurringPayment(java.lang.Integer paymentId)
           
 java.lang.String getIndividualSubscriber(java.lang.Integer subscriberId)
           
 java.lang.String getIndividualTransaction(java.lang.String transactionId)
           
 java.lang.String getInvidualOrder(java.lang.Integer orderId)
           
 java.lang.String getOauthApplications()
           
 java.lang.String getOauthIndividualApplication(java.lang.Integer applicationId)
           
 java.lang.String getOperationUrl(java.lang.String operation)
           
 java.lang.String getOrders()
           
 java.lang.String getPaymentMethods()
           
 java.lang.String getPricesHistorical()
           
 java.lang.String getPricesSpotRate()
           
 java.lang.String getPriceToBuy()
           
 java.lang.String getPriceToSell()
           
 java.lang.String getReceiveAddress()
           
 java.lang.String getRecentBuysAndSells()
           
 java.lang.String getRecentTransactions()
           
 java.lang.String getRecurringPayments()
           
 ResponseDeserializer getResponseDeserializer()
           
 java.math.BigDecimal getSpecificExchangeRate(java.lang.String exchangeRateType)
           
 java.lang.String getSubscribers()
           
protected  java.lang.String httpDelete(java.lang.String operation)
           
protected  java.lang.String httpGet(java.lang.String operation)
           
protected  java.lang.String httpPost(java.lang.String operation, java.lang.String payload)
           
protected  java.lang.String httpPut(java.lang.String operation, java.lang.String payload)
           
 java.lang.String postCreateOauthApplication(OauthApplication oauthApplication)
           
 java.lang.String postCreateOrder(java.lang.String objectId)
           
 java.lang.String postCreatePaymentObject(ButtonRequest buttonRequest)
           
 java.lang.String postCreateUser(UserRequest userRequest)
           
 java.lang.String postOrders(ButtonRequest buttonRequest)
           
 java.lang.String postTokens()
           
 java.lang.String postTokensRedeem(TokenRequest tokenRequest)
           
 java.lang.String postTransactionsRequestMoney(TransactionFromRequest transactionFromRequest)
           
 java.lang.String putTransactionsCompleteRequest(java.lang.String transactionId)
           
 java.lang.String putTransactionsResendRequest(java.lang.String transactionId)
           
 java.lang.String putUserAccountSettings(java.lang.String userId, UserRequest userRequest)
           
 SendMoneyResponse sendMoney(TransactionRequest transactionSenderWrapper)
           
 void setCoinbaseAuthenticatedHttpClient(CoinbaseAuthenticatedHttpClient coinbaseAuthenticatedHttpClient)
           
 void setResponseDeserializer(ResponseDeserializer responseDeserializer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_API_KEY

public static final java.lang.String INVALID_API_KEY
See Also:
Constant Field Values

FORWARD_SLASH

public static final java.lang.String FORWARD_SLASH
See Also:
Constant Field Values

ACCOUNT_CHANGES

public static final java.lang.String ACCOUNT_CHANGES
See Also:
Constant Field Values

GENERATE_RECEIVE_ADDRESS

public static final java.lang.String GENERATE_RECEIVE_ADDRESS
See Also:
Constant Field Values

BALANCE

public static final java.lang.String BALANCE
See Also:
Constant Field Values

RECEIVE_ADDRESS

public static final java.lang.String RECEIVE_ADDRESS
See Also:
Constant Field Values

ADDRESSES

public static final java.lang.String ADDRESSES
See Also:
Constant Field Values

OAUTH

public static final java.lang.String OAUTH
See Also:
Constant Field Values

OAUTH_APPLICATIONS

public static final java.lang.String OAUTH_APPLICATIONS
See Also:
Constant Field Values

AUTHORIZATION

public static final java.lang.String AUTHORIZATION
See Also:
Constant Field Values

BUYS

public static final java.lang.String BUYS
See Also:
Constant Field Values

CONTACTS

public static final java.lang.String CONTACTS
See Also:
Constant Field Values

CURRENCIES

public static final java.lang.String CURRENCIES
See Also:
Constant Field Values

EXCHANGE_RATES

public static final java.lang.String EXCHANGE_RATES
See Also:
Constant Field Values

ORDERS

public static final java.lang.String ORDERS
See Also:
Constant Field Values

PAYMENT_METHODS

public static final java.lang.String PAYMENT_METHODS
See Also:
Constant Field Values

PRICES_BUY

public static final java.lang.String PRICES_BUY
See Also:
Constant Field Values

PRICES_SELL

public static final java.lang.String PRICES_SELL
See Also:
Constant Field Values

PRICES_SPOT_RATE

public static final java.lang.String PRICES_SPOT_RATE
See Also:
Constant Field Values

PRICES_HISTORICAL

public static final java.lang.String PRICES_HISTORICAL
See Also:
Constant Field Values

TOKENS

public static final java.lang.String TOKENS
See Also:
Constant Field Values

TRANSACTIONS

public static final java.lang.String TRANSACTIONS
See Also:
Constant Field Values

SEND_MONEY

public static final java.lang.String SEND_MONEY
See Also:
Constant Field Values

REQUEST_MONEY

public static final java.lang.String REQUEST_MONEY
See Also:
Constant Field Values

RESEND_REQUEST

public static final java.lang.String RESEND_REQUEST
See Also:
Constant Field Values

CANCEL_REQUEST

public static final java.lang.String CANCEL_REQUEST
See Also:
Constant Field Values

COMPLETE_REQUEST

public static final java.lang.String COMPLETE_REQUEST
See Also:
Constant Field Values

TRANSFERS

public static final java.lang.String TRANSFERS
See Also:
Constant Field Values

USERS

public static final java.lang.String USERS
See Also:
Constant Field Values
Constructor Detail

CoinbaseClient

public CoinbaseClient()
Method Detail

getCoinbaseAuthenticatedHttpClient

public CoinbaseAuthenticatedHttpClient getCoinbaseAuthenticatedHttpClient()

setCoinbaseAuthenticatedHttpClient

public void setCoinbaseAuthenticatedHttpClient(CoinbaseAuthenticatedHttpClient coinbaseAuthenticatedHttpClient)

getResponseDeserializer

public ResponseDeserializer getResponseDeserializer()

setResponseDeserializer

public void setResponseDeserializer(ResponseDeserializer responseDeserializer)

getAccountChanges

public java.lang.String getAccountChanges()
                                   throws org.apache.http.client.ClientProtocolException,
                                          java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getBalance

public java.lang.String getBalance()
                            throws org.apache.http.client.ClientProtocolException,
                                   java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getReceiveAddress

public java.lang.String getReceiveAddress()
                                   throws org.apache.http.client.ClientProtocolException,
                                          java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getAddresses

public java.lang.String getAddresses()
                              throws org.apache.http.client.ClientProtocolException,
                                     java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getOauthApplications

public java.lang.String getOauthApplications()
                                      throws org.apache.http.client.ClientProtocolException,
                                             java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getOauthIndividualApplication

public java.lang.String getOauthIndividualApplication(java.lang.Integer applicationId)
                                               throws org.apache.http.client.ClientProtocolException,
                                                      java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postCreateOauthApplication

public java.lang.String postCreateOauthApplication(OauthApplication oauthApplication)
                                            throws org.apache.http.client.ClientProtocolException,
                                                   java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getAuthorization

public java.lang.String getAuthorization()
                                  throws org.apache.http.client.ClientProtocolException,
                                         java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postCreatePaymentObject

public java.lang.String postCreatePaymentObject(ButtonRequest buttonRequest)
                                         throws org.apache.http.client.ClientProtocolException,
                                                java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postCreateOrder

public java.lang.String postCreateOrder(java.lang.String objectId)
                                 throws org.apache.http.client.ClientProtocolException,
                                        java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getContacts

public java.lang.String getContacts()
                             throws org.apache.http.client.ClientProtocolException,
                                    java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getCurrencies

public java.lang.String getCurrencies()
                               throws org.apache.http.client.ClientProtocolException,
                                      java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getExchangeRates

public java.lang.String getExchangeRates()
                                  throws org.apache.http.client.ClientProtocolException,
                                         java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getSpecificExchangeRate

public java.math.BigDecimal getSpecificExchangeRate(java.lang.String exchangeRateType)
                                             throws org.apache.http.client.ClientProtocolException,
                                                    java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getOrders

public java.lang.String getOrders()
                           throws org.apache.http.client.ClientProtocolException,
                                  java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postOrders

public java.lang.String postOrders(ButtonRequest buttonRequest)
                            throws org.apache.http.client.ClientProtocolException,
                                   java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getInvidualOrder

public java.lang.String getInvidualOrder(java.lang.Integer orderId)
                                  throws org.apache.http.client.ClientProtocolException,
                                         java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getPaymentMethods

public java.lang.String getPaymentMethods()
                                   throws org.apache.http.client.ClientProtocolException,
                                          java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getPriceToBuy

public java.lang.String getPriceToBuy()
                               throws org.apache.http.client.ClientProtocolException,
                                      java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getPriceToSell

public java.lang.String getPriceToSell()
                                throws org.apache.http.client.ClientProtocolException,
                                       java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getPricesSpotRate

public java.lang.String getPricesSpotRate()
                                   throws org.apache.http.client.ClientProtocolException,
                                          java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getPricesHistorical

public java.lang.String getPricesHistorical()
                                     throws org.apache.http.client.ClientProtocolException,
                                            java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getRecurringPayments

public java.lang.String getRecurringPayments()
                                      throws org.apache.http.client.ClientProtocolException,
                                             java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getIndividualRecurringPayment

public java.lang.String getIndividualRecurringPayment(java.lang.Integer paymentId)
                                               throws org.apache.http.client.ClientProtocolException,
                                                      java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getSubscribers

public java.lang.String getSubscribers()
                                throws org.apache.http.client.ClientProtocolException,
                                       java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getIndividualSubscriber

public java.lang.String getIndividualSubscriber(java.lang.Integer subscriberId)
                                         throws org.apache.http.client.ClientProtocolException,
                                                java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postTokens

public java.lang.String postTokens()
                            throws org.apache.http.client.ClientProtocolException,
                                   java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postTokensRedeem

public java.lang.String postTokensRedeem(TokenRequest tokenRequest)
                                  throws org.apache.http.client.ClientProtocolException,
                                         java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getRecentTransactions

public java.lang.String getRecentTransactions()
                                       throws org.apache.http.client.ClientProtocolException,
                                              java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getIndividualTransaction

public java.lang.String getIndividualTransaction(java.lang.String transactionId)
                                          throws org.apache.http.client.ClientProtocolException,
                                                 java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

sendMoney

public SendMoneyResponse sendMoney(TransactionRequest transactionSenderWrapper)
                            throws org.apache.http.client.ClientProtocolException,
                                   java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postTransactionsRequestMoney

public java.lang.String postTransactionsRequestMoney(TransactionFromRequest transactionFromRequest)
                                              throws org.apache.http.client.ClientProtocolException,
                                                     java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putTransactionsResendRequest

public java.lang.String putTransactionsResendRequest(java.lang.String transactionId)
                                              throws org.apache.http.client.ClientProtocolException,
                                                     java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

deleteTransactionsCancelRequest

public java.lang.String deleteTransactionsCancelRequest(java.lang.String transactionId)
                                                 throws org.apache.http.client.ClientProtocolException,
                                                        java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putTransactionsCompleteRequest

public java.lang.String putTransactionsCompleteRequest(java.lang.String transactionId)
                                                throws org.apache.http.client.ClientProtocolException,
                                                       java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getRecentBuysAndSells

public java.lang.String getRecentBuysAndSells()
                                       throws org.apache.http.client.ClientProtocolException,
                                              java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

postCreateUser

public java.lang.String postCreateUser(UserRequest userRequest)
                                throws org.apache.http.client.ClientProtocolException,
                                       java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getCurrentUser

public java.lang.String getCurrentUser()
                                throws org.apache.http.client.ClientProtocolException,
                                       java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putUserAccountSettings

public java.lang.String putUserAccountSettings(java.lang.String userId,
                                               UserRequest userRequest)
                                        throws org.apache.http.client.ClientProtocolException,
                                               java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

generateReceiveAddress

public java.lang.String generateReceiveAddress()
                                        throws org.apache.http.client.ClientProtocolException,
                                               java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

buy

public BuyResponse buy(BuyRequest buyRequest)
                throws org.apache.http.client.ClientProtocolException,
                       java.io.IOException
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

getOperationUrl

public java.lang.String getOperationUrl(java.lang.String operation)

httpGet

protected java.lang.String httpGet(java.lang.String operation)
                            throws java.io.IOException,
                                   org.apache.http.client.ClientProtocolException
Throws:
java.io.IOException
org.apache.http.client.ClientProtocolException

httpPost

protected java.lang.String httpPost(java.lang.String operation,
                                    java.lang.String payload)
                             throws java.io.IOException,
                                    org.apache.http.client.ClientProtocolException
Throws:
java.io.IOException
org.apache.http.client.ClientProtocolException

httpPut

protected java.lang.String httpPut(java.lang.String operation,
                                   java.lang.String payload)
                            throws java.io.IOException,
                                   org.apache.http.client.ClientProtocolException
Throws:
java.io.IOException
org.apache.http.client.ClientProtocolException

httpDelete

protected java.lang.String httpDelete(java.lang.String operation)
                               throws java.io.IOException,
                                      org.apache.http.client.ClientProtocolException
Throws:
java.io.IOException
org.apache.http.client.ClientProtocolException

checkResponseForAuthenticationError

protected void checkResponseForAuthenticationError(java.lang.String responseString)