-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'knowm-develop' into enforcer-plugin
- Loading branch information
Showing
27 changed files
with
276 additions
and
40 deletions.
There are no files selected for viewing
20 changes: 11 additions & 9 deletions
20
xchange-binance/src/main/java/org/knowm/xchange/binance/dto/meta/BinanceSystemStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
package org.knowm.xchange.binance.dto.meta; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
||
@Value | ||
@Builder | ||
@Jacksonized | ||
public class BinanceSystemStatus { | ||
|
||
// 0: normal,1:system maintenance | ||
@JsonProperty private String status; | ||
// normal or system maintenance | ||
@JsonProperty private String msg; | ||
@JsonProperty | ||
String status; | ||
|
||
public String getStatus() { | ||
return status; | ||
} | ||
// normal or system maintenance | ||
@JsonProperty | ||
String msg; | ||
|
||
public String getMsg() { | ||
return msg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalFee.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.knowm.xchange.bitstamp.dto.account; | ||
|
||
import java.math.BigDecimal; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
import lombok.extern.jackson.Jacksonized; | ||
import org.knowm.xchange.currency.Currency; | ||
|
||
@Jacksonized | ||
@Value | ||
@Builder | ||
public class WithdrawalFee { | ||
|
||
String network; | ||
|
||
BigDecimal fee; | ||
|
||
Currency currency; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...bitstamp/src/test/java/org/knowm/xchange/bitstamp/dto/account/WithdrawalFeesJSONTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.knowm.xchange.bitstamp.dto.account; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.math.BigDecimal; | ||
import java.util.List; | ||
import org.junit.Test; | ||
|
||
public class WithdrawalFeesJSONTest { | ||
|
||
@Test | ||
public void testUnmarshal() throws IOException { | ||
|
||
// Read in the JSON from the example resources | ||
InputStream is = | ||
WithdrawalFeesJSONTest.class.getResourceAsStream( | ||
"/org/knowm/xchange/bitstamp/dto/account/withdrawal-fees.json"); | ||
|
||
// Use Jackson to parse it | ||
ObjectMapper mapper = new ObjectMapper(); | ||
|
||
List<WithdrawalFee> withdrawalFees = | ||
mapper.readValue( | ||
is, | ||
mapper.getTypeFactory().constructCollectionType(List.class, WithdrawalFee.class)); | ||
|
||
assertThat(withdrawalFees.size()).isEqualTo(1); | ||
assertThat(withdrawalFees.get(0).getNetwork()).isEqualTo("bitcoin"); | ||
assertThat(withdrawalFees.get(0).getCurrency().getCurrencyCode()).isEqualToIgnoringCase("btc"); | ||
assertThat(withdrawalFees.get(0).getFee()).isEqualTo(new BigDecimal("0.00015000")); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...e-bitstamp/src/test/resources/org/knowm/xchange/bitstamp/dto/account/withdrawal-fees.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"currency": "btc", | ||
"fee": "0.00015000", | ||
"network": "bitcoin" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
xchange-core/src/main/java/org/knowm/xchange/dto/meta/ExchangeHealth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.knowm.xchange.dto.meta; | ||
|
||
public enum ExchangeHealth { | ||
ONLINE, | ||
OFFLINE, | ||
|
||
/** | ||
* Can only cancel the order but not place order | ||
*/ | ||
CANCEL_ONLY; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.