<|start_filename|>xchange-huobi/src/main/java/org/knowm/xchange/huobi/dto/marketdata/HuobiCurrencyWrapper.java<|end_filename|>
package org.knowm.xchange.huobi.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Arrays;

public class HuobiCurrencyWrapper {

    private HuobiCurrency[] huobiCurrencies;
    private String currency;
    private String instStatus;

    public HuobiCurrencyWrapper(@JsonProperty("chains") HuobiCurrency[] huobiCurrencies,
                                @JsonProperty("currency") String currency,
                                @JsonProperty("instStatus") String instStatus) {
        this.huobiCurrencies = huobiCurrencies;
        this.currency = currency;
        this.instStatus = instStatus;
    }

    public HuobiCurrency[] getHuobiCurrencies() {
        return huobiCurrencies;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getInstStatus() {
        return instStatus;
    }

    @Override
    public String toString() {
        return "HuobiCurrencyWrapper{" +
                "huobiCurrencies=" + Arrays.toString(huobiCurrencies) +
                ", currency='" + currency + '\'' +
                ", instStatus='" + instStatus + '\'' +
                '}';
    }
}


<|start_filename|>xchange-bitfinex/src/main/java/org/knowm/xchange/bitfinex/v2/dto/account/UpdateCollateralDerivativePositionRequest.java<|end_filename|>
package org.knowm.xchange.bitfinex.v2.dto.account;

import java.math.BigDecimal;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NonNull;
import lombok.Value;

@Value
@Builder
@AllArgsConstructor(access = AccessLevel.PRIVATE)
/** see https://docs.bitfinex.com/reference#rest-auth-deriv-pos-collateral-set */
@JsonInclude(Include.NON_NULL)
public class UpdateCollateralDerivativePositionRequest {
    /** The derivative symbol, e.g. tBTCF0:USTF0 */
    @NonNull private String symbol;
    
    /** The amount of collateral to apply to the open position */
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @NonNull
    private BigDecimal collateral;
}


<|start_filename|>xchange-okex/src/main/java/org/knowm/xchange/okex/v5/service/OkexAccountServiceRaw.java<|end_filename|>
package org.knowm.xchange.okex.v5.service;

import org.knowm.xchange.client.ResilienceRegistries;
import org.knowm.xchange.okex.v5.OkexExchange;

/** Author: <NAME> (<EMAIL>) Created: 08-06-2021 */
public class OkexAccountServiceRaw extends OkexBaseService {
  public OkexAccountServiceRaw(OkexExchange exchange, ResilienceRegistries resilienceRegistries) {
    super(exchange, resilienceRegistries);
  }
}


<|start_filename|>xchange-huobi/src/main/java/org/knowm/xchange/huobi/dto/marketdata/results/HuobiCurrenciesResult.java<|end_filename|>
package org.knowm.xchange.huobi.dto.marketdata.results;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.knowm.xchange.huobi.dto.HuobiResultV2;
import org.knowm.xchange.huobi.dto.marketdata.HuobiCurrencyWrapper;

public class HuobiCurrenciesResult extends HuobiResultV2<HuobiCurrencyWrapper[]> {

    public HuobiCurrenciesResult(@JsonProperty("code") String code,
                                 @JsonProperty("message") String message,
                                 @JsonProperty("data") HuobiCurrencyWrapper[] result) {
        super(code, message, result);
    }
}

<|start_filename|>xchange-stream-kraken/src/test/java/info/bitrich/xchangestream/kraken/KrakenStreamingChecksumTest.java<|end_filename|>
package info.bitrich.xchangestream.kraken;

import org.assertj.core.util.Sets;
import org.junit.Before;
import org.junit.Test;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.Order;
import org.knowm.xchange.dto.trade.LimitOrder;

import java.math.BigDecimal;
import java.util.TreeSet;

import static org.assertj.core.api.Assertions.assertThat;

public class KrakenStreamingChecksumTest {
    private StringBuilder sb;

