Skip to content

Commit

Permalink
Merge pull request binance-exchange#158 from evhar002/master
Browse files Browse the repository at this point in the history
Prevent exception when a new property is added to the API.
  • Loading branch information
joaopsilva authored Jul 20, 2018
2 parents 6cc94a1 + 4aecd06 commit 3961477
Show file tree
Hide file tree
Showing 30 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Order execution type.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum ExecutionType {
NEW,
CANCELED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Order reject reason values.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum OrderRejectReason {
NONE,
UNKNOWN_INSTRUMENT,
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/binance/api/client/domain/OrderSide.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Buy/Sell order side.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum OrderSide {
BUY,
SELL
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/binance/api/client/domain/OrderStatus.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Status of a submitted order.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum OrderStatus {
NEW,
PARTIALLY_FILLED,
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/binance/api/client/domain/OrderType.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Type of order to submit to the system.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum OrderType {
LIMIT,
MARKET,
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/binance/api/client/domain/TimeInForce.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.binance.api.client.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Time in force to indicate how long an order will remain active before it is executed or expires.
*
Expand All @@ -9,6 +11,7 @@
*
* @see <a href="http://www.investopedia.com/terms/t/timeinforce.asp">http://www.investopedia.com/terms/t/timeinforce.asp</a>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum TimeInForce {
GTC,
IOC,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.binance.api.client.domain.account;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* An asset balance in an Account.
*
* @see Account
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AssetBalance {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.binance.api.client.domain.account;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* A deposit address for a given asset.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class DepositAddress {

private String address;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.binance.api.client.domain.account;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

Expand All @@ -11,6 +12,7 @@
*
* @see Deposit
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class DepositHistory {

@JsonProperty("depositList")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
import com.binance.api.client.domain.OrderSide;
import com.binance.api.client.domain.OrderType;
import com.binance.api.client.domain.TimeInForce;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* A trade order to enter or exit a position.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class NewOrder {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.binance.api.client.domain.account;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Desired response type of NewOrder requests.
* @see NewOrderResponse
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum NewOrderResponseType {
ACK,
RESULT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.binance.api.client.domain.account;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* Represents an executed trade.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class Trade {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.binance.api.client.domain.account;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* Represents an executed trade history item.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class TradeHistoryItem {
/**
* Trade id.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.binance.api.client.domain.account;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.List;
Expand All @@ -10,6 +11,7 @@
*
* @see Withdraw
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class WithdrawHistory {

private List<Withdraw> withdrawList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.binance.api.client.domain.account.request;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* Base request parameters for order-related methods.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderRequest {

private final String symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.binance.api.client.domain.event;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

Expand All @@ -11,6 +12,7 @@
*/
@JsonDeserialize(using = CandlestickEventDeserializer.class)
@JsonSerialize(using = CandlestickEventSerializer.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public class CandlestickEvent {

private String eventType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain.event;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Dummy type to wrap a listen key from a server response.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ListenKey {

private String listenKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.binance.api.client.domain.general;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
Expand All @@ -10,6 +11,7 @@
*
* The MAX_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange. "Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ExchangeFilter {

private FilterType filterType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain.general;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Filters define trading rules on a symbol or an exchange. Filters come in two forms: symbol filters and exchange filters.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum FilterType {
// Symbol
PRICE_FILTER,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.binance.api.client.domain.general;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* Rate limits.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RateLimit {

private RateLimitType rateLimitType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain.general;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Rate limit intervals.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum RateLimitInterval {
SECOND,
MINUTE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain.general;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Rate limiters.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum RateLimitType {
REQUEST_WEIGHT,
ORDERS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain.general;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Time of the server running Binance's REST API.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ServerTime {
private Long serverTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.binance.api.client.domain.general;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Filters define trading rules on a symbol or an exchange. Filters come in two forms: symbol filters and exchange filters.
*
Expand All @@ -13,6 +15,7 @@
*
* The MAX_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol. "Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SymbolFilter {

// PRICE_FILTER
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.binance.api.client.domain.general;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Status of a symbol on the exchange.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum SymbolStatus {
PRE_TRADING,
TRADING,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.binance.api.client.domain.market;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* Represents the best price/qty on the order book for a given symbol.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class BookTicker {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.binance.api.client.domain.market;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Kline/Candlestick intervals.
* m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum CandlestickInterval {
ONE_MINUTE("1m"),
THREE_MINUTES("3m"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.binance.api.client.domain.market;

import com.binance.api.client.constant.BinanceApiConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.List;

/**
* Order book of a symbol in Binance.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderBook {

/**
Expand Down
Loading

0 comments on commit 3961477

Please sign in to comment.