
org.knowm.xchange.simulated.SimulatedAccountService Maven / Gradle / Ivy
package org.knowm.xchange.simulated;
import java.io.IOException;
import java.math.BigDecimal;
import org.knowm.xchange.currency.Currency;
import org.knowm.xchange.dto.account.AccountInfo;
import org.knowm.xchange.dto.account.Wallet;
import org.knowm.xchange.service.BaseExchangeService;
import org.knowm.xchange.service.account.AccountService;
public class SimulatedAccountService extends BaseExchangeService
implements AccountService {
protected SimulatedAccountService(SimulatedExchange exchange) {
super(exchange);
}
@Override
public AccountInfo getAccountInfo() throws IOException {
exchange.maybeThrow();
return new AccountInfo(new Wallet(exchange.getAccount().balances()));
}
public void deposit(Currency currency, BigDecimal amount) {
exchange.getAccount().deposit(currency, amount);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy