diff --git a/build.gradle b/build.gradle index 786822d401..1a5e2ef66c 100644 --- a/build.gradle +++ b/build.gradle @@ -480,6 +480,7 @@ configure(project(':pricenode')) { compile("org.knowm.xchange:xchange-coinmarketcap:$knowmXchangeVersion") compile("org.knowm.xchange:xchange-coinone:$knowmXchangeVersion") compile("org.knowm.xchange:xchange-exmo:$knowmXchangeVersion") + compile("org.knowm.xchange:xchange-hitbtc:$knowmXchangeVersion") compile("org.knowm.xchange:xchange-huobi:$knowmXchangeVersion") compile("org.knowm.xchange:xchange-independentreserve:$knowmXchangeVersion") compile("org.knowm.xchange:xchange-kraken:$knowmXchangeVersion") diff --git a/pricenode/src/main/java/bisq/price/spot/providers/Hitbtc.java b/pricenode/src/main/java/bisq/price/spot/providers/Hitbtc.java new file mode 100644 index 0000000000..68e584f066 --- /dev/null +++ b/pricenode/src/main/java/bisq/price/spot/providers/Hitbtc.java @@ -0,0 +1,44 @@ +/* + * This file is part of Bisq. + * + * Bisq 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. + * + * Bisq 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 Bisq. If not, see . + */ + +package bisq.price.spot.providers; + +import bisq.price.spot.ExchangeRate; +import bisq.price.spot.ExchangeRateProvider; + +import org.knowm.xchange.hitbtc.v2.HitbtcExchange; + +import org.springframework.stereotype.Component; + +import java.time.Duration; + +import java.util.Set; + +@Component +class Hitbtc extends ExchangeRateProvider { + + public Hitbtc() { super("HITBTC", "hitbtc", Duration.ofMinutes(1)); } + + @Override + public Set doGet() { + // Supported fiat: USD + // Supported alts: AEON, BTM, DASH, DCR, DOGE, EMC, ETC, ETH, GRIN, LTC, NAV, + // PART, XMR, XRC, XZC, ZEC, ZEN + return doGet(HitbtcExchange.class); + } + +} diff --git a/pricenode/src/test/java/bisq/price/spot/providers/HitbtcTest.java b/pricenode/src/test/java/bisq/price/spot/providers/HitbtcTest.java new file mode 100644 index 0000000000..0d70e42722 --- /dev/null +++ b/pricenode/src/test/java/bisq/price/spot/providers/HitbtcTest.java @@ -0,0 +1,34 @@ +/* + * This file is part of Bisq. + * + * Bisq 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. + * + * Bisq 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 Bisq. If not, see . + */ + +package bisq.price.spot.providers; + +import bisq.price.AbstractExchangeRateProviderTest; + +import lombok.extern.slf4j.Slf4j; + +import org.junit.jupiter.api.Test; + +@Slf4j +public class HitbtcTest extends AbstractExchangeRateProviderTest { + + @Test + public void doGet_successfulCall() { + doGet_successfulCall(new Hitbtc()); + } + +}