use of io.everytrade.server.plugin.api.connector.DownloadResult in project everytrade-plugins by everytrade-io.
the class BlockchainDownloaderTest method btcBuySellWithFeesTest.
@Test
void btcBuySellWithFeesTest() {
List<TxInfo> txs = List.of(depositOnAddress(ADDRESS, 1_000_000), withdrawalFromAddress(ADDRESS, 100_000));
var blockchainDownloader = new BlockchainDownloader(mockClient(txs), null, 0, emptySet(), FIAT, BTC, true, true, true, true);
DownloadResult result = blockchainDownloader.download(ADDRESS);
var buyCluster = findOneCluster(result, BUY);
assertBuySell(buyCluster, BUY, new BigDecimal("0.009999"));
assertFees(buyCluster);
var sellCluster = findOneCluster(result, SELL);
assertBuySell(sellCluster, SELL, new BigDecimal("0.000999"));
assertFees(sellCluster);
}
use of io.everytrade.server.plugin.api.connector.DownloadResult in project everytrade-plugins by everytrade-io.
the class BlockchainDownloaderTest method btcDepositWithdrawalWithoutFeesTest.
@Test
void btcDepositWithdrawalWithoutFeesTest() {
List<TxInfo> txs = List.of(depositOnAddress(ADDRESS, 1_000_000), withdrawalFromAddress(ADDRESS, 100_000));
var blockchainDownloader = new BlockchainDownloader(mockClient(txs), null, 0, emptySet(), FIAT, BTC, false, false, false, false);
DownloadResult result = blockchainDownloader.download(ADDRESS);
var depositCluster = findOneCluster(result, DEPOSIT);
assertEquals(0, depositCluster.getRelated().size());
assertDepositWithdrawal(depositCluster, DEPOSIT, new BigDecimal("0.009999"));
var withdrawalCluster = findOneCluster(result, WITHDRAWAL);
assertEquals(0, withdrawalCluster.getRelated().size());
assertDepositWithdrawal(withdrawalCluster, WITHDRAWAL, new BigDecimal("0.000999"));
}
use of io.everytrade.server.plugin.api.connector.DownloadResult in project everytrade-plugins by everytrade-io.
the class BlockchainDownloaderTest method btcDepositWithdrawalWithFeesTest.
@Test
void btcDepositWithdrawalWithFeesTest() {
List<TxInfo> txs = List.of(depositOnAddress(ADDRESS, 1_000_000), withdrawalFromAddress(ADDRESS, 100_000));
var blockchainDownloader = new BlockchainDownloader(mockClient(txs), null, 0, emptySet(), FIAT, BTC, false, false, true, true);
DownloadResult result = blockchainDownloader.download(ADDRESS);
var depositCluster = findOneCluster(result, DEPOSIT);
assertEquals(0, depositCluster.getRelated().size());
assertDepositWithdrawal(depositCluster, DEPOSIT, new BigDecimal("0.009999"));
var withdrawalCluster = findOneCluster(result, WITHDRAWAL);
assertEquals(0, withdrawalCluster.getRelated().size());
assertDepositWithdrawal(withdrawalCluster, WITHDRAWAL, new BigDecimal("0.000999"));
}
use of io.everytrade.server.plugin.api.connector.DownloadResult in project everytrade-plugins by everytrade-io.
the class BlockchainEthDownloaderTest method ethBuySellWithoutFeesTest.
@Test
void ethBuySellWithoutFeesTest() throws Exception {
var txs = List.of(depositOnAddress(ADDRESS, ONE_ETH.multiply(TEN)), withdrawFromAddress(ADDRESS, ONE_ETH));
var downloader = new BlockchainEthDownloader(ADDRESS, "apiKey", FIAT, true, true, false, false, mockClient(txs, emptyList()));
DownloadResult result = downloader.download(null);
var buyCluster = findOneCluster(result, BUY);
assertEquals(0, buyCluster.getRelated().size());
assertBuySell(buyCluster, BUY, TEN);
var sellCluster = findOneCluster(result, SELL);
assertEquals(0, sellCluster.getRelated().size());
assertBuySell(sellCluster, SELL, ONE);
}
use of io.everytrade.server.plugin.api.connector.DownloadResult in project everytrade-plugins by everytrade-io.
the class CoinbaseConnector method getTransactions.
@Override
public DownloadResult getTransactions(String lastTransactionId) {
CoinbaseDownloader coinbaseDownloader = new CoinbaseDownloader(exchange);
DownloadResult download = coinbaseDownloader.download(lastTransactionId);
return download;
}
Aggregations