null to use default value.
+ * @param type
+ * @param side
+ * @param productID
+ * @param stp
+ * @param hidden
+ */
+ public AbucoinsBaseCreateOrderRequest(Type type, Side side, String productID, String stp, Boolean hidden) {
+ super();
+ this.type = type;
+ this.side = side;
+ this.productID = productID;
+ this.stp = stp;
+ this.hidden = hidden;
+ }
+
+ public AbucoinsOrder.Type getType() {
+ return type;
+ }
+
+ public AbucoinsOrder.Side getSide() {
+ return side;
+ }
+
+ public String getProductID() {
+ return productID;
+ }
+
+ public String getStp() {
+ return stp;
+ }
+
+ public Boolean isHidden() {
+ return hidden;
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateLimitOrderRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateLimitOrderRequest.java
new file mode 100644
index 000000000..9592580b9
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateLimitOrderRequest.java
@@ -0,0 +1,115 @@
+package org.knowm.xchange.abucoins.dto;
+
+import java.math.BigDecimal;
+
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder.Side;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder.TimeInForce;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder.Type;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class AbucoinsCreateLimitOrderRequest extends AbucoinsBaseCreateOrderRequest {
+ /** price per one asset */
+ BigDecimal price;
+
+ /** amount of assets to buy or sell */
+ BigDecimal size;
+
+ /** GTC [optional] GTC, GTT, IOC or FOK */
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ @JsonProperty("time_in_force")
+ AbucoinsOrder.TimeInForce timeInForce;
+
+ /** [optional]* min, hour, day. * Requires only with GTT */
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("cancel_after")
+ String cancelAfter;
+
+ /** [optional]** create order only if maker - true, false. ** Invalid when time_in_force is IOC or FOK */
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ @JsonProperty("post_only")
+ Boolean postOnly;
+
+ /**
+ * Constructor with skipping all optional fields.
+ * @param side
+ * @param product_id
+ * @param price
+ * @param size
+ */
+ public AbucoinsCreateLimitOrderRequest(Side side, String product_id, BigDecimal price, BigDecimal size) {
+ super(side, product_id);
+ this.type = AbucoinsOrder.Type.limit; // optional but being explicit.
+ this.price = price;
+ this.size = size;
+ }
+
+ /**
+ * Full constructor, use null for any optional fields to use their default value
+ * @param type
+ * @param side
+ * @param product_id
+ * @param stp
+ * @param hidden
+ * @param price
+ * @param size
+ * @param timeInForce
+ * @param cancel_after
+ * @param postOnly
+ */
+ public AbucoinsCreateLimitOrderRequest(Side side, String product_id, String stp, Boolean hidden, BigDecimal price, BigDecimal size,
+ TimeInForce timeInForce, String cancel_after, Boolean postOnly) {
+ super(AbucoinsOrder.Type.limit, side, product_id, stp, hidden);
+ this.price = price;
+ this.size = size;
+ this.timeInForce = timeInForce;
+ this.cancelAfter = cancel_after;
+ this.postOnly = postOnly;
+
+ switch ( timeInForce ) {
+ case GTT:
+ if ( cancelAfter == null )
+ throw new IllegalArgumentException("cancel_after required if time_in_force is GTT");
+ break;
+
+ case IOC:
+ case FOK:
+ if ( postOnly != null )
+ throw new IllegalArgumentException("post_only invalid if time_in_force is IOK OR FOK, use null.");
+ // falls through to default checks intentionally
+
+ default:
+ if ( cancelAfter != null )
+ throw new IllegalArgumentException("cancel_after only required for GTT. Use null");
+ }
+ }
+
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ public BigDecimal getSize() {
+ return size;
+ }
+
+ public AbucoinsOrder.TimeInForce getTimeInForce() {
+ return timeInForce;
+ }
+
+ public String getCancelAfter() {
+ return cancelAfter;
+ }
+
+ public Boolean getPostOnly() {
+ return postOnly;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsCreateLimitOrderRequest [price=" + price + ", size=" + size + ", timeInForce=" + timeInForce
+ + ", cancelAfter=" + cancelAfter + ", postOnly=" + postOnly + ", type=" + type + ", side=" + side
+ + ", productID=" + productID + ", stp=" + stp + ", hidden=" + hidden + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateMarketOrderRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateMarketOrderRequest.java
new file mode 100644
index 000000000..46f6c5f6f
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateMarketOrderRequest.java
@@ -0,0 +1,70 @@
+package org.knowm.xchange.abucoins.dto;
+
+import java.math.BigDecimal;
+
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder.Side;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * * One of size or funds is required.
+ * + *Funds will limit how much of your quote currency account balance is used and size will limit the asset + * amount transacted.
+ * + * @author bryant_harris + */ +public class AbucoinsCreateMarketOrderRequest extends AbucoinsBaseCreateOrderRequest{ + /** [optional]* Desired amount in BTC */ + @JsonInclude(JsonInclude.Include.NON_NULL) + BigDecimal size; + + /** [optional]* Desired amount of quote currency to use */ + @JsonInclude(JsonInclude.Include.NON_NULL) + BigDecimal funds; + + /** + * Constructor with skipping all optional fields. + * @param side + * @param product_id + * @param size + * @param funds + */ + public AbucoinsCreateMarketOrderRequest(Side side, String product_id, BigDecimal size, BigDecimal funds) { + super(side, product_id); + this.type = AbucoinsOrder.Type.market; + this.size = size; + this.funds = funds; + } + + /** + * Full constructor, usenull for any optional fields to use their default value
+ * @param type
+ * @param side
+ * @param productID
+ * @param stp
+ * @param hidden
+ * @param size
+ * @param funds
+ */
+ public AbucoinsCreateMarketOrderRequest(Side side, String productID, String stp, Boolean hidden, BigDecimal size, BigDecimal funds) {
+ super(AbucoinsOrder.Type.market, side, productID, stp, hidden);
+ this.size = size;
+ this.funds = funds;
+ }
+
+ public BigDecimal getSize() {
+ return size;
+ }
+
+ public BigDecimal getFunds() {
+ return funds;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsCreateMarketOrderRequest [size=" + size + ", funds=" + funds + ", type=" + type + ", side="
+ + side + ", productID=" + productID + ", stp=" + stp + ", hidden=" + hidden + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCryptoDepositRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCryptoDepositRequest.java
new file mode 100644
index 000000000..867562aa5
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCryptoDepositRequest.java
@@ -0,0 +1,28 @@
+package org.knowm.xchange.abucoins.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ *
+ * @author bryant_harris
+ *
+ */
+public class AbucoinsCryptoDepositRequest {
+ /** The type of currency */
+ @JsonProperty("currency")
+ String currency;
+
+ /** Payment method */
+ @JsonProperty("method")
+ String method;
+
+ public AbucoinsCryptoDepositRequest(String currency, String method) {
+ this.currency = currency;
+ this.method = method;
+ }
+
+ @Override
+ public String toString() {
+ return "CryptoDepositRequest [currency=" + currency + ", method=" + method + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCryptoWithdrawalRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCryptoWithdrawalRequest.java
new file mode 100644
index 000000000..b140fb1b9
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsCryptoWithdrawalRequest.java
@@ -0,0 +1,68 @@
+package org.knowm.xchange.abucoins.dto;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the input JSON for the Abucoins
+ * POST /withdrawals/crypto endpoint.
+ * {
+ * "amount": 10.00,
+ * "currency": "BTC",
+ * "method": "bitcoin",
+ * "address": "0x5ad5769cd04681FeD900BCE3DDc877B50E83d469"
+ * }
+ *
+ */
+public class AbucoinsCryptoWithdrawalRequest {
+ /** The amount to withdraw */
+ @JsonProperty("amount")
+ BigDecimal amount;
+
+ /** The type of currency */
+ @JsonProperty("currency")
+ String currency;
+
+ /** Payment method */
+ @JsonProperty("method")
+ String method;
+
+ /** A crypto address of the recipient */
+ @JsonProperty("address")
+ String address;
+
+ /** Tag/PaymentId/Memo of the recipient */
+ @JsonInclude(JsonInclude.Include.NON_EMPTY)
+ @JsonProperty("tag")
+ String tag;
+
+ /**
+ * @param amount The amount to withdraw
+ * @param currency The type of currency
+ * @param method Payment method
+ * @param address A crypto address of the recipient
+ * @param tag Tag/PaymentId/Memo of the recipient
+ */
+ public AbucoinsCryptoWithdrawalRequest(BigDecimal amount,
+ String currency,
+ String method,
+ String address,
+ String tag) {
+ this.amount = amount;
+ this.currency = currency;
+ this.method = method;
+ this.address = address;
+ this.tag = tag;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsCryptoWithDrawalRequest [amount=" + amount + ", currency=" + currency + ", method=" + method
+ + ", address=" + address + ", tag=" + tag + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsOrderRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsOrderRequest.java
new file mode 100644
index 000000000..6cf0cb780
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsOrderRequest.java
@@ -0,0 +1,54 @@
+package org.knowm.xchange.abucoins.dto;
+
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+
+public class AbucoinsOrderRequest {
+ AbucoinsOrder.Status status;
+ String productID;
+
+ /**
+ * all products any status.
+ */
+ public AbucoinsOrderRequest() {
+ this(null,null);
+ }
+
+ /**
+ * All products, just the specified status.
+ * @param status
+ */
+ public AbucoinsOrderRequest(AbucoinsOrder.Status status) {
+ this(status, null);
+ }
+
+ /**
+ * Orders for just the provided productID with any status.
+ * @param productID
+ */
+ public AbucoinsOrderRequest(String productID) {
+ this(null, productID);
+ }
+
+ /**
+ * Orders with the specified status for the specific productID
+ * @param status
+ * @param productID
+ */
+ public AbucoinsOrderRequest(AbucoinsOrder.Status status, String productID) {
+ this.status = status;
+ this.productID = productID;
+ }
+
+ public AbucoinsOrder.Status getStatus() {
+ return status;
+ }
+
+ public String getProductID() {
+ return productID;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsOrdersRequest [side=" + status + ", productID=" + productID + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsRequest.java
new file mode 100644
index 000000000..bcdefd49a
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsRequest.java
@@ -0,0 +1,15 @@
+package org.knowm.xchange.abucoins.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+//all fields gets set later by the digest.
+public class AbucoinsRequest {
+ @JsonProperty("key")
+ public String key;
+
+ @JsonProperty("nonce")
+ public String nonce;
+
+ @JsonProperty("signature")
+ public String signature;
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsServerTime.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsServerTime.java
new file mode 100644
index 000000000..09b3967f7
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsServerTime.java
@@ -0,0 +1,38 @@
+package org.knowm.xchange.abucoins.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /time endpoint.
+ * {
+ * "iso":"2017-10-10T11:16:50Z",
+ * "epoch":1507634210
+ * }
+ *
+ */
+public class AbucoinsServerTime {
+ String iso;
+ long epoch;
+
+ public AbucoinsServerTime(@JsonProperty("iso") String iso, @JsonProperty("epoch") long epoch) {
+ this.iso = iso;
+ this.epoch = epoch;
+ }
+
+ public String getIso() {
+ return iso;
+ }
+
+ public long getEpoch() {
+ return epoch;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsServerTime [iso=" + iso + ", epoch=" + epoch + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsSingleIdRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsSingleIdRequest.java
new file mode 100644
index 000000000..5862a855a
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsSingleIdRequest.java
@@ -0,0 +1,9 @@
+package org.knowm.xchange.abucoins.dto;
+
+public class AbucoinsSingleIdRequest extends AbucoinsRequest {
+ public final String id;
+
+ public AbucoinsSingleIdRequest(String id) {
+ this.id = id;
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsSingleOrderIdRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsSingleOrderIdRequest.java
new file mode 100644
index 000000000..e61f95b80
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/AbucoinsSingleOrderIdRequest.java
@@ -0,0 +1,12 @@
+package org.knowm.xchange.abucoins.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class AbucoinsSingleOrderIdRequest extends AbucoinsRequest {
+ @JsonProperty("id")
+ public final String orderId;
+
+ public AbucoinsSingleOrderIdRequest(String orderId) {
+ this.orderId = orderId;
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/PlaceOrderRequest.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/PlaceOrderRequest.java
new file mode 100644
index 000000000..13ee5c786
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/PlaceOrderRequest.java
@@ -0,0 +1,17 @@
+package org.knowm.xchange.abucoins.dto;
+
+import java.math.BigDecimal;
+
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+
+public class PlaceOrderRequest extends AbucoinsRequest {
+ public final AbucoinsOrder.Type type;
+ public final BigDecimal price;
+ public final BigDecimal amount;
+
+ public PlaceOrderRequest(AbucoinsOrder.Type type, BigDecimal price, BigDecimal amount) {
+ this.type = type;
+ this.price = price;
+ this.amount = amount;
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccount.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccount.java
new file mode 100644
index 000000000..9b89baeac
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccount.java
@@ -0,0 +1,106 @@
+package org.knowm.xchange.abucoins.dto.account;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /accounts/<account-id> endpoint.
+ * {
+ * "id": "3-BTC",
+ * "currency": "BTC",
+ * "balance": 13.38603805,
+ * "available": 13.38589212,
+ * "available_btc": 13.38589212,
+ * "hold": 0.00014593,
+ * "profile_id": 3
+ * }
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsAccount {
+ /** account id */
+ String id;
+
+ /** the currency of the account */
+ String currency;
+
+ /** the funds in the account */
+ BigDecimal balance;
+
+ /** founds available to withdraw or trade */
+ BigDecimal available;
+
+ /** founds available to withdraw or trade for BTC */
+ BigDecimal available_btc;
+
+ /** funds on hold (not available for use) */
+ BigDecimal hold;
+
+ /** profile id */
+ long profileID;
+
+ /** For error cases */
+ String message;
+
+ public AbucoinsAccount(@JsonProperty("id") String id,
+ @JsonProperty("currency") String currency,
+ @JsonProperty("balance") BigDecimal balance,
+ @JsonProperty("available") BigDecimal available,
+ @JsonProperty("available_btc") BigDecimal available_btc,
+ @JsonProperty("hold") BigDecimal hold,
+ @JsonProperty("profile_id") long profileID,
+ @JsonProperty("message") String message) {
+ this.id = id;
+ this.currency = currency;
+ this.balance = balance;
+ this.available = available;
+ this.available_btc = available_btc;
+ this.hold = hold;
+ this.profileID = profileID;
+ this.message = message;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public BigDecimal getBalance() {
+ return balance;
+ }
+
+ public BigDecimal getAvailable() {
+ return available;
+ }
+
+ public BigDecimal getAvailable_btc() {
+ return available_btc;
+ }
+
+ public BigDecimal getHold() {
+ return hold;
+ }
+
+ public long getProfileID() {
+ return profileID;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsAccount [id=" + id + ", currency=" + currency + ", balance=" + balance + ", available="
+ + available + ", available_btc=" + available_btc + ", hold=" + hold + ", profileID=" + profileID +
+ ", message=" + message +"]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccounts.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccounts.java
new file mode 100644
index 000000000..65a577716
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccounts.java
@@ -0,0 +1,65 @@
+package org.knowm.xchange.abucoins.dto.account;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.abucoins.service.AbucoinsArrayOrMessageDeserializer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /accounts endpoint.
+ * [
+ * {
+ * "id": "3-BTC",
+ * "currency": "BTC",
+ * "balance": 13.38603805,
+ * "available": 13.38589212,
+ * "available_btc": 13.38589212,
+ * "hold": 0.00014593,
+ * "profile_id": 3
+ * },
+ * {
+ * "id": "3-ETH",
+ * "currency": "ETH",
+ * "balance": 133.48685448,
+ * "available": 133.48685448,
+ * "available_btc": 9.38012126,
+ * "hold": 0,
+ * "profile_id": 3
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+@JsonDeserialize(using = AbucoinsAccounts.AbucoinsAccountsDeserializer.class)
+public class AbucoinsAccounts {
+ AbucoinsAccount[] accounts;
+
+ public AbucoinsAccounts(AbucoinsAccount[] accounts) {
+ this.accounts = accounts;
+ }
+
+ public AbucoinsAccount[] getAccounts() {
+ return accounts;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsAccounts [accounts=" + Arrays.toString(accounts) + "]";
+ }
+
+ /**
+ * Deserializer handles the success case (array json) as well as the error case
+ * (json object with message field).
+ * @author bryant_harris
+ */
+ static class AbucoinsAccountsDeserializer extends AbucoinsArrayOrMessageDeserializerPOJO representing the output JSON for the Abucoins
+ * POST /withdrawals/crypto endpoint.
+ * {
+ * "status": 0,
+ * "message": "Your transaction is pending. Please confirm it via email.",
+ * "payoutId": "65",
+ * "balance": [
+ * {
+ * "type": "PLN",
+ * "balance": "2999990.00000000",
+ * "locked": "0.00000000"
+ * },
+ * {
+ * "type": "BTC",
+ * "balance": "13.38589212",
+ * "locked": "0.00014593"
+ * }
+ * ]
+ * }
+ *
+ */
+public class AbucoinsCryptoWithdrawal {
+ long status;
+ String message;
+ String payoutId;
+ Balance[] balance;
+
+ public AbucoinsCryptoWithdrawal(@JsonProperty("status") long status,
+ @JsonProperty("message") String message,
+ @JsonProperty("payoutId") String payoutId,
+ @JsonProperty("balance") Balance[] balance) {
+ this.status = status;
+ this.message = message;
+ this.payoutId = payoutId;
+ this.balance = balance;
+ }
+
+ public long getStatus() {
+ return status;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public String getPayoutId() {
+ return payoutId;
+ }
+
+ public Balance[] getBalance() {
+ return balance;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsCryptoWithdrawal [status=" + status + ", message=" + message + ", payoutId=" + payoutId
+ + ", balance=" + Arrays.toString(balance) + "]";
+ }
+
+ static class Balance {
+ String type;
+ BigDecimal balance;
+ BigDecimal locked;
+
+ public Balance(@JsonProperty("type") String type,
+ @JsonProperty("balance") BigDecimal balance,
+ @JsonProperty("locked") BigDecimal locked) {
+ this.type = type;
+ this.balance = balance;
+ this.locked = locked;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public BigDecimal getBalance() {
+ return balance;
+ }
+
+ public BigDecimal getLocked() {
+ return locked;
+ }
+
+ @Override
+ public String toString() {
+ return "Balance [type=" + type + ", balance=" + balance + ", locked=" + locked + "]";
+ }
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsFill.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsFill.java
new file mode 100644
index 000000000..f3b9d04ff
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsFill.java
@@ -0,0 +1,147 @@
+package org.knowm.xchange.abucoins.dto.account;
+
+import java.math.BigDecimal;
+
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder.Side;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /fills endpoint.
+ * [
+ * {
+ * "trade_id":"785705",
+ * "product_id":"BTC-PLN",
+ * "price":"14734.55000000",
+ * "size":"100.00000000",
+ * "order_id":"4196245",
+ * "created_at":"2017-09-28T13:08:43Z",
+ * "liquidity":"T",
+ * "side":"sell"
+ * },
+ * {
+ * "trade_id":"785704",
+ * "product_id":"BTC-PLN",
+ * "price":"14734.55000000",
+ * "size":"0.01000000",
+ * "order_id":"4196245",
+ * "created_at":"2017-09-28T13:08:43Z",
+ * "liquidity":"T",
+ * "side":"sell"
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsFill {
+ /** identifier of the last trade */
+ String tradeID;
+
+ /** product identifier */
+ String productID;
+
+ /** trade price */
+ BigDecimal price;
+
+ /** trade size */
+ BigDecimal size;
+
+ /** Identifier of order */
+ String orderID;
+
+ /** time in UTC */
+ String createdAt;
+
+ /** indicates if the fill was the result of a liquidity provider or liquidity taker. M indicates Maker and T indicates Taker */
+ Liquidity liquidity;
+
+ /** user side(buy or sell) */
+ AbucoinsOrder.Side side;
+
+ String message;
+
+ public AbucoinsFill(@JsonProperty("trade_id") String tradeID,
+ @JsonProperty("product_id") String productID,
+ @JsonProperty("price") BigDecimal price,
+ @JsonProperty("size") BigDecimal size,
+ @JsonProperty("order_id") String orderID,
+ @JsonProperty("created_at") String createdAt,
+ @JsonProperty("liquidity") Liquidity liquidity,
+ @JsonProperty("side") Side side,
+ @JsonProperty("message") String message) {
+ this.tradeID = tradeID;
+ this.productID = productID;
+ this.price = price;
+ this.size = size;
+ this.orderID = orderID;
+ this.createdAt = createdAt;
+ this.liquidity = liquidity;
+ this.side = side;
+ this.message = message;
+ }
+
+ public String getTradeID() {
+ return tradeID;
+ }
+
+ public String getProductID() {
+ return productID;
+ }
+
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ public BigDecimal getSize() {
+ return size;
+ }
+
+ public String getOrderID() {
+ return orderID;
+ }
+
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public Liquidity getLiquidity() {
+ return liquidity;
+ }
+
+ public AbucoinsOrder.Side getSide() {
+ return side;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsFill [tradeID=" + tradeID + ", productID=" + productID + ", price=" + price + ", size=" + size
+ + ", orderID=" + orderID + ", createdAt=" + createdAt + ", liquidity=" + liquidity + ", side=" + side
+ + ", message=" + message + "]";
+ }
+
+ public enum Liquidity {
+ T,
+ M;
+
+ public String toDescription() {
+ switch (this) {
+ case T:
+ return "indicates that this fill was the result of a liquidity taker (Taker).";
+ case M:
+ return "indicates that this fill was the result of a liquidity provider (Maker).";
+
+ default:
+ return "";
+ }
+ }
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsFills.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsFills.java
new file mode 100644
index 000000000..84306d5ed
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsFills.java
@@ -0,0 +1,67 @@
+package org.knowm.xchange.abucoins.dto.account;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.abucoins.service.AbucoinsArrayOrMessageDeserializer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /fills endpoint.
+ * [
+ * {
+ * "trade_id":"785705",
+ * "product_id":"BTC-PLN",
+ * "price":"14734.55000000",
+ * "size":"100.00000000",
+ * "order_id":"4196245",
+ * "created_at":"2017-09-28T13:08:43Z",
+ * "liquidity":"T",
+ * "side":"sell"
+ * },
+ * {
+ * "trade_id":"785704",
+ * "product_id":"BTC-PLN",
+ * "price":"14734.55000000",
+ * "size":"0.01000000",
+ * "order_id":"4196245",
+ * "created_at":"2017-09-28T13:08:43Z",
+ * "liquidity":"T",
+ * "side":"sell"
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+@JsonDeserialize(using = AbucoinsFills.AbucoinsFillsDeserializer.class)
+public class AbucoinsFills {
+ AbucoinsFill[] fills;
+
+ public AbucoinsFills(AbucoinsFill[] fills) {
+ this.fills = fills;
+ }
+
+ public AbucoinsFill[] getFills() {
+ return fills;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsFills [fills=" + Arrays.toString(fills) + "]";
+ }
+
+ /**
+ * Deserializer handles the success case (array json) as well as the error case
+ * (json object with message field).
+ * @author bryant_harris
+ */
+ static class AbucoinsFillsDeserializer extends AbucoinsArrayOrMessageDeserializerPOJO representing and individual object from the output JSON for the Abucoins
+ * GET /payment-methods endpoint.
+ * {
+ * "id": "sepa_pln",
+ * "type": "sepa_pln",
+ * "name": "PLN",
+ * "currency": "PLN",
+ * "allow_buy": true,
+ * "allow_sell": true,
+ * "allow_deposit": true,
+ * "allow_withdraw": true,
+ * "limits": {
+ * "buy": 10000,
+ * "sell": 10000,
+ * "deposit": 9223372036854775807,
+ * "withdraw": 9223372036854775807
+ * }
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsPaymentMethod {
+ String id;
+ String type;
+ String name;
+ String currency;
+ boolean allowBuy;
+ boolean allowSell;
+ boolean allowDeposit;
+ boolean allowWithdrawal;
+ Limit limits;
+ String message;
+
+ public AbucoinsPaymentMethod(@JsonProperty("id") String id,
+ @JsonProperty("type") String type,
+ @JsonProperty("name") String name,
+ @JsonProperty("currency") String currency,
+ @JsonProperty("allow_buy") boolean allowBuy,
+ @JsonProperty("allow_sell") boolean allowSell,
+ @JsonProperty("allow_deposit") boolean allowDeposit,
+ @JsonProperty("allow_withdrawl") boolean allowWithdrawal,
+ @JsonProperty("limits") Limit limits,
+ @JsonProperty("message") String message) {
+ this.id = id;
+ this.type = type;
+ this.name = name;
+ this.currency = currency;
+ this.allowBuy = allowBuy;
+ this.allowSell = allowSell;
+ this.allowDeposit = allowDeposit;
+ this.allowWithdrawal = allowWithdrawal;
+ this.limits = limits;
+ this.message = message;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getCurrency() {
+ return currency;
+ }
+
+ public boolean isAllowBuy() {
+ return allowBuy;
+ }
+
+ public boolean isAllowSell() {
+ return allowSell;
+ }
+
+ public boolean isAllowDeposit() {
+ return allowDeposit;
+ }
+
+ public boolean isAllowWithdrawal() {
+ return allowWithdrawal;
+ }
+
+ public Limit getLimits() {
+ return limits;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsPaymentMethod [id=" + id + ", type=" + type + ", name=" + name + ", currency=" + currency
+ + ", allowBuy=" + allowBuy + ", allowSell=" + allowSell + ", allowDeposit=" + allowDeposit
+ + ", allowWithdrawal=" + allowWithdrawal + ", limits=" + limits + ", message=" + message + "]";
+ }
+
+ public static class Limit {
+ BigDecimal buy;
+ BigDecimal sell;
+ BigDecimal deposit;
+ BigDecimal withdraw;
+
+ public Limit (@JsonProperty("buy") BigDecimal buy,
+ @JsonProperty("sell") BigDecimal sell,
+ @JsonProperty("deposity") BigDecimal deposit,
+ @JsonProperty("withdraw") BigDecimal withdraw) {
+ this.buy = buy;
+ this.sell = sell;
+ this.deposit = deposit;
+ this.withdraw = withdraw;
+ }
+
+ public BigDecimal getBuy() {
+ return buy;
+ }
+
+ public BigDecimal getSell() {
+ return sell;
+ }
+
+ public BigDecimal getDeposit() {
+ return deposit;
+ }
+
+ public BigDecimal getWithdraw() {
+ return withdraw;
+ }
+
+ @Override
+ public String toString() {
+ return "Limit [buy=" + buy + ", sell=" + sell + ", deposit=" + deposit + ", withdraw=" + withdraw + "]";
+ }
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsPaymentMethods.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsPaymentMethods.java
new file mode 100644
index 000000000..3143e2e4b
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/account/AbucoinsPaymentMethods.java
@@ -0,0 +1,79 @@
+package org.knowm.xchange.abucoins.dto.account;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.abucoins.service.AbucoinsArrayOrMessageDeserializer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /payment-methods endpoint.
+ * [
+ * {
+ * "id": "sepa_pln",
+ * "type": "sepa_pln",
+ * "name": "PLN",
+ * "currency": "PLN",
+ * "allow_buy": true,
+ * "allow_sell": true,
+ * "allow_deposit": true,
+ * "allow_withdraw": true,
+ * "limits": {
+ * "buy": 10000,
+ * "sell": 10000,
+ * "deposit": 9223372036854775807,
+ * "withdraw": 9223372036854775807
+ * }
+ * },
+ * {
+ * "id": "bitcoin",
+ * "type": "bitcoin",
+ * "name": "Bitcoin",
+ * "currency": "BTC",
+ * "allow_buy": true,
+ * "allow_sell": true,
+ * "allow_deposit": true,
+ * "allow_withdraw": true,
+ * "limits": {
+ * "buy": 10000,
+ * "sell": 10000,
+ * "deposit": 5,
+ * "withdraw": 0.5
+ * }
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+@JsonDeserialize(using = AbucoinsPaymentMethods.AbucoinsPaymentMethodsDeserializer.class)
+public class AbucoinsPaymentMethods {
+ AbucoinsPaymentMethod[] paymentMethods;
+
+ public AbucoinsPaymentMethods(AbucoinsPaymentMethod[] paymentMethods) {
+ this.paymentMethods = paymentMethods;
+ }
+
+ public AbucoinsPaymentMethod[] getPaymentMethods() {
+ return paymentMethods;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsPaymentMethods [paymentMethods=" + Arrays.toString(paymentMethods) + "]";
+ }
+
+ /**
+ * Deserializer handles the success case (array json) as well as the error case
+ * (json object with message field).
+ * @author bryant_harris
+ */
+ static class AbucoinsPaymentMethodsDeserializer extends AbucoinsArrayOrMessageDeserializerPOJO representing the output JSON for the Abucoins
+ * GET GET /products/<product-id>/candles?granularity=[granularity]&start=[UTC time of start]&end=[UTC time of end] endpoint.
+ * [
+ * [ time, low, high, open, close, volume ],
+ * [
+ * "1505984400",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "0.001"
+ * ],
+ * [
+ * "1505984460",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "0.00052"
+ * ],
+ * [
+ * "1505984520",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "14209.92500000",
+ * "0.00068"
+ * ]
+ * ]
+ *
+ * @author bryant_harris
+ */
+@JsonFormat(shape=JsonFormat.Shape.ARRAY)
+public class AbucoinsHistoricRate {
+ BigDecimal time;
+ BigDecimal low;
+ BigDecimal high;
+ BigDecimal open;
+ BigDecimal close;
+ BigDecimal volume;
+
+ public BigDecimal getTime() {
+ return time;
+ }
+ public BigDecimal getLow() {
+ return low;
+ }
+ public BigDecimal getHigh() {
+ return high;
+ }
+ public BigDecimal getOpen() {
+ return open;
+ }
+ public BigDecimal getClose() {
+ return close;
+ }
+ public BigDecimal getVolume() {
+ return volume;
+ }
+ @Override
+ public String toString() {
+ return "AbucoinsHistoricRate [time=" + time + ", low=" + low + ", high=" + high + ", open=" + open + ", close="
+ + close + ", volume=" + volume + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsHistoricRates.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsHistoricRates.java
new file mode 100644
index 000000000..6f0ece475
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsHistoricRates.java
@@ -0,0 +1,46 @@
+package org.knowm.xchange.abucoins.dto.marketdata;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.abucoins.service.AbucoinsArrayOrMessageDeserializer;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = AbucoinsHistoricRates.AbucoinsHistoricRatesDeserializer.class)
+public class AbucoinsHistoricRates {
+ AbucoinsHistoricRate[] historicRates;
+
+ @JsonProperty("message")
+ public String message; // for error conditions
+
+ public AbucoinsHistoricRates() {}
+
+ public AbucoinsHistoricRates(AbucoinsHistoricRate[] historicRates) {
+ this.historicRates = historicRates;
+ }
+
+ public AbucoinsHistoricRate[] getHistoricRates() {
+ return historicRates;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsHistoricRates [historicRates=" + Arrays.toString(historicRates) + "]";
+ }
+
+ /**
+ * Deserializer handles the success case (array json) as well as the error case
+ * (json object with message field).
+ * @author bryant_harris
+ */
+ static class AbucoinsHistoricRatesDeserializer extends AbucoinsArrayOrMessageDeserializerPOJO representing the output JSON for the Abucoins
+ * GET /products/<product-id>/book endpoint.
+ * {
+ * "asks": [
+ * [ price, size, num-orders ],
+ * ["14160.13374000", "0.15994651", 1]
+ * ...
+ * ],
+ * "bids": [
+ * [ price, size, num-orders ],
+ * ["14140.00000000", "0.19970339", 1]
+ * ...
+ * ],
+ * "sequence": 1431
+}
+ *
+ */
+public class AbucoinsOrderBook {
+ AbucoinsOrderBook.LimitOrder[] asks;
+ AbucoinsOrderBook.LimitOrder[] bids;
+ long sequence;
+
+
+ public AbucoinsOrderBook(@JsonProperty("asks") AbucoinsOrderBook.LimitOrder[] asks,
+ @JsonProperty("bids") AbucoinsOrderBook.LimitOrder[] bids,
+ @JsonProperty("sequence") long sequence) {
+ this.asks = asks;
+ this.bids = bids;
+ this.sequence = sequence;
+ }
+
+ public AbucoinsOrderBook.LimitOrder[] getAsks() {
+ return asks;
+ }
+
+ public AbucoinsOrderBook.LimitOrder[] getBids() {
+ return bids;
+ }
+
+ public long getSequence() {
+ return sequence;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsOrderBook [asks=" + Arrays.toString(asks) + ", bids=" + Arrays.toString(bids) + ", sequence="
+ + sequence + "]";
+ }
+
+
+ @JsonFormat(shape=JsonFormat.Shape.ARRAY)
+ public static class LimitOrder {
+ BigDecimal price;
+ BigDecimal size;
+ long numOrders;
+ public BigDecimal getPrice() {
+ return price;
+ }
+ public BigDecimal getSize() {
+ return size;
+ }
+ public long getNumOrders() {
+ return numOrders;
+ }
+ @Override
+ public String toString() {
+ return "Book [price=" + price + ", size=" + size + ", numOrders=" + numOrders + "]";
+ }
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProduct.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProduct.java
new file mode 100644
index 000000000..75aa681ff
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProduct.java
@@ -0,0 +1,72 @@
+package org.knowm.xchange.abucoins.dto.marketdata;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class AbucoinsProduct {
+ /**identifier of market*/
+ String id;
+ /** which currency is buying/selling */
+ String baseCurrency;
+ /** price currency of base_currency */
+ String quoteCurrency;
+ /** minimum order size */
+ BigDecimal baseMinSize;
+ /** maximum order size */
+ BigDecimal baseMaxSize;
+ /** the order price must be a multiple of this increment */
+ BigDecimal quoteIncrement;
+ String displayName;
+
+ public AbucoinsProduct(@JsonProperty("id") String id,
+ @JsonProperty("base_currency") String baseCurrency,
+ @JsonProperty("quote_currency") String quoteCurrency,
+ @JsonProperty("base_min_size") BigDecimal baseMinSize,
+ @JsonProperty("base_max_size") BigDecimal baseMaxSize,
+ @JsonProperty("quote_increment") BigDecimal quoteIncrement,
+ @JsonProperty("base_min_size") String displayName) {
+ this.id = id;
+ this.baseCurrency = baseCurrency;
+ this.quoteCurrency = quoteCurrency;
+ this.baseMinSize = baseMinSize;
+ this.baseMaxSize = baseMaxSize;
+ this.quoteIncrement = quoteIncrement;
+ this.displayName = displayName;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getBaseCurrency() {
+ return baseCurrency;
+ }
+
+ public String getQuoteCurrency() {
+ return quoteCurrency;
+ }
+
+ public BigDecimal getBaseMinSize() {
+ return baseMinSize;
+ }
+
+ public BigDecimal getBaseMaxSize() {
+ return baseMaxSize;
+ }
+
+ public BigDecimal getQuoteIncrement() {
+ return quoteIncrement;
+ }
+
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsProduct [id=" + id + ", baseCurrency=" + baseCurrency + ", quoteCurrency=" + quoteCurrency
+ + ", baseMinSize=" + baseMinSize + ", baseMaxSize=" + baseMaxSize + ", quoteIncrement=" + quoteIncrement
+ + ", displayName=" + displayName + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProductStat.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProductStat.java
new file mode 100644
index 000000000..d2cbdf49a
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProductStat.java
@@ -0,0 +1,125 @@
+package org.knowm.xchange.abucoins.dto.marketdata;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /products/stats endpoint.
+ * [
+ * {
+ * "product_id":"BTC-PLN",
+ * "last":"14734.55000000",
+ * "open":"14734.55000000",
+ * "high":"0.00000000",
+ * "low":"0.00000000",
+ * "volume":"1.00000000",
+ * "volume_BTC":"1.00000000",
+ * "volume_USD":"4086.69",
+ * "volume_7d":"0.00000000",
+ * "volume_30d":"149.45718835",
+ * "change":"0.00"
+ * },
+ * {
+ * "product_id":"BTC-USD",
+ * "last":"4086.69000000",
+ * "open":"4086.69000000",
+ * "high":"0.00000000",
+ * "low":"0.00000000",
+ * "volume":"1.00000000",
+ * "volume_BTC":"1.00000000",
+ * "volume_USD":"4086.69",
+ * "volume_7d":"0.00000000",
+ * "volume_30d":"53.95784974",
+ * "change":"0.00"
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsProductStat {
+ String productID;
+ BigDecimal last;
+ BigDecimal open;
+ BigDecimal high;
+ BigDecimal low;
+ BigDecimal volume;
+ BigDecimal volumeBTC;
+ BigDecimal volumeUSD;
+ BigDecimal volume7d;
+ BigDecimal volume30d;
+ BigDecimal change;
+ String message;
+
+ public AbucoinsProductStat(@JsonProperty("product_id") String productID,
+ @JsonProperty("last") BigDecimal last,
+ @JsonProperty("open") BigDecimal open,
+ @JsonProperty("high") BigDecimal high,
+ @JsonProperty("low") BigDecimal low,
+ @JsonProperty("volume") BigDecimal volume,
+ @JsonProperty("volume_BTC") BigDecimal volumeBTC,
+ @JsonProperty("volume_USD") BigDecimal volumeUSD,
+ @JsonProperty("volume_7d") BigDecimal volume7d,
+ @JsonProperty("volume_30d") BigDecimal volume30d,
+ @JsonProperty("change") BigDecimal change,
+ @JsonProperty("message") String message) {
+ this.productID = productID;
+ this.last = last;
+ this.open = open;
+ this.high = high;
+ this.low = low;
+ this.volume = volume;
+ this.volumeBTC = volumeBTC;
+ this.volumeUSD = volumeUSD;
+ this.volume7d = volume7d;
+ this.volume30d = volume30d;
+ this.change = change;
+ this.message = message;
+ }
+ public String getProductID() {
+ return productID;
+ }
+ public BigDecimal getLast() {
+ return last;
+ }
+ public BigDecimal getOpen() {
+ return open;
+ }
+ public BigDecimal getHigh() {
+ return high;
+ }
+ public BigDecimal getLow() {
+ return low;
+ }
+ public BigDecimal getVolume() {
+ return volume;
+ }
+ public BigDecimal getVolumeBTC() {
+ return volumeBTC;
+ }
+ public BigDecimal getVolumeUSD() {
+ return volumeUSD;
+ }
+ public BigDecimal getVolume7d() {
+ return volume7d;
+ }
+ public BigDecimal getVolume30d() {
+ return volume30d;
+ }
+ public BigDecimal getChange() {
+ return change;
+ }
+ public String getMessage() {
+ return message;
+ }
+ @Override
+ public String toString() {
+ return "AbucoinsProductStat [productID=" + productID + ", last=" + last + ", open=" + open + ", high=" + high
+ + ", low=" + low + ", volume=" + volume + ", volumeBTC=" + volumeBTC + ", volumeUSD=" + volumeUSD
+ + ", volume7d=" + volume7d + ", volume30d=" + volume30d + ", change=" + change + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProductStats.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProductStats.java
new file mode 100644
index 000000000..65e5d927e
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsProductStats.java
@@ -0,0 +1,36 @@
+package org.knowm.xchange.abucoins.dto.marketdata;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.abucoins.service.AbucoinsArrayOrMessageDeserializer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = AbucoinsProductStats.AbucoinsProductStatsDeserializer.class)
+public class AbucoinsProductStats {
+ AbucoinsProductStat[] stats;
+
+ public AbucoinsProductStats(AbucoinsProductStat[] stats) {
+ this.stats = stats;
+ }
+
+ public AbucoinsProductStat[] getStats() {
+ return stats;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsProductStats [stats=" + Arrays.toString(stats) + "]";
+ }
+
+ /**
+ * Deserializer handles the success case (array json) as well as the error case
+ * (json object with message field).
+ * @author bryant_harris
+ */
+ static class AbucoinsProductStatsDeserializer extends AbucoinsArrayOrMessageDeserializerPOJO representing the output JSON for the Abucoins
+ * GET /products/<product-id>/ticker endpoint.
+ * {
+ * "trade_id": "553612",
+ * "price": "14160.85",
+ * "size": "0.00053",
+ * "bid": "14140.00000000",
+ * "ask": "14181.70000000",
+ * "volume": "1.09596639",
+ * "time": "2017-09-21T10:26:58Z"
+ * }
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsTicker {
+ /** identifier of the last trade */
+ String tradeID;
+
+ /** last price */
+ BigDecimal price;
+
+ /** size of the last trade */
+ BigDecimal size;
+
+ /** the best bid */
+ BigDecimal bid;
+
+ /** the best ask */
+ BigDecimal ask;
+
+ /** 24 hour volume */
+ BigDecimal volume;
+
+ /** time in UTC */
+ String time;
+
+ /**
+ * Constructor
+ *
+ * @param tradeID identifier of the last trade
+ * @param price last price
+ * @param size size of the last trade
+ * @param bid the best bid
+ * @param ask the best ask
+ * @param volume 24 hour volume
+ * @param time time in UTC
+ */
+ public AbucoinsTicker(@JsonProperty("trade_id") String tradeID, @JsonProperty("price") BigDecimal price, @JsonProperty("size") BigDecimal size, @JsonProperty("bid") BigDecimal bid, @JsonProperty("ask") BigDecimal ask,
+ @JsonProperty("volume") BigDecimal volume, @JsonProperty("time") String time) {
+ this.tradeID = tradeID;
+ this.price = price;
+ this.size = size;
+ this.bid = bid;
+ this.ask = ask;
+ this.volume = volume;
+ this.time = time;
+ }
+
+ /** identifier of the last trade */
+ public String getTradeID() {
+ return tradeID;
+ }
+
+ /** last price */
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ /** size of the last trade */
+ public BigDecimal getSize() {
+ return size;
+ }
+
+ /** the best bid */
+ public BigDecimal getBid() {
+ return bid;
+ }
+
+ /** the best ask */
+ public BigDecimal getAsk() {
+ return ask;
+ }
+
+ /** 24 hour volume */
+ public BigDecimal getVolume() {
+ return volume;
+ }
+
+ /** time in UTC */
+ public String getTime() {
+ return time;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsTicker [trade_id=" + tradeID + ", price=" + price + ", size=" + size + ", bid=" + bid + ", ask="
+ + ask + ", volume=" + volume + ", time=" + time + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsTrade.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsTrade.java
new file mode 100644
index 000000000..c71832d87
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsTrade.java
@@ -0,0 +1,98 @@
+package org.knowm.xchange.abucoins.dto.marketdata;
+
+import java.math.BigDecimal;
+
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /products/<product-id>/trades endpoint.
+ * [
+ * {
+ * "time": "2017-09-21T12:33:03Z",
+ * "trade_id": "553794",
+ * "price": "14167.99328000",
+ * "size": "0.00035000",
+ * "side": "buy"
+ * },
+ * {
+ * "time": "2017-09-21T12:32:34Z",
+ * "trade_id": "553780",
+ * "price": "14163.96328000",
+ * "size": "0.00050000",
+ * "side": "buy"
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsTrade {
+ /** time in UTC */
+ String time;
+
+ /** identifier of the last trade */
+ String tradeID;
+
+ /** last price */
+ BigDecimal price;
+
+ /** size of the last trade */
+ BigDecimal size;
+
+ /** maker order side(sell or buy) */
+ AbucoinsOrder.Side side;
+
+ /**
+ *
+ * @param time time in UTC
+ * @param tradeID identifier of the last trade
+ * @param price last price
+ * @param size size of the last trade
+ * @param side maker order side(sell or buy)
+ */
+ public AbucoinsTrade(@JsonProperty("time") String time, @JsonProperty("trade_id") String tradeID, @JsonProperty("price") BigDecimal price,
+ @JsonProperty("size") BigDecimal size, @JsonProperty("side") AbucoinsOrder.Side side) {
+
+ this.time = time;
+ this.tradeID = tradeID;
+ this.price = price;
+ this.size = size;
+ this.side = side;
+ }
+
+ /** time in UTC */
+ public String getTime() {
+ return time;
+ }
+
+ /** identifier of the last trade */
+ public String getTradeID() {
+ return tradeID;
+ }
+
+ /** last price */
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ /** size of the last trade */
+ public BigDecimal getSize() {
+ return size;
+ }
+
+ /** maker order side(sell or buy) */
+ public AbucoinsOrder.Side getSide() {
+ return side;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsTrade [time=" + time + ", tradeID=" + tradeID + ", price=" + price + ", size=" + size + ", side="
+ + side + "]";
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/trade/AbucoinsOrder.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/trade/AbucoinsOrder.java
new file mode 100644
index 000000000..b22c2b0fc
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/trade/AbucoinsOrder.java
@@ -0,0 +1,181 @@
+package org.knowm.xchange.abucoins.dto.trade;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /orders endpoint.
+ * [
+ * {
+ * "id": "7786713",
+ * "price": "0.05367433",
+ * "size": "0.10451686",
+ * "product_id": "ZEC-BTC",
+ * "side": "buy",
+ * "type": "limit",
+ * "time_in_force": "GTC",
+ * "post_only": false,
+ * "created_at": "2017-09-03T03:33:17Z",
+ * "filled_size": "0.00000000",
+ * "status": "closed",
+ * "settled": false
+ * },
+ * {
+ * "id": "7786713",
+ * "price": "0.05367433",
+ * "size": "0.10451686",
+ * "product_id": "ZEC-BTC",
+ * "side": "buy",
+ * "type": "limit",
+ * "time_in_force": "GTC",
+ * "post_only": false,
+ * "created_at": "2017-09-03T03:33:17Z",
+ * "filled_size": "0.00000000",
+ * "status": "closed",
+ * "settled": false
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+public class AbucoinsOrder {
+ String id;
+ BigDecimal price;
+ BigDecimal size;
+ String productID;
+ Side side;
+ Type type;
+ TimeInForce timeInForce;
+ boolean postOnly;
+ String createdAt;
+ BigDecimal filledSize;
+ Status status;
+ boolean settled;
+ String message;
+
+ public AbucoinsOrder(@JsonProperty("id") String id,
+ @JsonProperty("price") BigDecimal price,
+ @JsonProperty("size") BigDecimal size,
+ @JsonProperty("product_id") String productID,
+ @JsonProperty("side") Side side,
+ @JsonProperty("type") Type type,
+ @JsonProperty("time_in_force") TimeInForce timeInForce,
+ @JsonProperty("post_only") boolean postOnly,
+ @JsonProperty("created_at") String createdAt,
+ @JsonProperty("filled_size") BigDecimal filledSize,
+ @JsonProperty("status") Status status,
+ @JsonProperty("settled") boolean settled,
+ @JsonProperty("message") String message) {
+ this.id = id;
+ this.price = price;
+ this.size = size;
+ this.productID = productID;
+ this.side = side;
+ this.type = type;
+ this.timeInForce = timeInForce;
+ this.postOnly = postOnly;
+ this.createdAt = createdAt;
+ this.filledSize = filledSize;
+ this.status = status;
+ this.settled = settled;
+ this.message = message;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public BigDecimal getPrice() {
+ return price;
+ }
+
+ public BigDecimal getSize() {
+ return size;
+ }
+
+ public String getProductID() {
+ return productID;
+ }
+
+ public Side getSide() {
+ return side;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ public TimeInForce getTimeInForce() {
+ return timeInForce;
+ }
+
+ public boolean isPostOnly() {
+ return postOnly;
+ }
+
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ public BigDecimal getFilledSize() {
+ return filledSize;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public boolean isSettled() {
+ return settled;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsOrder [id=" + id + ", price=" + price + ", size=" + size + ", productID=" + productID + ", side="
+ + side + ", type=" + type + ", timeInForce=" + timeInForce + ", postOnly=" + postOnly + ", createdAt="
+ + createdAt + ", filledSize=" + filledSize + ", status=" + status + ", settled=" + settled + ", message="
+ + message + "]";
+ }
+
+ public enum Side {
+ buy, sell
+ }
+
+ public enum Type {
+ limit, market;
+ }
+
+ public enum TimeInForce {
+ GTC, GTT, IOC, FOK;
+
+ public String toDescription() {
+ switch (this) {
+ case GTC:
+ return "Good Till Canceled";
+
+ case GTT:
+ return "Good Till Time";
+
+ case IOC:
+ return "Immediate or cancel";
+
+ case FOK:
+ return "Fill or kill";
+ }
+ return ""; // dead code path
+ }
+ }
+
+ public enum Status {
+ pending, open, done, rejected;
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/trade/AbucoinsOrders.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/trade/AbucoinsOrders.java
new file mode 100644
index 000000000..c14e4415c
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/dto/trade/AbucoinsOrders.java
@@ -0,0 +1,75 @@
+package org.knowm.xchange.abucoins.dto.trade;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.abucoins.service.AbucoinsArrayOrMessageDeserializer;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+/**
+ * POJO representing the output JSON for the Abucoins
+ * GET /orders endpoint.
+ * [
+ * {
+ * "id": "7786713",
+ * "price": "0.05367433",
+ * "size": "0.10451686",
+ * "product_id": "ZEC-BTC",
+ * "side": "buy",
+ * "type": "limit",
+ * "time_in_force": "GTC",
+ * "post_only": false,
+ * "created_at": "2017-09-03T03:33:17Z",
+ * "filled_size": "0.00000000",
+ * "status": "closed",
+ * "settled": false
+ * },
+ * {
+ * "id": "7786713",
+ * "price": "0.05367433",
+ * "size": "0.10451686",
+ * "product_id": "ZEC-BTC",
+ * "side": "buy",
+ * "type": "limit",
+ * "time_in_force": "GTC",
+ * "post_only": false,
+ * "created_at": "2017-09-03T03:33:17Z",
+ * "filled_size": "0.00000000",
+ * "status": "closed",
+ * "settled": false
+ * }
+ * ]
+ *
+ * @author bryant_harris
+ */
+@JsonDeserialize(using = AbucoinsOrders.AbucoinsOrdersDeserializer.class)
+public class AbucoinsOrders {
+ AbucoinsOrder[] orders;
+
+ public AbucoinsOrders(AbucoinsOrder[] orders) {
+ this.orders = orders;
+ }
+
+ public AbucoinsOrder[] getOrders() {
+ return orders;
+ }
+
+ @Override
+ public String toString() {
+ return "AbucoinsOrders [orders=" + Arrays.toString(orders) + "]";
+ }
+
+ /**
+ * Deserializer handles the success case (array json) as well as the error case
+ * (json object with message field).
+ * @author bryant_harris
+ */
+ static class AbucoinsOrdersDeserializer extends AbucoinsArrayOrMessageDeserializerClass providing a 1:1 proxy for the Abucoins account related + * REST requests.
+ * + *GET /accounts
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsAccount[] getAbucoinsAccounts() throws IOException {
+ AbucoinsAccounts accounts = abucoinsAuthenticated.getAccounts(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+
+ if ( accounts.getAccounts().length == 1 && accounts.getAccounts()[0].getMessage() != null )
+ throw new ExchangeException( accounts.getAccounts()[0].getMessage() );
+ return accounts.getAccounts();
+ }
+
+ /**
+ * Corresponds to GET /accounts/<account-id>
+ * @param accountID
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsAccount getAbucoinsAccount(String accountID) throws IOException {
+ AbucoinsAccount account = abucoinsAuthenticated.getAccount(accountID,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ if ( account.getMessage() != null )
+ throw new ExchangeException( account.getMessage() );
+
+ return account;
+ }
+
+ /**
+ * Corresponds to GET /payment-methods
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsPaymentMethod[] getPaymentMethods() throws IOException {
+ AbucoinsPaymentMethods paymentMethods = abucoinsAuthenticated.getPaymentMethods(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+
+ if ( paymentMethods.getPaymentMethods().length == 1 && paymentMethods.getPaymentMethods()[0].getMessage() != null )
+ throw new ExchangeException(paymentMethods.getPaymentMethods()[0].getMessage());
+ return paymentMethods.getPaymentMethods();
+ }
+
+ /**
+ * Corresponds to POST withdrawals/crypto
+ * @param withdrawRequest
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsCryptoWithdrawal abucoinsWithdraw(AbucoinsCryptoWithdrawalRequest withdrawRequest) throws IOException {
+ return abucoinsAuthenticated.cryptoWithdrawal(withdrawRequest,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ }
+
+ /**
+ * Corresponds to POST deposits/crypto
+ * @param cryptoRequest
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsCryptoDeposit abucoinsCryptoDeposit(AbucoinsCryptoDepositRequest cryptoRequest) throws IOException {
+ return abucoinsAuthenticated.cryptoDeposit(cryptoRequest,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ }
+
+ /**
+ * Helper method that obtains the payment method for a given currency, based on the payment-method information
+ * returned from abucoins.
+ * @param currency
+ * @return The type (string) of the payment method.
+ * @throws IOException
+ */
+ public String abucoinsPaymentMethodForCurrency(String currency) throws IOException {
+ String method = null;
+ AbucoinsPaymentMethod[] paymentMethods = getPaymentMethods();
+ for ( AbucoinsPaymentMethod apm : paymentMethods ) {
+ if ( apm.getCurrency().equals(currency)) {
+ method = apm.getType();
+ break;
+ }
+ }
+
+ if ( method == null )
+ logger.warn("Unable to determine the payment method suitable for " + currency + " this will likely lead to an error");
+
+ return method;
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsArrayOrMessageDeserializer.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsArrayOrMessageDeserializer.java
new file mode 100644
index 000000000..9a2cea6b4
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsArrayOrMessageDeserializer.java
@@ -0,0 +1,91 @@
+package org.knowm.xchange.abucoins.service;
+
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+
+/**
+ * For several of the Abucoins APIs a JSON array is returned. If there is an error however, the json is + * a json object not an array. To handle this case we have this generic JsonDeserializer that can handle an array or + * a json object being returned.
+ * + *Class providing a 1:1 proxy for the Abucoins market related + * REST requests.
+ * + *GET /time
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsServerTime getAbucoinsServerTime() throws IOException {
+ return abucoins.getTime();
+ }
+
+ /**
+ * Corresponds to GET /products
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsProduct[] getAbucoinsProducts() throws IOException {
+ return abucoins.getProducts();
+ }
+
+ /**
+ * Corresponds to GET /products/{product-id}
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsProduct getAbucoinsProduct(String productID) throws IOException {
+ return abucoins.getProduct(productID);
+ }
+
+ /**
+ * Corresponds to GET /products/{product-id}/book
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsOrderBook getAbucoinsOrderBook(String productID) throws IOException {
+ return abucoins.getBook(productID);
+ }
+
+ /**
+ * Corresponds to GET /products/{product-id}/book?level={level}
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsOrderBook getAbucoinsOrderBook(String productID, AbucoinsOrderBookLevel level) throws IOException {
+ return abucoins.getBook(productID, level.name());
+ }
+
+ /**
+ * Corresponds to GET /products/{product-id}/ticker
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsTicker getAbucoinsTicker(String productID) throws IOException {
+
+ AbucoinsTicker abucoinsTicker = abucoins.getTicker(productID);
+
+ return abucoinsTicker;
+ }
+
+ /**
+ * Corresponds to GET /products/{product-id}/trades
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsTrade[] getAbucoinsTrades(String productID) throws IOException {
+ return abucoins.getTrades(productID);
+ }
+
+ /**
+ * Corresponds to GET /products/<product-id>/candles?granularity=[granularity]&start=[UTC time of start]&end=[UTC time of end]
+ * @param productID
+ * @param granularitySeconds Desired timeslice in seconds
+ * @param start Start time
+ * @param end End time
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsHistoricRate[] getAbucoinsHistoricRates(String productID, long granularitySeconds, Date start, Date end) throws IOException {
+ if ( start == null || end == null )
+ throw new IllegalArgumentException("Must provide begin and end dates");
+
+ String granularity = String.valueOf(granularitySeconds);
+
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ String startDate = dateFormat.format(start);
+ String endDate = dateFormat.format(end);
+
+ AbucoinsHistoricRates rates = abucoins.getHistoricRates(productID, granularity, startDate, endDate);
+ if ( rates.getMessage() != null )
+ throw new ExchangeException( rates.getMessage() );
+
+ return rates.getHistoricRates();
+ }
+
+ /**
+ * Corresponds to GET /products/stats
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsProductStat[] getAbucoinsProductStats() throws IOException {
+ AbucoinsProductStats stats = abucoins.getProductStats();
+
+ if ( stats.getStats().length == 1 && stats.getStats()[0].getMessage() != null )
+ throw new ExchangeException(stats.getStats()[0].getMessage() );
+
+ return stats.getStats();
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsOrderBookLevel.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsOrderBookLevel.java
new file mode 100644
index 000000000..2007ec894
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsOrderBookLevel.java
@@ -0,0 +1,21 @@
+package org.knowm.xchange.abucoins.service;
+
+public enum AbucoinsOrderBookLevel {
+ fullyAggregated,
+ bestAskAndBid,
+ top50AsksAndBids;
+
+ public String toLevelParameter() {
+ switch(this) {
+ default:
+ case fullyAggregated:
+ return "0";
+
+ case bestAskAndBid:
+ return "1";
+
+ case top50AsksAndBids:
+ return "2";
+ }
+ }
+}
diff --git a/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsTradeService.java b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsTradeService.java
new file mode 100644
index 000000000..a1fe647ee
--- /dev/null
+++ b/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsTradeService.java
@@ -0,0 +1,127 @@
+package org.knowm.xchange.abucoins.service;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.knowm.xchange.Exchange;
+import org.knowm.xchange.abucoins.AbucoinsAdapters;
+import org.knowm.xchange.abucoins.dto.AbucoinsCreateLimitOrderRequest;
+import org.knowm.xchange.abucoins.dto.AbucoinsCreateMarketOrderRequest;
+import org.knowm.xchange.abucoins.dto.AbucoinsOrderRequest;
+import org.knowm.xchange.abucoins.dto.marketdata.AbucoinsCreateOrderResponse;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+import org.knowm.xchange.dto.Order;
+import org.knowm.xchange.dto.trade.*;
+import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
+import org.knowm.xchange.service.trade.TradeService;
+import org.knowm.xchange.service.trade.params.CancelOrderByCurrencyPair;
+import org.knowm.xchange.service.trade.params.CancelOrderParams;
+import org.knowm.xchange.service.trade.params.TradeHistoryParams;
+import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair;
+import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamCurrencyPair;
+import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
+
+/**
+ * Author: bryant_harris
+ */
+
+public class AbucoinsTradeService extends AbucoinsTradeServiceRaw implements TradeService {
+
+ /**
+ * Constructor
+ *
+ * @param exchange
+ */
+ public AbucoinsTradeService(Exchange exchange) {
+
+ super(exchange);
+ }
+
+ @Override
+ public OpenOrders getOpenOrders() throws IOException {
+ return getOpenOrders(createOpenOrdersParams());
+ }
+
+ @Override
+ public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
+ if ( params instanceof OpenOrdersParamCurrencyPair ) {
+ OpenOrdersParamCurrencyPair cpParams = (OpenOrdersParamCurrencyPair) params;
+ AbucoinsOrderRequest orderRequest = new AbucoinsOrderRequest(AbucoinsOrder.Status.open,
+ AbucoinsAdapters.adaptCurrencyPairToProductID(cpParams.getCurrencyPair()));
+ AbucoinsOrder[] openOrders = getAbucoinsOrders(orderRequest);
+ return AbucoinsAdapters.adaptOpenOrders(openOrders);
+ }
+
+ throw new NotYetImplementedForExchangeException("Only OpenOrdersParamCurrencyPair supported");
+ }
+
+ @Override
+ public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
+ AbucoinsCreateMarketOrderRequest req = AbucoinsAdapters.adaptAbucoinsCreateMarketOrderRequest(marketOrder);
+ AbucoinsCreateOrderResponse resp = createAbucoinsOrder(req);
+ if ( resp.getMessage() != null )
+ throw new IOException(resp.getMessage());
+ return resp.getId();
+ }
+
+ @Override
+ public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
+ AbucoinsCreateLimitOrderRequest req = AbucoinsAdapters.adaptAbucoinsCreateLimitOrderRequest(limitOrder);
+ AbucoinsCreateOrderResponse resp = createAbucoinsOrder(req);
+ if ( resp.getMessage() != null )
+ throw new IOException(resp.getMessage());
+ return resp.getId();
+ }
+
+ @Override
+ public String placeStopOrder(StopOrder stopOrder) throws IOException {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public boolean cancelOrder(String orderId) throws IOException {
+
+ String id = deleteAbucoinsOrder(orderId);
+ return id.equals(orderId);
+ }
+
+ @Override
+ public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
+ if (orderParams instanceof CancelOrderByCurrencyPair) {
+ CancelOrderByCurrencyPair cob = (CancelOrderByCurrencyPair) orderParams;
+ deleteAllAbucoinsOrders(AbucoinsAdapters.adaptCurrencyPairToProductID(cob.getCurrencyPair()));
+ return true;
+ } else {
+ throw new NotYetImplementedForExchangeException("Only CancelOrderByCurrencyPair supported");
+ }
+ }
+
+ @Override
+ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public TradeHistoryParams createTradeHistoryParams() {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public OpenOrdersParams createOpenOrdersParams() {
+ return new DefaultOpenOrdersParamCurrencyPair();
+ }
+
+ @Override
+ public CollectionClass providing a 1:1 proxy for the Abucoins market related + * REST requests.
+ * + *GET orders/{order-id} or GET orders?status={status} or
+ * orders?product_id={product-id} or orders?status={status}&product_id={product-id}.
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsOrder[] getAbucoinsOrders(AbucoinsOrderRequest request) throws IOException {
+ AbucoinsOrder.Status status = null;
+ String productID = null;
+ if ( request != null ) {
+ status = request.getStatus();
+ productID = request.getProductID();
+ }
+
+ if ( status != null ) {
+ switch (status) {
+ default:
+ case open:
+ case done:
+ break;
+
+ case pending:
+ case rejected:
+ throw new IllegalArgumentException("/orders only accepts status of 'open' or 'done' not " + status);
+ }
+ }
+
+ AbucoinsOrders retVal = null;
+ if ( status == null ) {
+ if ( productID == null )
+ retVal = abucoinsAuthenticated.getOrders(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ else
+ retVal = abucoinsAuthenticated.getOrdersByProductID(productID,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ }
+ else {
+ if ( productID == null )
+ retVal = abucoinsAuthenticated.getOrdersByStatus(status.name(),
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ else
+ retVal = abucoinsAuthenticated.getOrdersByStatusAndProductID(status.name(),
+ productID,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ }
+
+ if ( retVal.getOrders().length == 1 && retVal.getOrders()[0].getMessage() != null )
+ throw new ExchangeException( retVal.getOrders()[0].getMessage() );
+
+ return retVal.getOrders();
+ }
+
+ /**
+ * Helper method that wraps {@link #getAbucoinsOrders(AbucoinsOrderRequest)} allowing you to get an order
+ * by order-id.
+ * @param orderID The OrderID of the order to retreive.
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsOrder getAbucoinsOrder(String orderID) throws IOException {
+ AbucoinsOrder order = abucoinsAuthenticated.getOrder(orderID,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ if ( order.getMessage() != null )
+ throw new ExchangeException( order.getMessage() );
+
+ return order;
+ }
+
+ /**
+ * Corresponds to POST orders
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsCreateOrderResponse createAbucoinsOrder(AbucoinsBaseCreateOrderRequest req) throws IOException {
+ AbucoinsCreateOrderResponse resp = abucoinsAuthenticated.createOrder(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp(),
+ req);
+ if ( resp.getMessage() != null )
+ throw new ExchangeException( resp.getMessage() );
+
+ return resp;
+ }
+
+ /**
+ * Corresponds to DELETE orders/{order-id}
+ * @return
+ * @throws IOException
+ */
+ public String deleteAbucoinsOrder(String orderID) throws IOException {
+ String resp = abucoinsAuthenticated.deleteOrder(orderID,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ String[] ids = AbucoinsAdapters.adaptToSetOfIDs(resp);
+ return ids[0];
+ }
+
+ /**
+ * Corresponds to DELETE /orders or DELETE orders?product_id={product-id}
+ * @return
+ * @throws IOException
+ */
+ public String[] deleteAllAbucoinsOrders(String... productIDs) throws IOException {
+ String res;
+ if ( productIDs.length == 0 )
+ return AbucoinsAdapters.adaptToSetOfIDs(abucoinsAuthenticated.deleteAllOrders(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp()));
+ else {
+ List ids = new ArrayList<>();
+ for ( String productID : productIDs ) {
+ res = abucoinsAuthenticated.deleteAllOrdersForProduct(productID,
+ exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ String[] deletedIds = AbucoinsAdapters.adaptToSetOfIDs(res);
+ for ( String id : deletedIds )
+ ids.add(id);
+ }
+ return ids.toArray(new String[ids.size()]);
+ }
+ }
+
+ /**
+ * Corresponds to GET /fills
+ * @return
+ * @throws IOException
+ */
+ public AbucoinsFill[] getFills() throws IOException {
+ AbucoinsFills fills = abucoinsAuthenticated.getFills(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator,
+ exchange.getExchangeSpecification().getPassword(),
+ timestamp());
+ if ( fills.getFills().length == 1 && fills.getFills()[0].getMessage() != null )
+ throw new ExchangeException( fills.getFills()[0].getMessage() );
+
+ return fills.getFills();
+ }
+}
diff --git a/xchange-abucoins/src/main/resources/abucoins.json b/xchange-abucoins/src/main/resources/abucoins.json
new file mode 100644
index 000000000..f43d2dcf3
--- /dev/null
+++ b/xchange-abucoins/src/main/resources/abucoins.json
@@ -0,0 +1,248 @@
+{
+ "currency_pairs": {
+ "BTC/PLN": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "ETH/PLN": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "BTC/EUR": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "BTC/USD": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.100000000
+ },
+ "BCH/PLN": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.500000000
+ },
+ "BCH/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.500000000
+ },
+ "ETH/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.500000000
+ },
+ "DASH/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.100000000
+ },
+ "ZEC/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.0100000000
+ },
+ "XMR/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.0100000000
+ },
+ "BTG/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "LTC/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "REP/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "ETC/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "STRAT/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "XRP/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "XEM/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "GNT/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "SC/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "ETH/EUR": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "LSK/PLN": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "LSK/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "BCH/EUR": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "ETH/USD": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "BTG/PLN": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "BCH/USD": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "LSK/USD": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "LSK/EUR": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "BTG/EUR": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ },
+ "HSR/BTC": {
+ "price_scale": 8,
+ "trading_fee": 0.001,
+ "min_amount": 0.010000000
+ },
+ "BTG/USD": {
+ "price_scale": 2,
+ "trading_fee": 0.0025,
+ "min_amount": 0.010000000
+ }
+ },
+ "currencies": {
+ "BCH": {
+ "scale": 8,
+ "withdrawal_fee": 0.0001
+ },
+ "BTC": {
+ "scale": 8,
+ "withdrawal_fee": 0.001
+ },
+ "BTG": {
+ "scale": 8,
+ "withdrawal_fee": 0.0005
+ },
+ "DASH": {
+ "scale": 8,
+ "withdrawal_fee": 0.01
+ },
+ "ETC": {
+ "scale": 8,
+ "withdrawal_fee": 0.01
+ },
+ "ETH": {
+ "scale": 8,
+ "withdrawal_fee": 0.005
+ },
+ "EUR": {
+ "scale": 2,
+ "withdrawal_fee": 1
+ },
+ "GNT": {
+ "scale": 8,
+ "withdrawal_fee": 0.01
+ },
+ "HSR": {
+ "scale": 8,
+ "withdrawal_fee": 0.5
+ },
+ "LSK": {
+ "scale": 8,
+ "withdrawal_fee": 0.2
+ },
+ "LTC": {
+ "scale": 8,
+ "withdrawal_fee": 0.001
+ },
+ "PLN": {
+ "scale": 2,
+ "withdrawal_fee": 0
+ },
+ "REP": {
+ "scale": 8,
+ "withdrawal_fee": 0.01
+ },
+ "SC": {
+ "scale": 8,
+ "withdrawal_fee": 10
+ },
+ "STRAT": {
+ "scale": 8,
+ "withdrawal_fee": 0.01
+ },
+ "USD": {
+ "scale": 2,
+ "withdrawal_fee": 50
+ },
+ "XEM": {
+ "scale": 8,
+ "withdrawal_fee": 2
+ },
+ "XMR": {
+ "scale": 8,
+ "withdrawal_fee": 0.02
+ },
+ "XRP": {
+ "scale": 8,
+ "withdrawal_fee": 0.5
+ },
+ "ZEC": {
+ "scale": 8,
+ "withdrawal_fee": 0.001
+ }
+ },
+ "private_rate_limits": [
+ {
+ "calls": 60,
+ "time_unit": "minutes"
+ }
+ ],
+ "share_rate_limits": true
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsAdaptersAdaptCurrenyPairTest.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsAdaptersAdaptCurrenyPairTest.java
new file mode 100644
index 000000000..188c22eaa
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsAdaptersAdaptCurrenyPairTest.java
@@ -0,0 +1,20 @@
+package org.knowm.xchange.abucoins;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.knowm.xchange.currency.CurrencyPair;
+
+public class AbucoinsAdaptersAdaptCurrenyPairTest {
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @Test
+ public void testAdaptsAbucoinsProductIDToCurrencyPair() {
+ assertEquals("Not adapting", CurrencyPair.BTC_USD, AbucoinsAdapters.adaptCurrencyPair("BTC-USD"));
+ }
+
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsAdaptersSplitIDsTest.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsAdaptersSplitIDsTest.java
new file mode 100644
index 000000000..9a6c5edcb
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsAdaptersSplitIDsTest.java
@@ -0,0 +1,27 @@
+package org.knowm.xchange.abucoins;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class AbucoinsAdaptersSplitIDsTest {
+
+ @Test
+ public void testSingleID() {
+ String[] string = AbucoinsAdapters.adaptToSetOfIDs("[\"1111\"]");
+ assertNotNull("null response", string);
+ assertEquals("wrong number of strings", 1, string.length);
+ assertEquals("Wrong value", "1111", string[0]);
+ }
+
+ @Test
+ public void testMultipleIDs() {
+ String[] string = AbucoinsAdapters.adaptToSetOfIDs("[\"1111\",\"2222\", \"3333\"]");
+ assertNotNull("null response", string);
+ assertEquals("wrong number of strings", 3, string.length);
+ assertEquals("Wrong value", "1111", string[0]);
+ assertEquals("Wrong value", "2222", string[1]);
+ assertEquals("Wrong value", "3333", string[2]);
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsExchangeMetaDataTest.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsExchangeMetaDataTest.java
new file mode 100644
index 000000000..49d483140
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/AbucoinsExchangeMetaDataTest.java
@@ -0,0 +1,45 @@
+package org.knowm.xchange.abucoins;
+
+import static org.junit.Assert.*;
+
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.knowm.xchange.ExchangeFactory;
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.meta.CurrencyMetaData;
+import org.knowm.xchange.dto.meta.CurrencyPairMetaData;
+import org.knowm.xchange.dto.meta.ExchangeMetaData;
+
+public class AbucoinsExchangeMetaDataTest {
+ AbucoinsExchange exchange;
+
+ @Before
+ public void setUp() throws Exception {
+ exchange = (AbucoinsExchange) ExchangeFactory.INSTANCE.createExchange(AbucoinsExchange.class);
+ }
+
+ @Test
+ public void testCurrencyPairs() {
+ ExchangeMetaData metaData = exchange.getExchangeMetaData();
+ assertNotNull("meta data is null", metaData);
+
+ Map currencyPairs = metaData.getCurrencyPairs();
+
+ assertNotNull("currencyPairs meta data is null", currencyPairs);
+ assertEquals("Wrong number of currency pairs", 31, currencyPairs.size());
+ }
+
+ @Test
+ public void testCurrencies() {
+ ExchangeMetaData metaData = exchange.getExchangeMetaData();
+ assertNotNull("meta data is null", metaData);
+
+ Map currencies = metaData.getCurrencies();
+
+ assertNotNull("currencies meta data is null", currencies);
+ assertEquals("Wrong number of currencies", 20, currencies.size());
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateLimitOrderRequestSkipsOptionalTest.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateLimitOrderRequestSkipsOptionalTest.java
new file mode 100644
index 000000000..0eae1b2fb
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/AbucoinsCreateLimitOrderRequestSkipsOptionalTest.java
@@ -0,0 +1,60 @@
+package org.knowm.xchange.abucoins.dto;
+
+import static org.junit.Assert.*;
+
+import java.math.BigDecimal;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.knowm.xchange.abucoins.AbucoinsAdapters;
+import org.knowm.xchange.abucoins.dto.trade.AbucoinsOrder;
+import org.knowm.xchange.currency.CurrencyPair;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+
+public class AbucoinsCreateLimitOrderRequestSkipsOptionalTest {
+ AbucoinsCreateLimitOrderRequest request;
+ ObjectMapper objectMapper;
+
+ @Before
+ public void setUp() throws Exception {
+ objectMapper = new ObjectMapper();
+ SimpleModule module = new SimpleModule();
+ module.addSerializer(BigDecimal.class, new ToStringSerializer());
+ objectMapper.registerModule(module);
+ }
+
+ @Test
+ public void testSkipsOptionalValuesWhenNull() throws Exception {
+ request = new AbucoinsCreateLimitOrderRequest(AbucoinsOrder.Side.buy, AbucoinsAdapters.adaptCurrencyPairToProductID(CurrencyPair.BTC_USD), new BigDecimal("500"), new BigDecimal("2"));
+ String s = objectMapper.writeValueAsString(request);
+ assertNotNull("String is null", s);
+ assertFalse("Contains optional stp", s.indexOf("stp") != -1);
+ assertFalse("Contains optional hidden", s.indexOf("hidden") != -1);
+ assertFalse("Contains optional time_in_force", s.indexOf("time_in_force") != -1);
+ assertFalse("Contains optional cancel_after", s.indexOf("cancel_after") != -1);
+ assertFalse("Contains optional post_only", s.indexOf("post_only") != -1);
+ }
+
+ @Test
+ public void testIncludesOptionalValues() throws Exception {
+ request = new AbucoinsCreateLimitOrderRequest(AbucoinsOrder.Side.buy,
+ AbucoinsAdapters.adaptCurrencyPairToProductID(CurrencyPair.BTC_USD),
+ "co",
+ true,
+ new BigDecimal("500"),
+ new BigDecimal("2"),
+ AbucoinsOrder.TimeInForce.FOK,
+ null,
+ null);
+ String s = objectMapper.writeValueAsString(request);
+ assertNotNull("String is null", s);
+ assertTrue("Contains optional stp", s.indexOf("stp") != -1);
+ assertTrue("Contains optional hidden", s.indexOf("hidden") != -1);
+ assertTrue("Contains optional time_in_force", s.indexOf("time_in_force") != -1);
+ assertFalse("Contains optional cancel_after", s.indexOf("cancel_after") != -1);
+ assertFalse("Contains optional post_only", s.indexOf("post_only") != -1);
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccountsJsonSerializationTest.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccountsJsonSerializationTest.java
new file mode 100644
index 000000000..66f7aaf79
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/account/AbucoinsAccountsJsonSerializationTest.java
@@ -0,0 +1,40 @@
+package org.knowm.xchange.abucoins.dto.account;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * Test that confirms we can handle array json (success case from REST call)
+ * as well as object json (occurs during the error case for the REST call).
+ */
+public class AbucoinsAccountsJsonSerializationTest {
+ ObjectMapper objectMapper;
+
+ @Before
+ public void setUp() throws Exception {
+ objectMapper = new ObjectMapper();
+ }
+
+ @Test
+ public void testJsonArray() throws Exception {
+ String json = "[ { \"id\": \"3-BTC\", \"currency\": \"BTC\", \"balance\": 13.38603805, \"available\": 13.38589212, \"available_btc\": 13.38589212," +
+ "\"hold\": 0.00014593, \"profile_id\": 3 }, { \"id\": \"3-ETH\", \"currency\": \"ETH\", \"balance\": 133.48685448, \"available\": " +
+ "133.48685448, \"available_btc\": 9.38012126, \"hold\": 0, \"profile_id\": 3 } ]";
+ AbucoinsAccounts accounts = objectMapper.readValue(json, AbucoinsAccounts.class);
+ assertNotNull("Accounts are null", accounts);
+ assertEquals("Not two elements in array", 2, accounts.accounts.length);
+ }
+
+ @Test
+ public void testErrorMessage() throws Exception {
+ String json = "{ \"message\" : \"PERMISSION DENIED\" }";
+ AbucoinsAccounts accounts = objectMapper.readValue(json, AbucoinsAccounts.class);
+ assertNotNull("Accounts are null", accounts);
+ assertEquals("Wrong number of elements", 1, accounts.accounts.length);
+ assertEquals("Error message not parsed", "PERMISSION DENIED", accounts.accounts[0].getMessage());
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsHistoricRatesJsonSerializationTest.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsHistoricRatesJsonSerializationTest.java
new file mode 100644
index 000000000..90294fb2a
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/dto/marketdata/AbucoinsHistoricRatesJsonSerializationTest.java
@@ -0,0 +1,41 @@
+package org.knowm.xchange.abucoins.dto.marketdata;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.knowm.xchange.abucoins.dto.account.AbucoinsAccounts;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * Test that confirms we can handle array json (success case from REST call)
+ * as well as object json (occurs during the error case for the REST call).
+ */
+public class AbucoinsHistoricRatesJsonSerializationTest {
+ ObjectMapper objectMapper;
+
+ @Before
+ public void setUp() throws Exception {
+ objectMapper = new ObjectMapper();
+ }
+
+ @Test
+ public void testJsonArray() throws Exception {
+ String json = "[ [ \"1505984400\", \"14209.92500000\", \"14209.92500000\", \"14209.92500000\", \"14209.92500000\", \"0.001\" ], [ \"1505984460\"," +
+ " \"14209.92500000\", \"14209.92500000\", \"14209.92500000\", \"14209.92500000\", \"0.00052\" ], [ \"1505984520\",\n" +
+ " \"14209.92500000\", \"14209.92500000\", \"14209.92500000\", \"14209.92500000\", \"0.00068\" ] ]";
+ AbucoinsHistoricRates accounts = objectMapper.readValue(json, AbucoinsHistoricRates.class);
+ assertNotNull("Accounts are null", accounts);
+ assertEquals("Not two elements in array", 3, accounts.historicRates.length);
+ }
+
+ @Test
+ public void testErrorMessage() throws Exception {
+ String json = "{ \"message\" : \"PERMISSION DENIED\" }";
+ AbucoinsHistoricRates accounts = objectMapper.readValue(json, AbucoinsHistoricRates.class);
+ assertNotNull("Accounts are null", accounts);
+ assertNotNull("Error message not parsed", accounts.getMessage());
+ assertEquals("Error message not parsed", "PERMISSION DENIED", accounts.getMessage());
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/account/AccountsFetchIntegration.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/account/AccountsFetchIntegration.java
new file mode 100644
index 000000000..333d9739d
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/account/AccountsFetchIntegration.java
@@ -0,0 +1,63 @@
+package org.knowm.xchange.abucoins.service.account;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Arrays;
+
+import org.knowm.xchange.Exchange;
+import org.knowm.xchange.ExchangeFactory;
+import org.knowm.xchange.ExchangeSpecification;
+import org.knowm.xchange.abucoins.AbucoinsExchange;
+import org.knowm.xchange.abucoins.dto.account.AbucoinsAccount;
+import org.knowm.xchange.abucoins.dto.account.AbucoinsPaymentMethod;
+import org.knowm.xchange.abucoins.service.AbucoinsAccountService;
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.dto.account.AccountInfo;
+
+/**
+ * Not structured as a unit test because it requires API Key information to run properly.
+ * @author bryant_harris
+ */
+public class AccountsFetchIntegration {
+ public static final String ABUCOINS_PASSPHRASE = " -- replace with your passphrase --";
+ public static final String ABUCOINS_KEY = " -- replace with your key --";
+ public static final String ABUCOINS_SECRET = " -- replace with your secret --";
+
+ public static void main(String[] args) throws Exception {
+ AccountsFetchIntegration test = new AccountsFetchIntegration();
+ test.accountsFetchTest();
+ }
+
+ public void accountsFetchTest() throws Exception {
+ ExchangeSpecification exSpec = new AbucoinsExchange().getDefaultExchangeSpecification();
+
+ exSpec.setPassword(ABUCOINS_PASSPHRASE);
+ exSpec.setApiKey(ABUCOINS_KEY);
+ exSpec.setSecretKey(ABUCOINS_SECRET);
+ Exchange exchange = ExchangeFactory.INSTANCE.createExchange( exSpec );
+
+ AbucoinsAccountService accountService = (AbucoinsAccountService) exchange.getAccountService();
+ AbucoinsAccount[] accountInfo = accountService.getAbucoinsAccounts();
+ assertThat(accountInfo).isNotNull();
+ System.out.println(Arrays.asList(accountInfo));
+
+ AccountInfo info = accountService.getAccountInfo();
+ System.out.println(info);
+
+ AbucoinsPaymentMethod[] paymentMethods = accountService.getPaymentMethods();
+ assertThat(paymentMethods).isNotNull();
+ System.out.println(Arrays.asList(paymentMethods));
+
+ String address = accountService.requestDepositAddress(Currency.BTC);
+ assertThat(address).isNotNull();
+ System.out.println("BTC: Address " + address);
+
+ address = accountService.requestDepositAddress(Currency.ETH);
+ assertThat(address).isNotNull();
+ System.out.println("ETH: Address " + address);
+
+ address = accountService.requestDepositAddress(Currency.BCH);
+ assertThat(address).isNotNull();
+ System.out.println("BCH: Address " + address);
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/account/Api.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/account/Api.java
new file mode 100644
index 000000000..e3b18349c
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/account/Api.java
@@ -0,0 +1,82 @@
+package org.knowm.xchange.abucoins.service.account;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Base64;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+
+/**
+ * Sample more or less cut and pasted from Abucoins API documentation. Useful for debugging raw calls.
+ * @author bryant_harris
+ *
+ */
+public class Api {
+
+ private final String URL = "https://api.abucoins.com";
+ private final String accessKey = "-- redacted --";
+ private final String secret = "-- redacted --";
+ private final String passphrase = "-- redacted --";
+ private final String USER_AGENT = "Mozilla/5.0";
+
+ public static void main(String[] args) throws Exception {
+ Api http = new Api();
+ System.out.println(http.sendRequest("POST","/deposits/crypto","{ \"currency\":\"ETH\", \"method\":\"ethereum\" }"));
+ //System.out.println(http.sendRequest("POST","/deposits/crypto","{ \"currency\":\"BTC\", \"method\":\"bitcoin\" }"));
+ //System.out.println(http.sendRequest("POST","/deposits/crypto","{ \"currency\":\"BCH\", \"method\":\"bitcoincash\" }"));
+ }
+
+ private String sendRequest(String method,String path, String body) throws Exception {
+ String localUrl;
+ if (method.equals("GET"))
+ localUrl = URL+path+body;
+ else
+ localUrl = URL+path;
+
+ String timestamp = String.valueOf(System.currentTimeMillis()/1000);
+ String sign = createSign(timestamp,method,path,body);
+
+ URL url = new URL(localUrl);
+ HttpURLConnection con = (HttpURLConnection) url.openConnection();
+ con.setRequestMethod(method);
+ con.setRequestProperty("User-Agent", USER_AGENT);
+ con.setRequestProperty("AC-ACCESS-KEY", accessKey);
+ con.setRequestProperty("AC-ACCESS-SIGN", sign);
+ con.setRequestProperty("AC-ACCESS-PASSPHRASE", passphrase);
+ con.setRequestProperty("AC-ACCESS-TIMESTAMP", timestamp);
+
+ if (method.equals("POST")){
+ con.setRequestProperty("Content-type", "application/json");
+ con.setDoOutput(true);
+ OutputStream os = con.getOutputStream();
+ os.write(body.getBytes("UTF-8"));
+ os.close();
+ }
+ int responseCode = con.getResponseCode();
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+ String inputLine;
+ StringBuffer response = new StringBuffer();
+
+ while ((inputLine = in.readLine()) != null) {
+ response.append(inputLine);
+ }
+ in.close();
+ return response.toString();
+ }
+
+ private String createSign(String timestamp, String method, String path, String queryParameters) throws NoSuchAlgorithmException, InvalidKeyException{
+ String queryArgs = timestamp + method + path + queryParameters;
+ Mac shaMac = Mac.getInstance("HmacSHA256");
+ SecretKeySpec keySpec = new SecretKeySpec(Base64.getDecoder().decode(secret), "HmacSHA256");
+ shaMac.init(keySpec);
+ final byte[] macData = shaMac.doFinal(queryArgs.getBytes());
+ return Base64.getEncoder().encodeToString(macData);
+ }
+}
\ No newline at end of file
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/marketdata/TickerFetchIntegration.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/marketdata/TickerFetchIntegration.java
new file mode 100644
index 000000000..3a2bc04df
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/marketdata/TickerFetchIntegration.java
@@ -0,0 +1,54 @@
+package org.knowm.xchange.abucoins.service.marketdata;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.junit.Test;
+import org.knowm.xchange.Exchange;
+import org.knowm.xchange.ExchangeFactory;
+import org.knowm.xchange.abucoins.AbucoinsExchange;
+import org.knowm.xchange.abucoins.dto.marketdata.AbucoinsHistoricRate;
+import org.knowm.xchange.abucoins.dto.marketdata.AbucoinsProductStat;
+import org.knowm.xchange.abucoins.service.AbucoinsMarketDataService;
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.marketdata.OrderBook;
+import org.knowm.xchange.dto.marketdata.Ticker;
+import org.knowm.xchange.dto.marketdata.Trades;
+import org.knowm.xchange.service.marketdata.MarketDataService;
+
+/**
+ * @author bryant_harris
+ */
+public class TickerFetchIntegration {
+
+ @Test
+ public void tickerFetchTest() throws Exception {
+
+ Exchange exchange = ExchangeFactory.INSTANCE.createExchange(AbucoinsExchange.class.getName());
+ MarketDataService marketDataService = exchange.getMarketDataService();
+ Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);
+ System.out.println(ticker.toString());
+ assertThat(ticker).isNotNull();
+
+ OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_USD);
+ System.out.println(orderBook.toString());
+
+ Trades trades = marketDataService.getTrades(CurrencyPair.BTC_USD);
+ System.out.println(trades.toString());
+
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.DAY_OF_MONTH, -60);
+ Date start = cal.getTime();
+ cal.add(Calendar.DAY_OF_MONTH, 15);
+ Date end = cal.getTime();
+ AbucoinsMarketDataService abucoinsMarketData = (AbucoinsMarketDataService) marketDataService;
+ AbucoinsHistoricRate[] historicRates = abucoinsMarketData.getAbucoinsHistoricRates("BTC-USD", 60, start, end);
+ System.out.println( Arrays.asList(historicRates));
+
+ AbucoinsProductStat[] stats = abucoinsMarketData.getAbucoinsProductStats();
+ System.out.println( Arrays.asList(stats));
+ }
+}
diff --git a/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/trade/OrdersFetchIntegration.java b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/trade/OrdersFetchIntegration.java
new file mode 100644
index 000000000..37fd07c91
--- /dev/null
+++ b/xchange-abucoins/src/test/java/org/knowm/xchange/abucoins/service/trade/OrdersFetchIntegration.java
@@ -0,0 +1,61 @@
+package org.knowm.xchange.abucoins.service.trade;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.knowm.xchange.Exchange;
+import org.knowm.xchange.ExchangeFactory;
+import org.knowm.xchange.ExchangeSpecification;
+import org.knowm.xchange.abucoins.AbucoinsExchange;
+import org.knowm.xchange.abucoins.dto.account.AbucoinsFill;
+import org.knowm.xchange.abucoins.service.AbucoinsTradeService;
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.Order;
+import org.knowm.xchange.dto.Order.OrderType;
+import org.knowm.xchange.dto.trade.LimitOrder;
+import org.knowm.xchange.dto.trade.OpenOrders;
+import org.knowm.xchange.service.trade.TradeService;
+
+/**
+ * Not structured as a unit test because it requires API Key information to run properly.
+ * @author bryant_harris
+ */
+public class OrdersFetchIntegration {
+ public static final String ABUCOINS_PASSPHRASE = " -- replace with your passphrase --";
+ public static final String ABUCOINS_KEY = " -- replace with your key --";
+ public static final String ABUCOINS_SECRET = " -- replace with your secret --";
+
+ public static void main(String[] args) throws Exception {
+ OrdersFetchIntegration test = new OrdersFetchIntegration();
+ test.accountsFetchTest();
+ }
+
+ public void accountsFetchTest() throws Exception {
+ ExchangeSpecification exSpec = new AbucoinsExchange().getDefaultExchangeSpecification();
+ exSpec.setPassword(ABUCOINS_PASSPHRASE);
+ exSpec.setApiKey(ABUCOINS_KEY);
+ exSpec.setSecretKey(ABUCOINS_SECRET);
+ Exchange exchange = ExchangeFactory.INSTANCE.createExchange( exSpec );
+ TradeService tradeService = exchange.getTradeService();
+
+ OpenOrders openOrders = tradeService.getOpenOrders();
+ assertThat(openOrders).isNotNull();
+ System.out.println(openOrders);
+
+ String orderID = tradeService.placeLimitOrder( new LimitOrder.Builder(OrderType.BID, CurrencyPair.BTC_USD)
+ .limitPrice(new BigDecimal("500"))
+ .originalAmount(new BigDecimal("0.75"))
+ .build());
+
+ Collection orders = tradeService.getOrder(orderID);
+ for ( Order order : orders )
+ tradeService.cancelOrder(order.getId());
+
+ AbucoinsTradeService abucoinsTradeService = (AbucoinsTradeService) tradeService;
+ AbucoinsFill[] fills = abucoinsTradeService.getFills();
+ System.out.println( Arrays.asList(fills));
+ }
+}
diff --git a/xchange-acx/api-specification.txt b/xchange-acx/api-specification.txt
new file mode 100644
index 000000000..4ad9af6f2
--- /dev/null
+++ b/xchange-acx/api-specification.txt
@@ -0,0 +1,4 @@
+ACX specification
+=====================================
+
+https://acx.io/documents/api_v2
diff --git a/xchange-acx/pom.xml b/xchange-acx/pom.xml
new file mode 100644
index 000000000..e518b01c9
--- /dev/null
+++ b/xchange-acx/pom.xml
@@ -0,0 +1,32 @@
+
+ 4.0.0
+
+ org.knowm.xchange
+ xchange-parent
+ 4.3.4-SNAPSHOT
+
+ xchange-acx
+ XChange ACX.IO
+
+
+
+ ${project.groupId}
+ xchange-core
+ ${project.version}
+
+
+
+
+ org.powermock
+ powermock-module-junit4
+ ${version.powermock}
+ test
+
+
+ org.powermock
+ powermock-api-mockito
+ ${version.powermock}
+ test
+
+
+
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/AcxApi.java b/xchange-acx/src/main/java/org/known/xchange/acx/AcxApi.java
new file mode 100644
index 000000000..e1f148628
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/AcxApi.java
@@ -0,0 +1,135 @@
+package org.known.xchange.acx;
+
+import org.known.xchange.acx.dto.AcxTrade;
+import org.known.xchange.acx.dto.account.AcxAccountInfo;
+import org.known.xchange.acx.dto.marketdata.AcxMarket;
+import org.known.xchange.acx.dto.marketdata.AcxOrder;
+import org.known.xchange.acx.dto.marketdata.AcxOrderBook;
+import si.mazi.rescu.ParamsDigest;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+import java.util.List;
+
+@Path("")
+@Produces(MediaType.APPLICATION_JSON)
+public interface AcxApi {
+ /**
+ * Get ticker of specific market.
+ *
+ * @param market Unique market id. It's always in the form of xxxyyy,
+ * where xxx is the base currency code, yyy is the quote
+ * currency code, e.g. 'btcaud'. All available markets c
+ * an be found at /api/v2/markets.
+ */
+ @GET
+ @Path("/tickers/{market}.json")
+ AcxMarket getTicker(@PathParam("market") String market) throws IOException;
+
+ /**
+ * Get the order book of specified market.
+ *
+ * @param market Unique market id. It's always in the form of xxxyyy,
+ * where xxx is the base currency code, yyy is the quote
+ * currency code, e.g. 'btcaud'. All available markets c
+ * an be found at /api/v2/markets.
+ * @param bidsLimit Limit the number of returned buy orders. Default to 20.
+ * @param asksLimit Limit the number of returned sell orders. Default to 20.
+ */
+ @GET
+ @Path("/order_book.json?market={market}&asks_limit={asks_limit}&bids_limit={bids_limit}")
+ AcxOrderBook getOrderBook(@PathParam("market") String market,
+ @PathParam("bids_limit") long bidsLimit,
+ @PathParam("asks_limit") long asksLimit) throws IOException;
+
+ /**
+ * Get recent trades on market, each trade is included only once. Trades are sorted in reverse creation order.
+ *
+ * @param market Unique market id. It's always in the form of xxxyyy,
+ * where xxx is the base currency code, yyy is the quote
+ * currency code, e.g. 'btcaud'. All available markets c
+ * an be found at /api/v2/markets.
+ */
+ @GET
+ @Path("/trades.json?market={market}")
+ List getTrades(@PathParam("market") String market) throws IOException;
+
+ /**
+ * Get your profile and accounts info.
+ *
+ * @param accessKey Access key.
+ * @param tonce Tonce is an integer represents the milliseconds elapsed since Unix epoch.
+ * @param signature The signature of your request payload, generated using your secret key.
+ */
+ @GET
+ @Path("/members/me.json?access_key={access_key}&tonce={tonce}&signature={signature}")
+ AcxAccountInfo getAccountInfo(@PathParam("access_key") String accessKey,
+ @PathParam("tonce") long tonce,
+ @PathParam("signature") ParamsDigest signature) throws IOException;
+
+ /**
+ * Get your orders, results are paginated.
+ *
+ * @param accessKey Access key.
+ * @param tonce Tonce is an integer represents the milliseconds elapsed since Unix epoch.
+ * @param market Unique market id. It's always in the form of xxxyyy,
+ * where xxx is the base currency code, yyy is the quote
+ * currency code, e.g. 'btcaud'. All available markets c
+ * an be found at /api/v2/markets.
+ * @param signature The signature of your request payload, generated using your secret key.
+ */
+ @GET
+ @Path("/orders.json?access_key={access_key}&tonce={tonce}&market={market}&signature={signature}")
+ List getOrders(@PathParam("access_key") String accessKey,
+ @PathParam("tonce") long tonce,
+ @PathParam("market") String market,
+ @PathParam("signature") ParamsDigest signature) throws IOException;
+
+ /**
+ * Create a Sell/Buy order.
+ *
+ * @param accessKey Access key.
+ * @param tonce Tonce is an integer represents the milliseconds elapsed since Unix epoch.
+ * @param market Unique market id. It's always in the form of xxxyyy,
+ * where xxx is the base currency code, yyy is the quote
+ * currency code, e.g. 'btcaud'. All available markets c
+ * an be found at /api/v2/markets.
+ * @param side Either 'sell' or 'buy'.
+ * @param volume The amount user want to sell/buy. An order could be partially executed,
+ * e.g. an order sell 5 btc can be matched with a buy 3 btc order, left 2
+ * btc to be sold; in this case the order's volume would be '5.0', its
+ * remaining_volume would be '2.0', its executed volume is '3.0'.
+ * @param price Price for each unit. e.g. If you want to sell/buy 1 btc at 3000 CNY,
+ * the price is '3000.0'
+ * @param ordType no docs, perhaps limit or market
+ * @param signature The signature of your request payload, generated using your secret key.
+ */
+ @POST
+ @Path("/orders.json")
+ AcxOrder createOrder(@FormParam("access_key") String accessKey,
+ @FormParam("tonce") long tonce,
+ @FormParam("market") String market,
+ @FormParam("side") String side,
+ @FormParam("volume") String volume,
+ @FormParam("price") String price,
+ @FormParam("ord_type") String ordType,
+ @FormParam("signature") ParamsDigest signature) throws IOException;
+
+ /**
+ * Cancel an order.
+ *
+ * @param accessKey Access key.
+ * @param tonce Tonce is an integer represents the milliseconds elapsed since Unix epoch.
+ * @param id Unique order id.
+ * @param signature The signature of your request payload, generated using your secret key.
+ */
+ @POST
+ @Path("/order/delete.json")
+ AcxOrder cancelOrder(@FormParam("access_key") String accessKey,
+ @FormParam("tonce") long tonce,
+ @FormParam("id") String id,
+ @FormParam("signature") ParamsDigest signature) throws IOException;
+
+
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/AcxExchange.java b/xchange-acx/src/main/java/org/known/xchange/acx/AcxExchange.java
new file mode 100644
index 000000000..faf7d05d3
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/AcxExchange.java
@@ -0,0 +1,44 @@
+package org.known.xchange.acx;
+
+import org.knowm.xchange.BaseExchange;
+import org.knowm.xchange.Exchange;
+import org.knowm.xchange.ExchangeSpecification;
+import org.knowm.xchange.utils.nonce.AtomicLongIncrementalTime2014NonceFactory;
+import org.known.xchange.acx.service.account.AcxAccountService;
+import org.known.xchange.acx.service.marketdata.AcxMarketDataService;
+import org.known.xchange.acx.service.trade.AcxTradeService;
+import si.mazi.rescu.RestProxyFactory;
+import si.mazi.rescu.SynchronizedValueFactory;
+
+public class AcxExchange extends BaseExchange implements Exchange {
+ private final SynchronizedValueFactory nonceFactory = new AtomicLongIncrementalTime2014NonceFactory();
+
+ @Override
+ protected void initServices() {
+ ExchangeSpecification spec = getExchangeSpecification();
+ AcxApi api = RestProxyFactory.createProxy(AcxApi.class, spec.getSslUri());
+ AcxMapper mapper = new AcxMapper();
+ this.marketDataService = new AcxMarketDataService(api, mapper);
+ if (spec.getApiKey() != null && spec.getSecretKey() != null) {
+ AcxSignatureCreator signatureCreator = new AcxSignatureCreator(spec.getSecretKey());
+ this.accountService = new AcxAccountService(api, mapper, signatureCreator, spec.getApiKey());
+ this.tradeService = new AcxTradeService(api, mapper, signatureCreator, spec.getApiKey());
+ }
+ }
+
+ @Override
+ public ExchangeSpecification getDefaultExchangeSpecification() {
+ ExchangeSpecification spec = new ExchangeSpecification(this.getClass().getCanonicalName());
+ spec.setSslUri("https://acx.io/api/v2/");
+ spec.setHost("acx.io");
+ spec.setExchangeName("ACX");
+ spec.setExchangeDescription("The largest liquidity pool and orderbook of Bitcoin in Australia");
+ return spec;
+ }
+
+ @Override
+ public SynchronizedValueFactory getNonceFactory() {
+ return nonceFactory;
+ }
+
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/AcxMapper.java b/xchange-acx/src/main/java/org/known/xchange/acx/AcxMapper.java
new file mode 100644
index 000000000..9524f9807
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/AcxMapper.java
@@ -0,0 +1,144 @@
+package org.known.xchange.acx;
+
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.Order.OrderStatus;
+import org.knowm.xchange.dto.Order.OrderType;
+import org.knowm.xchange.dto.account.AccountInfo;
+import org.knowm.xchange.dto.account.Balance;
+import org.knowm.xchange.dto.account.Wallet;
+import org.knowm.xchange.dto.marketdata.OrderBook;
+import org.knowm.xchange.dto.marketdata.Ticker;
+import org.knowm.xchange.dto.marketdata.Trade;
+import org.knowm.xchange.dto.marketdata.Trades;
+import org.knowm.xchange.dto.marketdata.Trades.TradeSortType;
+import org.knowm.xchange.dto.trade.LimitOrder;
+import org.known.xchange.acx.dto.AcxTrade;
+import org.known.xchange.acx.dto.account.AcxAccount;
+import org.known.xchange.acx.dto.account.AcxAccountInfo;
+import org.known.xchange.acx.dto.marketdata.AcxOrder;
+import org.known.xchange.acx.dto.marketdata.AcxOrderBook;
+import org.known.xchange.acx.dto.marketdata.AcxTicker;
+import org.known.xchange.acx.dto.marketdata.AcxMarket;
+
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class AcxMapper {
+ public Ticker mapTicker(CurrencyPair currencyPair, AcxMarket tickerData) {
+ AcxTicker ticker = tickerData.ticker;
+ return new Ticker.Builder()
+ .currencyPair(currencyPair)
+ .timestamp(new Date(tickerData.at * 1000))
+ .ask(ticker.sell)
+ .bid(ticker.buy)
+ .open(ticker.open)
+ .low(ticker.low)
+ .high(ticker.high)
+ .last(ticker.last)
+ .volume(ticker.vol)
+ .build();
+ }
+
+ public OrderBook mapOrderBook(CurrencyPair currencyPair, AcxOrderBook orderBook) {
+ return new OrderBook(null,
+ mapOrders(currencyPair, orderBook.asks),
+ mapOrders(currencyPair, orderBook.bids));
+ }
+
+ public List mapOrders(CurrencyPair currencyPair, List orders) {
+ return orders.stream()
+ .map(o -> mapOrder(currencyPair, o))
+ .collect(Collectors.toList());
+ }
+
+ private LimitOrder mapOrder(CurrencyPair currencyPair, AcxOrder order) {
+ OrderType type = mapOrderType(order);
+ return new LimitOrder.Builder(type, currencyPair)
+ .id(order.id)
+ .limitPrice(order.price)
+ .averagePrice(order.avgPrice)
+ .timestamp(order.createdAt)
+ .originalAmount(order.volume)
+ .remainingAmount(order.remainingVolume)
+ .cumulativeAmount(order.executedVolume)
+ .orderStatus(mapOrderStatus(order.state))
+ .build();
+ }
+
+ private OrderType mapOrderType(AcxOrder order) {
+ switch (order.side) {
+ case "sell":
+ return OrderType.ASK;
+ case "buy":
+ return OrderType.BID;
+ }
+ return null;
+ }
+
+ private OrderStatus mapOrderStatus(String state) {
+ switch (state) {
+ case "wait":
+ return OrderStatus.PENDING_NEW;
+ case "done":
+ return OrderStatus.FILLED;
+ case "cancel":
+ return OrderStatus.CANCELED;
+ }
+ return null;
+ }
+
+ public Trades mapTrades(CurrencyPair currencyPair, List trades) {
+ return new Trades(trades.stream()
+ .map(t -> mapTrade(currencyPair, t))
+ .collect(Collectors.toList()), TradeSortType.SortByTimestamp);
+ }
+
+ private Trade mapTrade(CurrencyPair currencyPair, AcxTrade trade) {
+ return new Trade.Builder()
+ .currencyPair(currencyPair)
+ .id(trade.id)
+ .price(trade.price)
+ .originalAmount(trade.volume)
+ .timestamp(trade.createdAt)
+ .type(mapTradeType(trade.side))
+ .build();
+ }
+
+ private OrderType mapTradeType(String side) {
+ if ("sell".equals(side)) {
+ return OrderType.ASK;
+ } else if ("buy".equals(side)) {
+ return OrderType.BID;
+ }
+ return null;
+ }
+
+ public AccountInfo mapAccountInfo(AcxAccountInfo accountInfo) {
+ return new AccountInfo(accountInfo.name, new Wallet(
+ accountInfo.accounts.stream()
+ .map(this::mapBalance)
+ .collect(Collectors.toList())
+ ));
+ }
+
+ private Balance mapBalance(AcxAccount acc) {
+ return new Balance(
+ Currency.getInstance(acc.currency),
+ acc.balance.add(acc.locked),
+ acc.balance,
+ acc.locked
+ );
+ }
+
+ public String getOrderType(OrderType type) {
+ switch (type) {
+ case BID:
+ return "buy";
+ case ASK:
+ return "sell";
+ }
+ throw new IllegalArgumentException("Unknown order type: " + type);
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/AcxSignatureCreator.java b/xchange-acx/src/main/java/org/known/xchange/acx/AcxSignatureCreator.java
new file mode 100644
index 000000000..28a308f30
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/AcxSignatureCreator.java
@@ -0,0 +1,94 @@
+package org.known.xchange.acx;
+
+import org.knowm.xchange.service.BaseParamsDigest;
+import si.mazi.rescu.Params;
+import si.mazi.rescu.RestInvocation;
+
+import javax.crypto.Mac;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.PathParam;
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class AcxSignatureCreator extends BaseParamsDigest {
+ private final Field invocationUrlField;
+ private static final String PLACEHOLDER = "ACX_PLACEHOLDER";
+
+ public AcxSignatureCreator(String secretKey) {
+ super(secretKey, HMAC_SHA_256);
+ try {
+ invocationUrlField = RestInvocation.class.getDeclaredField("invocationUrl");
+ invocationUrlField.setAccessible(true);
+ } catch (NoSuchFieldException e) {
+ throw new IllegalStateException("rescu library has been updated");
+ }
+ }
+
+ @Override
+ public String digestParams(RestInvocation restInvocation) {
+ String method = restInvocation.getHttpMethod();
+ String path = stripParams(restInvocation.getPath());
+ String query = Stream.of(
+ restInvocation.getParamsMap().get(PathParam.class),
+ restInvocation.getParamsMap().get(FormParam.class))
+ .map(Params::asHttpHeaders)
+ .map(Map::entrySet)
+ .flatMap(Collection::stream)
+ .filter(e -> !"signature".equals(e.getKey()))
+ .sorted(Entry.comparingByKey())
+ .map(e -> e.getKey() + "=" + e.getValue())
+ .collect(Collectors.joining("&"));
+ String toSign = String.format("%s|/api/v2/%s|%s", method, path, query);
+ Mac sha256hmac = getMac();
+ byte[] signed = sha256hmac.doFinal(toSign.getBytes());
+ String signature = new String(encodeHex(signed));
+ replaceInvocationUrl(restInvocation, signature);
+ return signature;
+ }
+
+ private String stripParams(String path) {
+ int paramsStart = path.indexOf("?");
+ String stripped = paramsStart == -1 ? path : path.substring(0, paramsStart);
+ if (stripped.startsWith("/")) {
+ stripped = stripped.substring(1);
+ }
+ return stripped;
+ }
+
+ private static char[] encodeHex(byte[] data) {
+ int l = data.length;
+ char[] out = new char[l << 1];
+ // two characters form the hex value.
+ for (int i = 0, j = 0; i < l; i++) {
+ out[j++] = DIGITS[(0xF0 & data[i]) >>> 4];
+ out[j++] = DIGITS[0x0F & data[i]];
+ }
+ return out;
+ }
+
+ // rescu client doesn't support ParamsDigest and therefore url has to be updated manually,
+ // see https://github.com/mmazi/rescu/issues/62
+ // TODO: remove the hack once the functionality is provided
+ private void replaceInvocationUrl(RestInvocation restInvocation, String signature) {
+ String invocationUrl = restInvocation.getInvocationUrl();
+ String newInvocationUrl = invocationUrl.replace(PLACEHOLDER, signature);
+ try {
+ invocationUrlField.set(restInvocation, newInvocationUrl);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ throw new IllegalStateException("rescu library has been updated");
+ }
+ }
+
+ @Override
+ public String toString() {
+ return PLACEHOLDER;
+ }
+
+ private static final char[] DIGITS = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/AcxTrade.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/AcxTrade.java
new file mode 100644
index 000000000..76b666984
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/AcxTrade.java
@@ -0,0 +1,41 @@
+package org.known.xchange.acx.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class AcxTrade {
+ /** Unique ID */
+ public final String id;
+ /** trade price */
+ public final BigDecimal price;
+ /** trade volume */
+ public final BigDecimal volume;
+ public final BigDecimal funds;
+ /** the market trade belongs to, like ‘btcaud’ */
+ public final String market;
+ /** trade time */
+ public final Date createdAt;
+ public final String trend;
+ public final String side;
+
+ public AcxTrade(
+ @JsonProperty("id") String id,
+ @JsonProperty("price") BigDecimal price,
+ @JsonProperty("volume") BigDecimal volume,
+ @JsonProperty("funds") BigDecimal funds,
+ @JsonProperty("market") String market,
+ @JsonProperty("created_at") Date createdAt,
+ @JsonProperty("trend") String trend,
+ @JsonProperty("side") String side) {
+ this.id = id;
+ this.price = price;
+ this.volume = volume;
+ this.funds = funds;
+ this.market = market;
+ this.createdAt = createdAt;
+ this.trend = trend;
+ this.side = side;
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/account/AcxAccount.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/account/AcxAccount.java
new file mode 100644
index 000000000..597f5b6ce
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/account/AcxAccount.java
@@ -0,0 +1,22 @@
+package org.known.xchange.acx.dto.account;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.math.BigDecimal;
+
+public class AcxAccount {
+ public final String currency;
+ /** Account balance, exclude locked funds */
+ public final BigDecimal balance;
+ /** locked funds */
+ public final BigDecimal locked;
+
+ public AcxAccount(
+ @JsonProperty("currency") String currency,
+ @JsonProperty("balance") BigDecimal balance,
+ @JsonProperty("locked") BigDecimal locked) {
+ this.currency = currency;
+ this.balance = balance;
+ this.locked = locked;
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/account/AcxAccountInfo.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/account/AcxAccountInfo.java
new file mode 100644
index 000000000..aca0978cf
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/account/AcxAccountInfo.java
@@ -0,0 +1,31 @@
+package org.known.xchange.acx.dto.account;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.List;
+
+public class AcxAccountInfo {
+ /** Unique identifier of user */
+ public final String sn;
+ /** User name */
+ public final String name;
+ /** User email */
+ public final String email;
+ /** Whether user is activated */
+ public final boolean activated;
+ /** User’s accounts info, see {@link AcxAccount} */
+ public final List accounts;
+
+ public AcxAccountInfo(
+ @JsonProperty("an") String sn,
+ @JsonProperty("name") String name,
+ @JsonProperty("email") String email,
+ @JsonProperty("activated") boolean activated,
+ @JsonProperty("accounts") List accounts) {
+ this.sn = sn;
+ this.name = name;
+ this.email = email;
+ this.activated = activated;
+ this.accounts = accounts;
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxMarket.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxMarket.java
new file mode 100644
index 000000000..3a04c2a12
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxMarket.java
@@ -0,0 +1,19 @@
+package org.known.xchange.acx.dto.marketdata;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Date;
+
+public class AcxMarket {
+ /** A timestamp in seconds since Epoch */
+ public final long at;
+ public final AcxTicker ticker;
+
+ public AcxMarket(
+ @JsonProperty("at") long at,
+ @JsonProperty("ticker") AcxTicker ticker
+ ) {
+ this.at = at;
+ this.ticker = ticker;
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxOrder.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxOrder.java
new file mode 100644
index 000000000..933551829
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxOrder.java
@@ -0,0 +1,62 @@
+package org.known.xchange.acx.dto.marketdata;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class AcxOrder {
+ /** Unique order ID */
+ public final String id;
+ /** Buy/Sell */
+ public final String side;
+ public final String ordType;
+ public final BigDecimal price;
+ /** Average execution price */
+ public final BigDecimal avgPrice;
+ /**
+ * wait, done or cancel.
+ * - ‘wait’ represents the order is active, it may be a new order or partial complete order;
+ * - ‘done’ means the order has been fulfilled completely;
+ * - ‘cancel’ means the order has been cancelled.
+ */
+ public final String state;
+ /** the market the order belongs to, like ‘btcaud’ */
+ private final String marker;
+ /** Order created time */
+ public final Date createdAt;
+ /** Volume to buy/sell */
+ public final BigDecimal volume;
+ /** remaining_volume is always less or equal than volume */
+ public final BigDecimal remainingVolume;
+ /** volume = remaining_volume + executed_volume */
+ public final BigDecimal executedVolume;
+ public final int tradesCount;
+
+ public AcxOrder(
+ @JsonProperty("id") String id,
+ @JsonProperty("side") String side,
+ @JsonProperty("ord_type") String ordType,
+ @JsonProperty("price") BigDecimal price,
+ @JsonProperty("avg_price") BigDecimal avgPrice,
+ @JsonProperty("state") String state,
+ @JsonProperty("market") String market,
+ @JsonProperty("created_at") Date createdAt,
+ @JsonProperty("volume") BigDecimal volume,
+ @JsonProperty("remaining_volume") BigDecimal remainingVolume,
+ @JsonProperty("executed_volume") BigDecimal executedVolume,
+ @JsonProperty("trades_count") int tradesCount) {
+ this.id = id;
+ this.side = side;
+ this.ordType = ordType;
+ this.price = price;
+ this.avgPrice = avgPrice;
+ this.state = state;
+ this.marker = market;
+ this.createdAt = createdAt;
+ this.volume = volume;
+ this.remainingVolume = remainingVolume;
+ this.executedVolume = executedVolume;
+ this.tradesCount = tradesCount;
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxOrderBook.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxOrderBook.java
new file mode 100644
index 000000000..e8fc006e5
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxOrderBook.java
@@ -0,0 +1,18 @@
+package org.known.xchange.acx.dto.marketdata;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Collections;
+import java.util.List;
+
+public class AcxOrderBook {
+ public final List bids;
+ public final List asks;
+
+ public AcxOrderBook(
+ @JsonProperty("bids") List bids, //
+ @JsonProperty("asks") List asks) {
+ this.bids = Collections.unmodifiableList(bids);
+ this.asks = Collections.unmodifiableList(asks);
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxTicker.java b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxTicker.java
new file mode 100644
index 000000000..a4ddc173b
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/dto/marketdata/AcxTicker.java
@@ -0,0 +1,39 @@
+package org.known.xchange.acx.dto.marketdata;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.math.BigDecimal;
+
+public class AcxTicker {
+ /** Current sell price */
+ public final BigDecimal buy;
+ /** Current sell price */
+ public final BigDecimal sell;
+ public final BigDecimal open;
+ /** Lowest price in last 24 hours */
+ public final BigDecimal low;
+ /** Highest price in last 24 hours */
+ public final BigDecimal high;
+ /** Last price */
+ public final BigDecimal last;
+ /** Trade volume in last 24 hours */
+ public final BigDecimal vol;
+
+ public AcxTicker(
+ @JsonProperty("buy") BigDecimal buy,
+ @JsonProperty("sell") BigDecimal sell,
+ @JsonProperty("open") BigDecimal open,
+ @JsonProperty("low") BigDecimal low,
+ @JsonProperty("high") BigDecimal high,
+ @JsonProperty("last") BigDecimal last,
+ @JsonProperty("vol") BigDecimal vol
+ ) {
+ this.buy = buy;
+ this.sell = sell;
+ this.open = open;
+ this.low = low;
+ this.high = high;
+ this.last = last;
+ this.vol = vol;
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/service/account/AcxAccountService.java b/xchange-acx/src/main/java/org/known/xchange/acx/service/account/AcxAccountService.java
new file mode 100644
index 000000000..151339290
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/service/account/AcxAccountService.java
@@ -0,0 +1,64 @@
+package org.known.xchange.acx.service.account;
+
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.dto.account.AccountInfo;
+import org.knowm.xchange.dto.account.FundingRecord;
+import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
+import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
+import org.knowm.xchange.service.account.AccountService;
+import org.knowm.xchange.service.trade.params.TradeHistoryParams;
+import org.knowm.xchange.service.trade.params.WithdrawFundsParams;
+import org.known.xchange.acx.AcxApi;
+import org.known.xchange.acx.AcxMapper;
+import org.known.xchange.acx.AcxSignatureCreator;
+import org.known.xchange.acx.dto.account.AcxAccountInfo;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+
+public class AcxAccountService implements AccountService {
+ private final AcxApi api;
+ private final AcxMapper mapper;
+ private final AcxSignatureCreator signatureCreator;
+ private final String accessKey;
+
+ public AcxAccountService(AcxApi api, AcxMapper mapper, AcxSignatureCreator signatureCreator, String accessKey) {
+ this.api = api;
+ this.mapper = mapper;
+ this.signatureCreator = signatureCreator;
+ this.accessKey = accessKey;
+ }
+
+ @Override
+ public AccountInfo getAccountInfo() throws IOException {
+ long tonce = System.currentTimeMillis();
+ AcxAccountInfo accountInfo = api.getAccountInfo(accessKey, tonce, signatureCreator);
+ return mapper.mapAccountInfo(accountInfo);
+ }
+
+ @Override
+ public String withdrawFunds(Currency currency, BigDecimal amount, String address) {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public String withdrawFunds(WithdrawFundsParams params) {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public String requestDepositAddress(Currency currency, String... args) {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public TradeHistoryParams createFundingHistoryParams() {
+ throw new NotAvailableFromExchangeException();
+ }
+
+ @Override
+ public List getFundingHistory(TradeHistoryParams params) {
+ throw new NotYetImplementedForExchangeException();
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/service/marketdata/AcxMarketDataService.java b/xchange-acx/src/main/java/org/known/xchange/acx/service/marketdata/AcxMarketDataService.java
new file mode 100644
index 000000000..4fa3b1eb8
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/service/marketdata/AcxMarketDataService.java
@@ -0,0 +1,51 @@
+package org.known.xchange.acx.service.marketdata;
+
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.marketdata.OrderBook;
+import org.knowm.xchange.dto.marketdata.Ticker;
+import org.knowm.xchange.dto.marketdata.Trades;
+import org.knowm.xchange.service.marketdata.MarketDataService;
+import org.known.xchange.acx.AcxApi;
+import org.known.xchange.acx.AcxMapper;
+import org.known.xchange.acx.dto.AcxTrade;
+import org.known.xchange.acx.dto.marketdata.AcxMarket;
+import org.known.xchange.acx.dto.marketdata.AcxOrderBook;
+import org.known.xchange.acx.utils.ArgUtils;
+
+import java.io.IOException;
+import java.util.List;
+
+import static org.known.xchange.acx.utils.AcxUtils.getAcxMarket;
+
+public class AcxMarketDataService implements MarketDataService {
+ public static final int MAX_LIMIT = 200;
+
+ private final AcxApi api;
+ private final AcxMapper mapper;
+
+ public AcxMarketDataService(AcxApi api, AcxMapper mapper) {
+ this.api = api;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOException {
+ AcxMarket tickerData = api.getTicker(getAcxMarket(currencyPair));
+ return mapper.mapTicker(currencyPair, tickerData);
+ }
+
+ @Override
+ public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {
+ Integer bidsLimit = ArgUtils.tryGet(args, 0, Integer.class, MAX_LIMIT);
+ Integer askLimit = ArgUtils.tryGet(args, 1, Integer.class, MAX_LIMIT);
+ AcxOrderBook orderBook = api.getOrderBook(getAcxMarket(currencyPair), bidsLimit, askLimit);
+ return mapper.mapOrderBook(currencyPair, orderBook);
+ }
+
+ @Override
+ public Trades getTrades(CurrencyPair currencyPair, Object... args) throws IOException {
+ List trades = api.getTrades(getAcxMarket(currencyPair));
+ return mapper.mapTrades(currencyPair, trades);
+ }
+
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/service/trade/AcxTradeService.java b/xchange-acx/src/main/java/org/known/xchange/acx/service/trade/AcxTradeService.java
new file mode 100644
index 000000000..65bd63592
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/service/trade/AcxTradeService.java
@@ -0,0 +1,118 @@
+package org.known.xchange.acx.service.trade;
+
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.Order;
+import org.knowm.xchange.dto.trade.*;
+import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
+import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
+import org.knowm.xchange.service.trade.TradeService;
+import org.knowm.xchange.service.trade.params.CancelOrderParams;
+import org.knowm.xchange.service.trade.params.TradeHistoryParams;
+import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair;
+import org.knowm.xchange.service.trade.params.orders.OpenOrdersParamCurrencyPair;
+import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
+import org.known.xchange.acx.AcxApi;
+import org.known.xchange.acx.AcxMapper;
+import org.known.xchange.acx.AcxSignatureCreator;
+import org.known.xchange.acx.dto.marketdata.AcxOrder;
+import org.known.xchange.acx.utils.ArgUtils;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.Collection;
+import java.util.List;
+
+import static org.known.xchange.acx.utils.AcxUtils.getAcxMarket;
+
+public class AcxTradeService implements TradeService {
+ private final AcxApi api;
+ private final AcxMapper mapper;
+ private final AcxSignatureCreator signatureCreator;
+ private final String accessKey;
+
+ public AcxTradeService(AcxApi api, AcxMapper mapper, AcxSignatureCreator signatureCreator, String accessKey) {
+ this.api = api;
+ this.mapper = mapper;
+ this.signatureCreator = signatureCreator;
+ this.accessKey = accessKey;
+ }
+
+ @Override
+ public OpenOrders getOpenOrders() throws IOException {
+ return getOpenOrders(createOpenOrdersParams());
+ }
+
+ @Override
+ public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
+ long tonce = System.currentTimeMillis();
+ OpenOrdersParamCurrencyPair param = ArgUtils.tryCast(params, OpenOrdersParamCurrencyPair.class);
+ CurrencyPair currencyPair = param.getCurrencyPair();
+ List orders = api.getOrders(accessKey, tonce, getAcxMarket(currencyPair), signatureCreator);
+ return new OpenOrders(mapper.mapOrders(currencyPair, orders));
+ }
+
+ @Override
+ public DefaultOpenOrdersParamCurrencyPair createOpenOrdersParams() {
+ return new DefaultOpenOrdersParamCurrencyPair();
+ }
+
+ @Override
+ public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
+ long tonce = System.currentTimeMillis();
+ String market = getAcxMarket(limitOrder.getCurrencyPair());
+ String side = mapper.getOrderType(limitOrder.getType());
+ String volume = limitOrder.getOriginalAmount().setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
+ String price = limitOrder.getLimitPrice().setScale(4, BigDecimal.ROUND_DOWN).toPlainString();
+ AcxOrder order = api.createOrder(accessKey, tonce, market, side, volume, price, "limit", signatureCreator);
+ return order.id;
+ }
+
+ @Override
+ public String placeStopOrder(StopOrder stopOrder) throws IOException {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public String placeMarketOrder(MarketOrder marketOrder) {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public boolean cancelOrder(String orderId) throws IOException {
+ long tonce = System.currentTimeMillis();
+ AcxOrder order = api.cancelOrder(accessKey, tonce, orderId, signatureCreator);
+ return order != null;
+ }
+
+ @Override
+ public boolean cancelOrder(CancelOrderParams orderParams) {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public UserTrades getTradeHistory(TradeHistoryParams params) {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public Collection getOrder(String... orderIds) {
+ throw new NotAvailableFromExchangeException();
+ }
+
+ // not available
+
+ @Override
+ public TradeHistoryParams createTradeHistoryParams() {
+ throw new NotYetImplementedForExchangeException();
+ }
+
+ @Override
+ public void verifyOrder(LimitOrder limitOrder) {
+ throw new NotAvailableFromExchangeException();
+ }
+
+ @Override
+ public void verifyOrder(MarketOrder marketOrder) {
+ throw new NotAvailableFromExchangeException();
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/utils/AcxUtils.java b/xchange-acx/src/main/java/org/known/xchange/acx/utils/AcxUtils.java
new file mode 100644
index 000000000..07d360fc4
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/utils/AcxUtils.java
@@ -0,0 +1,10 @@
+package org.known.xchange.acx.utils;
+
+import org.knowm.xchange.currency.CurrencyPair;
+
+public class AcxUtils {
+ public static String getAcxMarket(CurrencyPair currencyPair) {
+ return currencyPair.base.getCurrencyCode().toLowerCase() +
+ currencyPair.counter.getCurrencyCode().toLowerCase();
+ }
+}
diff --git a/xchange-acx/src/main/java/org/known/xchange/acx/utils/ArgUtils.java b/xchange-acx/src/main/java/org/known/xchange/acx/utils/ArgUtils.java
new file mode 100644
index 000000000..dad35e188
--- /dev/null
+++ b/xchange-acx/src/main/java/org/known/xchange/acx/utils/ArgUtils.java
@@ -0,0 +1,17 @@
+package org.known.xchange.acx.utils;
+
+public class ArgUtils {
+ public static T tryGet(Object[] args, int index, Class clz, T defaultValue) {
+ if (args.length > index) {
+ return tryCast(args[index], clz);
+ }
+ return defaultValue;
+ }
+
+ public static T tryCast(K arg, Class clz) {
+ if (clz.isAssignableFrom(arg.getClass())) {
+ return clz.cast(arg);
+ }
+ throw new IllegalArgumentException("Argument has type " + arg.getClass() + ", expected " + clz);
+ }
+}
diff --git a/xchange-acx/src/main/resources/acx.json b/xchange-acx/src/main/resources/acx.json
new file mode 100644
index 000000000..780709ae4
--- /dev/null
+++ b/xchange-acx/src/main/resources/acx.json
@@ -0,0 +1,20 @@
+{
+ "currency_pairs": {
+ "BTC/AUD": {
+ "price_scale": 2,
+ "trading_fee": 0
+ },
+ "ETH/AUD": {
+ "price_scale": 2,
+ "trading_fee": 0
+ }
+ },
+ "currencies": {
+ "AUD": {
+ "scale": 8,
+ "withdrawal_fee": 0.01
+ }
+ },
+ "public_rate_limits": null,
+ "private_rate_limits": null
+}
diff --git a/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxAccountServiceTest.java b/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxAccountServiceTest.java
new file mode 100644
index 000000000..2b7d7eea3
--- /dev/null
+++ b/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxAccountServiceTest.java
@@ -0,0 +1,55 @@
+package org.knowm.xchange.acx;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.dto.account.AccountInfo;
+import org.knowm.xchange.service.account.AccountService;
+import org.known.xchange.acx.AcxApi;
+import org.known.xchange.acx.AcxMapper;
+import org.known.xchange.acx.AcxSignatureCreator;
+import org.known.xchange.acx.dto.account.AcxAccountInfo;
+import org.known.xchange.acx.service.account.AcxAccountService;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.*;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+
+public class AcxAccountServiceTest {
+
+ private AcxApi api;
+ private ObjectMapper objectMapper;
+ private AccountService service;
+ private String accessKey;
+
+ @Before
+ public void setUp() {
+ objectMapper = new ObjectMapper();
+ AcxMapper mapper = new AcxMapper();
+ api = mock(AcxApi.class);
+ accessKey = "access_key";
+ service = new AcxAccountService(api, mapper, mock(AcxSignatureCreator.class), accessKey);
+ }
+
+ @Test
+ public void testGetAccountInfo() throws IOException {
+ when(api.getAccountInfo(eq(accessKey), anyLong(), any()))
+ .thenReturn(read("/account/account_info.json", AcxAccountInfo.class));
+
+ AccountInfo accountInfo = service.getAccountInfo();
+
+ assertEquals("Satoshi Nakamoto", accountInfo.getUsername());
+ assertEquals(new BigDecimal("2159091.0"), accountInfo.getWallet().getBalance(Currency.BTC).getTotal());
+ assertEquals(new BigDecimal("2159090.0"), accountInfo.getWallet().getBalance(Currency.BTC).getAvailable());
+ }
+
+
+ private T read(String path, Class clz) throws IOException {
+ return objectMapper.readValue(this.getClass().getResourceAsStream(path), clz);
+ }
+}
diff --git a/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxMarketDataServiceTest.java b/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxMarketDataServiceTest.java
new file mode 100644
index 000000000..95d3a1597
--- /dev/null
+++ b/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxMarketDataServiceTest.java
@@ -0,0 +1,102 @@
+package org.knowm.xchange.acx;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.marketdata.OrderBook;
+import org.knowm.xchange.dto.marketdata.Ticker;
+import org.knowm.xchange.dto.marketdata.Trades;
+import org.knowm.xchange.service.marketdata.MarketDataService;
+import org.known.xchange.acx.AcxApi;
+import org.known.xchange.acx.AcxMapper;
+import org.known.xchange.acx.dto.AcxTrade;
+import org.known.xchange.acx.dto.marketdata.AcxMarket;
+import org.known.xchange.acx.dto.marketdata.AcxOrderBook;
+import org.known.xchange.acx.service.marketdata.AcxMarketDataService;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.knowm.xchange.dto.Order.OrderType.ASK;
+import static org.knowm.xchange.dto.Order.OrderType.BID;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+
+public class AcxMarketDataServiceTest {
+
+ private AcxApi api;
+ private ObjectMapper objectMapper;
+ private MarketDataService service;
+
+ @Before
+ public void setUp() {
+ objectMapper = new ObjectMapper();
+ AcxMapper mapper = new AcxMapper();
+ api = mock(AcxApi.class);
+ service = new AcxMarketDataService(api, mapper);
+ }
+
+ @Test
+ public void testTickers() throws IOException {
+ when(api.getTicker("ethaud"))
+ .thenReturn(read("/marketdata/tickers.json", AcxMarket.class));
+
+ Ticker ticker = service.getTicker(CurrencyPair.ETH_AUD);
+
+ assertEquals(new BigDecimal("576.3302"), ticker.getVolume());
+ assertEquals(new BigDecimal("1119.33"), ticker.getBid());
+ assertEquals(new Date(1513687641000L), ticker.getTimestamp());
+ }
+
+ @Test
+ public void testOrderBooks() throws IOException {
+ when(api.getOrderBook("ethaud", AcxMarketDataService.MAX_LIMIT, AcxMarketDataService.MAX_LIMIT))
+ .thenReturn(read("/marketdata/order_book.json", AcxOrderBook.class));
+
+ OrderBook orderBook = service.getOrderBook(CurrencyPair.ETH_AUD);
+
+ assertFalse(orderBook.getAsks().isEmpty());
+ assertFalse(orderBook.getBids().isEmpty());
+ assertEquals(new BigDecimal("1144.94"), orderBook.getAsks().get(0).getLimitPrice());
+ assertEquals(ASK, orderBook.getAsks().get(0).getType());
+ assertEquals(new BigDecimal("1128.88"), orderBook.getBids().get(0).getLimitPrice());
+ assertEquals(BID, orderBook.getBids().get(0).getType());
+ }
+
+ @Test
+ public void testOrderBooksArguments() throws IOException {
+ when(api.getOrderBook("ethaud", 5, 6))
+ .thenReturn(read("/marketdata/order_book.json", AcxOrderBook.class));
+
+ OrderBook orderBook = service.getOrderBook(CurrencyPair.ETH_AUD, 5, 6);
+
+ assertFalse(orderBook.getAsks().isEmpty());
+ assertFalse(orderBook.getBids().isEmpty());
+ }
+
+ @Test
+ public void testTrades() throws IOException {
+ when(api.getTrades("ethaud"))
+ .thenReturn(read("/marketdata/trades.json", new TypeReference>(){}));
+
+ Trades trades = service.getTrades(CurrencyPair.ETH_AUD);
+
+ assertFalse(trades.getTrades().isEmpty());
+ assertEquals(new BigDecimal("0.0085"), trades.getTrades().get(0).getOriginalAmount());
+ }
+
+ private T read(String path, Class clz) throws IOException {
+ return objectMapper.readValue(this.getClass().getResourceAsStream(path), clz);
+ }
+
+ private T read(String path, TypeReference type) throws IOException {
+ return objectMapper.readValue(this.getClass().getResourceAsStream(path), type);
+ }
+}
diff --git a/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxTradingServiceTest.java b/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxTradingServiceTest.java
new file mode 100644
index 000000000..cb50728c2
--- /dev/null
+++ b/xchange-acx/src/test/java/org/knowm/xchange/acx/AcxTradingServiceTest.java
@@ -0,0 +1,100 @@
+package org.knowm.xchange.acx;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.currency.CurrencyPair;
+import org.knowm.xchange.dto.Order;
+import org.knowm.xchange.dto.account.AccountInfo;
+import org.knowm.xchange.dto.trade.LimitOrder;
+import org.knowm.xchange.dto.trade.OpenOrders;
+import org.knowm.xchange.service.account.AccountService;
+import org.knowm.xchange.service.trade.TradeService;
+import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamCurrencyPair;
+import org.known.xchange.acx.AcxApi;
+import org.known.xchange.acx.AcxMapper;
+import org.known.xchange.acx.AcxSignatureCreator;
+import org.known.xchange.acx.dto.account.AcxAccountInfo;
+import org.known.xchange.acx.dto.marketdata.AcxOrder;
+import org.known.xchange.acx.service.account.AcxAccountService;
+import org.known.xchange.acx.service.trade.AcxTradeService;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.knowm.xchange.dto.Order.OrderType.BID;
+import static org.mockito.Matchers.*;
+import static org.powermock.api.mockito.PowerMockito.mock;
+import static org.powermock.api.mockito.PowerMockito.when;
+
+public class AcxTradingServiceTest {
+
+ private AcxApi api;
+ private ObjectMapper objectMapper;
+ private TradeService service;
+ private String accessKey;
+
+ @Before
+ public void setUp() {
+ objectMapper = new ObjectMapper();
+ AcxMapper mapper = new AcxMapper();
+ api = mock(AcxApi.class);
+ accessKey = "access_key";
+ service = new AcxTradeService(api, mapper, mock(AcxSignatureCreator.class), accessKey);
+ }
+
+ @Test
+ public void testGetOrders() throws IOException {
+ when(api.getOrders(eq(accessKey), anyLong(), any(), any()))
+ .thenReturn(read("/trade/open_orders.json", new TypeReference>() {}));
+
+ List openOrders = service.getOpenOrders(new DefaultOpenOrdersParamCurrencyPair(CurrencyPair.ETH_AUD))
+ .getOpenOrders();
+
+ assertEquals(1, openOrders.size());
+ assertEquals("198602763", openOrders.get(0).getId());
+ assertEquals(new BigDecimal("97900.99"), openOrders.get(0).getLimitPrice());
+ assertEquals(new BigDecimal("0.01"), openOrders.get(0).getRemainingAmount());
+ assertEquals(new BigDecimal("0.01"), openOrders.get(0).getOriginalAmount());
+ assertEquals(new BigDecimal("0.00"), openOrders.get(0).getCumulativeAmount());
+ }
+
+ @Test
+ public void testCreateOrder() throws IOException {
+ when(api.createOrder(eq(accessKey), anyLong(), eq("btcaud"), eq("buy"), any(), any(), any(), any()))
+ .thenReturn(read("/trade/create_order.json", AcxOrder.class));
+
+ LimitOrder order = new LimitOrder.Builder(Order.OrderType.BID, CurrencyPair.BTC_AUD)
+ .limitPrice(new BigDecimal(10.1234))
+ .originalAmount(new BigDecimal(0.1))
+ .build();
+ String id = service.placeLimitOrder(order);
+
+ assertEquals("199918493", id);
+ }
+
+
+ @Test
+ public void testCancelOrder() throws IOException {
+ String orderId = "198602763";
+ when(api.cancelOrder(eq(accessKey), anyLong(), eq(orderId), any()))
+ .thenReturn(read("/trade/cancel_order.json", AcxOrder.class));
+
+ boolean result = service.cancelOrder(orderId);
+
+ assertEquals(true, result);
+ }
+
+
+ private T read(String path, Class clz) throws IOException {
+ return objectMapper.readValue(this.getClass().getResourceAsStream(path), clz);
+ }
+
+ private T read(String path, TypeReference type) throws IOException {
+ return objectMapper.readValue(this.getClass().getResourceAsStream(path), type);
+ }
+}
diff --git a/xchange-acx/src/test/resources/account/account_info.json b/xchange-acx/src/test/resources/account/account_info.json
new file mode 100644
index 000000000..24b93d7a1
--- /dev/null
+++ b/xchange-acx/src/test/resources/account/account_info.json
@@ -0,0 +1,48 @@
+{
+ "sn": "ADEX3S3DRANDOM",
+ "name": "Satoshi Nakamoto",
+ "email": "richestguy@i.am",
+ "activated": true,
+ "accounts": [
+ {
+ "currency": "btc",
+ "balance": "2159090.0",
+ "locked": "1.0"
+ },
+ {
+ "currency": "aud",
+ "balance": "0.0",
+ "locked": "0.0"
+ },
+ {
+ "currency": "usd",
+ "balance": "0.0",
+ "locked": "0.0"
+ },
+ {
+ "currency": "bch",
+ "balance": "0.0",
+ "locked": "0.0"
+ },
+ {
+ "currency": "eth",
+ "balance": "1.0",
+ "locked": "0.0"
+ },
+ {
+ "currency": "hsr",
+ "balance": "0.0",
+ "locked": "0.0"
+ },
+ {
+ "currency": "fuel",
+ "balance": "0.0",
+ "locked": "0.0"
+ },
+ {
+ "currency": "ubtc",
+ "balance": "0.0",
+ "locked": "0.0"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/xchange-acx/src/test/resources/marketdata/order_book.json b/xchange-acx/src/test/resources/marketdata/order_book.json
new file mode 100644
index 000000000..d89de8978
--- /dev/null
+++ b/xchange-acx/src/test/resources/marketdata/order_book.json
@@ -0,0 +1,566 @@
+{
+ "asks": [
+ {
+ "id": 185823771,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1144.94",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:18:38+11:00",
+ "volume": "2.0",
+ "remaining_volume": "2.0",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185811118,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1144.99",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:55:11+11:00",
+ "volume": "0.5235",
+ "remaining_volume": "0.5235",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185813905,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1144.99",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:01:41+11:00",
+ "volume": "0.3803",
+ "remaining_volume": "0.3803",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185780223,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1149.95",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:02:26+11:00",
+ "volume": "9.0",
+ "remaining_volume": "9.0",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849744,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1179.98",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:42+11:00",
+ "volume": "0.0005",
+ "remaining_volume": "0.0005",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849763,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1179.99",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:43+11:00",
+ "volume": "24.3892",
+ "remaining_volume": "24.3892",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185749483,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1180.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:15:22+11:00",
+ "volume": "14.3701",
+ "remaining_volume": "14.3701",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185809049,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1198.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:49:48+11:00",
+ "volume": "0.1717",
+ "remaining_volume": "0.1717",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185628356,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1200.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T18:19:16+11:00",
+ "volume": "0.0937",
+ "remaining_volume": "0.0937",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 183907794,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1210.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-17T22:05:02+11:00",
+ "volume": "10.0",
+ "remaining_volume": "10.0",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185690324,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1210.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T19:48:36+11:00",
+ "volume": "1.0",
+ "remaining_volume": "1.0",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185645338,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1230.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T18:45:13+11:00",
+ "volume": "1.9731",
+ "remaining_volume": "1.9731",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 183647656,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1231.25",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-17T15:23:03+11:00",
+ "volume": "0.0517",
+ "remaining_volume": "0.0517",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185756512,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1250.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:27:23+11:00",
+ "volume": "5.1309",
+ "remaining_volume": "5.1309",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185766566,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1250.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:41:41+11:00",
+ "volume": "0.4",
+ "remaining_volume": "0.4",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 181953401,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1260.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-15T15:21:43+11:00",
+ "volume": "20.313",
+ "remaining_volume": "20.313",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 182748335,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1262.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-16T14:29:05+11:00",
+ "volume": "8.8653",
+ "remaining_volume": "8.8653",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 181954574,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1275.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-15T15:23:13+11:00",
+ "volume": "3.7338",
+ "remaining_volume": "3.7338",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185524803,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1280.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T15:42:43+11:00",
+ "volume": "0.2097",
+ "remaining_volume": "0.2097",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185511996,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "1299.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T15:21:35+11:00",
+ "volume": "2.794",
+ "remaining_volume": "2.794",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ }
+ ],
+ "bids": [
+ {
+ "id": 185849734,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1128.88",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:40+11:00",
+ "volume": "30.435",
+ "remaining_volume": "30.435",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849621,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1128.87",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:27+11:00",
+ "volume": "0.1196",
+ "remaining_volume": "0.1196",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849677,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1128.87",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:35+11:00",
+ "volume": "0.84",
+ "remaining_volume": "0.84",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849451,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1128.79",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:05+11:00",
+ "volume": "0.0696",
+ "remaining_volume": "0.0696",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849401,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1128.71",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:53:57+11:00",
+ "volume": "0.0696",
+ "remaining_volume": "0.0696",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849592,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1119.32",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:24+11:00",
+ "volume": "0.0696",
+ "remaining_volume": "0.0696",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849426,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1119.23",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:53:59+11:00",
+ "volume": "0.1196",
+ "remaining_volume": "0.1196",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185824722,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1119.15",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:19:48+11:00",
+ "volume": "5.4676",
+ "remaining_volume": "5.4676",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185846476,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1110.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:49:42+11:00",
+ "volume": "0.4603",
+ "remaining_volume": "0.4603",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185849616,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1105.04",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:54:26+11:00",
+ "volume": "0.0796",
+ "remaining_volume": "0.0796",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185813605,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1105.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:01:06+11:00",
+ "volume": "0.3",
+ "remaining_volume": "0.3",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185810706,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1103.43",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:54:00+11:00",
+ "volume": "0.0014",
+ "remaining_volume": "0.0014",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185808271,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1103.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:48:21+11:00",
+ "volume": "2.2926",
+ "remaining_volume": "2.2926",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185848332,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1100.48",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:51:58+11:00",
+ "volume": "30.435",
+ "remaining_volume": "30.435",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185788844,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1100.1",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:17:19+11:00",
+ "volume": "0.1867",
+ "remaining_volume": "0.1867",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185765435,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1100.0",
+ "avg_price": "1100.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:39:38+11:00",
+ "volume": "45.5",
+ "remaining_volume": "44.3243",
+ "executed_volume": "1.1757",
+ "trades_count": 1
+ },
+ {
+ "id": 185819903,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1100.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:11:51+11:00",
+ "volume": "3.0",
+ "remaining_volume": "3.0",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185762166,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1090.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:34:59+11:00",
+ "volume": "2.754",
+ "remaining_volume": "2.754",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185416110,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1080.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T12:42:31+11:00",
+ "volume": "0.999",
+ "remaining_volume": "0.999",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ },
+ {
+ "id": 185418388,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "1080.0",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-19T12:46:32+11:00",
+ "volume": "18.5312",
+ "remaining_volume": "18.5312",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/xchange-acx/src/test/resources/marketdata/tickers.json b/xchange-acx/src/test/resources/marketdata/tickers.json
new file mode 100644
index 000000000..1268747eb
--- /dev/null
+++ b/xchange-acx/src/test/resources/marketdata/tickers.json
@@ -0,0 +1,12 @@
+{
+ "at": 1513687641,
+ "ticker": {
+ "buy": "1119.33",
+ "sell": "1144.9",
+ "open": 999.99,
+ "low": "954.94",
+ "high": "1197.0",
+ "last": "1144.94",
+ "vol": "576.3302"
+ }
+}
\ No newline at end of file
diff --git a/xchange-acx/src/test/resources/marketdata/trades.json b/xchange-acx/src/test/resources/marketdata/trades.json
new file mode 100644
index 000000000..741a81b96
--- /dev/null
+++ b/xchange-acx/src/test/resources/marketdata/trades.json
@@ -0,0 +1,502 @@
+[
+ {
+ "id": 4245787,
+ "price": "1128.6",
+ "volume": "0.0001",
+ "funds": "0.11286",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:51:32+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4245474,
+ "price": "1144.94",
+ "volume": "9.3811",
+ "funds": "10740.796634",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:44:34+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4245473,
+ "price": "1144.92",
+ "volume": "0.0007",
+ "funds": "0.801444",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:44:34+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4245472,
+ "price": "1144.92",
+ "volume": "0.0007",
+ "funds": "0.801444",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:44:34+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4245471,
+ "price": "1144.9",
+ "volume": "0.0008",
+ "funds": "0.91592",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:44:34+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4245470,
+ "price": "1144.0",
+ "volume": "0.4444",
+ "funds": "508.3936",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:44:34+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4245469,
+ "price": "1144.0",
+ "volume": "0.1723",
+ "funds": "197.1112",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:44:34+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4245174,
+ "price": "1144.0",
+ "volume": "0.0428",
+ "funds": "48.9632",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:40:03+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4244057,
+ "price": "1119.15",
+ "volume": "0.0001",
+ "funds": "0.111915",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:18:33+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4243995,
+ "price": "1125.57",
+ "volume": "0.0001",
+ "funds": "0.112557",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:17:33+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243994,
+ "price": "1125.56",
+ "volume": "0.0001",
+ "funds": "0.112556",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:17:30+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4243905,
+ "price": "1144.95",
+ "volume": "16.501",
+ "funds": "18892.81995",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:16:38+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243904,
+ "price": "1144.94",
+ "volume": "0.499",
+ "funds": "571.32506",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:16:38+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243758,
+ "price": "1135.0",
+ "volume": "0.5",
+ "funds": "567.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:14:18+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243757,
+ "price": "1134.0",
+ "volume": "0.5",
+ "funds": "567.0",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:14:18+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4243059,
+ "price": "1135.08",
+ "volume": "0.0001",
+ "funds": "0.113508",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:05:56+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243058,
+ "price": "1135.08",
+ "volume": "0.0001",
+ "funds": "0.113508",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:05:55+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243053,
+ "price": "1135.08",
+ "volume": "0.0001",
+ "funds": "0.113508",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:05:50+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243051,
+ "price": "1135.0",
+ "volume": "0.0001",
+ "funds": "0.1135",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:05:48+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4243050,
+ "price": "1135.0",
+ "volume": "0.499",
+ "funds": "566.365",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:05:46+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242927,
+ "price": "1135.0",
+ "volume": "0.1",
+ "funds": "113.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:04:39+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242926,
+ "price": "1135.0",
+ "volume": "0.1",
+ "funds": "113.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:04:36+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242924,
+ "price": "1135.0",
+ "volume": "0.1",
+ "funds": "113.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:04:32+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242922,
+ "price": "1135.0",
+ "volume": "0.1",
+ "funds": "113.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:04:28+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242921,
+ "price": "1135.0",
+ "volume": "0.1",
+ "funds": "113.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:04:24+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242816,
+ "price": "1127.38",
+ "volume": "0.0001",
+ "funds": "0.112738",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:03:30+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4242710,
+ "price": "1118.4",
+ "volume": "0.0001",
+ "funds": "0.11184",
+ "market": "ethaud",
+ "created_at": "2017-12-19T23:02:29+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4241273,
+ "price": "1144.99",
+ "volume": "1.0",
+ "funds": "1144.99",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:50:10+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4241121,
+ "price": "1145.0",
+ "volume": "1.4021",
+ "funds": "1605.4045",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:49:14+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4241055,
+ "price": "1145.0",
+ "volume": "0.0744",
+ "funds": "85.188",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:48:33+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4241054,
+ "price": "1144.99",
+ "volume": "0.537",
+ "funds": "614.85963",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:48:33+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4238653,
+ "price": "1100.91",
+ "volume": "12.0",
+ "funds": "13210.92",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:27:16+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4238571,
+ "price": "1100.85",
+ "volume": "10.0",
+ "funds": "11008.5",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:26:43+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4236130,
+ "price": "1100.1",
+ "volume": "0.517",
+ "funds": "568.7517",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:09:58+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4236122,
+ "price": "1109.82",
+ "volume": "0.0054",
+ "funds": "5.993028",
+ "market": "ethaud",
+ "created_at": "2017-12-19T22:09:37+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4234074,
+ "price": "1149.97",
+ "volume": "0.0008",
+ "funds": "0.919976",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:57:13+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4233948,
+ "price": "1149.97",
+ "volume": "0.0009",
+ "funds": "1.034973",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:56:54+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232887,
+ "price": "1149.96",
+ "volume": "0.0039",
+ "funds": "4.484844",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:51:04+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232804,
+ "price": "1149.95",
+ "volume": "0.0024",
+ "funds": "2.75988",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:48+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4232801,
+ "price": "1149.98",
+ "volume": "0.003",
+ "funds": "3.44994",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:39+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232799,
+ "price": "1149.98",
+ "volume": "0.0014",
+ "funds": "1.609972",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:29+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232798,
+ "price": "1149.94",
+ "volume": "0.003",
+ "funds": "3.44982",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:29+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4232714,
+ "price": "1149.98",
+ "volume": "0.0061",
+ "funds": "7.014878",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:16+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232713,
+ "price": "1149.75",
+ "volume": "0.0044",
+ "funds": "5.0589",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:16+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232710,
+ "price": "1109.82",
+ "volume": "0.0052",
+ "funds": "5.771064",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:50:02+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4232602,
+ "price": "1149.97",
+ "volume": "0.0077",
+ "funds": "8.854769",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:49:42+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232599,
+ "price": "1109.86",
+ "volume": "0.0007",
+ "funds": "0.776902",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:49:35+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232560,
+ "price": "1109.86",
+ "volume": "0.0054",
+ "funds": "5.993244",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:49:22+11:00",
+ "trend": "down",
+ "side": null
+ },
+ {
+ "id": 4232487,
+ "price": "1149.97",
+ "volume": "0.002",
+ "funds": "2.29994",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:49:14+11:00",
+ "trend": "up",
+ "side": null
+ },
+ {
+ "id": 4232486,
+ "price": "1149.91",
+ "volume": "0.0085",
+ "funds": "9.774235",
+ "market": "ethaud",
+ "created_at": "2017-12-19T21:49:13+11:00",
+ "trend": "up",
+ "side": null
+ }
+]
\ No newline at end of file
diff --git a/xchange-acx/src/test/resources/trade/cancel_order.json b/xchange-acx/src/test/resources/trade/cancel_order.json
new file mode 100644
index 000000000..17d6cb266
--- /dev/null
+++ b/xchange-acx/src/test/resources/trade/cancel_order.json
@@ -0,0 +1,14 @@
+{
+ "id": 198602763,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "97900.99",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-31T18:12:28+11:00",
+ "volume": "0.01",
+ "remaining_volume": "0.01",
+ "executed_volume": "0.0",
+ "trades_count": 0
+}
diff --git a/xchange-acx/src/test/resources/trade/create_order.json b/xchange-acx/src/test/resources/trade/create_order.json
new file mode 100644
index 000000000..66ca2c4c9
--- /dev/null
+++ b/xchange-acx/src/test/resources/trade/create_order.json
@@ -0,0 +1,14 @@
+{
+ "id": 199918493,
+ "side": "buy",
+ "ord_type": "limit",
+ "price": "10.12",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "btcaud",
+ "created_at": "2018-01-01T22:22:14+11:00",
+ "volume": "0.1",
+ "remaining_volume": "0.1",
+ "executed_volume": "0.0",
+ "trades_count": 0
+}
\ No newline at end of file
diff --git a/xchange-acx/src/test/resources/trade/open_orders.json b/xchange-acx/src/test/resources/trade/open_orders.json
new file mode 100644
index 000000000..62956bc3c
--- /dev/null
+++ b/xchange-acx/src/test/resources/trade/open_orders.json
@@ -0,0 +1,16 @@
+[
+ {
+ "id": 198602763,
+ "side": "sell",
+ "ord_type": "limit",
+ "price": "97900.99",
+ "avg_price": "0.0",
+ "state": "wait",
+ "market": "ethaud",
+ "created_at": "2017-12-31T18:12:28+11:00",
+ "volume": "0.01",
+ "remaining_volume": "0.01",
+ "executed_volume": "0.0",
+ "trades_count": 0
+ }
+]
diff --git a/xchange-anx/pom.xml b/xchange-anx/pom.xml
index f398f0973..036de2863 100644
--- a/xchange-anx/pom.xml
+++ b/xchange-anx/pom.xml
@@ -1,34 +1,34 @@
- 4.0.0
-
- org.knowm.xchange
- xchange-parent
- 4.2.1-SNAPSHOT
-
+ 4.0.0
+
+ org.knowm.xchange
+ xchange-parent
+ 4.3.4-SNAPSHOT
+
- xchange-anx
+ xchange-anx
- XChange ANX
- XChange implementations for the ANX.HK Exchange.
+ XChange ANX
+ XChange implementations for the ANX.HK Exchange.
- http://knowm.org/open-source/xchange/
- 2012
+ http://knowm.org/open-source/xchange/
+ 2012
-
- Knowm Inc.
- http://knowm.org/open-source/xchange/
-
+
+ Knowm Inc.
+ http://knowm.org/open-source/xchange/
+
-
-
+
+
-
-
- org.knowm.xchange
- xchange-core
- 4.2.1-SNAPSHOT
-
+
+
+ org.knowm.xchange
+ xchange-core
+ 4.3.4-SNAPSHOT
+
-
+
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/ANXUtils.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/ANXUtils.java
index 20de37c2f..5451878a6 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/ANXUtils.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/ANXUtils.java
@@ -39,7 +39,7 @@ public static boolean findLimitOrder(List orders, LimitOrder order,
for (LimitOrder openOrder : orders) {
if (openOrder.getId().equalsIgnoreCase(id)) {
- if (order.getCurrencyPair().equals(openOrder.getCurrencyPair()) && (order.getTradableAmount().compareTo(openOrder.getTradableAmount()) == 0)
+ if (order.getCurrencyPair().equals(openOrder.getCurrencyPair()) && (order.getOriginalAmount().compareTo(openOrder.getOriginalAmount()) == 0)
&& (order.getLimitPrice().compareTo(openOrder.getLimitPrice()) == 0)) {
found = true;
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXAdapters.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXAdapters.java
index 7feae2230..3cb0003f5 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXAdapters.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXAdapters.java
@@ -6,8 +6,10 @@
import java.util.List;
import java.util.Map;
+import org.knowm.xchange.anx.v2.dto.ANXValue;
import org.knowm.xchange.anx.v2.dto.account.ANXAccountInfo;
import org.knowm.xchange.anx.v2.dto.account.ANXWallet;
+import org.knowm.xchange.anx.v2.dto.account.ANXWalletHistoryEntry;
import org.knowm.xchange.anx.v2.dto.marketdata.ANXOrder;
import org.knowm.xchange.anx.v2.dto.marketdata.ANXTicker;
import org.knowm.xchange.anx.v2.dto.marketdata.ANXTrade;
@@ -19,6 +21,7 @@
import org.knowm.xchange.dto.Order.OrderType;
import org.knowm.xchange.dto.account.AccountInfo;
import org.knowm.xchange.dto.account.Balance;
+import org.knowm.xchange.dto.account.FundingRecord;
import org.knowm.xchange.dto.account.Wallet;
import org.knowm.xchange.dto.marketdata.Ticker;
import org.knowm.xchange.dto.marketdata.Trade;
@@ -34,7 +37,6 @@
*/
public final class ANXAdapters {
- private static final String SIDE_BID = "bid";
private static final int PERCENT_DECIMAL_SHIFT = 2;
/**
@@ -69,14 +71,14 @@ public static BigDecimal percentToFactor(BigDecimal percent) {
* @param orderTypeString
* @return
*/
- public static LimitOrder adaptOrder(BigDecimal amount, BigDecimal price, String tradedCurrency, String transactionCurrency, String orderTypeString,
+ public static LimitOrder adaptOrder(BigDecimal originalAmount, BigDecimal price, String tradedCurrency, String transactionCurrency, String orderTypeString,
String id, Date timestamp) {
// place a limit order
- OrderType orderType = SIDE_BID.equalsIgnoreCase(orderTypeString) ? OrderType.BID : OrderType.ASK;
+ OrderType orderType = adaptSide(orderTypeString);
CurrencyPair currencyPair = adaptCurrencyPair(tradedCurrency, transactionCurrency);
- LimitOrder limitOrder = new LimitOrder(orderType, amount, currencyPair, id, timestamp, price);
+ LimitOrder limitOrder = new LimitOrder(orderType, originalAmount, currencyPair, id, timestamp, price);
return limitOrder;
@@ -92,7 +94,7 @@ public static LimitOrder adaptOrder(BigDecimal amount, BigDecimal price, String
*/
public static List adaptOrders(List anxOrders, String tradedCurrency, String currency, String orderType, String id) {
- List limitOrders = new ArrayList();
+ List limitOrders = new ArrayList<>();
for (ANXOrder anxOrder : anxOrders) {
limitOrders.add(adaptOrder(anxOrder.getAmount(), anxOrder.getPrice(), tradedCurrency, currency, orderType, id, new Date(anxOrder.getStamp())));
@@ -103,7 +105,7 @@ public static List adaptOrders(List anxOrders, String trad
public static List adaptOrders(ANXOpenOrder[] anxOpenOrders) {
- List limitOrders = new ArrayList();
+ List limitOrders = new ArrayList<>();
for (ANXOpenOrder anxOpenOrder : anxOpenOrders) {
limitOrders.add(adaptOrder(anxOpenOrder.getAmount().getValue(), anxOpenOrder.getPrice().getValue(), anxOpenOrder.getItem(),
@@ -138,7 +140,7 @@ public static Balance adaptBalance(ANXWallet anxWallet) {
*/
public static Wallet adaptWallet(Map anxWallets) {
- List balances = new ArrayList();
+ List balances = new ArrayList<>();
for (ANXWallet anxWallet : anxWallets.values()) {
Balance balance = adaptBalance(anxWallet);
@@ -177,7 +179,7 @@ public static Wallet adaptWallet(Map anxWallets) {
*/
public static Trades adaptTrades(List anxTrades) {
- List tradesList = new ArrayList();
+ List tradesList = new ArrayList<>();
long latestTid = 0;
for (ANXTrade anxTrade : anxTrades) {
long tid = anxTrade.getTid();
@@ -231,7 +233,7 @@ public static CurrencyPair adaptCurrencyPair(String tradeCurrency, String priceC
public static UserTrades adaptUserTrades(ANXTradeResult[] anxTradeResults, ANXMetaData meta) {
- List trades = new ArrayList(anxTradeResults.length);
+ List trades = new ArrayList<>(anxTradeResults.length);
for (ANXTradeResult tradeResult : anxTradeResults) {
trades.add(adaptUserTrade(tradeResult, meta));
}
@@ -256,6 +258,8 @@ private static CurrencyPair adaptCurrencyPair(String currencyPairRaw) {
if ("DOGEBTC".equalsIgnoreCase(currencyPairRaw)) {
return CurrencyPair.DOGE_BTC;
+ } else if ("STARTBTC".equalsIgnoreCase(currencyPairRaw)) {
+ return new CurrencyPair(Currency.START, Currency.BTC);
} else if (currencyPairRaw.length() != 6) {
throw new IllegalArgumentException("Unrecognized currency pair " + currencyPairRaw);
} else {
@@ -264,7 +268,72 @@ private static CurrencyPair adaptCurrencyPair(String currencyPairRaw) {
}
private static OrderType adaptSide(String side) {
+ // buy & sell are used for trades
+ // bid and offer are used for orders
+
+ switch (side.toUpperCase()) {
+ case "BUY":
+ return OrderType.BID;
+ case "SELL":
+ return OrderType.ASK;
+ case "BID":
+ return OrderType.BID;
+ case "OFFER":
+ return OrderType.ASK;
+ case "ASK":
+ return OrderType.ASK;
+ default:
+ throw new IllegalStateException("Don't understand order direction: " + side);
+ }
+ }
- return SIDE_BID.equals(side) ? OrderType.BID : OrderType.ASK;
+ public static FundingRecord adaptFundingRecord(ANXWalletHistoryEntry entry) {
+ /*
+ type can be can be any of:
+
+ deposit,
+ withdraw,
+
+ or...
+
+ fee
+ earned
+ spent
+ out
+ */
+
+ String entryType = entry.getType();
+
+ FundingRecord.Type type;
+ if (entryType.equalsIgnoreCase("deposit"))
+ type = FundingRecord.Type.DEPOSIT;
+ else if (entryType.equalsIgnoreCase("withdraw"))
+ type = FundingRecord.Type.WITHDRAWAL;
+ else
+ throw new IllegalStateException("should not get here");
+
+ Long rawDate = Long.valueOf(entry.getDate());
+ //this date is not in utc, it's in HK time (I think) - for example: 1495759124000 should translate to 2017-05-26 09:38:44
+
+ Long eightHours = 1000 * 60 * 60 * 8L;
+ Date date = DateUtils.fromMillisUtc(rawDate + eightHours);
+
+ ANXValue value = entry.getValue();
+ Currency currency = new Currency(value.getCurrency());
+ ANXValue balance = entry.getBalance();
+
+ return new FundingRecord(
+ entry.getInfo(),
+ date,
+ currency,
+ value.getValue(),
+ entry.getTransactionId(),
+ null,
+ type,
+ FundingRecord.Status.COMPLETE,
+ balance == null ? null : balance.getValue(),
+ null,
+ null
+ );
}
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXV2.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXV2.java
index 44532046f..874b8d1fd 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXV2.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/ANXV2.java
@@ -52,13 +52,13 @@ ANXTickersWrapper getTickers(@PathParam("ident") String tradeableIdentifier, @Pa
@GET
@Path("{ident}{currency}/money/depth/fetch")
- ANXDepthWrapper getPartialDepth(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency)
- throws ANXException, IOException;
+ ANXDepthWrapper getPartialDepth(@PathParam("ident") String tradeableIdentifier,
+ @PathParam("currency") String currency) throws ANXException, IOException;
@GET
@Path("{ident}{currency}/money/depth/full")
- ANXDepthWrapper getFullDepth(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency)
- throws ANXException, IOException;
+ ANXDepthWrapper getFullDepth(@PathParam("ident") String tradeableIdentifier,
+ @PathParam("currency") String currency) throws ANXException, IOException;
@GET
@Path("{ident}{currency}/money/depth/full")
@@ -67,8 +67,8 @@ ANXDepthsWrapper getFullDepths(@PathParam("ident") String tradeableIdentifier, @
@GET
@Path("{ident}{currency}/money/trade/fetch")
- ANXTradesWrapper getTrades(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency, @QueryParam("since") long since)
- throws ANXException, IOException;
+ ANXTradesWrapper getTrades(@PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency,
+ @QueryParam("since") long since) throws ANXException, IOException;
// Account Info API
@@ -124,8 +124,8 @@ ANXOpenOrderWrapper getOpenOrders(@HeaderParam("Rest-Key") String apiKey, @Heade
@Path("money/trade/list")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ANXTradeResultWrapper getExecutedTrades(@HeaderParam("Rest-Key") String apiKey, @HeaderParam("Rest-Sign") ParamsDigest postBodySignatureCreator,
- @FormParam("nonce") SynchronizedValueFactory nonce, @FormParam("from") Long from, @FormParam("to") Long to)
- throws ANXException, IOException;
+ @FormParam("nonce") SynchronizedValueFactory nonce, @FormParam("from") Long from,
+ @FormParam("to") Long to) throws ANXException, IOException;
/**
* Status of the order
@@ -144,8 +144,8 @@ ANXTradeResultWrapper getExecutedTrades(@HeaderParam("Rest-Key") String apiKey,
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ANXOrderResultWrapper getOrderResult(@HeaderParam("Rest-Key") String apiKey, @HeaderParam("Rest-Sign") ParamsDigest postBodySignatureCreator,
@FormParam("nonce") SynchronizedValueFactory nonce, @PathParam("baseCurrency") String baseCurrency,
- @PathParam("counterCurrency") String counterCurrency, @FormParam("order") String order, @FormParam("type") String type)
- throws ANXException, IOException;
+ @PathParam("counterCurrency") String counterCurrency, @FormParam("order") String order,
+ @FormParam("type") String type) throws ANXException, IOException;
/**
* @param postBodySignatureCreator
@@ -184,6 +184,8 @@ ANXGenericResponse cancelOrder(@HeaderParam("Rest-Key") String apiKey, @HeaderPa
* @param nonce
* @param currency
* @param page to fetch (can be null for first page)
+ * @param from start time (can be null)
+ * @param to end time (can be null)
* @return
* @throws org.knowm.xchange.anx.v2.dto.ANXException
*/
@@ -191,6 +193,6 @@ ANXGenericResponse cancelOrder(@HeaderParam("Rest-Key") String apiKey, @HeaderPa
@Path("money/wallet/history")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
ANXWalletHistoryWrapper getWalletHistory(@HeaderParam("Rest-Key") String apiKey, @HeaderParam("Rest-Sign") ParamsDigest postBodySignatureCreator,
- @FormParam("nonce") SynchronizedValueFactory nonce, @FormParam("currency") String currency, @FormParam("page") Integer page)
- throws ANXException, IOException;
+ @FormParam("nonce") SynchronizedValueFactory nonce, @FormParam("currency") String currency,
+ @FormParam("page") Integer page, @FormParam("from") Long from, @FormParam("to") Long to) throws ANXException, IOException;
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/ANXValue.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/ANXValue.java
index eaf1f9410..d03dd942a 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/ANXValue.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/ANXValue.java
@@ -14,7 +14,7 @@ public final class ANXValue {
/**
* Constructor
- *
+ *
* @param value
* @param currency
*/
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfo.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfo.java
index b033f571a..3b1a6bb04 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfo.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfo.java
@@ -26,7 +26,7 @@ public final class ANXAccountInfo {
/**
* Constructor
- *
+ *
* @param login
* @param index
* @param id
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfoWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfoWrapper.java
index 30eb5d7fe..a4de4f81d 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfoWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXAccountInfoWrapper.java
@@ -13,7 +13,7 @@ public class ANXAccountInfoWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxAccountInfo
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXBitcoinDepositAddressWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXBitcoinDepositAddressWrapper.java
index 68d78d23b..125f96f97 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXBitcoinDepositAddressWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXBitcoinDepositAddressWrapper.java
@@ -13,7 +13,7 @@ public class ANXBitcoinDepositAddressWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxBitcoinDepositAddress
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWallet.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWallet.java
index df4f39543..5ee01df88 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWallet.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWallet.java
@@ -18,7 +18,7 @@ public final class ANXWallet {
/**
* Constructor
- *
+ *
* @param balance
* @param dailyWithdrawLimit
* @param maxWithdraw
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistory.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistory.java
index 50eb76940..6a47459ee 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistory.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistory.java
@@ -15,7 +15,7 @@ public final class ANXWalletHistory {
/**
* Constructor
- *
+ *
* @param records
* @param anxWalletHistoryEntries
*/
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryEntry.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryEntry.java
index a311917d2..761a66da7 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryEntry.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryEntry.java
@@ -1,5 +1,7 @@
package org.knowm.xchange.anx.v2.dto.account;
+import java.util.Arrays;
+
import org.knowm.xchange.anx.v2.dto.ANXValue;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -17,10 +19,11 @@ public final class ANXWalletHistoryEntry {
private final String info;
private final String[] link;
private final ANXWalletHistoryEntryTrade trade;
+ private final String transactionId;
/**
* Constructor
- *
+ *
* @param index
* @param date
* @param type
@@ -32,7 +35,8 @@ public final class ANXWalletHistoryEntry {
*/
public ANXWalletHistoryEntry(@JsonProperty("Index") int index, @JsonProperty("Date") String date, @JsonProperty("Type") String type,
@JsonProperty("Info") String info, @JsonProperty("Link") String[] link, @JsonProperty("Value") ANXValue value,
- @JsonProperty("Balance") ANXValue balance, @JsonProperty("Trade") ANXWalletHistoryEntryTrade trade) {
+ @JsonProperty("Balance") ANXValue balance, @JsonProperty("Trade") ANXWalletHistoryEntryTrade trade,
+ @JsonProperty("TransactionId") String transactionId) {
this.index = index;
this.date = date;
@@ -42,6 +46,11 @@ public ANXWalletHistoryEntry(@JsonProperty("Index") int index, @JsonProperty("Da
this.value = value;
this.balance = balance;
this.trade = trade;
+ this.transactionId = transactionId;
+ }
+
+ public String getTransactionId() {
+ return transactionId;
}
public int getIndex() {
@@ -88,7 +97,7 @@ public ANXWalletHistoryEntryTrade getTrade() {
public String toString() {
return "ANXWalletHistoryEntry{" + "index=" + index + ", date=" + date + ", type=" + type + ", value=" + value + ", balance=" + balance + ", info="
- + info + ", link=" + link + ", trade=" + trade + '}';
+ + info + ", link=" + Arrays.toString(link) + ", trade=" + trade + '}';
}
public static class ANXWalletHistoryEntryTrade {
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryWrapper.java
index 6c0086bea..cb09c3eb3 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWalletHistoryWrapper.java
@@ -13,7 +13,7 @@ public class ANXWalletHistoryWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxWalletHistory
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponse.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponse.java
index 788b89e7b..ec2658774 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponse.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponse.java
@@ -8,17 +8,22 @@
public final class ANXWithdrawalResponse {
/**
- * Bitcion transaction id (in the block chain)
+ * Bitcoin transaction id (in the block chain)
*/
private final String transactionId;
+ /**
+ * error message
+ */
+ private final String message;
+
/**
* Constructor
- *
+ *
* @param transactionId
*/
- public ANXWithdrawalResponse(@JsonProperty("trx") String transactionId) {
-
+ public ANXWithdrawalResponse(@JsonProperty("trx") String transactionId, @JsonProperty("message") String message) {
+ this.message = message;
this.transactionId = transactionId;
}
@@ -27,6 +32,10 @@ public String getTransactionId() {
return transactionId;
}
+ public String getMessage() {
+ return message;
+ }
+
@Override
public String toString() {
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponseWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponseWrapper.java
index dab18dcd0..99179ae5c 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponseWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/account/ANXWithdrawalResponseWrapper.java
@@ -13,7 +13,7 @@ public class ANXWithdrawalResponseWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxWithdrawalResponse
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepth.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepth.java
index 05ff0ea9e..04c6dfc91 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepth.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepth.java
@@ -18,7 +18,7 @@ public final class ANXDepth {
/**
* Constructor
- *
+ *
* @param asks
* @param bids
*/
@@ -71,7 +71,7 @@ public static class FilterPrice {
/**
* Constructor
- *
+ *
* @param value
* @param valueInt
* @param currency
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthUpdate.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthUpdate.java
index d22c89ee7..1daac47b4 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthUpdate.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthUpdate.java
@@ -22,7 +22,7 @@ public final class ANXDepthUpdate {
/**
* Constructor
- *
+ *
* @param tradeType
* @param priceInt
* @param volumeInt
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthWrapper.java
index e802efd88..15e627cd7 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXDepthWrapper.java
@@ -13,7 +13,7 @@ public class ANXDepthWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxDepth
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXOrder.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXOrder.java
index 6c153dcdf..261854b03 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXOrder.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXOrder.java
@@ -17,7 +17,7 @@ public final class ANXOrder {
/**
* Constructor
- *
+ *
* @param price
* @param amount
* @param priceInt
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTicker.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTicker.java
index 395bbc411..7336594a2 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTicker.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTicker.java
@@ -21,7 +21,7 @@ public final class ANXTicker {
/**
* Constructor
- *
+ *
* @param high
* @param low
* @param avg
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTickerWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTickerWrapper.java
index f2446c39b..ba2aca721 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTickerWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTickerWrapper.java
@@ -13,7 +13,7 @@ public class ANXTickerWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxTicker
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTradesWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTradesWrapper.java
index c3e663754..15f30cbc5 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTradesWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/marketdata/ANXTradesWrapper.java
@@ -15,7 +15,7 @@ public class ANXTradesWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxTrades
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXGenericResponse.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXGenericResponse.java
index 120783340..1182e6e7c 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXGenericResponse.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXGenericResponse.java
@@ -13,7 +13,7 @@ public final class ANXGenericResponse {
/**
* Constructor
- *
+ *
* @param result
* @param data
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLag.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLag.java
index 0e3093870..cfc837553 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLag.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLag.java
@@ -14,7 +14,7 @@ public class ANXLag {
/**
* Constructor
- *
+ *
* @param lag
* @param lagDecimal
* @param lagText
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLagWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLagWrapper.java
index 77a28df0f..d20cb1900 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLagWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXLagWrapper.java
@@ -13,7 +13,7 @@ public class ANXLagWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxLag
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrder.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrder.java
index bcf23cef9..465074d93 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrder.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrder.java
@@ -23,7 +23,7 @@ public final class ANXOpenOrder {
/**
* Constructor
- *
+ *
* @param oid
* @param currency
* @param item
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrderWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrderWrapper.java
index 7eb1bd0fe..6b3bb30a5 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrderWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOpenOrderWrapper.java
@@ -13,7 +13,7 @@ public class ANXOpenOrderWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxOpenOrders
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResult.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResult.java
index c32ae94b3..5968c57a9 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResult.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResult.java
@@ -17,7 +17,7 @@ public final class ANXOrderResult {
/**
* Constructor
- *
+ *
* @param avgCost
* @param orderId
* @param totalAmount
@@ -63,10 +63,10 @@ public ANXOrderResultTrade[] getTrades() {
@Override
public String toString() {
- String tradesString = "[";
+ StringBuilder tradesString = new StringBuilder("[");
for (int i = 0; i < trades.length; i++)
- tradesString += ((i > 0) ? ", " : "") + trades[i].toString();
- tradesString += "]";
+ tradesString.append((i > 0) ? ", " : "").append(trades[i].toString());
+ tradesString.append("]");
return "ANXOpenOrder [avgCost=" + avgCost + ", orderId=" + orderId + ", totalAmount=" + totalAmount + ", totalSpent=" + totalSpent + ", trades="
+ tradesString + "]";
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultTrade.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultTrade.java
index df1539bc9..9e5eba680 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultTrade.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultTrade.java
@@ -21,7 +21,7 @@ public final class ANXOrderResultTrade {
/**
* Constructor
- *
+ *
* @param amount
* @param currency
* @param date
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultWrapper.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultWrapper.java
index 138da09d4..aad167aad 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultWrapper.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/dto/trade/ANXOrderResultWrapper.java
@@ -13,7 +13,7 @@ public class ANXOrderResultWrapper {
/**
* Constructor
- *
+ *
* @param result
* @param anxOrderResult
* @param error
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountService.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountService.java
index 8e4f714f4..90c3f008c 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountService.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountService.java
@@ -2,13 +2,27 @@
import java.io.IOException;
import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
import org.knowm.xchange.BaseExchange;
import org.knowm.xchange.anx.ANXUtils;
import org.knowm.xchange.anx.v2.ANXAdapters;
+import org.knowm.xchange.anx.v2.dto.account.ANXWalletHistoryEntry;
+import org.knowm.xchange.anx.v2.dto.account.ANXWithdrawalResponse;
+import org.knowm.xchange.anx.v2.dto.account.ANXWithdrawalResponseWrapper;
import org.knowm.xchange.currency.Currency;
import org.knowm.xchange.dto.account.AccountInfo;
+import org.knowm.xchange.dto.account.FundingRecord;
+import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
import org.knowm.xchange.service.account.AccountService;
+import org.knowm.xchange.service.trade.params.DefaultWithdrawFundsParams;
+import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrency;
+import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
+import org.knowm.xchange.service.trade.params.TradeHistoryParams;
+import org.knowm.xchange.service.trade.params.TradeHistoryParamsTimeSpan;
+import org.knowm.xchange.service.trade.params.WithdrawFundsParams;
/**
*
@@ -45,8 +59,27 @@ public String withdrawFunds(Currency currency, BigDecimal amount, String address
throw new IllegalArgumentException("Amount cannot be null");
}
- anxWithdrawFunds(currency.toString(), amount, address);
- return "success";
+ ANXWithdrawalResponseWrapper wrapper = anxWithdrawFunds(currency.toString(), amount, address);
+ ANXWithdrawalResponse response = wrapper.getAnxWithdrawalResponse();
+
+ //eg: { "result": "error", "data": { "message": "min size, params, or available funds problem." }}
+ if (wrapper.getResult().equals("error")) {
+ throw new IllegalStateException("Failed to withdraw funds: " + response.getMessage());
+ } else if (wrapper.getError() != null) {//does this ever happen?
+ throw new IllegalStateException("Failed to withdraw funds: " + wrapper.getError());
+ } else {
+ return response.getTransactionId();
+ }
+ }
+
+ @Override
+ public String withdrawFunds(WithdrawFundsParams params) throws IOException {
+
+ if (params instanceof DefaultWithdrawFundsParams) {
+ DefaultWithdrawFundsParams defaultParams = (DefaultWithdrawFundsParams) params;
+ return withdrawFunds(defaultParams.currency, defaultParams.amount, defaultParams.address);
+ }
+ throw new IllegalStateException("Don't know how to withdraw: " + params);
}
@Override
@@ -55,4 +88,94 @@ public String requestDepositAddress(Currency currency, String... args) throws IO
return anxRequestDepositAddress(currency.toString()).getAddress();
}
+ @Override
+ public TradeHistoryParams createFundingHistoryParams() {
+ throw new NotAvailableFromExchangeException();
+ }
+
+ @Override
+ public List getFundingHistory(TradeHistoryParams params) throws IOException {
+
+ List results = new ArrayList<>();
+
+ List walletHistory = getWalletHistory(params);
+ for (ANXWalletHistoryEntry entry : walletHistory) {
+
+ if (!entry.getType().equalsIgnoreCase("deposit") && !entry.getType().equalsIgnoreCase("withdraw"))
+ continue;
+
+ results.add(ANXAdapters.adaptFundingRecord(entry));
+ }
+ return results;
+ }
+
+ public static class AnxFundingHistoryParams implements TradeHistoryParamCurrency, TradeHistoryParamPaging, TradeHistoryParamsTimeSpan {
+
+ private Currency currency;
+ private Integer pageNumber;
+ private Integer pageLength;//not supported
+ private Date startTime;
+ private Date endTime;
+
+ public AnxFundingHistoryParams() {
+ }
+
+ public AnxFundingHistoryParams(Currency currency, Date startTime, Date endTime) {
+ this.currency = currency;
+ this.startTime = startTime;
+ this.endTime = endTime;
+ }
+
+ @Override
+ public void setCurrency(Currency currency) {
+ this.currency = currency;
+ }
+
+ @Override
+ public Currency getCurrency() {
+ return currency;
+ }
+
+ @Override
+ public void setPageLength(Integer pageLength) {
+ //not supported, failed quietly
+ }
+
+ @Override
+ public Integer getPageLength() {
+ return pageLength;
+ }
+
+ @Override
+ public void setPageNumber(Integer pageNumber) {
+ if (pageNumber != null && pageNumber == 0)
+ throw new IllegalStateException("Pages are '1' indexed");
+ this.pageNumber = pageNumber;
+ }
+
+ @Override
+ public Integer getPageNumber() {
+ return pageNumber;
+ }
+
+ @Override
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ @Override
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ @Override
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ @Override
+ public Date getEndTime() {
+ return endTime;
+ }
+ }
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountServiceRaw.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountServiceRaw.java
index a542e8ff6..669f38adf 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountServiceRaw.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXAccountServiceRaw.java
@@ -1,7 +1,13 @@
package org.knowm.xchange.anx.v2.service;
+import static org.knowm.xchange.utils.DateUtils.toMillisNullSafe;
+
import java.io.IOException;
import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.anx.ANXUtils;
@@ -11,8 +17,15 @@
import org.knowm.xchange.anx.v2.dto.account.ANXAccountInfoWrapper;
import org.knowm.xchange.anx.v2.dto.account.ANXBitcoinDepositAddress;
import org.knowm.xchange.anx.v2.dto.account.ANXBitcoinDepositAddressWrapper;
-import org.knowm.xchange.anx.v2.dto.account.ANXWithdrawalResponse;
+import org.knowm.xchange.anx.v2.dto.account.ANXWalletHistory;
+import org.knowm.xchange.anx.v2.dto.account.ANXWalletHistoryEntry;
+import org.knowm.xchange.anx.v2.dto.account.ANXWalletHistoryWrapper;
import org.knowm.xchange.anx.v2.dto.account.ANXWithdrawalResponseWrapper;
+import org.knowm.xchange.currency.Currency;
+import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrency;
+import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
+import org.knowm.xchange.service.trade.params.TradeHistoryParams;
+import org.knowm.xchange.service.trade.params.TradeHistoryParamsTimeSpan;
import org.knowm.xchange.utils.Assert;
import si.mazi.rescu.HttpStatusIOException;
@@ -31,7 +44,7 @@ protected ANXAccountServiceRaw(Exchange exchange) {
super(exchange);
Assert.notNull(exchange.getExchangeSpecification().getSslUri(), "Exchange specification URI cannot be null");
- this.anxV2 = RestProxyFactory.createProxy(ANXV2.class, exchange.getExchangeSpecification().getSslUri());
+ this.anxV2 = RestProxyFactory.createProxy(ANXV2.class, exchange.getExchangeSpecification().getSslUri(), getClientConfig());
this.signatureCreator = ANXV2Digest.createInstance(exchange.getExchangeSpecification().getSecretKey());
}
@@ -48,13 +61,13 @@ public ANXAccountInfo getANXAccountInfo() throws IOException {
}
}
- public ANXWithdrawalResponse anxWithdrawFunds(String currency, BigDecimal amount, String address) throws IOException {
+ public ANXWithdrawalResponseWrapper anxWithdrawFunds(String currency, BigDecimal amount, String address) throws IOException {
try {
ANXWithdrawalResponseWrapper anxWithdrawalResponseWrapper = anxV2.withdrawBtc(exchange.getExchangeSpecification().getApiKey(), signatureCreator,
exchange.getNonceFactory(), currency, address,
amount.multiply(new BigDecimal(ANXUtils.BTC_VOLUME_AND_AMOUNT_INT_2_DECIMAL_FACTOR_2)).intValue(), 1, false, false);
- return anxWithdrawalResponseWrapper.getAnxWithdrawalResponse();
+ return anxWithdrawalResponseWrapper;
} catch (ANXException e) {
throw handleError(e);
} catch (HttpStatusIOException e) {
@@ -74,4 +87,55 @@ public ANXBitcoinDepositAddress anxRequestDepositAddress(String currency) throws
throw handleHttpError(e);
}
}
+
+ public List getWalletHistory(TradeHistoryParams params) throws IOException {
+ String currencyCode = null;
+ if (params instanceof TradeHistoryParamCurrency) {
+ Currency currency = ((TradeHistoryParamCurrency) params).getCurrency();
+ currencyCode = currency == null ? null : currency.getCurrencyCode();
+ }
+
+ Integer pageNumber = null;
+ if (params instanceof TradeHistoryParamPaging) {
+ pageNumber = ((TradeHistoryParamPaging) params).getPageNumber();
+ }
+ boolean userSpecifiedPageNumber = pageNumber != null;
+
+ Date from = null;
+ Date to = null;
+ if (params instanceof TradeHistoryParamsTimeSpan) {
+ TradeHistoryParamsTimeSpan tradeHistoryParamsTimeSpan = (TradeHistoryParamsTimeSpan) params;
+ from = tradeHistoryParamsTimeSpan.getStartTime();
+ to = tradeHistoryParamsTimeSpan.getEndTime();
+ }
+
+ List all = new ArrayList<>();
+
+ ANXWalletHistory walletHistory = getWalletHistory(currencyCode, pageNumber, from, to);
+
+ all.addAll(Arrays.asList(walletHistory.getANXWalletHistoryEntries()));
+
+ //if there are more results (and the user didn't specify a specific page) keep loading
+ while (walletHistory.getRecords() == walletHistory.getMaxResults() && !userSpecifiedPageNumber) {
+ pageNumber = walletHistory.getCurrentPage() + 1;
+
+ walletHistory = getWalletHistory(currencyCode, pageNumber, from, to);
+
+ all.addAll(Arrays.asList(walletHistory.getANXWalletHistoryEntries()));
+ }
+
+ return all;
+ }
+
+ public ANXWalletHistory getWalletHistory(String currency, Integer page, Date from, Date to) throws IOException {
+ try {
+ ANXWalletHistoryWrapper walletHistory = anxV2.getWalletHistory(exchange.getExchangeSpecification().getApiKey(),
+ signatureCreator, exchange.getNonceFactory(), currency, page, toMillisNullSafe(from), toMillisNullSafe(to));
+ return walletHistory.getANXWalletHistory();
+ } catch (ANXException e) {
+ throw handleError(e);
+ } catch (HttpStatusIOException e) {
+ throw handleHttpError(e);
+ }
+ }
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXBaseService.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXBaseService.java
index f0b4a2f12..d905a5b8d 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXBaseService.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXBaseService.java
@@ -25,6 +25,7 @@ public ANXBaseService(Exchange exchange) {
}
protected RuntimeException handleHttpError(HttpStatusIOException exception) throws IOException {
+
if (exception.getHttpStatusCode() == 304) {
return new NonceException(exception.getHttpBody());
} else {
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataService.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataService.java
index 748eedb8a..7e7e62944 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataService.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataService.java
@@ -46,7 +46,7 @@ public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOExce
* Get market depth from exchange
*
* @param args Optional arguments. Exchange-specific. This implementation assumes: absent or "full" -> get full OrderBook "partial" -> get partial
- * OrderBook
+ * OrderBook
* @return The OrderBook
* @throws java.io.IOException
*/
@@ -55,7 +55,7 @@ public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws
// Request data
ANXDepthWrapper anxDepthWrapper = null;
- if (args.length > 0) {
+ if (args != null && args.length > 0) {
if (args[0] instanceof String) {
if ("full" == args[0]) {
anxDepthWrapper = getANXFullOrderBook(currencyPair);
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataServiceRaw.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataServiceRaw.java
index 84cdf4b80..e2e8e6bfa 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataServiceRaw.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXMarketDataServiceRaw.java
@@ -36,7 +36,7 @@ protected ANXMarketDataServiceRaw(Exchange exchange) {
super(exchange);
Assert.notNull(exchange.getExchangeSpecification().getSslUri(), "Exchange specification URI cannot be null");
- this.anxV2 = RestProxyFactory.createProxy(ANXV2.class, exchange.getExchangeSpecification().getSslUri());
+ this.anxV2 = RestProxyFactory.createProxy(ANXV2.class, exchange.getExchangeSpecification().getSslUri(), getClientConfig());
}
public ANXTicker getANXTicker(CurrencyPair currencyPair) throws IOException {
@@ -69,7 +69,7 @@ public Map getANXTickers(Collection currencyPai
try {
if (i == 2) {
ANXTicker anxTicker = getANXTicker(pathCurrencyPair);
- Map ticker = new HashMap();
+ Map ticker = new HashMap<>();
ticker.put(pathCurrencyPair.base.getCurrencyCode() + pathCurrencyPair.counter.getCurrencyCode(), anxTicker);
return ticker;
}
@@ -113,7 +113,7 @@ public Map getANXFullOrderBooks(Collection curre
try {
if (i == 2) {
ANXDepthWrapper anxDepthWrapper = getANXFullOrderBook(pathCurrencyPair);
- Map book = new HashMap();
+ Map book = new HashMap<>();
book.put(pathCurrencyPair.base.getCurrencyCode() + pathCurrencyPair.counter.getCurrencyCode(), anxDepthWrapper.getAnxDepth());
return book;
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeService.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeService.java
index 0f00c0970..c77890dc3 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeService.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeService.java
@@ -11,14 +11,11 @@
import org.knowm.xchange.anx.v2.dto.trade.ANXTradeResultWrapper;
import org.knowm.xchange.dto.Order;
import org.knowm.xchange.dto.Order.OrderType;
-import org.knowm.xchange.dto.trade.LimitOrder;
-import org.knowm.xchange.dto.trade.MarketOrder;
-import org.knowm.xchange.dto.trade.OpenOrders;
-import org.knowm.xchange.dto.trade.UserTrades;
-import org.knowm.xchange.exceptions.ExchangeException;
-import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
+import org.knowm.xchange.dto.trade.*;
import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
import org.knowm.xchange.service.trade.TradeService;
+import org.knowm.xchange.service.trade.params.CancelOrderByIdParams;
+import org.knowm.xchange.service.trade.params.CancelOrderParams;
import org.knowm.xchange.service.trade.params.DefaultTradeHistoryParamsTimeSpan;
import org.knowm.xchange.service.trade.params.TradeHistoryParams;
import org.knowm.xchange.service.trade.params.TradeHistoryParamsTimeSpan;
@@ -47,7 +44,7 @@ public OpenOrders getOpenOrders() throws IOException {
}
@Override
- public OpenOrders getOpenOrders(OpenOrdersParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
+ public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
return new OpenOrders(ANXAdapters.adaptOrders(getANXOpenOrders()));
}
@@ -62,10 +59,10 @@ public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
// Validation
Assert.notNull(limitOrder.getLimitPrice(), "getLimitPrice() cannot be null");
- Assert.notNull(limitOrder.getTradableAmount(), "getTradableAmount() cannot be null");
+ Assert.notNull(limitOrder.getOriginalAmount(), "getOriginalAmount() cannot be null");
- if (limitOrder.getTradableAmount().scale() > 8) {
- throw new IllegalArgumentException("tradableAmount scale exceeds max");
+ if (limitOrder.getOriginalAmount().scale() > 8) {
+ throw new IllegalArgumentException("originalAmount scale exceeds max");
}
if (limitOrder.getLimitPrice().scale() > ANXUtils.getMaxPriceScale(limitOrder.getCurrencyPair())) {
@@ -74,12 +71,17 @@ public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
String type = limitOrder.getType().equals(OrderType.BID) ? "bid" : "ask";
- BigDecimal amount = limitOrder.getTradableAmount();
+ BigDecimal amount = limitOrder.getOriginalAmount();
BigDecimal price = limitOrder.getLimitPrice();
return placeANXLimitOrder(limitOrder.getCurrencyPair(), type, amount, price).getDataString();
}
+ @Override
+ public String placeStopOrder(StopOrder stopOrder) throws IOException {
+ throw new NotYetImplementedForExchangeException();
+ }
+
@Override
public boolean cancelOrder(String orderId) throws IOException {
@@ -88,7 +90,17 @@ public boolean cancelOrder(String orderId) throws IOException {
return cancelANXOrder(orderId, "BTC", "EUR").getResult().equals("success");
}
+ @Override
+ public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
+ if (orderParams instanceof CancelOrderByIdParams) {
+ return cancelOrder(((CancelOrderByIdParams) orderParams).getOrderId());
+ } else {
+ return false;
+ }
+ }
+
private UserTrades getTradeHistory(Long from, Long to) throws IOException {
+
ANXTradeResultWrapper rawTrades = getExecutedANXTrades(from, to);
String error = rawTrades.getError();
@@ -100,10 +112,10 @@ private UserTrades getTradeHistory(Long from, Long to) throws IOException {
}
/**
- * Suported parameter types: {@link TradeHistoryParamsTimeSpan}
+ * Supported parameter types: {@link TradeHistoryParamsTimeSpan}
*/
@Override
- public UserTrades getTradeHistory(TradeHistoryParams params) throws ExchangeException, IOException {
+ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
Long from = null;
Long to = null;
@@ -127,8 +139,7 @@ public OpenOrdersParams createOpenOrdersParams() {
}
@Override
- public Collection getOrder(String... orderIds)
- throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
+ public Collection getOrder(String... orderIds) throws IOException {
throw new NotYetImplementedForExchangeException();
}
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeServiceRaw.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeServiceRaw.java
index 3cdb8afd0..918443a63 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeServiceRaw.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXTradeServiceRaw.java
@@ -35,7 +35,7 @@ protected ANXTradeServiceRaw(Exchange exchange) {
super(exchange);
Assert.notNull(exchange.getExchangeSpecification().getSslUri(), "Exchange specification URI cannot be null");
- this.anxV2 = RestProxyFactory.createProxy(ANXV2.class, exchange.getExchangeSpecification().getSslUri());
+ this.anxV2 = RestProxyFactory.createProxy(ANXV2.class, exchange.getExchangeSpecification().getSslUri(), getClientConfig());
this.signatureCreator = ANXV2Digest.createInstance(exchange.getExchangeSpecification().getSecretKey());
}
@@ -70,7 +70,7 @@ public ANXGenericResponse placeANXMarketOrder(MarketOrder marketOrder) throws IO
try {
ANXGenericResponse anxGenericResponse = anxV2.placeOrder(exchange.getExchangeSpecification().getApiKey(), signatureCreator,
exchange.getNonceFactory(), marketOrder.getCurrencyPair().base.getCurrencyCode(), marketOrder.getCurrencyPair().counter.getCurrencyCode(),
- marketOrder.getType().equals(Order.OrderType.BID) ? "bid" : "ask", marketOrder.getTradableAmount(), null);
+ marketOrder.getType().equals(Order.OrderType.BID) ? "bid" : "ask", marketOrder.getOriginalAmount(), null);
return anxGenericResponse;
} catch (ANXException e) {
throw handleError(e);
@@ -82,6 +82,7 @@ public ANXGenericResponse placeANXMarketOrder(MarketOrder marketOrder) throws IO
public ANXGenericResponse placeANXLimitOrder(CurrencyPair currencyPair, String type, BigDecimal amount, BigDecimal price) throws IOException {
try {
+
ANXGenericResponse anxGenericResponse = anxV2.placeOrder(exchange.getExchangeSpecification().getApiKey(), signatureCreator,
exchange.getNonceFactory(), currencyPair.base.getCurrencyCode(), currencyPair.counter.getCurrencyCode(), type, amount, price);
diff --git a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXV2Digest.java b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXV2Digest.java
index 7c1ccc869..d65910e19 100644
--- a/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXV2Digest.java
+++ b/xchange-anx/src/main/java/org/knowm/xchange/anx/v2/service/ANXV2Digest.java
@@ -16,7 +16,7 @@ public class ANXV2Digest extends BaseParamsDigest {
/**
* Constructor
- *
+ *
* @param secretKeyBase64
* @throws IllegalArgumentException if key is invalid (cannot be base-64-decoded or the decoded key is invalid).
*/
@@ -41,9 +41,9 @@ public String digestParams(RestInvocation restInvocation) {
Mac mac = getMac();
mac.update(restInvocation.getMethodPath().getBytes());
- mac.update(new byte[] { 0 });
+ mac.update(new byte[]{0});
mac.update(restInvocation.getRequestBody().getBytes());
return Base64.encodeBytes(mac.doFinal()).trim();
}
-}
\ No newline at end of file
+}
diff --git a/xchange-anx/src/main/resources/anxpro.json b/xchange-anx/src/main/resources/anxpro.json
index 8dad70a60..25ba3c8ab 100644
--- a/xchange-anx/src/main/resources/anxpro.json
+++ b/xchange-anx/src/main/resources/anxpro.json
@@ -25,6 +25,11 @@
"max_amount": 100000.00000000,
"price_scale": 5
},
+ "ETH/BTC": {
+ "min_amount": 0.01000000,
+ "max_amount": 100000.00000000,
+ "price_scale": 5
+ },
"BTC/HKD": {
"min_amount": 0.01000000,
"max_amount": 100000.00000000,
@@ -50,11 +55,19 @@
"max_amount": 100000.00000000,
"price_scale": 5
},
+ "ETH/USD": {
+ "min_amount": 0.01000000,
+ "max_amount": 100000.00000000,
+ "price_scale": 5
+ },
"DOGE/BTC": {
"min_amount": 10000.00000000,
"max_amount": 10000000000.00000000,
"price_scale": 8
},
+ "START/BTC": {
+ "price_scale": 8
+ },
"EGD/AUD": {
"price_scale": 8
},
@@ -156,6 +169,9 @@
"EUR": {
"scale": 2
},
+ "ETH": {
+ "scale": 8
+ },
"GBP": {
"scale": 2
},
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/ANXAdapterTest.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/ANXAdapterTest.java
index 2f82375ab..b10cfa76c 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/ANXAdapterTest.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/ANXAdapterTest.java
@@ -1,6 +1,6 @@
package org.knowm.xchange.anx.v2;
-import static org.fest.assertions.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.io.InputStream;
@@ -87,7 +87,7 @@ public void testOrderAdapterWithOpenOrders() throws IOException {
Assert.assertEquals(new BigDecimal("412.34567"), openorders.get(0).getLimitPrice());
Assert.assertEquals(OrderType.ASK, openorders.get(0).getType());
Assert.assertEquals(new BigDecimal("412.34567"), openorders.get(0).getLimitPrice());
- Assert.assertEquals(new BigDecimal("10.00000000"), openorders.get(0).getTradableAmount());
+ Assert.assertEquals(new BigDecimal("10.00000000"), openorders.get(0).getOriginalAmount());
Assert.assertEquals("BTC", openorders.get(0).getCurrencyPair().base.getCurrencyCode());
Assert.assertEquals("HKD", openorders.get(0).getCurrencyPair().counter.getCurrencyCode());
@@ -112,7 +112,7 @@ public void testOrderAdapterWithDepth() throws IOException {
// Verify all fields filled
assertThat(asks.get(0).getType()).isEqualTo(OrderType.ASK);
- Assert.assertEquals(new BigDecimal("16.00000000"), asks.get(0).getTradableAmount());
+ Assert.assertEquals(new BigDecimal("16.00000000"), asks.get(0).getOriginalAmount());
Assert.assertEquals(new BigDecimal("3260.40000"), asks.get(0).getLimitPrice());
Assert.assertEquals("BTC", asks.get(0).getCurrencyPair().base.getCurrencyCode());
@@ -138,7 +138,7 @@ public void testTradeAdapter() throws IOException {
assertThat(tradeList.size()).isEqualTo(2);
Trade trade = tradeList.get(0);
- assertThat(trade.getTradableAmount()).isEqualTo("0.25");
+ assertThat(trade.getOriginalAmount()).isEqualTo("0.25");
assertThat(trade.getCurrencyPair()).isEqualTo(CurrencyPair.BTC_USD);
assertThat(trade.getPrice()).isEqualTo("655");
assertThat(trade.getId()).isEqualTo("1402189342525");
@@ -159,7 +159,7 @@ public void testWalletAdapter() throws IOException {
// in Wallet, only wallets from ANXAccountInfo.getBalancesList that contained data are NOT null.
Collection balances = ANXAdapters.adaptWallet(anxAccountInfo.getWallets()).getBalances().values();
- Assert.assertEquals(21, balances.size());
+ Assert.assertEquals(22, balances.size());
Assert.assertTrue(balances.contains(new Balance(Currency.CAD, new BigDecimal("100000.00000"), new BigDecimal("100000.00000"))));
Assert.assertTrue(balances.contains(new Balance(Currency.BTC, new BigDecimal("100000.01988000"), new BigDecimal("100000.01988000"))));
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/bootstrap/ANXGenerator.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/bootstrap/ANXGenerator.java
index 4e4a1c3d3..0780f5546 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/bootstrap/ANXGenerator.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/bootstrap/ANXGenerator.java
@@ -55,20 +55,20 @@ public class ANXGenerator {
static ObjectMapper mapper = new ObjectMapper().configure(SerializationFeature.INDENT_OUTPUT, true)
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- static Set cryptos = new HashSet(Arrays.asList(BTC, LTC, DOGE, STR, XRP, START, EGD));
- static Currency[] fiats = { USD, EUR, GBP, HKD, AUD, CAD, NZD, SGD, JPY, CNY };
+ static Set cryptos = new HashSet<>(Arrays.asList(BTC, LTC, DOGE, STR, XRP, START, EGD));
+ static Currency[] fiats = {USD, EUR, GBP, HKD, AUD, CAD, NZD, SGD, JPY, CNY};
// counter currencies for STARTCoin - all fiats but CNY
- static Currency[] fiatsStart = { USD, EUR, GBP, HKD, AUD, CAD, NZD, SGD, JPY };
+ static Currency[] fiatsStart = {USD, EUR, GBP, HKD, AUD, CAD, NZD, SGD, JPY};
- static CurrencyPair[] pairsOther = { LTC_BTC, DOGE_BTC, STR_BTC, XRP_BTC };
+ static CurrencyPair[] pairsOther = {LTC_BTC, DOGE_BTC, STR_BTC, XRP_BTC};
// base currency -> min order size
- static Map minAmount = new HashMap();
- static Map maxAmount = new HashMap();
- static Map currencyMap = new TreeMap();
+ static Map minAmount = new HashMap<>();
+ static Map maxAmount = new HashMap<>();
+ static Map currencyMap = new TreeMap<>();
- static Set pairs = new HashSet();
+ static Set pairs = new HashSet<>();
static {
minAmount.put(BTC, ONE.movePointLeft(2));
@@ -88,21 +88,21 @@ public class ANXGenerator {
maxAmount.put(EGD, null);
for (Currency crypto : cryptos) {
- currencyMap.put(crypto, new CurrencyMetaData(8));
+ currencyMap.put(crypto, new CurrencyMetaData(8, null));
}
- currencyMap.put(CNY, new CurrencyMetaData(8));
+ currencyMap.put(CNY, new CurrencyMetaData(8, null));
for (Currency fiat : fiats) {
if (!currencyMap.containsKey(fiat)) {
- currencyMap.put(fiat, new CurrencyMetaData(2));
+ currencyMap.put(fiat, new CurrencyMetaData(2, null));
}
}
// extra currencies available, but not traded
- currencyMap.put(CHF, new CurrencyMetaData(2));
- currencyMap.put(NMC, new CurrencyMetaData(8));
- currencyMap.put(BGC, new CurrencyMetaData(8));
- currencyMap.put(PPC, new CurrencyMetaData(8));
+ currencyMap.put(CHF, new CurrencyMetaData(2, null));
+ currencyMap.put(NMC, new CurrencyMetaData(8, null));
+ currencyMap.put(BGC, new CurrencyMetaData(8, null));
+ currencyMap.put(PPC, new CurrencyMetaData(8, null));
Collections.addAll(pairs, pairsOther);
@@ -125,7 +125,7 @@ public static void main(String[] args) throws IOException {
private void run() throws IOException {
- Map map = new TreeMap();
+ Map map = new TreeMap<>();
for (CurrencyPair pair : pairs) {
handleCurrencyPair(map, pair);
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/DepositResponseJSONTest.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/DepositResponseJSONTest.java
index a09ec3393..def7f1fcb 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/DepositResponseJSONTest.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/DepositResponseJSONTest.java
@@ -1,6 +1,6 @@
package org.knowm.xchange.anx.v2.dto.account;
-import static org.fest.assertions.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.io.InputStream;
@@ -29,4 +29,4 @@ public void testUnmarshal() throws IOException {
// Verify that the example data was unmarshalled correctly
assertThat(anxBitcoinDepositAddress.getAddress()).isEqualTo("1GAUBau3nKQYJ1uvMWUfWCdEbMTJ1BXFjW");
}
-}
\ No newline at end of file
+}
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletHistoryJSONTest.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletHistoryJSONTest.java
index ab8b502c5..2a3fd298b 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletHistoryJSONTest.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletHistoryJSONTest.java
@@ -10,7 +10,7 @@
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
-//import static org.fest.assertions.api.Assertions.assertThat;
+//import static org.assertj.core.api.Assertions.assertThat;
/**
* Test ANXWalletHistory JSON parsing
@@ -65,4 +65,4 @@ public void testUnmarshal() throws IOException {
Assert.assertEquals("market", anxWalletHistoryWrapper.getANXWalletHistory().getANXWalletHistoryEntries()[0].getTrade().getProperties());
}
-}
\ No newline at end of file
+}
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletJSONTest.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletJSONTest.java
index 7a058b110..f7a7fd27e 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletJSONTest.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WalletJSONTest.java
@@ -1,6 +1,6 @@
package org.knowm.xchange.anx.v2.dto.account;
-import static org.fest.assertions.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
@@ -67,11 +67,11 @@ public void testCurrencies() throws Exception {
Exchange exchange = ExchangeFactory.INSTANCE.createExchange(ANXExchange.class.getName());
ANXMetaData anxMetaData = ((ANXExchange) exchange).getANXMetaData();
- Set metadataCurrencyStrings = new TreeSet();
+ Set metadataCurrencyStrings = new TreeSet<>();
for (Currency currency : anxMetaData.getCurrencies().keySet())
metadataCurrencyStrings.add(currency.toString());
- assertEquals(wallets.keySet(), metadataCurrencyStrings);
+ assertEquals(new TreeSet<>(wallets.keySet()), metadataCurrencyStrings);
}
}
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WithdrawalResponseJSONTest.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WithdrawalResponseJSONTest.java
index 3307a76e6..1a4c695df 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WithdrawalResponseJSONTest.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/account/WithdrawalResponseJSONTest.java
@@ -3,8 +3,6 @@
import java.io.IOException;
import java.io.InputStream;
-import org.junit.Ignore;
-
import com.fasterxml.jackson.databind.ObjectMapper;
/**
@@ -12,7 +10,6 @@
*/
public class WithdrawalResponseJSONTest {
- @Ignore
public void testUnmarshal() throws IOException {
// Read in the JSON from the example resources
@@ -27,4 +24,4 @@ public void testUnmarshal() throws IOException {
// Verify that the example data was unmarshalled correctly
// assertThat(anxWithdrawalResponse.getTransactionId()).isEqualTo("9921d2c5abecfd3604e921888b32e48256c914156cc76c4c8eca1ad2709b48e6");
}
-}
\ No newline at end of file
+}
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/marketdata/TradesJSONTest.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/marketdata/TradesJSONTest.java
index f91670b95..1afd38628 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/marketdata/TradesJSONTest.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/dto/marketdata/TradesJSONTest.java
@@ -1,6 +1,6 @@
package org.knowm.xchange.anx.v2.dto.marketdata;
-import static org.fest.assertions.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.io.InputStream;
diff --git a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/service/marketdata/TickerFetchIntegration.java b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/service/marketdata/TickerFetchIntegration.java
index 01c112119..ff31ff9de 100644
--- a/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/service/marketdata/TickerFetchIntegration.java
+++ b/xchange-anx/src/test/java/org/knowm/xchange/anx/v2/service/marketdata/TickerFetchIntegration.java
@@ -1,6 +1,6 @@
package org.knowm.xchange.anx.v2.service.marketdata;
-import static org.fest.assertions.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.knowm.xchange.Exchange;
diff --git a/xchange-anx/src/test/resources/errors.json b/xchange-anx/src/test/resources/errors.json
index 13cb07b6c..45ac7d137 100644
--- a/xchange-anx/src/test/resources/errors.json
+++ b/xchange-anx/src/test/resources/errors.json
@@ -1,5 +1,23 @@
-{"error": "Invalid username and/or password"}
-{"error": "API access disabled. Check your user settings."}
-{"error": {"__all__": ["You need $1.26 to open that order. You have only $0.0 available. Check your account balance for details."]}}
-{"error": "Order not found"}
-{"error": {"__all__": ["Minimum order size is $1"]}}
+{
+ "error": "Invalid username and/or password"
+}
+{
+ "error": "API access disabled. Check your user settings."
+}
+{
+ "error": {
+ "__all__": [
+ "You need $1.26 to open that order. You have only $0.0 available. Check your account balance for details."
+ ]
+ }
+}
+{
+ "error": "Order not found"
+}
+{
+ "error": {
+ "__all__": [
+ "Minimum order size is $1"
+ ]
+ }
+}
diff --git a/xchange-anx/src/test/resources/v2/account/example-accountinfo-data.json b/xchange-anx/src/test/resources/v2/account/example-accountinfo-data.json
index 92e5bdabf..093473323 100644
--- a/xchange-anx/src/test/resources/v2/account/example-accountinfo-data.json
+++ b/xchange-anx/src/test/resources/v2/account/example-accountinfo-data.json
@@ -1,640 +1,674 @@
{
- "Created": "2014-02-11 15:41:40",
- "Language": "en",
- "Last_Login": "2014-03-11 14:07:22",
- "Login": "test@anxpro.com",
- "Trade_Fee": "0.6000",
- "Rights": ["trade", "withdraw", "get_info"],
- "Wallets": {
- "GBP": {
- "Balance": {
- "currency": "GBP",
- "display": "100,000.00000 GBP",
- "display_short": "100,000.00 GBP",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "GBP",
- "display": "100,000.00000 GBP",
- "display_short": "100,000.00 GBP",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "GBP",
- "display": "10,000.00000 GBP",
- "display_short": "10,000.00 GBP",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "GBP",
- "display": "10,000.00000 GBP",
- "display_short": "10,000.00 GBP",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "EUR": {
- "Balance": {
- "currency": "EUR",
- "display": "100,000.00000 EUR",
- "display_short": "100,000.00 EUR",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "EUR",
- "display": "100,000.00000 EUR",
- "display_short": "100,000.00 EUR",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "EUR",
- "display": "10,000.00000 EUR",
- "display_short": "10,000.00 EUR",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "EUR",
- "display": "10,000.00000 EUR",
- "display_short": "10,000.00 EUR",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "NMC": {
- "Balance": {
- "currency": "NMC",
- "display": "100,000.00000000 NMC",
- "display_short": "100,000.00 NMC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "NMC",
- "display": "100,000.00000000 NMC",
- "display_short": "100,000.00 NMC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "NMC",
- "display": "10,000.00000000 NMC",
- "display_short": "10,000.00 NMC",
- "value": "10000.00000000",
- "value_int": "1000000000000"
- },
- "Max_Withdraw": {
- "currency": "NMC",
- "display": "10,000.00000000 NMC",
- "display_short": "10,000.00 NMC",
- "value": "10000.00000000",
- "value_int": "1000000000000"
- }
- },
- "JPY": {
- "Balance": {
- "currency": "JPY",
- "display": "100,000.00000 JPY",
- "display_short": "100,000.00 JPY",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "JPY",
- "display": "100,000.00000 JPY",
- "display_short": "100,000.00 JPY",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "JPY",
- "display": "100,000.00000 JPY",
- "display_short": "100,000.00 JPY",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Max_Withdraw": {
- "currency": "JPY",
- "display": "100,000.00000 JPY",
- "display_short": "100,000.00 JPY",
- "value": "100000.00000",
- "value_int": "10000000000"
- }
- },
- "SGD": {
- "Balance": {
- "currency": "SGD",
- "display": "100,000.00000 SGD",
- "display_short": "100,000.00 SGD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "SGD",
- "display": "100,000.00000 SGD",
- "display_short": "100,000.00 SGD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "SGD",
- "display": "10,000.00000 SGD",
- "display_short": "10,000.00 SGD",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "SGD",
- "display": "10,000.00000 SGD",
- "display_short": "10,000.00 SGD",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "CAD": {
- "Balance": {
- "currency": "CAD",
- "display": "100,000.00000 CAD",
- "display_short": "100,000.00 CAD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "CAD",
- "display": "100,000.00000 CAD",
- "display_short": "100,000.00 CAD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "CAD",
- "display": "10,000.00000 CAD",
- "display_short": "10,000.00 CAD",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "CAD",
- "display": "10,000.00000 CAD",
- "display_short": "10,000.00 CAD",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "DOGE": {
- "Balance": {
- "currency": "DOGE",
- "display": "9,999,781.09457936 DOGE",
- "display_short": "9,999,781.09 DOGE",
- "value": "9999781.09457936",
- "value_int": "999978109457936"
- },
- "Available_Balance": {
- "currency": "DOGE",
- "display": "9,914,833.52608521 DOGE",
- "display_short": "9,914,833.53 DOGE",
- "value": "9914833.52608521",
- "value_int": "991483352608521"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "DOGE",
- "display": "10,000,000.00000000 DOGE",
- "display_short": "10,000,000.00 DOGE",
- "value": "10000000.00000000",
- "value_int": "1000000000000000"
- },
- "Max_Withdraw": {
- "currency": "DOGE",
- "display": "10,000,000.00000000 DOGE",
- "display_short": "10,000,000.00 DOGE",
- "value": "10000000.00000000",
- "value_int": "1000000000000000"
- }
- },
- "NZD": {
- "Balance": {
- "currency": "NZD",
- "display": "100,000.00000 NZD",
- "display_short": "100,000.00 NZD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "NZD",
- "display": "100,000.00000 NZD",
- "display_short": "100,000.00 NZD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "NZD",
- "display": "10,000.00000 NZD",
- "display_short": "10,000.00 NZD",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "NZD",
- "display": "10,000.00000 NZD",
- "display_short": "10,000.00 NZD",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "LTC": {
- "Balance": {
- "currency": "LTC",
- "display": "100,000.00000000 LTC",
- "display_short": "100,000.00 LTC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "LTC",
- "display": "100,000.00000000 LTC",
- "display_short": "100,000.00 LTC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "LTC",
- "display": "500.00000000 LTC",
- "display_short": "500.00 LTC",
- "value": "500.00000000",
- "value_int": "50000000000"
- },
- "Max_Withdraw": {
- "currency": "LTC",
- "display": "500.00000000 LTC",
- "display_short": "500.00 LTC",
- "value": "500.00000000",
- "value_int": "50000000000"
- }
- },
- "PPC": {
- "Balance": {
- "currency": "PPC",
- "display": "100,000.00000000 PPC",
- "display_short": "100,000.00 PPC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "PPC",
- "display": "100,000.00000000 PPC",
- "display_short": "100,000.00 PPC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "PPC",
- "display": "10,000.00000000 PPC",
- "display_short": "10,000.00 PPC",
- "value": "10000.00000000",
- "value_int": "1000000000000"
- },
- "Max_Withdraw": {
- "currency": "PPC",
- "display": "10,000.00000000 PPC",
- "display_short": "10,000.00 PPC",
- "value": "10000.00000000",
- "value_int": "1000000000000"
- }
- },
- "USD": {
- "Balance": {
- "currency": "USD",
- "display": "100,000.00000 USD",
- "display_short": "100,000.00 USD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "USD",
- "display": "100,000.00000 USD",
- "display_short": "100,000.00 USD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "USD",
- "display": "1,000.00000 USD",
- "display_short": "1,000.00 USD",
- "value": "1000.00000",
- "value_int": "100000000"
- },
- "Max_Withdraw": {
- "currency": "USD",
- "display": "1,000.00000 USD",
- "display_short": "1,000.00 USD",
- "value": "1000.00000",
- "value_int": "100000000"
- }
- },
- "CNY": {
- "Balance": {
- "currency": "CNY",
- "display": "100,000.00000 CNY",
- "display_short": "100,000.00 CNY",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "CNY",
- "display": "100,000.00000 CNY",
- "display_short": "100,000.00 CNY",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "CNY",
- "display": "10,000.00000 CNY",
- "display_short": "10,000.00 CNY",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "CNY",
- "display": "10,000.00000 CNY",
- "display_short": "10,000.00 CNY",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "HKD": {
- "Balance": {
- "currency": "HKD",
- "display": "99,863.07000 HKD",
- "display_short": "99,863.07 HKD",
- "value": "99863.07000",
- "value_int": "9986307000"
- },
- "Available_Balance": {
- "currency": "HKD",
- "display": "62,839.56868 HKD",
- "display_short": "62,839.57 HKD",
- "value": "62839.56868",
- "value_int": "6283956868"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "HKD",
- "display": "7,950.00000 HKD",
- "display_short": "7,950.00 HKD",
- "value": "7950.00000",
- "value_int": "795000000"
- },
- "Max_Withdraw": {
- "currency": "HKD",
- "display": "7,950.00000 HKD",
- "display_short": "7,950.00 HKD",
- "value": "7950.00000",
- "value_int": "795000000"
- }
- },
- "CHF": {
- "Balance": {
- "currency": "CHF",
- "display": "100,000.00000 CHF",
- "display_short": "100,000.00 CHF",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "CHF",
- "display": "100,000.00000 CHF",
- "display_short": "100,000.00 CHF",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "CHF",
- "display": "10,000.00000 CHF",
- "display_short": "10,000.00 CHF",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "CHF",
- "display": "10,000.00000 CHF",
- "display_short": "10,000.00 CHF",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "AUD": {
- "Balance": {
- "currency": "AUD",
- "display": "100,000.00000 AUD",
- "display_short": "100,000.00 AUD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Available_Balance": {
- "currency": "AUD",
- "display": "100,000.00000 AUD",
- "display_short": "100,000.00 AUD",
- "value": "100000.00000",
- "value_int": "10000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "AUD",
- "display": "10,000.00000 AUD",
- "display_short": "10,000.00 AUD",
- "value": "10000.00000",
- "value_int": "1000000000"
- },
- "Max_Withdraw": {
- "currency": "AUD",
- "display": "10,000.00000 AUD",
- "display_short": "10,000.00 AUD",
- "value": "10000.00000",
- "value_int": "1000000000"
- }
- },
- "BTC": {
- "Balance": {
- "currency": "BTC",
- "display": "100,000.01988000 BTC",
- "display_short": "100,000.02 BTC",
- "value": "100000.01988000",
- "value_int": "10000001988000"
- },
- "Available_Balance": {
- "currency": "BTC",
- "display": "100,000.01988000 BTC",
- "display_short": "100,000.02 BTC",
- "value": "100000.01988000",
- "value_int": "10000001988000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "BTC",
- "display": "20.00000000 BTC",
- "display_short": "20.00 BTC",
- "value": "20.00000000",
- "value_int": "2000000000"
- },
- "Max_Withdraw": {
- "currency": "BTC",
- "display": "20.00000000 BTC",
- "display_short": "20.00 BTC",
- "value": "20.00000000",
- "value_int": "2000000000"
- }
- },
- "BGC": {
- "Balance": {
- "currency": "BGC",
- "display": "100,000.00000000 BGC",
- "display_short": "100,000.00 BGC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "BGC",
- "display": "100,000.00000000 BGC",
- "display_short": "100,000.00 BGC",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "BGC",
- "display": "0.00000000 BGC",
- "display_short": "0.00 BGC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Max_Withdraw": {
- "currency": "BGC",
- "display": "0.00000000 BGC",
- "display_short": "0.00 BGC",
- "value": "0.00000000",
- "value_int": "0"
- }
- },
- "XRP": {
- "Balance": {
- "currency": "XRP",
- "display": "100,000.00000000 XRP",
- "display_short": "100,000.00 XRP",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "XRP",
- "display": "100,000.00000000 XRP",
- "display_short": "100,000.00 XRP",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "XRP",
- "display": "500,000.00000000 XRP",
- "display_short": "500,000.00 XRP",
- "value": "500000.00000000",
- "value_int": "50000000000000"
- },
- "Max_Withdraw": {
- "currency": "XRP",
- "display": "500,000.00000000 XRP",
- "display_short": "500,000.00 XRP",
- "value": "500000.00000000",
- "value_int": "50000000000000"
- }
- },
- "START": {
- "Balance": {
- "currency": "START",
- "display": "100,000.00000000 START",
- "display_short": "100,000.00 START",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "START",
- "display": "100,000.00000000 START",
- "display_short": "100,000.00 START",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "START",
- "display": "50,000.00000000 START",
- "display_short": "50,000.00 START",
- "value": "50000.00000000",
- "value_int": "5000000000000"
- },
- "Max_Withdraw": {
- "currency": "START",
- "display": "50,000.00000000 START",
- "display_short": "50,000.00 START",
- "value": "50000.00000000",
- "value_int": "5000000000000"
- }
- },
- "EGD": {
- "Balance": {
- "currency": "EGD",
- "display": "100,000.00000000 EGD",
- "display_short": "100,000.00 EGD",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "EGD",
- "display": "100,000.00000000 EGD",
- "display_short": "100,000.00 EGD",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "EGD",
- "display": "80.00000000 EGD",
- "display_short": "80.00 EGD",
- "value": "80.00000000",
- "value_int": "8000000000"
- },
- "Max_Withdraw": {
- "currency": "EGD",
- "display": "80.00000000 EGD",
- "display_short": "80.00 EGD",
- "value": "80.00000000",
- "value_int": "8000000000"
- }
- },
- "STR": {
- "Balance": {
- "currency": "STR",
- "display": "100,000.00000000 STR",
- "display_short": "100,000.00 STR",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Available_Balance": {
- "currency": "STR",
- "display": "100,000.00000000 STR",
- "display_short": "100,000.00 STR",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Daily_Withdrawal_Limit": {
- "currency": "STR",
- "display": "400,000.00000000 STR",
- "display_short": "400,000.00 STR",
- "value": "400000.00000000",
- "value_int": "40000000000000"
- },
- "Max_Withdraw": {
- "currency": "STR",
- "display": "400,000.00000000 STR",
- "display_short": "400,000.00 STR",
- "value": "400000.00000000",
- "value_int": "40000000000000"
- }
- }
+ "Created": "2014-02-11 15:41:40",
+ "Language": "en",
+ "Last_Login": "2014-03-11 14:07:22",
+ "Login": "test@anxpro.com",
+ "Trade_Fee": "0.6000",
+ "Rights": [
+ "trade",
+ "withdraw",
+ "get_info"
+ ],
+ "Wallets": {
+ "GBP": {
+ "Balance": {
+ "currency": "GBP",
+ "display": "100,000.00000 GBP",
+ "display_short": "100,000.00 GBP",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "GBP",
+ "display": "100,000.00000 GBP",
+ "display_short": "100,000.00 GBP",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "GBP",
+ "display": "10,000.00000 GBP",
+ "display_short": "10,000.00 GBP",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "GBP",
+ "display": "10,000.00000 GBP",
+ "display_short": "10,000.00 GBP",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "EUR": {
+ "Balance": {
+ "currency": "EUR",
+ "display": "100,000.00000 EUR",
+ "display_short": "100,000.00 EUR",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "EUR",
+ "display": "100,000.00000 EUR",
+ "display_short": "100,000.00 EUR",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "EUR",
+ "display": "10,000.00000 EUR",
+ "display_short": "10,000.00 EUR",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "EUR",
+ "display": "10,000.00000 EUR",
+ "display_short": "10,000.00 EUR",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "NMC": {
+ "Balance": {
+ "currency": "NMC",
+ "display": "100,000.00000000 NMC",
+ "display_short": "100,000.00 NMC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "NMC",
+ "display": "100,000.00000000 NMC",
+ "display_short": "100,000.00 NMC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "NMC",
+ "display": "10,000.00000000 NMC",
+ "display_short": "10,000.00 NMC",
+ "value": "10000.00000000",
+ "value_int": "1000000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "NMC",
+ "display": "10,000.00000000 NMC",
+ "display_short": "10,000.00 NMC",
+ "value": "10000.00000000",
+ "value_int": "1000000000000"
+ }
+ },
+ "JPY": {
+ "Balance": {
+ "currency": "JPY",
+ "display": "100,000.00000 JPY",
+ "display_short": "100,000.00 JPY",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "JPY",
+ "display": "100,000.00000 JPY",
+ "display_short": "100,000.00 JPY",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "JPY",
+ "display": "100,000.00000 JPY",
+ "display_short": "100,000.00 JPY",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "JPY",
+ "display": "100,000.00000 JPY",
+ "display_short": "100,000.00 JPY",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ }
+ },
+ "SGD": {
+ "Balance": {
+ "currency": "SGD",
+ "display": "100,000.00000 SGD",
+ "display_short": "100,000.00 SGD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "SGD",
+ "display": "100,000.00000 SGD",
+ "display_short": "100,000.00 SGD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "SGD",
+ "display": "10,000.00000 SGD",
+ "display_short": "10,000.00 SGD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "SGD",
+ "display": "10,000.00000 SGD",
+ "display_short": "10,000.00 SGD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "CAD": {
+ "Balance": {
+ "currency": "CAD",
+ "display": "100,000.00000 CAD",
+ "display_short": "100,000.00 CAD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "CAD",
+ "display": "100,000.00000 CAD",
+ "display_short": "100,000.00 CAD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "CAD",
+ "display": "10,000.00000 CAD",
+ "display_short": "10,000.00 CAD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "CAD",
+ "display": "10,000.00000 CAD",
+ "display_short": "10,000.00 CAD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "ETH": {
+ "Balance": {
+ "display_short": "4.24 ETH",
+ "value_int": "424413380",
+ "currency": "ETH",
+ "display": "4.24413380 ETH",
+ "value": "4.24413380"
+ },
+ "Available_Balance": {
+ "display_short": "4.24 ETH",
+ "value_int": "424413380",
+ "currency": "ETH",
+ "display": "4.24413380 ETH",
+ "value": "4.24413380"
+ },
+ "Daily_Withdrawal_Limit": {
+ "display_short": "1,500.00 ETH",
+ "value_int": "150000000000",
+ "currency": "ETH",
+ "display": "1,500.00000000 ETH",
+ "value": "1500.00000000"
+ },
+ "Max_Withdraw": {
+ "display_short": "1,500.00 ETH",
+ "value_int": "150000000000",
+ "currency": "ETH",
+ "display": "1,500.00000000 ETH",
+ "value": "1500.00000000"
+ }
+ },
+ "DOGE": {
+ "Balance": {
+ "currency": "DOGE",
+ "display": "9,999,781.09457936 DOGE",
+ "display_short": "9,999,781.09 DOGE",
+ "value": "9999781.09457936",
+ "value_int": "999978109457936"
+ },
+ "Available_Balance": {
+ "currency": "DOGE",
+ "display": "9,914,833.52608521 DOGE",
+ "display_short": "9,914,833.53 DOGE",
+ "value": "9914833.52608521",
+ "value_int": "991483352608521"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "DOGE",
+ "display": "10,000,000.00000000 DOGE",
+ "display_short": "10,000,000.00 DOGE",
+ "value": "10000000.00000000",
+ "value_int": "1000000000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "DOGE",
+ "display": "10,000,000.00000000 DOGE",
+ "display_short": "10,000,000.00 DOGE",
+ "value": "10000000.00000000",
+ "value_int": "1000000000000000"
+ }
+ },
+ "NZD": {
+ "Balance": {
+ "currency": "NZD",
+ "display": "100,000.00000 NZD",
+ "display_short": "100,000.00 NZD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "NZD",
+ "display": "100,000.00000 NZD",
+ "display_short": "100,000.00 NZD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "NZD",
+ "display": "10,000.00000 NZD",
+ "display_short": "10,000.00 NZD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "NZD",
+ "display": "10,000.00000 NZD",
+ "display_short": "10,000.00 NZD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "LTC": {
+ "Balance": {
+ "currency": "LTC",
+ "display": "100,000.00000000 LTC",
+ "display_short": "100,000.00 LTC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "LTC",
+ "display": "100,000.00000000 LTC",
+ "display_short": "100,000.00 LTC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "LTC",
+ "display": "500.00000000 LTC",
+ "display_short": "500.00 LTC",
+ "value": "500.00000000",
+ "value_int": "50000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "LTC",
+ "display": "500.00000000 LTC",
+ "display_short": "500.00 LTC",
+ "value": "500.00000000",
+ "value_int": "50000000000"
+ }
+ },
+ "PPC": {
+ "Balance": {
+ "currency": "PPC",
+ "display": "100,000.00000000 PPC",
+ "display_short": "100,000.00 PPC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "PPC",
+ "display": "100,000.00000000 PPC",
+ "display_short": "100,000.00 PPC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "PPC",
+ "display": "10,000.00000000 PPC",
+ "display_short": "10,000.00 PPC",
+ "value": "10000.00000000",
+ "value_int": "1000000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "PPC",
+ "display": "10,000.00000000 PPC",
+ "display_short": "10,000.00 PPC",
+ "value": "10000.00000000",
+ "value_int": "1000000000000"
+ }
+ },
+ "USD": {
+ "Balance": {
+ "currency": "USD",
+ "display": "100,000.00000 USD",
+ "display_short": "100,000.00 USD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "USD",
+ "display": "100,000.00000 USD",
+ "display_short": "100,000.00 USD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "USD",
+ "display": "1,000.00000 USD",
+ "display_short": "1,000.00 USD",
+ "value": "1000.00000",
+ "value_int": "100000000"
+ },
+ "Max_Withdraw": {
+ "currency": "USD",
+ "display": "1,000.00000 USD",
+ "display_short": "1,000.00 USD",
+ "value": "1000.00000",
+ "value_int": "100000000"
+ }
+ },
+ "CNY": {
+ "Balance": {
+ "currency": "CNY",
+ "display": "100,000.00000 CNY",
+ "display_short": "100,000.00 CNY",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "CNY",
+ "display": "100,000.00000 CNY",
+ "display_short": "100,000.00 CNY",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "CNY",
+ "display": "10,000.00000 CNY",
+ "display_short": "10,000.00 CNY",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "CNY",
+ "display": "10,000.00000 CNY",
+ "display_short": "10,000.00 CNY",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "HKD": {
+ "Balance": {
+ "currency": "HKD",
+ "display": "99,863.07000 HKD",
+ "display_short": "99,863.07 HKD",
+ "value": "99863.07000",
+ "value_int": "9986307000"
+ },
+ "Available_Balance": {
+ "currency": "HKD",
+ "display": "62,839.56868 HKD",
+ "display_short": "62,839.57 HKD",
+ "value": "62839.56868",
+ "value_int": "6283956868"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "HKD",
+ "display": "7,950.00000 HKD",
+ "display_short": "7,950.00 HKD",
+ "value": "7950.00000",
+ "value_int": "795000000"
+ },
+ "Max_Withdraw": {
+ "currency": "HKD",
+ "display": "7,950.00000 HKD",
+ "display_short": "7,950.00 HKD",
+ "value": "7950.00000",
+ "value_int": "795000000"
+ }
+ },
+ "CHF": {
+ "Balance": {
+ "currency": "CHF",
+ "display": "100,000.00000 CHF",
+ "display_short": "100,000.00 CHF",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "CHF",
+ "display": "100,000.00000 CHF",
+ "display_short": "100,000.00 CHF",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "CHF",
+ "display": "10,000.00000 CHF",
+ "display_short": "10,000.00 CHF",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "CHF",
+ "display": "10,000.00000 CHF",
+ "display_short": "10,000.00 CHF",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "AUD": {
+ "Balance": {
+ "currency": "AUD",
+ "display": "100,000.00000 AUD",
+ "display_short": "100,000.00 AUD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Available_Balance": {
+ "currency": "AUD",
+ "display": "100,000.00000 AUD",
+ "display_short": "100,000.00 AUD",
+ "value": "100000.00000",
+ "value_int": "10000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "AUD",
+ "display": "10,000.00000 AUD",
+ "display_short": "10,000.00 AUD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "AUD",
+ "display": "10,000.00000 AUD",
+ "display_short": "10,000.00 AUD",
+ "value": "10000.00000",
+ "value_int": "1000000000"
+ }
+ },
+ "BTC": {
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,000.01988000 BTC",
+ "display_short": "100,000.02 BTC",
+ "value": "100000.01988000",
+ "value_int": "10000001988000"
+ },
+ "Available_Balance": {
+ "currency": "BTC",
+ "display": "100,000.01988000 BTC",
+ "display_short": "100,000.02 BTC",
+ "value": "100000.01988000",
+ "value_int": "10000001988000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "BTC",
+ "display": "20.00000000 BTC",
+ "display_short": "20.00 BTC",
+ "value": "20.00000000",
+ "value_int": "2000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "BTC",
+ "display": "20.00000000 BTC",
+ "display_short": "20.00 BTC",
+ "value": "20.00000000",
+ "value_int": "2000000000"
+ }
+ },
+ "BGC": {
+ "Balance": {
+ "currency": "BGC",
+ "display": "100,000.00000000 BGC",
+ "display_short": "100,000.00 BGC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "BGC",
+ "display": "100,000.00000000 BGC",
+ "display_short": "100,000.00 BGC",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "BGC",
+ "display": "0.00000000 BGC",
+ "display_short": "0.00 BGC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Max_Withdraw": {
+ "currency": "BGC",
+ "display": "0.00000000 BGC",
+ "display_short": "0.00 BGC",
+ "value": "0.00000000",
+ "value_int": "0"
+ }
+ },
+ "XRP": {
+ "Balance": {
+ "currency": "XRP",
+ "display": "100,000.00000000 XRP",
+ "display_short": "100,000.00 XRP",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "XRP",
+ "display": "100,000.00000000 XRP",
+ "display_short": "100,000.00 XRP",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "XRP",
+ "display": "500,000.00000000 XRP",
+ "display_short": "500,000.00 XRP",
+ "value": "500000.00000000",
+ "value_int": "50000000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "XRP",
+ "display": "500,000.00000000 XRP",
+ "display_short": "500,000.00 XRP",
+ "value": "500000.00000000",
+ "value_int": "50000000000000"
+ }
+ },
+ "START": {
+ "Balance": {
+ "currency": "START",
+ "display": "100,000.00000000 START",
+ "display_short": "100,000.00 START",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "START",
+ "display": "100,000.00000000 START",
+ "display_short": "100,000.00 START",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "START",
+ "display": "50,000.00000000 START",
+ "display_short": "50,000.00 START",
+ "value": "50000.00000000",
+ "value_int": "5000000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "START",
+ "display": "50,000.00000000 START",
+ "display_short": "50,000.00 START",
+ "value": "50000.00000000",
+ "value_int": "5000000000000"
+ }
+ },
+ "EGD": {
+ "Balance": {
+ "currency": "EGD",
+ "display": "100,000.00000000 EGD",
+ "display_short": "100,000.00 EGD",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "EGD",
+ "display": "100,000.00000000 EGD",
+ "display_short": "100,000.00 EGD",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "EGD",
+ "display": "80.00000000 EGD",
+ "display_short": "80.00 EGD",
+ "value": "80.00000000",
+ "value_int": "8000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "EGD",
+ "display": "80.00000000 EGD",
+ "display_short": "80.00 EGD",
+ "value": "80.00000000",
+ "value_int": "8000000000"
+ }
+ },
+ "STR": {
+ "Balance": {
+ "currency": "STR",
+ "display": "100,000.00000000 STR",
+ "display_short": "100,000.00 STR",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Available_Balance": {
+ "currency": "STR",
+ "display": "100,000.00000000 STR",
+ "display_short": "100,000.00 STR",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Daily_Withdrawal_Limit": {
+ "currency": "STR",
+ "display": "400,000.00000000 STR",
+ "display_short": "400,000.00 STR",
+ "value": "400000.00000000",
+ "value_int": "40000000000000"
+ },
+ "Max_Withdraw": {
+ "currency": "STR",
+ "display": "400,000.00000000 STR",
+ "display_short": "400,000.00 STR",
+ "value": "400000.00000000",
+ "value_int": "40000000000000"
+ }
}
+ }
}
diff --git a/xchange-anx/src/test/resources/v2/account/example-deposit-response.json b/xchange-anx/src/test/resources/v2/account/example-deposit-response.json
index a78479db5..99c565946 100644
--- a/xchange-anx/src/test/resources/v2/account/example-deposit-response.json
+++ b/xchange-anx/src/test/resources/v2/account/example-deposit-response.json
@@ -1,3 +1,3 @@
{
- "addr": "1GAUBau3nKQYJ1uvMWUfWCdEbMTJ1BXFjW"
+ "addr": "1GAUBau3nKQYJ1uvMWUfWCdEbMTJ1BXFjW"
}
\ No newline at end of file
diff --git a/xchange-anx/src/test/resources/v2/account/example-wallethistory-response.json b/xchange-anx/src/test/resources/v2/account/example-wallethistory-response.json
index 72f60ed9e..516d4f5a2 100644
--- a/xchange-anx/src/test/resources/v2/account/example-wallethistory-response.json
+++ b/xchange-anx/src/test/resources/v2/account/example-wallethistory-response.json
@@ -1,1368 +1,1419 @@
{
- "result": "success",
- "data": {
- "records": "104",
- "result": [{
- "Index": "104",
- "Date": 1394594770000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,168.75400000 BTC",
- "display_short": "103,168.75 BTC",
- "value": "103168.75400000",
- "value_int": "10316875400000"
- },
- "Info": "BTC bought: [tid:264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51] 10.00000000 BTC at 280.65500 HKD",
- "Trade": {
- "oid": "cc496636-4849-4acf-a390-e4091a5009c3",
- "tid": "264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51",
- "Amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "103",
- "Date": 1394594770000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,168.75400000 BTC",
- "display_short": "103,168.75 BTC",
- "value": "103168.75400000",
- "value_int": "10316875400000"
- },
- "Info": "BTC bought: [tid:264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51] 10.00000000 BTC at 280.65500 HKD",
- "Trade": {
- "oid": "cc496636-4849-4acf-a390-e4091a5009c3",
- "tid": "264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51",
- "Amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "102",
- "Date": 1394591732000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.75400000 BTC",
- "display_short": "103,158.75 BTC",
- "value": "103158.75400000",
- "value_int": "10315875400000"
- },
- "Info": "BTC bought: [tid:0da16e7e-661e-43ad-9596-b96b846966e9] 0.01000000 BTC at 801.00000 HKD",
- "Trade": {
- "oid": "5b66392f-5d43-4391-92fb-d5ba56ba8deb",
- "tid": "0da16e7e-661e-43ad-9596-b96b846966e9",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "101",
- "Date": 1394591732000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.75400000 BTC",
- "display_short": "103,158.75 BTC",
- "value": "103158.75400000",
- "value_int": "10315875400000"
- },
- "Info": "BTC bought: [tid:0da16e7e-661e-43ad-9596-b96b846966e9] 0.01000000 BTC at 801.00000 HKD",
- "Trade": {
- "oid": "5b66392f-5d43-4391-92fb-d5ba56ba8deb",
- "tid": "0da16e7e-661e-43ad-9596-b96b846966e9",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "100",
- "Date": 1394590522000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.74400000 BTC",
- "display_short": "103,158.74 BTC",
- "value": "103158.74400000",
- "value_int": "10315874400000"
- },
- "Info": "BTC bought: [tid:03eefdf9-dd2b-4fcf-bdca-a60a53e519fd] 0.01000000 BTC at 801.00000 HKD",
- "Trade": {
- "oid": "b19ac3e2-0822-4745-a5c6-c9620995b2ba",
- "tid": "03eefdf9-dd2b-4fcf-bdca-a60a53e519fd",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "99",
- "Date": 1394590522000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.74400000 BTC",
- "display_short": "103,158.74 BTC",
- "value": "103158.74400000",
- "value_int": "10315874400000"
- },
- "Info": "BTC bought: [tid:03eefdf9-dd2b-4fcf-bdca-a60a53e519fd] 0.01000000 BTC at 801.00000 HKD",
- "Trade": {
- "oid": "b19ac3e2-0822-4745-a5c6-c9620995b2ba",
- "tid": "03eefdf9-dd2b-4fcf-bdca-a60a53e519fd",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "98",
- "Date": 1394590219000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.73400000 BTC",
- "display_short": "103,158.73 BTC",
- "value": "103158.73400000",
- "value_int": "10315873400000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "97",
- "Date": 1394590219000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.73410000 BTC",
- "display_short": "103,158.73 BTC",
- "value": "103158.73410000",
- "value_int": "10315873410000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "96",
- "Date": 1394589675000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.73500000 BTC",
- "display_short": "103,158.74 BTC",
- "value": "103158.73500000",
- "value_int": "10315873500000"
- },
- "Info": "BTC bought: [tid:1b0ba8e9-3a28-420c-94a5-86959e3a63f6] 0.01000000 BTC at 5050.00000 HKD",
- "Trade": {
- "oid": "3cac06ea-d475-40f0-b680-ace2f3573542",
- "tid": "1b0ba8e9-3a28-420c-94a5-86959e3a63f6",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "95",
- "Date": 1394589675000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.73500000 BTC",
- "display_short": "103,158.74 BTC",
- "value": "103158.73500000",
- "value_int": "10315873500000"
- },
- "Info": "BTC bought: [tid:1b0ba8e9-3a28-420c-94a5-86959e3a63f6] 0.01000000 BTC at 5050.00000 HKD",
- "Trade": {
- "oid": "3cac06ea-d475-40f0-b680-ace2f3573542",
- "tid": "1b0ba8e9-3a28-420c-94a5-86959e3a63f6",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "94",
- "Date": 1394533355000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.72500000 BTC",
- "display_short": "103,158.72 BTC",
- "value": "103158.72500000",
- "value_int": "10315872500000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "93",
- "Date": 1394533355000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.72510000 BTC",
- "display_short": "103,158.73 BTC",
- "value": "103158.72510000",
- "value_int": "10315872510000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "92",
- "Date": 1394533351000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.72600000 BTC",
- "display_short": "103,158.73 BTC",
- "value": "103158.72600000",
- "value_int": "10315872600000"
- },
- "Info": "BTC bought: [tid:b55ad445-6669-4459-9026-7b1130709188] 0.01000000 BTC at 4910.00000 HKD",
- "Trade": {
- "oid": "7b98e3f5-0daf-43de-9c91-f04f8141177a",
- "tid": "b55ad445-6669-4459-9026-7b1130709188",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "91",
- "Date": 1394533351000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.72600000 BTC",
- "display_short": "103,158.73 BTC",
- "value": "103158.72600000",
- "value_int": "10315872600000"
- },
- "Info": "BTC bought: [tid:b55ad445-6669-4459-9026-7b1130709188] 0.01000000 BTC at 4910.00000 HKD",
- "Trade": {
- "oid": "7b98e3f5-0daf-43de-9c91-f04f8141177a",
- "tid": "b55ad445-6669-4459-9026-7b1130709188",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "90",
- "Date": 1394533291000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.71600000 BTC",
- "display_short": "103,158.72 BTC",
- "value": "103158.71600000",
- "value_int": "10315871600000"
- },
- "Info": "BTC bought: [tid:c1118561-b894-4782-ad53-132b34884ee0] 0.01000000 BTC at 4910.00000 HKD",
- "Trade": {
- "oid": "76120392-1746-4f61-a62b-af7c6550eff3",
- "tid": "c1118561-b894-4782-ad53-132b34884ee0",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "89",
- "Date": 1394533291000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.71600000 BTC",
- "display_short": "103,158.72 BTC",
- "value": "103158.71600000",
- "value_int": "10315871600000"
- },
- "Info": "BTC bought: [tid:c1118561-b894-4782-ad53-132b34884ee0] 0.01000000 BTC at 4910.00000 HKD",
- "Trade": {
- "oid": "76120392-1746-4f61-a62b-af7c6550eff3",
- "tid": "c1118561-b894-4782-ad53-132b34884ee0",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "88",
- "Date": 1394532835000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.70600000 BTC",
- "display_short": "103,158.71 BTC",
- "value": "103158.70600000",
- "value_int": "10315870600000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "87",
- "Date": 1394532835000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.70610000 BTC",
- "display_short": "103,158.71 BTC",
- "value": "103158.70610000",
- "value_int": "10315870610000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "86",
- "Date": 1394531038000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.70700000 BTC",
- "display_short": "103,158.71 BTC",
- "value": "103158.70700000",
- "value_int": "10315870700000"
- },
- "Info": "DOGE sold: [tid:8e6c97ce-ec9a-4232-9599-36de109e1905] 100000.00000000 DOGE at 0.00002000 BTC",
- "Trade": {
- "oid": "41d928d1-6daf-444d-88ca-92b5cf05f21e",
- "tid": "8e6c97ce-ec9a-4232-9599-36de109e1905",
- "Amount": {
- "currency": "DOGE",
- "display": "100,000.00000000 DOGE",
- "display_short": "100,000.00 DOGE",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "85",
- "Date": 1394531038000,
- "Type": "earned",
- "Value": {
- "currency": "BTC",
- "display": "2.00000000 BTC",
- "display_short": "2.00 BTC",
- "value": "2.00000000",
- "value_int": "200000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,158.70700000 BTC",
- "display_short": "103,158.71 BTC",
- "value": "103158.70700000",
- "value_int": "10315870700000"
- },
- "Info": "DOGE sold: [tid:8e6c97ce-ec9a-4232-9599-36de109e1905] 100000.00000000 DOGE at 0.00002000 BTC",
- "Trade": {
- "oid": "41d928d1-6daf-444d-88ca-92b5cf05f21e",
- "tid": "8e6c97ce-ec9a-4232-9599-36de109e1905",
- "Amount": {
- "currency": "DOGE",
- "display": "100,000.00000000 DOGE",
- "display_short": "100,000.00 DOGE",
- "value": "100000.00000000",
- "value_int": "10000000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "84",
- "Date": 1394526957000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.70700000 BTC",
- "display_short": "103,156.71 BTC",
- "value": "103156.70700000",
- "value_int": "10315670700000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "83",
- "Date": 1394526957000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.70710000 BTC",
- "display_short": "103,156.71 BTC",
- "value": "103156.70710000",
- "value_int": "10315670710000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "82",
- "Date": 1394524823000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.70800000 BTC",
- "display_short": "103,156.71 BTC",
- "value": "103156.70800000",
- "value_int": "10315670800000"
- },
- "Info": "BTC bought: [tid:6a5d4d1a-7f31-43d2-80bb-a626f793707f] 0.01000000 BTC at 222222.00000 HKD",
- "Trade": {
- "oid": "8bfbeb5a-815c-4362-a0ee-b33b34368518",
- "tid": "6a5d4d1a-7f31-43d2-80bb-a626f793707f",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "81",
- "Date": 1394524823000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.70800000 BTC",
- "display_short": "103,156.71 BTC",
- "value": "103156.70800000",
- "value_int": "10315670800000"
- },
- "Info": "BTC bought: [tid:6a5d4d1a-7f31-43d2-80bb-a626f793707f] 0.01000000 BTC at 222222.00000 HKD",
- "Trade": {
- "oid": "8bfbeb5a-815c-4362-a0ee-b33b34368518",
- "tid": "6a5d4d1a-7f31-43d2-80bb-a626f793707f",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "80",
- "Date": 1394507388000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69800000 BTC",
- "display_short": "103,156.70 BTC",
- "value": "103156.69800000",
- "value_int": "10315669800000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "79",
- "Date": 1394507388000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69810000 BTC",
- "display_short": "103,156.70 BTC",
- "value": "103156.69810000",
- "value_int": "10315669810000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "78",
- "Date": 1394507379000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69900000 BTC",
- "display_short": "103,156.70 BTC",
- "value": "103156.69900000",
- "value_int": "10315669900000"
- },
- "Info": "BTC bought: [tid:09d142c4-c567-44cc-ba40-7ee762330a1c] 0.01000000 BTC at 222222.00000 HKD",
- "Trade": {
- "oid": "94474f3a-d9b6-4b77-9f10-59f7b250012d",
- "tid": "09d142c4-c567-44cc-ba40-7ee762330a1c",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "77",
- "Date": 1394507379000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69900000 BTC",
- "display_short": "103,156.70 BTC",
- "value": "103156.69900000",
- "value_int": "10315669900000"
- },
- "Info": "BTC bought: [tid:09d142c4-c567-44cc-ba40-7ee762330a1c] 0.01000000 BTC at 222222.00000 HKD",
- "Trade": {
- "oid": "94474f3a-d9b6-4b77-9f10-59f7b250012d",
- "tid": "09d142c4-c567-44cc-ba40-7ee762330a1c",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "76",
- "Date": 1394507372000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.68900000 BTC",
- "display_short": "103,156.69 BTC",
- "value": "103156.68900000",
- "value_int": "10315668900000"
- },
- "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
- }, {
- "Index": "75",
- "Date": 1394507372000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.68910000 BTC",
- "display_short": "103,156.69 BTC",
- "value": "103156.68910000",
- "value_int": "10315668910000"
- },
- "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
- }, {
- "Index": "74",
- "Date": 1394502457000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69000000 BTC",
- "display_short": "103,156.69 BTC",
- "value": "103156.69000000",
- "value_int": "10315669000000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "73",
- "Date": 1394502457000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69010000 BTC",
- "display_short": "103,156.69 BTC",
- "value": "103156.69010000",
- "value_int": "10315669010000"
- },
- "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
- }, {
- "Index": "72",
- "Date": 1394502450000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69100000 BTC",
- "display_short": "103,156.69 BTC",
- "value": "103156.69100000",
- "value_int": "10315669100000"
- },
- "Info": "BTC bought: [tid:67b01301-5de0-4b1b-ac81-d4b86cffe7f4] 0.01000000 BTC at 222222.00000 HKD",
- "Trade": {
- "oid": "0472cfdd-8c21-4d05-bdd8-0be4a325a3a7",
- "tid": "67b01301-5de0-4b1b-ac81-d4b86cffe7f4",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "71",
- "Date": 1394502450000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.69100000 BTC",
- "display_short": "103,156.69 BTC",
- "value": "103156.69100000",
- "value_int": "10315669100000"
- },
- "Info": "BTC bought: [tid:67b01301-5de0-4b1b-ac81-d4b86cffe7f4] 0.01000000 BTC at 222222.00000 HKD",
- "Trade": {
- "oid": "0472cfdd-8c21-4d05-bdd8-0be4a325a3a7",
- "tid": "67b01301-5de0-4b1b-ac81-d4b86cffe7f4",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "70",
- "Date": 1394502446000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00010000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00010000",
- "value_int": "10000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.68100000 BTC",
- "display_short": "103,156.68 BTC",
- "value": "103156.68100000",
- "value_int": "10315668100000"
- },
- "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
- }, {
- "Index": "69",
- "Date": 1394502446000,
- "Type": "withdraw",
- "Value": {
- "currency": "BTC",
- "display": "0.00090000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00090000",
- "value_int": "90000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.68110000 BTC",
- "display_short": "103,156.68 BTC",
- "value": "103156.68110000",
- "value_int": "10315668110000"
- },
- "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
- }, {
- "Index": "68",
- "Date": 1394502365000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.68200000 BTC",
- "display_short": "103,156.68 BTC",
- "value": "103156.68200000",
- "value_int": "10315668200000"
- },
- "Info": "BTC bought: [tid:72ef46e8-db0e-4f58-99b7-3949f80a4af6] 0.34920635 BTC at 32066.65629 USD",
- "Trade": {
- "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
- "tid": "72ef46e8-db0e-4f58-99b7-3949f80a4af6",
- "Amount": {
- "currency": "BTC",
- "display": "0.34920635 BTC",
- "display_short": "0.35 BTC",
- "value": "0.34920635",
- "value_int": "34920635"
- },
- "Properties": "market"
- }
- }, {
- "Index": "67",
- "Date": 1394502365000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.34920635 BTC",
- "display_short": "0.35 BTC",
- "value": "0.34920635",
- "value_int": "34920635"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.68200000 BTC",
- "display_short": "103,156.68 BTC",
- "value": "103156.68200000",
- "value_int": "10315668200000"
- },
- "Info": "BTC bought: [tid:72ef46e8-db0e-4f58-99b7-3949f80a4af6] 0.34920635 BTC at 32066.65629 USD",
- "Trade": {
- "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
- "tid": "72ef46e8-db0e-4f58-99b7-3949f80a4af6",
- "Amount": {
- "currency": "BTC",
- "display": "0.34920635 BTC",
- "display_short": "0.35 BTC",
- "value": "0.34920635",
- "value_int": "34920635"
- },
- "Properties": "market"
- }
- }, {
- "Index": "66",
- "Date": 1394502365000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.33279365 BTC",
- "display_short": "103,156.33 BTC",
- "value": "103156.33279365",
- "value_int": "10315633279365"
- },
- "Info": "BTC bought: [tid:39c1f9b5-1407-4358-a406-c15926875107] 793.65079365 BTC at 6.30000 USD",
- "Trade": {
- "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
- "tid": "39c1f9b5-1407-4358-a406-c15926875107",
- "Amount": {
- "currency": "BTC",
- "display": "793.65079365 BTC",
- "display_short": "793.65 BTC",
- "value": "793.65079365",
- "value_int": "79365079365"
- },
- "Properties": "market"
- }
- }, {
- "Index": "65",
- "Date": 1394502365000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "793.65079365 BTC",
- "display_short": "793.65 BTC",
- "value": "793.65079365",
- "value_int": "79365079365"
- },
- "Balance": {
- "currency": "BTC",
- "display": "103,156.33279365 BTC",
- "display_short": "103,156.33 BTC",
- "value": "103156.33279365",
- "value_int": "10315633279365"
- },
- "Info": "BTC bought: [tid:39c1f9b5-1407-4358-a406-c15926875107] 793.65079365 BTC at 6.30000 USD",
- "Trade": {
- "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
- "tid": "39c1f9b5-1407-4358-a406-c15926875107",
- "Amount": {
- "currency": "BTC",
- "display": "793.65079365 BTC",
- "display_short": "793.65 BTC",
- "value": "793.65079365",
- "value_int": "79365079365"
- },
- "Properties": "market"
- }
- }, {
- "Index": "64",
- "Date": 1394502330000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "102,362.68200000 BTC",
- "display_short": "102,362.68 BTC",
- "value": "102362.68200000",
- "value_int": "10236268200000"
- },
- "Info": "BTC bought: [tid:4cdba55a-d51c-4793-8613-6ad7f77340fe] 2233.30000000 BTC at 21.45000 HKD",
- "Trade": {
- "oid": "3aceda14-734f-4575-9676-6304de326c45",
- "tid": "4cdba55a-d51c-4793-8613-6ad7f77340fe",
- "Amount": {
- "currency": "BTC",
- "display": "2,233.30000000 BTC",
- "display_short": "2,233.30 BTC",
- "value": "2233.30000000",
- "value_int": "223330000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "63",
- "Date": 1394502330000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "2,233.30000000 BTC",
- "display_short": "2,233.30 BTC",
- "value": "2233.30000000",
- "value_int": "223330000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "102,362.68200000 BTC",
- "display_short": "102,362.68 BTC",
- "value": "102362.68200000",
- "value_int": "10236268200000"
- },
- "Info": "BTC bought: [tid:4cdba55a-d51c-4793-8613-6ad7f77340fe] 2233.30000000 BTC at 21.45000 HKD",
- "Trade": {
- "oid": "3aceda14-734f-4575-9676-6304de326c45",
- "tid": "4cdba55a-d51c-4793-8613-6ad7f77340fe",
- "Amount": {
- "currency": "BTC",
- "display": "2,233.30000000 BTC",
- "display_short": "2,233.30 BTC",
- "value": "2233.30000000",
- "value_int": "223330000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "62",
- "Date": 1394502161000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,129.38200000 BTC",
- "display_short": "100,129.38 BTC",
- "value": "100129.38200000",
- "value_int": "10012938200000"
- },
- "Info": "BTC bought: [tid:e9d7961e-7d99-4efc-bb78-f319455a7620] 10.00000000 BTC at 21.45000 HKD",
- "Trade": {
- "oid": "95e7ae28-9553-4a01-aee8-8df6f9e6fa84",
- "tid": "e9d7961e-7d99-4efc-bb78-f319455a7620",
- "Amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "61",
- "Date": 1394502161000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,129.38200000 BTC",
- "display_short": "100,129.38 BTC",
- "value": "100129.38200000",
- "value_int": "10012938200000"
- },
- "Info": "BTC bought: [tid:e9d7961e-7d99-4efc-bb78-f319455a7620] 10.00000000 BTC at 21.45000 HKD",
- "Trade": {
- "oid": "95e7ae28-9553-4a01-aee8-8df6f9e6fa84",
- "tid": "e9d7961e-7d99-4efc-bb78-f319455a7620",
- "Amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "60",
- "Date": 1394502121000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,119.38200000 BTC",
- "display_short": "100,119.38 BTC",
- "value": "100119.38200000",
- "value_int": "10011938200000"
- },
- "Info": "BTC bought: [tid:5b31eb7b-d11e-429a-8462-890a24a92d2b] 10.00000000 BTC at 21.45000 HKD",
- "Trade": {
- "oid": "d5c1f774-901c-4763-82a4-a925238cd3c3",
- "tid": "5b31eb7b-d11e-429a-8462-890a24a92d2b",
- "Amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "59",
- "Date": 1394502121000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,119.38200000 BTC",
- "display_short": "100,119.38 BTC",
- "value": "100119.38200000",
- "value_int": "10011938200000"
- },
- "Info": "BTC bought: [tid:5b31eb7b-d11e-429a-8462-890a24a92d2b] 10.00000000 BTC at 21.45000 HKD",
- "Trade": {
- "oid": "d5c1f774-901c-4763-82a4-a925238cd3c3",
- "tid": "5b31eb7b-d11e-429a-8462-890a24a92d2b",
- "Amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "58",
- "Date": 1394439614000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,109.38200000 BTC",
- "display_short": "100,109.38 BTC",
- "value": "100109.38200000",
- "value_int": "10010938200000"
- },
- "Info": "BTC bought: [tid:62f64ffa-8299-4306-93a4-146c8b86a87c] 0.01000000 BTC at 1.00000 USD",
- "Trade": {
- "oid": "ee387558-7188-409b-a3d2-98eacff1ca21",
- "tid": "62f64ffa-8299-4306-93a4-146c8b86a87c",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "57",
- "Date": 1394439614000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,109.38200000 BTC",
- "display_short": "100,109.38 BTC",
- "value": "100109.38200000",
- "value_int": "10010938200000"
- },
- "Info": "BTC bought: [tid:62f64ffa-8299-4306-93a4-146c8b86a87c] 0.01000000 BTC at 1.00000 USD",
- "Trade": {
- "oid": "ee387558-7188-409b-a3d2-98eacff1ca21",
- "tid": "62f64ffa-8299-4306-93a4-146c8b86a87c",
- "Amount": {
- "currency": "BTC",
- "display": "0.01000000 BTC",
- "display_short": "0.01 BTC",
- "value": "0.01000000",
- "value_int": "1000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "56",
- "Date": 1394439613000,
- "Type": "fee",
- "Value": {
- "currency": "BTC",
- "display": "0.00000000 BTC",
- "display_short": "0.00 BTC",
- "value": "0.00000000",
- "value_int": "0"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,109.37200000 BTC",
- "display_short": "100,109.37 BTC",
- "value": "100109.37200000",
- "value_int": "10010937200000"
- },
- "Info": "BTC bought: [tid:9aeba888-a0f0-49e0-a8d6-d4992ed42cb2] 2.33000000 BTC at 280.08155 HKD",
- "Trade": {
- "oid": "446b610b-c064-4680-99c2-03a35d9a1628",
- "tid": "9aeba888-a0f0-49e0-a8d6-d4992ed42cb2",
- "Amount": {
- "currency": "BTC",
- "display": "2.33000000 BTC",
- "display_short": "2.33 BTC",
- "value": "2.33000000",
- "value_int": "233000000"
- },
- "Properties": "market"
- }
- }, {
- "Index": "55",
- "Date": 1394439613000,
- "Type": "in",
- "Value": {
- "currency": "BTC",
- "display": "2.33000000 BTC",
- "display_short": "2.33 BTC",
- "value": "2.33000000",
- "value_int": "233000000"
- },
- "Balance": {
- "currency": "BTC",
- "display": "100,109.37200000 BTC",
- "display_short": "100,109.37 BTC",
- "value": "100109.37200000",
- "value_int": "10010937200000"
- },
- "Info": "BTC bought: [tid:9aeba888-a0f0-49e0-a8d6-d4992ed42cb2] 2.33000000 BTC at 280.08155 HKD",
- "Trade": {
- "oid": "446b610b-c064-4680-99c2-03a35d9a1628",
- "tid": "9aeba888-a0f0-49e0-a8d6-d4992ed42cb2",
- "Amount": {
- "currency": "BTC",
- "display": "2.33000000 BTC",
- "display_short": "2.33 BTC",
- "value": "2.33000000",
- "value_int": "233000000"
- },
- "Properties": "market"
- }
- }],
- "current_page": 1,
- "max_page": 3,
- "max_results": 50
- }
+ "result": "success",
+ "data": {
+ "records": "104",
+ "result": [
+ {
+ "Index": "104",
+ "Date": 1394594770000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,168.75400000 BTC",
+ "display_short": "103,168.75 BTC",
+ "value": "103168.75400000",
+ "value_int": "10316875400000"
+ },
+ "Info": "BTC bought: [tid:264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51] 10.00000000 BTC at 280.65500 HKD",
+ "Trade": {
+ "oid": "cc496636-4849-4acf-a390-e4091a5009c3",
+ "tid": "264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51",
+ "Amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "103",
+ "Date": 1394594770000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,168.75400000 BTC",
+ "display_short": "103,168.75 BTC",
+ "value": "103168.75400000",
+ "value_int": "10316875400000"
+ },
+ "Info": "BTC bought: [tid:264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51] 10.00000000 BTC at 280.65500 HKD",
+ "Trade": {
+ "oid": "cc496636-4849-4acf-a390-e4091a5009c3",
+ "tid": "264f7b7f-f70c-4fc6-ba27-2bcf33b6cd51",
+ "Amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "102",
+ "Date": 1394591732000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.75400000 BTC",
+ "display_short": "103,158.75 BTC",
+ "value": "103158.75400000",
+ "value_int": "10315875400000"
+ },
+ "Info": "BTC bought: [tid:0da16e7e-661e-43ad-9596-b96b846966e9] 0.01000000 BTC at 801.00000 HKD",
+ "Trade": {
+ "oid": "5b66392f-5d43-4391-92fb-d5ba56ba8deb",
+ "tid": "0da16e7e-661e-43ad-9596-b96b846966e9",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "101",
+ "Date": 1394591732000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.75400000 BTC",
+ "display_short": "103,158.75 BTC",
+ "value": "103158.75400000",
+ "value_int": "10315875400000"
+ },
+ "Info": "BTC bought: [tid:0da16e7e-661e-43ad-9596-b96b846966e9] 0.01000000 BTC at 801.00000 HKD",
+ "Trade": {
+ "oid": "5b66392f-5d43-4391-92fb-d5ba56ba8deb",
+ "tid": "0da16e7e-661e-43ad-9596-b96b846966e9",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "100",
+ "Date": 1394590522000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.74400000 BTC",
+ "display_short": "103,158.74 BTC",
+ "value": "103158.74400000",
+ "value_int": "10315874400000"
+ },
+ "Info": "BTC bought: [tid:03eefdf9-dd2b-4fcf-bdca-a60a53e519fd] 0.01000000 BTC at 801.00000 HKD",
+ "Trade": {
+ "oid": "b19ac3e2-0822-4745-a5c6-c9620995b2ba",
+ "tid": "03eefdf9-dd2b-4fcf-bdca-a60a53e519fd",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "99",
+ "Date": 1394590522000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.74400000 BTC",
+ "display_short": "103,158.74 BTC",
+ "value": "103158.74400000",
+ "value_int": "10315874400000"
+ },
+ "Info": "BTC bought: [tid:03eefdf9-dd2b-4fcf-bdca-a60a53e519fd] 0.01000000 BTC at 801.00000 HKD",
+ "Trade": {
+ "oid": "b19ac3e2-0822-4745-a5c6-c9620995b2ba",
+ "tid": "03eefdf9-dd2b-4fcf-bdca-a60a53e519fd",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "98",
+ "Date": 1394590219000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.73400000 BTC",
+ "display_short": "103,158.73 BTC",
+ "value": "103158.73400000",
+ "value_int": "10315873400000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "97",
+ "Date": 1394590219000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.73410000 BTC",
+ "display_short": "103,158.73 BTC",
+ "value": "103158.73410000",
+ "value_int": "10315873410000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "96",
+ "Date": 1394589675000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.73500000 BTC",
+ "display_short": "103,158.74 BTC",
+ "value": "103158.73500000",
+ "value_int": "10315873500000"
+ },
+ "Info": "BTC bought: [tid:1b0ba8e9-3a28-420c-94a5-86959e3a63f6] 0.01000000 BTC at 5050.00000 HKD",
+ "Trade": {
+ "oid": "3cac06ea-d475-40f0-b680-ace2f3573542",
+ "tid": "1b0ba8e9-3a28-420c-94a5-86959e3a63f6",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "95",
+ "Date": 1394589675000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.73500000 BTC",
+ "display_short": "103,158.74 BTC",
+ "value": "103158.73500000",
+ "value_int": "10315873500000"
+ },
+ "Info": "BTC bought: [tid:1b0ba8e9-3a28-420c-94a5-86959e3a63f6] 0.01000000 BTC at 5050.00000 HKD",
+ "Trade": {
+ "oid": "3cac06ea-d475-40f0-b680-ace2f3573542",
+ "tid": "1b0ba8e9-3a28-420c-94a5-86959e3a63f6",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "94",
+ "Date": 1394533355000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.72500000 BTC",
+ "display_short": "103,158.72 BTC",
+ "value": "103158.72500000",
+ "value_int": "10315872500000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "93",
+ "Date": 1394533355000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.72510000 BTC",
+ "display_short": "103,158.73 BTC",
+ "value": "103158.72510000",
+ "value_int": "10315872510000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "92",
+ "Date": 1394533351000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.72600000 BTC",
+ "display_short": "103,158.73 BTC",
+ "value": "103158.72600000",
+ "value_int": "10315872600000"
+ },
+ "Info": "BTC bought: [tid:b55ad445-6669-4459-9026-7b1130709188] 0.01000000 BTC at 4910.00000 HKD",
+ "Trade": {
+ "oid": "7b98e3f5-0daf-43de-9c91-f04f8141177a",
+ "tid": "b55ad445-6669-4459-9026-7b1130709188",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "91",
+ "Date": 1394533351000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.72600000 BTC",
+ "display_short": "103,158.73 BTC",
+ "value": "103158.72600000",
+ "value_int": "10315872600000"
+ },
+ "Info": "BTC bought: [tid:b55ad445-6669-4459-9026-7b1130709188] 0.01000000 BTC at 4910.00000 HKD",
+ "Trade": {
+ "oid": "7b98e3f5-0daf-43de-9c91-f04f8141177a",
+ "tid": "b55ad445-6669-4459-9026-7b1130709188",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "90",
+ "Date": 1394533291000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.71600000 BTC",
+ "display_short": "103,158.72 BTC",
+ "value": "103158.71600000",
+ "value_int": "10315871600000"
+ },
+ "Info": "BTC bought: [tid:c1118561-b894-4782-ad53-132b34884ee0] 0.01000000 BTC at 4910.00000 HKD",
+ "Trade": {
+ "oid": "76120392-1746-4f61-a62b-af7c6550eff3",
+ "tid": "c1118561-b894-4782-ad53-132b34884ee0",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "89",
+ "Date": 1394533291000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.71600000 BTC",
+ "display_short": "103,158.72 BTC",
+ "value": "103158.71600000",
+ "value_int": "10315871600000"
+ },
+ "Info": "BTC bought: [tid:c1118561-b894-4782-ad53-132b34884ee0] 0.01000000 BTC at 4910.00000 HKD",
+ "Trade": {
+ "oid": "76120392-1746-4f61-a62b-af7c6550eff3",
+ "tid": "c1118561-b894-4782-ad53-132b34884ee0",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "88",
+ "Date": 1394532835000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.70600000 BTC",
+ "display_short": "103,158.71 BTC",
+ "value": "103158.70600000",
+ "value_int": "10315870600000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "87",
+ "Date": 1394532835000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.70610000 BTC",
+ "display_short": "103,158.71 BTC",
+ "value": "103158.70610000",
+ "value_int": "10315870610000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "86",
+ "Date": 1394531038000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.70700000 BTC",
+ "display_short": "103,158.71 BTC",
+ "value": "103158.70700000",
+ "value_int": "10315870700000"
+ },
+ "Info": "DOGE sold: [tid:8e6c97ce-ec9a-4232-9599-36de109e1905] 100000.00000000 DOGE at 0.00002000 BTC",
+ "Trade": {
+ "oid": "41d928d1-6daf-444d-88ca-92b5cf05f21e",
+ "tid": "8e6c97ce-ec9a-4232-9599-36de109e1905",
+ "Amount": {
+ "currency": "DOGE",
+ "display": "100,000.00000000 DOGE",
+ "display_short": "100,000.00 DOGE",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "85",
+ "Date": 1394531038000,
+ "Type": "earned",
+ "Value": {
+ "currency": "BTC",
+ "display": "2.00000000 BTC",
+ "display_short": "2.00 BTC",
+ "value": "2.00000000",
+ "value_int": "200000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,158.70700000 BTC",
+ "display_short": "103,158.71 BTC",
+ "value": "103158.70700000",
+ "value_int": "10315870700000"
+ },
+ "Info": "DOGE sold: [tid:8e6c97ce-ec9a-4232-9599-36de109e1905] 100000.00000000 DOGE at 0.00002000 BTC",
+ "Trade": {
+ "oid": "41d928d1-6daf-444d-88ca-92b5cf05f21e",
+ "tid": "8e6c97ce-ec9a-4232-9599-36de109e1905",
+ "Amount": {
+ "currency": "DOGE",
+ "display": "100,000.00000000 DOGE",
+ "display_short": "100,000.00 DOGE",
+ "value": "100000.00000000",
+ "value_int": "10000000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "84",
+ "Date": 1394526957000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.70700000 BTC",
+ "display_short": "103,156.71 BTC",
+ "value": "103156.70700000",
+ "value_int": "10315670700000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "83",
+ "Date": 1394526957000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.70710000 BTC",
+ "display_short": "103,156.71 BTC",
+ "value": "103156.70710000",
+ "value_int": "10315670710000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "82",
+ "Date": 1394524823000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.70800000 BTC",
+ "display_short": "103,156.71 BTC",
+ "value": "103156.70800000",
+ "value_int": "10315670800000"
+ },
+ "Info": "BTC bought: [tid:6a5d4d1a-7f31-43d2-80bb-a626f793707f] 0.01000000 BTC at 222222.00000 HKD",
+ "Trade": {
+ "oid": "8bfbeb5a-815c-4362-a0ee-b33b34368518",
+ "tid": "6a5d4d1a-7f31-43d2-80bb-a626f793707f",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "81",
+ "Date": 1394524823000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.70800000 BTC",
+ "display_short": "103,156.71 BTC",
+ "value": "103156.70800000",
+ "value_int": "10315670800000"
+ },
+ "Info": "BTC bought: [tid:6a5d4d1a-7f31-43d2-80bb-a626f793707f] 0.01000000 BTC at 222222.00000 HKD",
+ "Trade": {
+ "oid": "8bfbeb5a-815c-4362-a0ee-b33b34368518",
+ "tid": "6a5d4d1a-7f31-43d2-80bb-a626f793707f",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "80",
+ "Date": 1394507388000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69800000 BTC",
+ "display_short": "103,156.70 BTC",
+ "value": "103156.69800000",
+ "value_int": "10315669800000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "79",
+ "Date": 1394507388000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69810000 BTC",
+ "display_short": "103,156.70 BTC",
+ "value": "103156.69810000",
+ "value_int": "10315669810000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "78",
+ "Date": 1394507379000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69900000 BTC",
+ "display_short": "103,156.70 BTC",
+ "value": "103156.69900000",
+ "value_int": "10315669900000"
+ },
+ "Info": "BTC bought: [tid:09d142c4-c567-44cc-ba40-7ee762330a1c] 0.01000000 BTC at 222222.00000 HKD",
+ "Trade": {
+ "oid": "94474f3a-d9b6-4b77-9f10-59f7b250012d",
+ "tid": "09d142c4-c567-44cc-ba40-7ee762330a1c",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "77",
+ "Date": 1394507379000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69900000 BTC",
+ "display_short": "103,156.70 BTC",
+ "value": "103156.69900000",
+ "value_int": "10315669900000"
+ },
+ "Info": "BTC bought: [tid:09d142c4-c567-44cc-ba40-7ee762330a1c] 0.01000000 BTC at 222222.00000 HKD",
+ "Trade": {
+ "oid": "94474f3a-d9b6-4b77-9f10-59f7b250012d",
+ "tid": "09d142c4-c567-44cc-ba40-7ee762330a1c",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "76",
+ "Date": 1394507372000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.68900000 BTC",
+ "display_short": "103,156.69 BTC",
+ "value": "103156.68900000",
+ "value_int": "10315668900000"
+ },
+ "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
+ },
+ {
+ "Index": "75",
+ "Date": 1394507372000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.68910000 BTC",
+ "display_short": "103,156.69 BTC",
+ "value": "103156.68910000",
+ "value_int": "10315668910000"
+ },
+ "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
+ },
+ {
+ "Index": "74",
+ "Date": 1394502457000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69000000 BTC",
+ "display_short": "103,156.69 BTC",
+ "value": "103156.69000000",
+ "value_int": "10315669000000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "73",
+ "Date": 1394502457000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69010000 BTC",
+ "display_short": "103,156.69 BTC",
+ "value": "103156.69010000",
+ "value_int": "10315669010000"
+ },
+ "Info": "1DTZHQF47QzETutRRQVr2o2Rjcku8gBWft"
+ },
+ {
+ "Index": "72",
+ "Date": 1394502450000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69100000 BTC",
+ "display_short": "103,156.69 BTC",
+ "value": "103156.69100000",
+ "value_int": "10315669100000"
+ },
+ "Info": "BTC bought: [tid:67b01301-5de0-4b1b-ac81-d4b86cffe7f4] 0.01000000 BTC at 222222.00000 HKD",
+ "Trade": {
+ "oid": "0472cfdd-8c21-4d05-bdd8-0be4a325a3a7",
+ "tid": "67b01301-5de0-4b1b-ac81-d4b86cffe7f4",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "71",
+ "Date": 1394502450000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.69100000 BTC",
+ "display_short": "103,156.69 BTC",
+ "value": "103156.69100000",
+ "value_int": "10315669100000"
+ },
+ "Info": "BTC bought: [tid:67b01301-5de0-4b1b-ac81-d4b86cffe7f4] 0.01000000 BTC at 222222.00000 HKD",
+ "Trade": {
+ "oid": "0472cfdd-8c21-4d05-bdd8-0be4a325a3a7",
+ "tid": "67b01301-5de0-4b1b-ac81-d4b86cffe7f4",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "70",
+ "Date": 1394502446000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00010000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00010000",
+ "value_int": "10000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.68100000 BTC",
+ "display_short": "103,156.68 BTC",
+ "value": "103156.68100000",
+ "value_int": "10315668100000"
+ },
+ "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
+ },
+ {
+ "Index": "69",
+ "Date": 1394502446000,
+ "Type": "withdraw",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00090000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00090000",
+ "value_int": "90000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.68110000 BTC",
+ "display_short": "103,156.68 BTC",
+ "value": "103156.68110000",
+ "value_int": "10315668110000"
+ },
+ "Info": "14rKWoWNphPNEZAHuXyWVmwemALux9y1Vr"
+ },
+ {
+ "Index": "68",
+ "Date": 1394502365000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.68200000 BTC",
+ "display_short": "103,156.68 BTC",
+ "value": "103156.68200000",
+ "value_int": "10315668200000"
+ },
+ "Info": "BTC bought: [tid:72ef46e8-db0e-4f58-99b7-3949f80a4af6] 0.34920635 BTC at 32066.65629 USD",
+ "Trade": {
+ "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
+ "tid": "72ef46e8-db0e-4f58-99b7-3949f80a4af6",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.34920635 BTC",
+ "display_short": "0.35 BTC",
+ "value": "0.34920635",
+ "value_int": "34920635"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "67",
+ "Date": 1394502365000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.34920635 BTC",
+ "display_short": "0.35 BTC",
+ "value": "0.34920635",
+ "value_int": "34920635"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.68200000 BTC",
+ "display_short": "103,156.68 BTC",
+ "value": "103156.68200000",
+ "value_int": "10315668200000"
+ },
+ "Info": "BTC bought: [tid:72ef46e8-db0e-4f58-99b7-3949f80a4af6] 0.34920635 BTC at 32066.65629 USD",
+ "Trade": {
+ "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
+ "tid": "72ef46e8-db0e-4f58-99b7-3949f80a4af6",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.34920635 BTC",
+ "display_short": "0.35 BTC",
+ "value": "0.34920635",
+ "value_int": "34920635"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "66",
+ "Date": 1394502365000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.33279365 BTC",
+ "display_short": "103,156.33 BTC",
+ "value": "103156.33279365",
+ "value_int": "10315633279365"
+ },
+ "Info": "BTC bought: [tid:39c1f9b5-1407-4358-a406-c15926875107] 793.65079365 BTC at 6.30000 USD",
+ "Trade": {
+ "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
+ "tid": "39c1f9b5-1407-4358-a406-c15926875107",
+ "Amount": {
+ "currency": "BTC",
+ "display": "793.65079365 BTC",
+ "display_short": "793.65 BTC",
+ "value": "793.65079365",
+ "value_int": "79365079365"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "65",
+ "Date": 1394502365000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "793.65079365 BTC",
+ "display_short": "793.65 BTC",
+ "value": "793.65079365",
+ "value_int": "79365079365"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "103,156.33279365 BTC",
+ "display_short": "103,156.33 BTC",
+ "value": "103156.33279365",
+ "value_int": "10315633279365"
+ },
+ "Info": "BTC bought: [tid:39c1f9b5-1407-4358-a406-c15926875107] 793.65079365 BTC at 6.30000 USD",
+ "Trade": {
+ "oid": "56cd7703-e45c-4e66-932b-f852b07da66e",
+ "tid": "39c1f9b5-1407-4358-a406-c15926875107",
+ "Amount": {
+ "currency": "BTC",
+ "display": "793.65079365 BTC",
+ "display_short": "793.65 BTC",
+ "value": "793.65079365",
+ "value_int": "79365079365"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "64",
+ "Date": 1394502330000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "102,362.68200000 BTC",
+ "display_short": "102,362.68 BTC",
+ "value": "102362.68200000",
+ "value_int": "10236268200000"
+ },
+ "Info": "BTC bought: [tid:4cdba55a-d51c-4793-8613-6ad7f77340fe] 2233.30000000 BTC at 21.45000 HKD",
+ "Trade": {
+ "oid": "3aceda14-734f-4575-9676-6304de326c45",
+ "tid": "4cdba55a-d51c-4793-8613-6ad7f77340fe",
+ "Amount": {
+ "currency": "BTC",
+ "display": "2,233.30000000 BTC",
+ "display_short": "2,233.30 BTC",
+ "value": "2233.30000000",
+ "value_int": "223330000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "63",
+ "Date": 1394502330000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "2,233.30000000 BTC",
+ "display_short": "2,233.30 BTC",
+ "value": "2233.30000000",
+ "value_int": "223330000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "102,362.68200000 BTC",
+ "display_short": "102,362.68 BTC",
+ "value": "102362.68200000",
+ "value_int": "10236268200000"
+ },
+ "Info": "BTC bought: [tid:4cdba55a-d51c-4793-8613-6ad7f77340fe] 2233.30000000 BTC at 21.45000 HKD",
+ "Trade": {
+ "oid": "3aceda14-734f-4575-9676-6304de326c45",
+ "tid": "4cdba55a-d51c-4793-8613-6ad7f77340fe",
+ "Amount": {
+ "currency": "BTC",
+ "display": "2,233.30000000 BTC",
+ "display_short": "2,233.30 BTC",
+ "value": "2233.30000000",
+ "value_int": "223330000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "62",
+ "Date": 1394502161000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,129.38200000 BTC",
+ "display_short": "100,129.38 BTC",
+ "value": "100129.38200000",
+ "value_int": "10012938200000"
+ },
+ "Info": "BTC bought: [tid:e9d7961e-7d99-4efc-bb78-f319455a7620] 10.00000000 BTC at 21.45000 HKD",
+ "Trade": {
+ "oid": "95e7ae28-9553-4a01-aee8-8df6f9e6fa84",
+ "tid": "e9d7961e-7d99-4efc-bb78-f319455a7620",
+ "Amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "61",
+ "Date": 1394502161000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,129.38200000 BTC",
+ "display_short": "100,129.38 BTC",
+ "value": "100129.38200000",
+ "value_int": "10012938200000"
+ },
+ "Info": "BTC bought: [tid:e9d7961e-7d99-4efc-bb78-f319455a7620] 10.00000000 BTC at 21.45000 HKD",
+ "Trade": {
+ "oid": "95e7ae28-9553-4a01-aee8-8df6f9e6fa84",
+ "tid": "e9d7961e-7d99-4efc-bb78-f319455a7620",
+ "Amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "60",
+ "Date": 1394502121000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,119.38200000 BTC",
+ "display_short": "100,119.38 BTC",
+ "value": "100119.38200000",
+ "value_int": "10011938200000"
+ },
+ "Info": "BTC bought: [tid:5b31eb7b-d11e-429a-8462-890a24a92d2b] 10.00000000 BTC at 21.45000 HKD",
+ "Trade": {
+ "oid": "d5c1f774-901c-4763-82a4-a925238cd3c3",
+ "tid": "5b31eb7b-d11e-429a-8462-890a24a92d2b",
+ "Amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "59",
+ "Date": 1394502121000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,119.38200000 BTC",
+ "display_short": "100,119.38 BTC",
+ "value": "100119.38200000",
+ "value_int": "10011938200000"
+ },
+ "Info": "BTC bought: [tid:5b31eb7b-d11e-429a-8462-890a24a92d2b] 10.00000000 BTC at 21.45000 HKD",
+ "Trade": {
+ "oid": "d5c1f774-901c-4763-82a4-a925238cd3c3",
+ "tid": "5b31eb7b-d11e-429a-8462-890a24a92d2b",
+ "Amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "58",
+ "Date": 1394439614000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,109.38200000 BTC",
+ "display_short": "100,109.38 BTC",
+ "value": "100109.38200000",
+ "value_int": "10010938200000"
+ },
+ "Info": "BTC bought: [tid:62f64ffa-8299-4306-93a4-146c8b86a87c] 0.01000000 BTC at 1.00000 USD",
+ "Trade": {
+ "oid": "ee387558-7188-409b-a3d2-98eacff1ca21",
+ "tid": "62f64ffa-8299-4306-93a4-146c8b86a87c",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "57",
+ "Date": 1394439614000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,109.38200000 BTC",
+ "display_short": "100,109.38 BTC",
+ "value": "100109.38200000",
+ "value_int": "10010938200000"
+ },
+ "Info": "BTC bought: [tid:62f64ffa-8299-4306-93a4-146c8b86a87c] 0.01000000 BTC at 1.00000 USD",
+ "Trade": {
+ "oid": "ee387558-7188-409b-a3d2-98eacff1ca21",
+ "tid": "62f64ffa-8299-4306-93a4-146c8b86a87c",
+ "Amount": {
+ "currency": "BTC",
+ "display": "0.01000000 BTC",
+ "display_short": "0.01 BTC",
+ "value": "0.01000000",
+ "value_int": "1000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "56",
+ "Date": 1394439613000,
+ "Type": "fee",
+ "Value": {
+ "currency": "BTC",
+ "display": "0.00000000 BTC",
+ "display_short": "0.00 BTC",
+ "value": "0.00000000",
+ "value_int": "0"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,109.37200000 BTC",
+ "display_short": "100,109.37 BTC",
+ "value": "100109.37200000",
+ "value_int": "10010937200000"
+ },
+ "Info": "BTC bought: [tid:9aeba888-a0f0-49e0-a8d6-d4992ed42cb2] 2.33000000 BTC at 280.08155 HKD",
+ "Trade": {
+ "oid": "446b610b-c064-4680-99c2-03a35d9a1628",
+ "tid": "9aeba888-a0f0-49e0-a8d6-d4992ed42cb2",
+ "Amount": {
+ "currency": "BTC",
+ "display": "2.33000000 BTC",
+ "display_short": "2.33 BTC",
+ "value": "2.33000000",
+ "value_int": "233000000"
+ },
+ "Properties": "market"
+ }
+ },
+ {
+ "Index": "55",
+ "Date": 1394439613000,
+ "Type": "in",
+ "Value": {
+ "currency": "BTC",
+ "display": "2.33000000 BTC",
+ "display_short": "2.33 BTC",
+ "value": "2.33000000",
+ "value_int": "233000000"
+ },
+ "Balance": {
+ "currency": "BTC",
+ "display": "100,109.37200000 BTC",
+ "display_short": "100,109.37 BTC",
+ "value": "100109.37200000",
+ "value_int": "10010937200000"
+ },
+ "Info": "BTC bought: [tid:9aeba888-a0f0-49e0-a8d6-d4992ed42cb2] 2.33000000 BTC at 280.08155 HKD",
+ "Trade": {
+ "oid": "446b610b-c064-4680-99c2-03a35d9a1628",
+ "tid": "9aeba888-a0f0-49e0-a8d6-d4992ed42cb2",
+ "Amount": {
+ "currency": "BTC",
+ "display": "2.33000000 BTC",
+ "display_short": "2.33 BTC",
+ "value": "2.33000000",
+ "value_int": "233000000"
+ },
+ "Properties": "market"
+ }
+ }
+ ],
+ "current_page": 1,
+ "max_page": 3,
+ "max_results": 50
+ }
}
\ No newline at end of file
diff --git a/xchange-anx/src/test/resources/v2/marketdata/example-fulldepth-data.json b/xchange-anx/src/test/resources/v2/marketdata/example-fulldepth-data.json
index bace431c8..2fcc15aed 100644
--- a/xchange-anx/src/test/resources/v2/marketdata/example-fulldepth-data.json
+++ b/xchange-anx/src/test/resources/v2/marketdata/example-fulldepth-data.json
@@ -1,40 +1,49 @@
{
- "now": "1392693096241000",
- "asks": [{
- "price": "3260.40000",
- "price_int": "326040000",
- "amount": "16.00000000",
- "amount_int": "1600000000"
- }, {
- "price": "6280.79172",
- "price_int": "628079172",
- "amount": "8.84549083",
- "amount_int": "884549083"
- }, {
- "price": "8580.00000",
- "price_int": "858000000",
- "amount": "0.02000000",
- "amount_int": "2000000"
- }],
- "bids": [{
- "price": "2000.00000",
- "price_int": "200000000",
- "amount": "3.00000000",
- "amount_int": "300000000"
- }, {
- "price": "210.00000",
- "price_int": "21000000",
- "amount": "0.49000000",
- "amount_int": "49000000"
- }, {
- "price": "205.00000",
- "price_int": "20500000",
- "amount": "1.00000000",
- "amount_int": "100000000"
- }, {
- "price": "200.00000",
- "price_int": "20000000",
- "amount": "72.00000000",
- "amount_int": "7200000000"
- }]
+ "now": "1392693096241000",
+ "asks": [
+ {
+ "price": "3260.40000",
+ "price_int": "326040000",
+ "amount": "16.00000000",
+ "amount_int": "1600000000"
+ },
+ {
+ "price": "6280.79172",
+ "price_int": "628079172",
+ "amount": "8.84549083",
+ "amount_int": "884549083"
+ },
+ {
+ "price": "8580.00000",
+ "price_int": "858000000",
+ "amount": "0.02000000",
+ "amount_int": "2000000"
+ }
+ ],
+ "bids": [
+ {
+ "price": "2000.00000",
+ "price_int": "200000000",
+ "amount": "3.00000000",
+ "amount_int": "300000000"
+ },
+ {
+ "price": "210.00000",
+ "price_int": "21000000",
+ "amount": "0.49000000",
+ "amount_int": "49000000"
+ },
+ {
+ "price": "205.00000",
+ "price_int": "20500000",
+ "amount": "1.00000000",
+ "amount_int": "100000000"
+ },
+ {
+ "price": "200.00000",
+ "price_int": "20000000",
+ "amount": "72.00000000",
+ "amount_int": "7200000000"
+ }
+ ]
}
\ No newline at end of file
diff --git a/xchange-anx/src/test/resources/v2/marketdata/example-ticker-data.json b/xchange-anx/src/test/resources/v2/marketdata/example-ticker-data.json
index 1416caab9..64ef173bb 100644
--- a/xchange-anx/src/test/resources/v2/marketdata/example-ticker-data.json
+++ b/xchange-anx/src/test/resources/v2/marketdata/example-ticker-data.json
@@ -1,59 +1,59 @@
{
- "high": {
- "currency": "USD",
- "display": "725.38123 USD",
- "display_short": "725.38 USD",
- "value": "725.38123",
- "value_int": "72538123"
- },
- "low": {
- "currency": "USD",
- "display": "380.00000 USD",
- "display_short": "380.00 USD",
- "value": "380.00000",
- "value_int": "38000000"
- },
- "avg": {
- "currency": "USD",
- "display": "429.34018 USD",
- "display_short": "429.34 USD",
- "value": "429.34018",
- "value_int": "42934018"
- },
- "vwap": {
- "currency": "USD",
- "display": "429.34018 USD",
- "display_short": "429.34 USD",
- "value": "429.34018",
- "value_int": "42934018"
- },
- "vol": {
- "currency": "BTC",
- "display": "7.00000000 BTC",
- "display_short": "7.00 BTC",
- "value": "7.00000000",
- "value_int": "700000000"
- },
- "last": {
- "currency": "USD",
- "display": "725.38123 USD",
- "display_short": "725.38 USD",
- "value": "725.38123",
- "value_int": "72538123"
- },
- "buy": {
- "currency": "USD",
- "display": "38.85148 USD",
- "display_short": "38.85 USD",
- "value": "38.85148",
- "value_int": "3885148"
- },
- "sell": {
- "currency": "USD",
- "display": "897.25596 USD",
- "display_short": "897.26 USD",
- "value": "897.25596",
- "value_int": "89725596"
- },
- "now": 1393388594814000
+ "high": {
+ "currency": "USD",
+ "display": "725.38123 USD",
+ "display_short": "725.38 USD",
+ "value": "725.38123",
+ "value_int": "72538123"
+ },
+ "low": {
+ "currency": "USD",
+ "display": "380.00000 USD",
+ "display_short": "380.00 USD",
+ "value": "380.00000",
+ "value_int": "38000000"
+ },
+ "avg": {
+ "currency": "USD",
+ "display": "429.34018 USD",
+ "display_short": "429.34 USD",
+ "value": "429.34018",
+ "value_int": "42934018"
+ },
+ "vwap": {
+ "currency": "USD",
+ "display": "429.34018 USD",
+ "display_short": "429.34 USD",
+ "value": "429.34018",
+ "value_int": "42934018"
+ },
+ "vol": {
+ "currency": "BTC",
+ "display": "7.00000000 BTC",
+ "display_short": "7.00 BTC",
+ "value": "7.00000000",
+ "value_int": "700000000"
+ },
+ "last": {
+ "currency": "USD",
+ "display": "725.38123 USD",
+ "display_short": "725.38 USD",
+ "value": "725.38123",
+ "value_int": "72538123"
+ },
+ "buy": {
+ "currency": "USD",
+ "display": "38.85148 USD",
+ "display_short": "38.85 USD",
+ "value": "38.85148",
+ "value_int": "3885148"
+ },
+ "sell": {
+ "currency": "USD",
+ "display": "897.25596 USD",
+ "display_short": "897.26 USD",
+ "value": "897.25596",
+ "value_int": "89725596"
+ },
+ "now": 1393388594814000
}
\ No newline at end of file
diff --git a/xchange-anx/src/test/resources/v2/marketdata/example-trades-data.json b/xchange-anx/src/test/resources/v2/marketdata/example-trades-data.json
index 0970295a6..a8a5efb4d 100644
--- a/xchange-anx/src/test/resources/v2/marketdata/example-trades-data.json
+++ b/xchange-anx/src/test/resources/v2/marketdata/example-trades-data.json
@@ -1,29 +1,29 @@
{
- "result":"success",
- "data":[
- {
- "price":655,
- "amount":0.25,
- "price_int":65500000,
- "amount_int":25000000,
- "tid":1402189342525,
- "price_currency":"USD",
- "item":"BTC",
- "trade_type":"bid",
- "primary":true,
- "properties":"Not Supported"
- },
- {
- "price":655.6335,
- "amount":0.09233,
- "price_int":65563350,
- "amount_int":9233000,
- "tid":1402189349725,
- "price_currency":"USD",
- "item":"BTC",
- "trade_type":"bid",
- "primary":true,
- "properties":"Not Supported"
- }
- ]
+ "result": "success",
+ "data": [
+ {
+ "price": 655,
+ "amount": 0.25,
+ "price_int": 65500000,
+ "amount_int": 25000000,
+ "tid": 1402189342525,
+ "price_currency": "USD",
+ "item": "BTC",
+ "trade_type": "bid",
+ "primary": true,
+ "properties": "Not Supported"
+ },
+ {
+ "price": 655.6335,
+ "amount": 0.09233,
+ "price_int": 65563350,
+ "amount_int": 9233000,
+ "tid": 1402189349725,
+ "price_currency": "USD",
+ "item": "BTC",
+ "trade_type": "bid",
+ "primary": true,
+ "properties": "Not Supported"
+ }
+ ]
}
\ No newline at end of file
diff --git a/xchange-anx/src/test/resources/v2/trade/example-openorders-data.json b/xchange-anx/src/test/resources/v2/trade/example-openorders-data.json
index 91977b0cb..35f4be9f8 100644
--- a/xchange-anx/src/test/resources/v2/trade/example-openorders-data.json
+++ b/xchange-anx/src/test/resources/v2/trade/example-openorders-data.json
@@ -1,64 +1,64 @@
[
- {
- "oid": "e74305c7-c424-4fbc-a8a2-b41d8329deb0",
- "currency": "HKD",
- "item": "BTC",
- "type": "offer",
- "amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "effective_amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "price": {
- "currency": "HKD",
- "display": "412.34567 HKD",
- "display_short": "412.35 HKD",
- "value": "412.34567",
- "value_int": "41234567"
- },
- "status": "open",
- "date": 1393411075000,
- "priority": 1393411075000000,
- "actions": []
+ {
+ "oid": "e74305c7-c424-4fbc-a8a2-b41d8329deb0",
+ "currency": "HKD",
+ "item": "BTC",
+ "type": "offer",
+ "amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
},
- {
- "oid": "7eecf4b2-5785-4500-a5d4-f3f8c924395c",
- "currency": "HKD",
- "item": "BTC",
- "type": "bid",
- "amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "effective_amount": {
- "currency": "BTC",
- "display": "10.00000000 BTC",
- "display_short": "10.00 BTC",
- "value": "10.00000000",
- "value_int": "1000000000"
- },
- "price": {
- "currency": "HKD",
- "display": "212.34567 HKD",
- "display_short": "212.35 HKD",
- "value": "212.34567",
- "value_int": "21234567"
- },
- "status": "open",
- "date": 1393411073000,
- "priority": 1393411073000000,
- "actions": []
- }
+ "effective_amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "price": {
+ "currency": "HKD",
+ "display": "412.34567 HKD",
+ "display_short": "412.35 HKD",
+ "value": "412.34567",
+ "value_int": "41234567"
+ },
+ "status": "open",
+ "date": 1393411075000,
+ "priority": 1393411075000000,
+ "actions": []
+ },
+ {
+ "oid": "7eecf4b2-5785-4500-a5d4-f3f8c924395c",
+ "currency": "HKD",
+ "item": "BTC",
+ "type": "bid",
+ "amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "effective_amount": {
+ "currency": "BTC",
+ "display": "10.00000000 BTC",
+ "display_short": "10.00 BTC",
+ "value": "10.00000000",
+ "value_int": "1000000000"
+ },
+ "price": {
+ "currency": "HKD",
+ "display": "212.34567 HKD",
+ "display_short": "212.35 HKD",
+ "value": "212.34567",
+ "value_int": "21234567"
+ },
+ "status": "open",
+ "date": 1393411073000,
+ "priority": 1393411073000000,
+ "actions": []
+ }
]
\ No newline at end of file
diff --git a/xchange-binance/api-specification.txt b/xchange-binance/api-specification.txt
new file mode 100644
index 000000000..67200dcdb
--- /dev/null
+++ b/xchange-binance/api-specification.txt
@@ -0,0 +1,9 @@
+Binance Exchange API specification
+==============================
+
+
+This api provides access to such information as tickers, trades, orderbooks and common statistics of currency pairs.
+
+Documentation
+-------------
+https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md
diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml
new file mode 100644
index 000000000..767916b7d
--- /dev/null
+++ b/xchange-binance/pom.xml
@@ -0,0 +1,31 @@
+
+
+ 4.0.0
+
+
+ xchange-parent
+ org.knowm.xchange
+ 4.3.4-SNAPSHOT
+
+
+ xchange-binance
+
+ XChange Binance
+ XChange implementation for the Binance Exchange
+
+ http://knowm.org/open-source/xchange/
+ 2012
+
+
+ Knowm Inc.
+ http://knowm.org/open-source/xchange/
+
+
+
+
+ org.knowm.xchange
+ xchange-core
+ 4.3.4-SNAPSHOT
+
+
+
diff --git a/xchange-binance/src/main/java/org/knowm/xchange/binance/Binance.java b/xchange-binance/src/main/java/org/knowm/xchange/binance/Binance.java
new file mode 100644
index 000000000..3e1bef1d4
--- /dev/null
+++ b/xchange-binance/src/main/java/org/knowm/xchange/binance/Binance.java
@@ -0,0 +1,137 @@
+package org.knowm.xchange.binance;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.knowm.xchange.binance.dto.BinanceException;
+import org.knowm.xchange.binance.dto.marketdata.BinanceAggTrades;
+import org.knowm.xchange.binance.dto.marketdata.BinanceOrderbook;
+import org.knowm.xchange.binance.dto.marketdata.BinancePrice;
+import org.knowm.xchange.binance.dto.marketdata.BinancePriceQuantity;
+import org.knowm.xchange.binance.dto.marketdata.BinanceTicker24h;
+import org.knowm.xchange.binance.dto.meta.BinanceTime;
+import org.knowm.xchange.binance.dto.meta.exchangeinfo.BinanceExchangeInfo;
+
+@Path("")
+@Produces(MediaType.APPLICATION_JSON)
+public interface Binance {
+
+ @GET
+ @Path("api/v1/ping")
+ /**
+ * Test connectivity to the Rest API.
+ * @return
+ * @throws IOException
+ */
+ Object ping() throws IOException;
+
+ @GET
+ @Path("api/v1/time")
+ /**
+ * Test connectivity to the Rest API and get the current server time.
+ * @return
+ * @throws IOException
+ */
+ BinanceTime time() throws IOException;
+
+ @GET
+ @Path("api/v1/exchangeInfo")
+ /**
+ * Current exchange trading rules and symbol information.
+ * @return
+ * @throws IOException
+ */
+ BinanceExchangeInfo exchangeInfo() throws IOException;
+
+ @GET
+ @Path("api/v1/depth")
+ /**
+ *
+ * @param symbol
+ * @param limit optional, default 100; max 100.
+ * @return
+ * @throws IOException
+ * @throws BinanceException
+ */
+ BinanceOrderbook depth(@QueryParam("symbol") String symbol, @QueryParam("limit") Integer limit)
+ throws IOException, BinanceException;
+
+ @GET
+ @Path("api/v1/aggTrades")
+ /**
+ * Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will
+ * have the quantity aggregated.
+ * If both startTime and endTime are sent, limit should not be sent AND the distance between startTime and endTime
+ * must be less than 24 hours.
+ * If frondId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.
+ * @param symbol
+ * @param fromId optional, ID to get aggregate trades from INCLUSIVE.
+ * @param startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
+ * @param endTime optional, Timestamp in ms to get aggregate trades until INCLUSIVE.
+ * @param limit optional, Default 500; max 500.
+ * @return
+ * @throws IOException
+ * @throws BinanceException
+ */
+ List aggTrades(@QueryParam("symbol") String symbol, @QueryParam("fromId") Long fromId
+ , @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime
+ , @QueryParam("limit") Integer limit)
+ throws IOException, BinanceException;
+
+ @GET
+ @Path("api/v1/klines")
+ /**
+ * Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
+ * If startTime and endTime are not sent, the most recent klines are returned.
+ * @param symbol
+ * @param interval
+ * @param limit optional, default 500; max 500.
+ * @param startTime optional
+ * @param endTime optional
+ * @return
+ * @throws IOException
+ * @throws BinanceException
+ */
+ List