diff --git a/gradle.properties b/gradle.properties index d0f763eb2..3528fdfc5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/exchanges/coinbase/CoinbaseExchange.java b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/exchanges/coinbase/CoinbaseExchange.java index c689a580c..461a27f2e 100644 --- a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/exchanges/coinbase/CoinbaseExchange.java +++ b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/exchanges/coinbase/CoinbaseExchange.java @@ -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; @@ -264,6 +265,9 @@ 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; @@ -271,6 +275,7 @@ public String sendCoins(String destinationAddress, BigDecimal amount, String cry 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; diff --git a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/wallets/coinbase/v2/CoinbaseWalletV2.java b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/wallets/coinbase/v2/CoinbaseWalletV2.java index a41f4c6c4..3c2f5abaf 100644 --- a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/wallets/coinbase/v2/CoinbaseWalletV2.java +++ b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/bitcoin/wallets/coinbase/v2/CoinbaseWalletV2.java @@ -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);