Skip to content

Commit

Permalink
add buyQuick and sellQuick methods
Browse files Browse the repository at this point in the history
  • Loading branch information
stachon committed Jun 9, 2022
1 parent 5367860 commit b9a4f05
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,30 @@ CoinmateTradeResponse sellInstant(
@FormParam("currencyPair") String currencyPair)
throws IOException;

@POST
@Path("buyQuick")
CoinmateTradeResponse buyQuick(
@FormParam("publicKey") String publicKey,
@FormParam("clientId") String clientId,
@FormParam("clientOrderId") String clientOrderId,
@FormParam("signature") ParamsDigest signer,
@FormParam("nonce") SynchronizedValueFactory<Long> nonce,
@FormParam("total") BigDecimal total,
@FormParam("currencyPair") String currencyPair)
throws IOException;

@POST
@Path("sellQuick")
CoinmateTradeResponse sellQuick(
@FormParam("publicKey") String publicKey,
@FormParam("clientId") String clientId,
@FormParam("clientOrderId") String clientOrderId,
@FormParam("signature") ParamsDigest signer,
@FormParam("nonce") SynchronizedValueFactory<Long> nonce,
@FormParam("amount") BigDecimal amount,
@FormParam("currencyPair") String currencyPair)
throws IOException;

// withdrawal and deposits
// bitcoin
@POST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,40 @@ public CoinmateTradeResponse sellCoinmateInstant(BigDecimal total, String curren
return response;
}

public CoinmateTradeResponse buyCoinmateQuick(BigDecimal total, String currencyPair, String clientOrderId)
throws IOException {
CoinmateTradeResponse response =
coinmateAuthenticated.buyQuick(
exchange.getExchangeSpecification().getApiKey(),
exchange.getExchangeSpecification().getUserName(),
clientOrderId,
signatureCreator,
exchange.getNonceFactory(),
total,
currencyPair);

throwExceptionIfError(response);

return response;
}

public CoinmateTradeResponse sellCoinmateQuick(BigDecimal amount, String currencyPair, String clientOrderId)
throws IOException {
CoinmateTradeResponse response =
coinmateAuthenticated.sellQuick(
exchange.getExchangeSpecification().getApiKey(),
exchange.getExchangeSpecification().getUserName(),
clientOrderId,
signatureCreator,
exchange.getNonceFactory(),
amount,
currencyPair);

throwExceptionIfError(response);

return response;
}

public CoinmateReplaceResponse coinmateReplaceByBuyInstant(
String orderId, BigDecimal total, String currencyPair) throws IOException {
CoinmateReplaceResponse response =
Expand Down

0 comments on commit b9a4f05

Please sign in to comment.