Search in sources :

Example 1 with BinanceAccountService

use of org.knowm.xchange.binance.service.BinanceAccountService in project XChange by knowm.

the class BinanceExchangeIntegration method testSytemStatus.

@Test
public void testSytemStatus() throws IOException {
    assumeProduction();
    BinanceSystemStatus systemStatus = ((BinanceAccountService) exchange.getAccountService()).getSystemStatus();
    assertThat(systemStatus).isNotNull();
    assertThat(systemStatus.getStatus()).isNotEmpty();
}
Also used : BinanceSystemStatus(org.knowm.xchange.binance.dto.meta.BinanceSystemStatus) BinanceAccountService(org.knowm.xchange.binance.service.BinanceAccountService) Test(org.junit.Test)

Example 2 with BinanceAccountService

use of org.knowm.xchange.binance.service.BinanceAccountService in project XChange by knowm.

the class BinanceExchange method remoteInit.

@Override
public void remoteInit() {
    try {
        BinanceMarketDataService marketDataService = (BinanceMarketDataService) this.marketDataService;
        exchangeInfo = marketDataService.getExchangeInfo();
        BinanceAccountService accountService = (BinanceAccountService) getAccountService();
        Map<String, AssetDetail> assetDetailMap = null;
        if (!usingSandbox() && isAuthenticated()) {
            // not available in sndbox
            assetDetailMap = accountService.getAssetDetails();
        }
        postInit(assetDetailMap);
    } catch (Exception e) {
        throw new ExchangeException("Failed to initialize: " + e.getMessage(), e);
    }
}
Also used : AssetDetail(org.knowm.xchange.binance.dto.account.AssetDetail) BinanceMarketDataService(org.knowm.xchange.binance.service.BinanceMarketDataService) BinanceAccountService(org.knowm.xchange.binance.service.BinanceAccountService) ExchangeException(org.knowm.xchange.exceptions.ExchangeException) ExchangeException(org.knowm.xchange.exceptions.ExchangeException)

Example 3 with BinanceAccountService

use of org.knowm.xchange.binance.service.BinanceAccountService in project XChange by knowm.

the class BinanceExchange method initServices.

@Override
protected void initServices() {
    this.binance = ExchangeRestProxyBuilder.forInterface(BinanceAuthenticated.class, getExchangeSpecification()).build();
    this.timestampFactory = new BinanceTimestampFactory(binance, getExchangeSpecification().getResilience(), getResilienceRegistries());
    this.marketDataService = new BinanceMarketDataService(this, binance, getResilienceRegistries());
    this.tradeService = new BinanceTradeService(this, binance, getResilienceRegistries());
    this.accountService = new BinanceAccountService(this, binance, getResilienceRegistries());
}
Also used : BinanceTradeService(org.knowm.xchange.binance.service.BinanceTradeService) BinanceMarketDataService(org.knowm.xchange.binance.service.BinanceMarketDataService) BinanceAccountService(org.knowm.xchange.binance.service.BinanceAccountService)

Aggregations

BinanceAccountService (org.knowm.xchange.binance.service.BinanceAccountService)3 BinanceMarketDataService (org.knowm.xchange.binance.service.BinanceMarketDataService)2 Test (org.junit.Test)1 AssetDetail (org.knowm.xchange.binance.dto.account.AssetDetail)1 BinanceSystemStatus (org.knowm.xchange.binance.dto.meta.BinanceSystemStatus)1 BinanceTradeService (org.knowm.xchange.binance.service.BinanceTradeService)1 ExchangeException (org.knowm.xchange.exceptions.ExchangeException)1