    private TreeSet<LimitOrder> asks = Sets.newTreeSet(
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05005")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05010")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05015")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05020")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05025")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05030")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05035")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05040")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05045")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05050")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05050")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05055")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05060")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.ASK, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05065")).originalAmount(new BigDecimal("0.00000500")).build()
    );
    private TreeSet<LimitOrder> bids = Sets.newTreeSet(
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.05000")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04995")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04990")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04980")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04975")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04970")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04965")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04960")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04955")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04950")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04945")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04940")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04935")).originalAmount(new BigDecimal("0.00000500")).build(),
            new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("0.04930")).originalAmount(new BigDecimal("0.00000500")).build()
    );

    private final String expectedCrcString = "50055005010500501550050205005025500503050050355005040500504550050505005000500499550049905004980500497550049705004965500496050049555004950500";

    @Before
    public void setUp() {
        this.sb = new StringBuilder();
    }

    @Test
    public void testAddBigDecimal() {
        KrakenStreamingChecksum.addBigDecimalToCrcString(this.sb, new BigDecimal("0.05005"));
        assertThat(sb.toString()).isEqualTo("5005");
    }

    @Test
    public void testAddBigDecimalWithDecimalEndingInZero() {
        KrakenStreamingChecksum.addBigDecimalToCrcString(this.sb, new BigDecimal("0.05000"));
        assertThat(sb.toString()).isEqualTo("5000");
        this.setUp();
        KrakenStreamingChecksum.addBigDecimalToCrcString(this.sb, new BigDecimal("5000"));
        assertThat(sb.toString()).isEqualTo("5000");
    }


    @Test
    public void testAddOrderbook() {
        String crcString = KrakenStreamingChecksum.createCrcString(asks, bids);
        assertThat(crcString).isEqualTo(expectedCrcString);
    }

    @Test
    public void testCreateCrcLong() {
        long crcLong = KrakenStreamingChecksum.createCrcLong(expectedCrcString);
        assertThat(crcLong).isEqualTo(974947235L);
    }
}

<|start_filename|>xchange-okex/src/main/java/org/knowm/xchange/okex/v5/service/OkexAccountService.java<|end_filename|>
package org.knowm.xchange.okex.v5.service;

import org.knowm.xchange.client.ResilienceRegistries;
import org.knowm.xchange.okex.v5.OkexExchange;
import org.knowm.xchange.service.account.AccountService;

/** Author: <NAME> (<EMAIL>) Created: 08-06-2021 */
public class OkexAccountService extends OkexAccountServiceRaw implements AccountService {
  public OkexAccountService(OkexExchange exchange, ResilienceRegistries resilienceRegistries) {
    super(exchange, resilienceRegistries);
  }
}


<|start_filename|>xchange-huobi/src/main/java/org/knowm/xchange/huobi/dto/marketdata/HuobiCurrency.java<|end_filename|>
package org.knowm.xchange.huobi.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonProperty;

public class HuobiCurrency {

    private String chain;
    private String displayName;
    private String baseChain;
    private String baseChainProtocol;
    private boolean isDynamic;
    private String depositStatus;
    private String maxTransactFeeWithdraw;
    private String maxWithdrawAmt;
    private String minDepositAmt;
    private String minTransactFeeWithdraw;
    private String minWithdrawAmt;
    private int numOfConfirmations;
    private int numOfFastConfirmations;
    private String transactFeeWithdraw;
    private String withdrawFeeType;
    private int withdrawPrecision;
    private String withdrawQuotaPerDay;
    private String withdrawQuotaPerYear;
    private String withdrawQuotaTotal;
    private String withdrawStatus;

