Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/src/main/java/com/coinbase/exchange/api/accounts/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,16 @@ public String getProfile_id() {
public void setProfile_id(String profile_id) {
this.profile_id = profile_id;
}

@Override
public String toString() {
return "Account{"
+ "id='" + id + '\''
+ ", currency='" + currency + '\''
+ ", balance=" + balance
+ ", available=" + available
+ ", hold=" + hold
+ ", profile_id='" + profile_id + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@ public Detail getDetail() {
public void setDetail(Detail detail) {
this.detail = detail;
}

@Override
public String toString() {
return "AccountHistory{"
+ "id=" + id
+ ", created_at='" + created_at + '\''
+ ", amount=" + amount
+ ", balance=" + balance
+ ", type='" + type + '\''
+ ", detail=" + detail
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ public List<OrderItem> getAsks() {
public void setAsks(List<OrderItem> asks) {
this.asks = asks;
}

@Override
public String toString() {
return "MarketData{"
+ "sequence=" + sequence
+ ", bids=" + bids
+ ", asks=" + asks
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,20 @@ public void setTime(String time) {
this.time = time;
}

@Override
public String toString() {
return "Message{"
+ "type='" + type + '\''
+ ", sequence=" + sequence
+ ", order_id='" + order_id + '\''
+ ", size=" + size
+ ", price=" + price
+ ", side='" + side + '\''
+ ", remaining_size=" + remaining_size
+ ", reason='" + reason + '\''
+ ", maker_order_id='" + maker_order_id + '\''
+ ", taker_order_id='" + taker_order_id + '\''
+ ", time='" + time + '\''
+ '}';
}
}
24 changes: 18 additions & 6 deletions api/src/main/java/com/coinbase/exchange/api/orders/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,24 @@ public void setSettled(Boolean settled) {
this.settled = settled;
}

@Override
public String toString() {
String orderString = getSide();
orderString += ": " + getProduct_id();
orderString += ": " + getPrice();
orderString += ": " + getSize();
return orderString;
return "Order{"
+ "id='" + id + '\''
+ ", size='" + size + '\''
+ ", price='" + price + '\''
+ ", product_id='" + product_id + '\''
+ ", side='" + side + '\''
+ ", stp='" + stp + '\''
+ ", type='" + type + '\''
+ ", time_in_force='" + time_in_force + '\''
+ ", post_only='" + post_only + '\''
+ ", created_at='" + created_at + '\''
+ ", fill_fees='" + fill_fees + '\''
+ ", filled_size='" + filled_size + '\''
+ ", executed_value='" + executed_value + '\''
+ ", status='" + status + '\''
+ ", settled=" + settled
+ '}';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,13 @@ public Amount getRemaining() {
public void setRemaining(Amount remaining) {
this.remaining = remaining;
}

@Override
public String toString() {
return "AccountLimit{"
+ "period_in_days=" + period_in_days
+ ", total=" + total
+ ", remaining=" + remaining
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,12 @@ public String getCurrency() {
public void setCurrency(String currency) {
this.currency = currency;
}

@Override
public String toString() {
return "Amount{"
+ "amount=" + amount
+ ", currency='" + currency + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ public String getName() {
public void setName(String name) {
this.name = name;
}

@Override
public String toString() {
return "BankCountry{"
+ "code='" + code + '\''
+ ", name='" + name + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,19 @@ public SepaDepositInformation getSepa_deposit_information() {
public void setSepa_deposit_information(SepaDepositInformation sepa_deposit_information) {
this.sepa_deposit_information = sepa_deposit_information;
}

@Override
public String toString() {
return "CoinbaseAccount{"
+ "id='" + id + '\''
+ ", name='" + name + '\''
+ ", balance=" + balance
+ ", currency='" + currency + '\''
+ ", type='" + type + '\''
+ ", primary=" + primary
+ ", active=" + active
+ ", wire_deposit_information=" + wire_deposit_information
+ ", sepa_deposit_information=" + sepa_deposit_information
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,18 @@ public String getReference() {
public void setReference(String reference) {
this.reference = reference;
}

@Override
public String toString() {
return "DepositInformation{"
+ "account_number='" + account_number + '\''
+ ", routing_number='" + routing_number + '\''
+ ", bank_name='" + bank_name + '\''
+ ", bank_address='" + bank_address + '\''
+ ", bank_country=" + bank_country
+ ", account_name='" + account_name + '\''
+ ", account_address='" + account_address + '\''
+ ", reference='" + reference + '\''
+ '}';
}
}
12 changes: 12 additions & 0 deletions api/src/main/java/com/coinbase/exchange/api/payments/Limit.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.coinbase.exchange.api.payments;

import java.util.Arrays;

/**
* Created by robevansuk on 16/02/2017.
*/
Expand Down Expand Up @@ -50,4 +52,14 @@ public AccountLimit[] getDeposit() {
public void setDeposit(AccountLimit[] deposit) {
this.deposit = deposit;
}

@Override
public String toString() {
return "Limit{"
+ "buy=" + Arrays.toString(buy)
+ ", instant_buy=" + Arrays.toString(instant_buy)
+ ", sell=" + Arrays.toString(sell)
+ ", deposit=" + Arrays.toString(deposit)
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,21 @@ public Limit getLimits() {
public void setLimits(Limit limits) {
this.limits = limits;
}

@Override
public String toString() {
return "PaymentType{"
+ "id='" + id + '\''
+ ", type='" + type + '\''
+ ", name='" + name + '\''
+ ", currency='" + currency + '\''
+ ", primary_buy=" + primary_buy
+ ", primary_sell=" + primary_sell
+ ", allow_buy=" + allow_buy
+ ", allow_sell=" + allow_sell
+ ", allow_deposit=" + allow_deposit
+ ", allow_withdraw=" + allow_withdraw
+ ", limits=" + limits
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,18 @@ public String getReference() {
public void setReference(String reference) {
this.reference = reference;
}

@Override
public String toString() {
return "SepaDepositInformation{"
+ "iban='" + iban + '\''
+ ", swift='" + swift + '\''
+ ", bank_name='" + bank_name + '\''
+ ", bank_address='" + bank_address + '\''
+ ", bank_country_name='" + bank_country_name + '\''
+ ", account_name='" + account_name + '\''
+ ", account_address='" + account_address + '\''
+ ", reference='" + reference + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,13 @@ public String getEnd_date() {
public void setEnd_date(String end_date) {
this.end_date = end_date;
}

@Override
public String toString() {
return "ReportRequest{"
+ "type='" + type + '\''
+ ", start_date='" + start_date + '\''
+ ", end_date='" + end_date + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,18 @@ public TimePeriod getParams() {
public void setParams(TimePeriod params) {
this.params = params;
}

@Override
public String toString() {
return "ReportResponse{"
+ "id='" + id + '\''
+ ", type='" + type + '\''
+ ", status='" + status + '\''
+ ", created_at='" + created_at + '\''
+ ", completed_at='" + completed_at + '\''
+ ", expires_at='" + expires_at + '\''
+ ", file_url='" + file_url + '\''
+ ", params=" + params
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ public String getEnd_date() {
public void setEnd_date(String end_date) {
this.end_date = end_date;
}

@Override
public String toString() {
return "TimePeriod{"
+ "start_date='" + start_date + '\''
+ ", end_date='" + end_date + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ public String getCoinbase_account_id() {
public void setCoinbase_account_id(String coinbase_account_id) {
this.coinbase_account_id = coinbase_account_id;
}

@Override
public String toString() {
return "Transfer{"
+ "type='" + type + '\''
+ ", amount=" + amount
+ ", coinbase_account_id='" + coinbase_account_id + '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,14 @@ public String getRecorded_at() {
public void setRecorded_at(String recorded_at) {
this.recorded_at = recorded_at;
}

@Override
public String toString() {
return "UserAccountData{"
+ "product_id='" + product_id + '\''
+ ", exchange_volume=" + exchange_volume
+ ", volume=" + volume
+ ", recorded_at='" + recorded_at + '\''
+ '}';
}
}
28 changes: 21 additions & 7 deletions model/src/main/java/com/coinbase/exchange/model/Candle.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ public class Candle {
private BigDecimal volume;

public Candle(String[] entry) {
this(Instant.ofEpochSecond(Long.parseLong(entry[0])),
this(
Instant.ofEpochSecond(Long.parseLong(entry[0])),
new BigDecimal(entry[1]),
new BigDecimal(entry[2]),
new BigDecimal(entry[3]),
new BigDecimal(entry[4]),
new BigDecimal(entry[5]));
new BigDecimal(entry[5])
);
}

public Candle(Instant time, BigDecimal low, BigDecimal high, BigDecimal open, BigDecimal close, BigDecimal volume) {
this.time = time;
this.low = low;
this.high = high;
this.open = open;
this.close = close;
this.time = time;
this.low = low;
this.high = high;
this.open = open;
this.close = close;
this.volume = volume;
}

Expand Down Expand Up @@ -77,4 +79,16 @@ public void setClose(BigDecimal close) {
public void setVolume(BigDecimal volume) {
this.volume = volume;
}

@Override
public String toString() {
return "Candle{"
+ "time=" + time
+ ", low=" + low
+ ", high=" + high
+ ", open=" + open
+ ", close=" + close
+ ", volume=" + volume
+ '}';
}
}
7 changes: 7 additions & 0 deletions model/src/main/java/com/coinbase/exchange/model/Candles.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ public Candles(List<String[]> candles) {
public List<Candle> getCandleList() {
return candleList;
}

@Override
public String toString() {
return "Candles{"
+ "candleList=" + candleList
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,22 @@ public CoinbasePaymentRequest(BigDecimal amount, String currency, String coinbas
this.payment_method_id = coinbase_account_id; //Duplicated field for gdax compliance, I believe
//We could probably remove coinbase_account_id but there are no tests for this specific thing
}

public String getCoinbase_account_id() {
return coinbase_account_id;
}

public void setCoinbase_account_id(String coinbase_account_id) {
this.coinbase_account_id = coinbase_account_id;
}

@Override
public String toString() {
return "CoinbasePaymentRequest{"
+ "coinbase_account_id='" + coinbase_account_id + '\''
+ ", payment_method_id='" + payment_method_id + '\''
+ ", amount=" + amount
+ ", currency='" + currency + '\''
+ '}';
}
}
Loading