Skip to content

Commit

Permalink
Sync changes from 1.6 to master
Browse files Browse the repository at this point in the history
  • Loading branch information
filipocelka authored Sep 3, 2024
2 parents 206a0b2 + 85e149d commit 7548818
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# buildscript - project id
projectGroup=com.generalbytes.batm.public
projectVersion=1.7.2
projectVersion=1.7.3

# buildscript - common dependency versions
bitrafaelVersion=1.0.44
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
Expand Down Expand Up @@ -264,13 +265,17 @@ private String getMethodIdForCurrency(String currency, String payamentMethodName
@Override
public String sendCoins(String destinationAddress, BigDecimal amount, String cryptoCurrency, String description) {
try {
if (CryptoCurrency.USDT.getCode().equals(cryptoCurrency) || CryptoCurrency.ADA.getCode().equals(cryptoCurrency)) {
amount = amount.setScale(6, RoundingMode.FLOOR);
}
String coinBaseTime = getTime();
CBSendCoinsRequest sendCoinsRequest = new CBSendCoinsRequest();
sendCoinsRequest.to = destinationAddress;
sendCoinsRequest.amount = amount.toPlainString();
sendCoinsRequest.currency = cryptoCurrency.toUpperCase();
sendCoinsRequest.description = description;
RateLimiter.waitForPossibleCall(getClass());
log.info("sending {} {} to {}", amount, cryptoCurrency, destinationAddress);
CBSendCoinsResponse sendCoinsResponse = api.sendCoins(CB_VERSION, apiKey, CoinbaseDigest.createInstance(secretKey), coinBaseTime, getAccountId(accountName, cryptoCurrency), sendCoinsRequest);
if (sendCoinsResponse.errors == null) {
return sendCoinsResponse.data.id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public String sendCoins(String destinationAddress, BigDecimal amount, String cry
destinationTag = addressParts[1];
}
}
if (CryptoCurrency.USDT.getCode().equals(cryptoCurrency)) {
if (CryptoCurrency.USDT.getCode().equals(cryptoCurrency) || CryptoCurrency.ADA.getCode().equals(cryptoCurrency)) {
amount = amount.setScale(6, RoundingMode.FLOOR);
}
log.info("sending {} {} to {}", amount, cryptoCurrency, destinationAddress);
Expand Down

0 comments on commit 7548818

Please sign in to comment.