Package org.knowm.xchange.coinbase.v2
Interface CoinbaseAuthenticated
- All Superinterfaces:
Coinbase
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
All API key requests must be signed and contain the following headers.static final String
static final String
static final String
Fields inherited from interface org.knowm.xchange.coinbase.v2.Coinbase
CB_VERSION, CB_VERSION_VALUE, LOG
-
Method Summary
Modifier and TypeMethodDescriptionbuy
(String contentType, String apiVersion, String apiKey, String signature, BigDecimal timestamp, String accountId, Object payload) createAccount
(String contentType, String apiVersion, String apiKey, String signature, BigDecimal timestamp, Object payload) getAccount
(String apiVersion, String apiKey, CoinbaseV2Digest signature, BigDecimal timestamp, String currency) getAccounts
(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, Integer limit, String starting_after) getBuys
(String apiVersion, String apiKey, CoinbaseV2Digest signature, BigDecimal timestamp, String accountId, Integer limit, String startingAfter) getDeposits
(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, String accountId) getPaymentMethods
(String apiVersion, String apiKey, CoinbaseV2Digest signature, BigDecimal timestamp) getSells
(String apiVersion, String apiKey, CoinbaseV2Digest signature, BigDecimal timestamp, String accountId, Integer limit, String startingAfter) getTransactions
(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, String accountId) getWithdrawals
(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, String accountId) sell
(String contentType, String apiVersion, String apiKey, String signature, BigDecimal timestamp, String accountId, Object payload) Methods inherited from interface org.knowm.xchange.coinbase.v2.Coinbase
getBuyPrice, getCurrencies, getCurrencyExchangeRates, getHistoricalSpotRate, getSellPrice, getSpotRate, getTime
-
Field Details
-
CB_ACCESS_KEY
All API key requests must be signed and contain the following headers.All request bodies should have content type application/json and be valid JSON.
The CB-ACCESS-SIGN header is generated by creating a sha256 HMAC using the secret key on the prehash string timestamp + method + requestPath + body (where + represents string concatenation). The timestamp value is the same as the CB-ACCESS-TIMESTAMP header.
The body is the request body string or omitted if there is no request body (typically for GET requests).
The method should be UPPER CASE.
- See Also:
-
CB_ACCESS_SIGN
- See Also:
-
CB_ACCESS_TIMESTAMP
- See Also:
-
CONTENT_TYPE
- See Also:
-
-
Method Details
-
getTransactions
@GET @Path("accounts/{accountId}/transactions") CoinbaseTransactionsResponse getTransactions(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") si.mazi.rescu.ParamsDigest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("accountId") String accountId) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getBuys
@GET @Path("accounts/{accountId}/buys") CoinbaseBuySellResponse getBuys(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") CoinbaseV2Digest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("accountId") String accountId, @QueryParam("limit") Integer limit, @QueryParam("starting_after") String startingAfter) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getSells
@GET @Path("accounts/{accountId}/sells") CoinbaseBuySellResponse getSells(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") CoinbaseV2Digest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("accountId") String accountId, @QueryParam("limit") Integer limit, @QueryParam("starting_after") String startingAfter) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getDeposits
@GET @Path("accounts/{accountId}/deposits") Map getDeposits(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") si.mazi.rescu.ParamsDigest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("accountId") String accountId) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getWithdrawals
@GET @Path("accounts/{accountId}/withdrawals") Map getWithdrawals(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") si.mazi.rescu.ParamsDigest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("accountId") String accountId) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getAccounts
@GET @Path("accounts") CoinbaseAccountsData getAccounts(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") si.mazi.rescu.ParamsDigest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @QueryParam("limit") Integer limit, @QueryParam("starting_after") String starting_after) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getAccount
@GET @Path("accounts/{currency}") CoinbaseAccountData getAccount(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") CoinbaseV2Digest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("currency") String currency) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
createAccount
@POST @Path("accounts") @Consumes("application/json") CoinbaseAccountData createAccount(@HeaderParam("Content-Type") String contentType, @HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") String signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, Object payload) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
getPaymentMethods
@GET @Path("payment-methods") CoinbasePaymentMethodsData getPaymentMethods(@HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") CoinbaseV2Digest signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
buy
@POST @Path("accounts/{account}/buys") @Consumes("application/json") CoinbaseBuyData buy(@HeaderParam("Content-Type") String contentType, @HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") String signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("account") String accountId, Object payload) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-
sell
@POST @Path("accounts/{account}/sells") @Consumes("application/json") CoinbaseSellData sell(@HeaderParam("Content-Type") String contentType, @HeaderParam("CB-VERSION") String apiVersion, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") String signature, @HeaderParam("CB-ACCESS-TIMESTAMP") BigDecimal timestamp, @PathParam("account") String accountId, Object payload) throws IOException, CoinbaseException - Throws:
IOException
CoinbaseException
-