Class AccountService
java.lang.Object
com.github.badpop.jcoinbase.service.account.AccountService
public class AccountService
extends java.lang.Object
This service allows you to request coinbase accounts data. To properly use this service,
you must provide an API Key and an API secret when building a JCoinbaseClient instance.
-
Constructor Summary
Constructors Constructor Description AccountService()
-
Method Summary
Modifier and Type Method Description CallResult<io.vavr.collection.Seq<CoinbaseError>,Account>
getAccount(java.lang.String id)
Get an account by its idCallResult<java.util.List<CoinbaseError>,Account>
getAccountAsJava(java.lang.String id)
Get an account by its idCallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage>
getAccountsPage()
Get the first accounts pageCallResult<java.util.List<CoinbaseError>,AccountsPage>
getAccountsPageAsJava()
Get the first accounts pageCallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage>
getNextAccountsPage(Pagination pagination)
Get the next accounts pageCallResult<java.util.List<CoinbaseError>,AccountsPage>
getNextAccountsPageAsJava(Pagination pagination)
Get the next accounts pageCallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage>
getPreviousAccountsPage(Pagination pagination)
Get the previous accounts pageCallResult<java.util.List<CoinbaseError>,AccountsPage>
getPreviousAccountsPageAsJava(Pagination pagination)
Get the previous accounts pageCallResult<io.vavr.collection.Seq<CoinbaseError>,Account>
updateAccount(java.lang.String id, UpdateAccountRequest request)
Update an account by its idCallResult<java.util.List<CoinbaseError>,Account>
updateAccountAsJava(java.lang.String id, UpdateAccountRequest request)
Update an account by its idMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AccountService
public AccountService()
-
-
Method Details
-
getAccountsPageAsJava
Get the first accounts page- Returns:
- a
CallResult
containing anAccountsPage
object if it's ok, a List ofCoinbaseError
otherwise. - Throws:
JCoinbaseException
- on unknown errors
-
getAccountsPage
Get the first accounts page- Returns:
- a
CallResult
containing anAccountsPage
object if it's ok, a Seq ofCoinbaseError
otherwise. - Throws:
JCoinbaseException
- on unknown errors
-
getNextAccountsPageAsJava
public CallResult<java.util.List<CoinbaseError>,AccountsPage> getNextAccountsPageAsJava(Pagination pagination)Get the next accounts page- Parameters:
pagination
- a pagination object that will allow JCoinbase to request the next accounts page- Returns:
- a
CallResult
containing anAccountsPage
object if it's ok, a List ofCoinbaseError
otherwise. - Throws:
java.lang.NullPointerException
- if the pagination is nullNoNextPageException
- if there is no next pageJCoinbaseException
- on unknown errors
-
getNextAccountsPage
public CallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage> getNextAccountsPage(Pagination pagination)Get the next accounts page- Parameters:
pagination
- a pagination object that will allow JCoinbase to request the next accounts page- Returns:
- a
CallResult
containing anAccountsPage
object if it's ok, a Seq ofCoinbaseError
otherwise. - Throws:
java.lang.NullPointerException
- if the pagination is nullNoNextPageException
- if there is no next pageJCoinbaseException
- on unknown errors
-
getPreviousAccountsPageAsJava
public CallResult<java.util.List<CoinbaseError>,AccountsPage> getPreviousAccountsPageAsJava(Pagination pagination)Get the previous accounts page- Parameters:
pagination
- a pagination object that will allow JCoinbase to request the next accounts page- Returns:
- a
CallResult
containing anAccountsPage
object if it's ok, a List ofCoinbaseError
otherwise. - Throws:
java.lang.NullPointerException
- if the pagination is nullNoPreviousPageException
- if there is no previous pageJCoinbaseException
- on unknown errors
-
getPreviousAccountsPage
public CallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage> getPreviousAccountsPage(Pagination pagination)Get the previous accounts page- Parameters:
pagination
- a pagination object that will allow JCoinbase to request the next accounts page- Returns:
- a
CallResult
containing anAccountsPage
object if it's ok, a Seq ofCoinbaseError
otherwise. - Throws:
java.lang.NullPointerException
- if the pagination is nullNoPreviousPageException
- if there is no previous pageJCoinbaseException
- on unknown errors
-
getAccountAsJava
Get an account by its id- Parameters:
id
- the account's id- Returns:
- a
CallResult
containing anAccount
object if it's ok, a List ofCoinbaseError
otherwise. - Throws:
InvalidRequestException
- if the given id is not validJCoinbaseException
- on unknown errors
-
getAccount
Get an account by its id- Parameters:
id
- the account's id- Returns:
- a
CallResult
containing anAccount
object if it's ok, a Seq ofCoinbaseError
otherwise. - Throws:
InvalidRequestException
- if the given id is not validJCoinbaseException
- on unknown errors
-
updateAccountAsJava
public CallResult<java.util.List<CoinbaseError>,Account> updateAccountAsJava(java.lang.String id, UpdateAccountRequest request)Update an account by its id- Parameters:
id
- the account's idrequest
- a validUpdateAccountRequest
containing the changes you want to apply on this account- Returns:
- a
CallResult
containing the updatedAccount
if it's ok, a List ofCoinbaseError
otherwise. - Throws:
java.lang.NullPointerException
- if the given request is nullInvalidRequestException
- if the given id is not validJCoinbaseException
- on unknown errors
-
updateAccount
public CallResult<io.vavr.collection.Seq<CoinbaseError>,Account> updateAccount(java.lang.String id, UpdateAccountRequest request)Update an account by its id- Parameters:
id
- the account's idrequest
- a validUpdateAccountRequest
containing the changes you want to apply on this account- Returns:
- a
CallResult
containing the updatedAccount
if it's ok, a Seq ofCoinbaseError
otherwise. - Throws:
java.lang.NullPointerException
- if the given request is nullInvalidRequestException
- if the given id is not validJCoinbaseException
- on unknown errors
-