Package org.knowm.xchange.coinbase.v2
Interface CoinbaseAuthenticated
-
-
Field Summary
Fields Modifier and Type Field Description static StringCB_ACCESS_KEYAll API key requests must be signed and contain the following headers.static StringCB_ACCESS_SIGNstatic StringCB_ACCESS_TIMESTAMPstatic StringCONTENT_TYPE-
Fields inherited from interface org.knowm.xchange.coinbase.v2.Coinbase
CB_VERSION, CB_VERSION_VALUE, LOG
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CoinbaseBuyDatabuy(String contentType, String apiVersion, String apiKey, String signature, BigDecimal timestamp, String accountId, Object payload)CoinbaseAccountDatacreateAccount(String contentType, String apiVersion, String apiKey, String signature, BigDecimal timestamp, Object payload)CoinbaseAccountDatagetAccount(String apiVersion, String apiKey, CoinbaseV2Digest signature, BigDecimal timestamp, String currency)CoinbaseAccountsDatagetAccounts(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp)MapgetDeposits(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, String accountId)CoinbasePaymentMethodsDatagetPaymentMethods(String apiVersion, String apiKey, CoinbaseV2Digest signature, BigDecimal timestamp)MapgetTransactions(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, String accountId)MapgetWithdrawals(String apiVersion, String apiKey, si.mazi.rescu.ParamsDigest signature, BigDecimal timestamp, String accountId)CoinbaseSellDatasell(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 Detail
-
CB_ACCESS_KEY
static final String 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:
- Constant Field Values
-
CB_ACCESS_SIGN
static final String CB_ACCESS_SIGN
- See Also:
- Constant Field Values
-
CB_ACCESS_TIMESTAMP
static final String CB_ACCESS_TIMESTAMP
- See Also:
- Constant Field Values
-
CONTENT_TYPE
static final String CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTransactions
@GET @Path("accounts/{accountId}/transactions") Map 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:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
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) throws IOException, CoinbaseException- Throws:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
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:
IOExceptionCoinbaseException
-
-