
org.knowm.xchange.binance.dto.account.BinanceBalance Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-binance Show documentation
Show all versions of xchange-binance Show documentation
Development fork. Not for general use.
The newest version!
package org.knowm.xchange.binance.dto.account;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import org.knowm.xchange.currency.Currency;
public final class BinanceBalance {
private final Currency currency;
private final BigDecimal free;
private final BigDecimal locked;
public BinanceBalance(
@JsonProperty("asset") String asset,
@JsonProperty("free") BigDecimal free,
@JsonProperty("locked") BigDecimal locked) {
this.currency = Currency.getInstance(asset);
this.locked = locked;
this.free = free;
}
public Currency getCurrency() {
return currency;
}
public BigDecimal getTotal() {
return free.add(locked);
}
public BigDecimal getAvailable() {
return free;
}
public BigDecimal getLocked() {
return locked;
}
public String toString() {
return "[" + currency + ", free=" + free + ", locked=" + locked + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy