From 14a03f30270046e7da05a9541f8a5be42a1f6e06 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Mon, 30 May 2022 21:38:28 -0500 Subject: [PATCH] Upgrade XChange 5.0.13, remove BitBay CoinPaprika add CoinbasePro. Co-Authored-by: jmacxx <47253594+jmacxx@users.noreply.github.com> --- build.gradle | 3 +- gradle/verification-metadata.xml | 311 ++++++++++++++++++ .../{Bitbay.java => CoinbasePro.java} | 20 +- .../bisq/price/spot/providers/BitbayTest.java | 36 -- ...npaprikaTest.java => CoinbaseProTest.java} | 4 +- 5 files changed, 327 insertions(+), 47 deletions(-) rename pricenode/src/main/java/bisq/price/spot/providers/{Bitbay.java => CoinbasePro.java} (68%) delete mode 100644 pricenode/src/test/java/bisq/price/spot/providers/BitbayTest.java rename pricenode/src/test/java/bisq/price/spot/providers/{CoinpaprikaTest.java => CoinbaseProTest.java} (88%) diff --git a/build.gradle b/build.gradle index e4ee5a731f..3d19f8621d 100644 --- a/build.gradle +++ b/build.gradle @@ -61,7 +61,7 @@ configure(subprojects) { junitVersion = '4.12' jupiterVersion = '5.7.0' kotlinVersion = '1.3.41' - knowmXchangeVersion = '4.4.2' + knowmXchangeVersion = '5.0.13' langVersion = '3.11' logbackVersion = '1.1.11' loggingVersion = '1.2' @@ -524,6 +524,7 @@ configure(project(':pricenode')) { implementation("org.knowm.xchange:xchange-bitstamp:$knowmXchangeVersion") implementation("org.knowm.xchange:xchange-btcmarkets:$knowmXchangeVersion") implementation("org.knowm.xchange:xchange-cexio:$knowmXchangeVersion") + implementation("org.knowm.xchange:xchange-coinbasepro:$knowmXchangeVersion") implementation("org.knowm.xchange:xchange-coinmarketcap:$knowmXchangeVersion") implementation("org.knowm.xchange:xchange-coinmate:$knowmXchangeVersion") implementation("org.knowm.xchange:xchange-coinone:$knowmXchangeVersion") diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 45a6535055..0d18c76ed1 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -46,6 +46,14 @@ + + + + + + + + @@ -411,6 +419,14 @@ + + + + + + + + @@ -837,6 +853,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1038,11 +1118,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1061,6 +1170,14 @@ + + + + + + + + @@ -1247,6 +1364,14 @@ + + + + + + + + @@ -1729,6 +1854,11 @@ + + + + + @@ -1777,6 +1907,14 @@ + + + + + + + + @@ -1785,6 +1923,14 @@ + + + + + + + + @@ -1793,6 +1939,14 @@ + + + + + + + + @@ -1801,6 +1955,14 @@ + + + + + + + + @@ -1809,6 +1971,14 @@ + + + + + + + + @@ -1817,6 +1987,14 @@ + + + + + + + + @@ -1825,6 +2003,22 @@ + + + + + + + + + + + + + + + + @@ -1833,6 +2027,14 @@ + + + + + + + + @@ -1841,6 +2043,14 @@ + + + + + + + + @@ -1849,6 +2059,14 @@ + + + + + + + + @@ -1857,6 +2075,14 @@ + + + + + + + + @@ -1865,6 +2091,14 @@ + + + + + + + + @@ -1873,6 +2107,14 @@ + + + + + + + + @@ -1881,6 +2123,14 @@ + + + + + + + + @@ -1889,6 +2139,14 @@ + + + + + + + + @@ -1897,6 +2155,14 @@ + + + + + + + + @@ -1905,6 +2171,14 @@ + + + + + + + + @@ -1913,11 +2187,24 @@ + + + + + + + + + + + + + @@ -1926,6 +2213,14 @@ + + + + + + + + @@ -1934,6 +2229,14 @@ + + + + + + + + @@ -1942,6 +2245,14 @@ + + + + + + + + diff --git a/pricenode/src/main/java/bisq/price/spot/providers/Bitbay.java b/pricenode/src/main/java/bisq/price/spot/providers/CoinbasePro.java similarity index 68% rename from pricenode/src/main/java/bisq/price/spot/providers/Bitbay.java rename to pricenode/src/main/java/bisq/price/spot/providers/CoinbasePro.java index 552b0f737a..bf6781b3fe 100644 --- a/pricenode/src/main/java/bisq/price/spot/providers/Bitbay.java +++ b/pricenode/src/main/java/bisq/price/spot/providers/CoinbasePro.java @@ -14,13 +14,12 @@ * You should have received a copy of the GNU Affero General Public License * along with Haveno. If not, see . */ - package bisq.price.spot.providers; import bisq.price.spot.ExchangeRate; import bisq.price.spot.ExchangeRateProvider; -import org.knowm.xchange.bitbay.BitbayExchange; +import org.knowm.xchange.coinbasepro.CoinbaseProExchange; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -30,16 +29,21 @@ import java.time.Duration; import java.util.Set; @Component -class Bitbay extends ExchangeRateProvider { +class CoinbasePro extends ExchangeRateProvider { - public Bitbay(Environment env) { - super(env, "BITBAY", "bitbay", Duration.ofMinutes(1)); + public CoinbasePro(Environment env) { + super(env, "COINBASEPRO", "coinbasepro", Duration.ofMinutes(1)); } @Override public Set doGet() { - // Supported fiat: EUR, GBP, PLN, USD - // Supported alts: DASH, ETH, LTC - return doGet(BitbayExchange.class); + // Supported fiat: EUR, USD, GBP + // Supported alts: DASH, DOGE, ETC, ETH, LTC, ZEC, ZEN + return doGet(CoinbaseProExchange.class); + } + + @Override + protected boolean requiresFilterDuringBulkTickerRetrieval() { + return true; } } diff --git a/pricenode/src/test/java/bisq/price/spot/providers/BitbayTest.java b/pricenode/src/test/java/bisq/price/spot/providers/BitbayTest.java deleted file mode 100644 index 5d2a7b3d98..0000000000 --- a/pricenode/src/test/java/bisq/price/spot/providers/BitbayTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of Haveno. - * - * Haveno is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Haveno is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Haveno. If not, see . - */ - -package bisq.price.spot.providers; - -import bisq.price.AbstractExchangeRateProviderTest; - -import org.springframework.core.env.StandardEnvironment; - -import lombok.extern.slf4j.Slf4j; - -import org.junit.jupiter.api.Test; - -@Slf4j -public class BitbayTest extends AbstractExchangeRateProviderTest { - - @Test - public void doGet_successfulCall() { - doGet_successfulCall(new Bitbay(new StandardEnvironment())); - } - -} diff --git a/pricenode/src/test/java/bisq/price/spot/providers/CoinpaprikaTest.java b/pricenode/src/test/java/bisq/price/spot/providers/CoinbaseProTest.java similarity index 88% rename from pricenode/src/test/java/bisq/price/spot/providers/CoinpaprikaTest.java rename to pricenode/src/test/java/bisq/price/spot/providers/CoinbaseProTest.java index 3262e5fdf8..4214c6700e 100644 --- a/pricenode/src/test/java/bisq/price/spot/providers/CoinpaprikaTest.java +++ b/pricenode/src/test/java/bisq/price/spot/providers/CoinbaseProTest.java @@ -26,11 +26,11 @@ import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; @Slf4j -public class CoinpaprikaTest extends AbstractExchangeRateProviderTest { +public class CoinbaseProTest extends AbstractExchangeRateProviderTest { @Test public void doGet_successfulCall() { - doGet_successfulCall(new Coinpaprika(new StandardEnvironment())); + doGet_successfulCall(new CoinbasePro(new StandardEnvironment())); } }