-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the data API to v3 and parameterize currencies in service calls
- Loading branch information
1 parent
ec3adeb
commit 8974f6c
Showing
7 changed files
with
120 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...t/java/org/knowm/xchange/mercadobitcoin/service/marketdata/OrderBookFetchIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.knowm.xchange.mercadobitcoin.service.marketdata; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.Test; | ||
import org.knowm.xchange.Exchange; | ||
import org.knowm.xchange.ExchangeFactory; | ||
import org.knowm.xchange.currency.CurrencyPair; | ||
import org.knowm.xchange.dto.marketdata.OrderBook; | ||
import org.knowm.xchange.mercadobitcoin.MercadoBitcoinExchange; | ||
import org.knowm.xchange.mercadobitcoin.MercadoBitcoinUtils; | ||
import org.knowm.xchange.service.marketdata.MarketDataService; | ||
|
||
public class OrderBookFetchIntegration { | ||
|
||
@Test | ||
public void orderbookFetchTest() throws Exception { | ||
|
||
Exchange exchange = | ||
ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class.getName()); | ||
MarketDataService marketDataService = exchange.getMarketDataService(); | ||
|
||
OrderBook orderBook; | ||
for (CurrencyPair pair : MercadoBitcoinUtils.availablePairs) { | ||
orderBook = marketDataService.getOrderBook(pair); | ||
System.out.println(orderBook.toString()); | ||
assertThat(orderBook).isNotNull(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...test/java/org/knowm/xchange/mercadobitcoin/service/marketdata/TradesFetchIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.knowm.xchange.mercadobitcoin.service.marketdata; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.Test; | ||
import org.knowm.xchange.Exchange; | ||
import org.knowm.xchange.ExchangeFactory; | ||
import org.knowm.xchange.currency.CurrencyPair; | ||
import org.knowm.xchange.dto.marketdata.Trades; | ||
import org.knowm.xchange.mercadobitcoin.MercadoBitcoinExchange; | ||
import org.knowm.xchange.mercadobitcoin.MercadoBitcoinUtils; | ||
import org.knowm.xchange.service.marketdata.MarketDataService; | ||
|
||
public class TradesFetchIntegration { | ||
|
||
@Test | ||
public void orderbookFetchTest() throws Exception { | ||
|
||
Exchange exchange = | ||
ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class.getName()); | ||
MarketDataService marketDataService = exchange.getMarketDataService(); | ||
|
||
Trades trades; | ||
|
||
for (CurrencyPair pair : MercadoBitcoinUtils.availablePairs) { | ||
trades = marketDataService.getTrades(pair); | ||
System.out.println(trades.toString()); | ||
assertThat(trades).isNotNull(); | ||
} | ||
} | ||
} |