    public HuobiCurrency(@JsonProperty("chain") String chain,
                         @JsonProperty("displayName") String displayName,
                         @JsonProperty("baseChain") String baseChain,
                         @JsonProperty("baseChainProtocol") String baseChainProtocol,
                         @JsonProperty("isDynamic") boolean isDynamic,
                         @JsonProperty("depositStatus") String depositStatus,
                         @JsonProperty("maxTransactFeeWithdraw") String maxTransactFeeWithdraw,
                         @JsonProperty("maxWithdrawAmt") String maxWithdrawAmt,
                         @JsonProperty("minDepositAmt") String minDepositAmt,
                         @JsonProperty("minTransactFeeWithdraw") String minTransactFeeWithdraw,
                         @JsonProperty("minWithdrawAmt") String minWithdrawAmt,
                         @JsonProperty("numOfConfirmations") int numOfConfirmations,
                         @JsonProperty("numOfFastConfirmations") int numOfFastConfirmations,
                         @JsonProperty("transactFeeWithdraw") String transactFeeWithdraw,
                         @JsonProperty("withdrawFeeType") String withdrawFeeType,
                         @JsonProperty("withdrawPrecision") int withdrawPrecision,
                         @JsonProperty("withdrawQuotaPerDay") String withdrawQuotaPerDay,
                         @JsonProperty("withdrawQuotaPerYear") String withdrawQuotaPerYear,
                         @JsonProperty("withdrawQuotaTotal") String withdrawQuotaTotal,
                         @JsonProperty("withdrawStatus") String withdrawStatus) {
        this.chain = chain;
        this.displayName = displayName;
        this.baseChain = baseChain;
        this.baseChainProtocol = baseChainProtocol;
        this.isDynamic = isDynamic;
        this.depositStatus = depositStatus;
        this.maxTransactFeeWithdraw = maxTransactFeeWithdraw;
        this.maxWithdrawAmt = maxWithdrawAmt;
        this.minDepositAmt = minDepositAmt;
        this.minTransactFeeWithdraw = minTransactFeeWithdraw;
        this.minWithdrawAmt = minWithdrawAmt;
        this.numOfConfirmations = numOfConfirmations;
        this.numOfFastConfirmations = numOfFastConfirmations;
        this.transactFeeWithdraw = transactFeeWithdraw;
        this.withdrawFeeType = withdrawFeeType;
        this.withdrawPrecision = withdrawPrecision;
        this.withdrawQuotaPerDay = withdrawQuotaPerDay;
        this.withdrawQuotaPerYear = withdrawQuotaPerYear;
        this.withdrawQuotaTotal = withdrawQuotaTotal;
        this.withdrawStatus = withdrawStatus;
    }

    public String getChain() {
        return chain;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getBaseChain() {
        return baseChain;
    }

    public String getBaseChainProtocol() {
        return baseChainProtocol;
    }

    public boolean isDynamic() {
        return isDynamic;
    }

    public String getDepositStatus() {
        return depositStatus;
    }

    public String getMaxTransactFeeWithdraw() {
        return maxTransactFeeWithdraw;
    }

    public String getMaxWithdrawAmt() {
        return maxWithdrawAmt;
    }

    public String getMinDepositAmt() {
        return minDepositAmt;
    }

    public String getMinTransactFeeWithdraw() {
        return minTransactFeeWithdraw;
    }

    public String getMinWithdrawAmt() {
        return minWithdrawAmt;
    }

    public int getNumOfConfirmations() {
        return numOfConfirmations;
    }

    public int getNumOfFastConfirmations() {
        return numOfFastConfirmations;
    }

    public String getTransactFeeWithdraw() {
        return transactFeeWithdraw;
    }

    public String getWithdrawFeeType() {
        return withdrawFeeType;
    }

    public int getWithdrawPrecision() {
        return withdrawPrecision;
    }

    public String getWithdrawQuotaPerDay() {
        return withdrawQuotaPerDay;
    }

    public String getWithdrawQuotaPerYear() {
        return withdrawQuotaPerYear;
    }

    public String getWithdrawQuotaTotal() {
        return withdrawQuotaTotal;
    }

    public String getWithdrawStatus() {
        return withdrawStatus;
    }

    @Override
    public String toString() {
        return "HuobiCurrency{" +
                "chain='" + chain + '\'' +
                ", displayName='" + displayName + '\'' +
                ", baseChain='" + baseChain + '\'' +
                ", baseChainProtocol='" + baseChainProtocol + '\'' +
                ", isDynamic=" + isDynamic +
                ", depositStatus='" + depositStatus + '\'' +
                ", maxTransactFeeWithdraw='" + maxTransactFeeWithdraw + '\'' +
                ", maxWithdrawAmt='" + maxWithdrawAmt + '\'' +
                ", minDepositAmt='" + minDepositAmt + '\'' +
                ", minTransactFeeWithdraw='" + minTransactFeeWithdraw + '\'' +
                ", minWithdrawAmt='" + minWithdrawAmt + '\'' +
                ", numOfConfirmations=" + numOfConfirmations +
                ", numOfFastConfirmations=" + numOfFastConfirmations +
                ", transactFeeWithdraw='" + transactFeeWithdraw + '\'' +
                ", withdrawFeeType='" + withdrawFeeType + '\'' +
                ", withdrawPrecision=" + withdrawPrecision +
                ", withdrawQuotaPerDay='" + withdrawQuotaPerDay + '\'' +
                ", withdrawQuotaPerYear='" + withdrawQuotaPerYear + '\'' +
                ", withdrawQuotaTotal='" + withdrawQuotaTotal + '\'' +
                ", withdrawStatus='" + withdrawStatus + '\'' +
                '}';
    }
}
