All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.poloniex.dto.trade.PoloniexAccountBalance Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package org.knowm.xchange.poloniex.dto.trade;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Map;

public class PoloniexAccountBalance {

  private final Map exchange;
  private final Map margin;
  private final Map lending;

  public PoloniexAccountBalance(
      @JsonProperty("exchange") Map exchange,
      @JsonProperty("margin") Map margin,
      @JsonProperty("lending") Map lending) {
    this.exchange = exchange;
    this.margin = margin;
    this.lending = lending;
  }

  public Map getExchangeBalance() {
    return exchange != null ? Collections.unmodifiableMap(exchange) : Collections.emptyMap();
  }

  public Map getMarginBalance() {
    return margin != null ? Collections.unmodifiableMap(margin) : Collections.emptyMap();
  }

  public Map getLendingBalance() {
    return lending != null ? Collections.unmodifiableMap(lending) : Collections.emptyMap();
  }

  @Override
  public String toString() {
    return "PoloniexAvailableAccountBalance{"
        + "exchange="
        + exchange
        + ", margin="
        + margin
        + ", lending="
        + lending
        + '}';
  }

  public enum ACCOUNT {
    EXCHANGE("exchange"),
    MARGIN("margin"),
    LENDING("lending");

    private String name;

    ACCOUNT(String name) {
      this.name = name;
    }

    @Override
    public String toString() {
      return name;
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy