This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
forked from joaopsilva/binance-java-api
-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented /fapi/v1/leverage and /fapi/v1/marginType
- Loading branch information
Showing
18 changed files
with
306 additions
and
21 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ce/api/client/impl/BinanceApiService.java → ...nce/api/client/api/BinanceApiService.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
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
13 changes: 13 additions & 0 deletions
13
src/main/java/com/binance/api/client/domain/MarginType.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,13 @@ | ||
package com.binance.api.client.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
/** | ||
* Binance futures margin types | ||
* | ||
* @author Mahdi Sheikh Hosseini | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public enum MarginType { | ||
ISOLATED, CROSSED; | ||
} |
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
68 changes: 68 additions & 0 deletions
68
src/main/java/com/binance/api/client/domain/account/LeverageRequest.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,68 @@ | ||
package com.binance.api.client.domain.account; | ||
|
||
import com.binance.api.client.constant.BinanceApiConstants; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import org.apache.commons.lang3.builder.ToStringBuilder; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class LeverageRequest { | ||
|
||
private String symbol; | ||
private int leverage; | ||
private long recvWindow; | ||
private long timestamp; | ||
|
||
public LeverageRequest() { | ||
this.timestamp = System.currentTimeMillis(); | ||
this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW; | ||
} | ||
|
||
public LeverageRequest(String symbol, int leverage) { | ||
this.symbol = symbol; | ||
this.leverage = leverage; | ||
this.timestamp = System.currentTimeMillis(); | ||
this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW; | ||
} | ||
|
||
public String getSymbol() { | ||
return symbol; | ||
} | ||
|
||
public void setSymbol(String symbol) { | ||
this.symbol = symbol; | ||
} | ||
|
||
public int getLeverage() { | ||
return leverage; | ||
} | ||
|
||
public void setLeverage(int leverage) { | ||
this.leverage = leverage; | ||
} | ||
|
||
public long getRecvWindow() { | ||
return recvWindow; | ||
} | ||
|
||
public void setRecvWindow(long recvWindow) { | ||
this.recvWindow = recvWindow; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(long timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE) | ||
.append("symbol", symbol) | ||
.append("leverage", leverage) | ||
.append("recvWindow", recvWindow) | ||
.append("timestamp", timestamp) | ||
.toString(); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/binance/api/client/domain/account/LeverageResponse.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,46 @@ | ||
package com.binance.api.client.domain.account; | ||
|
||
import com.binance.api.client.constant.BinanceApiConstants; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import org.apache.commons.lang3.builder.ToStringBuilder; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class LeverageResponse { | ||
|
||
private String symbol; | ||
private int leverage; | ||
private String maxNotionalValue; | ||
|
||
public int getLeverage() { | ||
return leverage; | ||
} | ||
|
||
public void setLeverage(int leverage) { | ||
this.leverage = leverage; | ||
} | ||
|
||
public String getMaxNotionalValue() { | ||
return maxNotionalValue; | ||
} | ||
|
||
public void setMaxNotionalValue(String maxNotionalValue) { | ||
this.maxNotionalValue = maxNotionalValue; | ||
} | ||
|
||
public String getSymbol() { | ||
return symbol; | ||
} | ||
|
||
public void setSymbol(String symbol) { | ||
this.symbol = symbol; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE) | ||
.append("symbol", symbol) | ||
.append("leverage", leverage) | ||
.append("maxNotionalValue", maxNotionalValue) | ||
.toString(); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
src/main/java/com/binance/api/client/domain/account/MarginTypeRequest.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,73 @@ | ||
package com.binance.api.client.domain.account; | ||
|
||
import com.binance.api.client.constant.BinanceApiConstants; | ||
import com.binance.api.client.domain.MarginType; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import org.apache.commons.lang3.builder.ToStringBuilder; | ||
|
||
/** | ||
* @author Mahdi Sheikh Hosseini | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class MarginTypeRequest { | ||
|
||
private String symbol; | ||
private MarginType marginType; | ||
private long recvWindow; | ||
private long timestamp; | ||
|
||
public MarginTypeRequest() { | ||
this.timestamp = System.currentTimeMillis(); | ||
this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW; | ||
} | ||
|
||
public MarginTypeRequest(String symbol, MarginType marginType) { | ||
this.symbol = symbol; | ||
this.marginType = marginType; | ||
this.timestamp = System.currentTimeMillis(); | ||
this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW; | ||
} | ||
|
||
public String getSymbol() { | ||
return symbol; | ||
} | ||
|
||
public void setSymbol(String symbol) { | ||
this.symbol = symbol; | ||
} | ||
|
||
public MarginType getMarginType() { | ||
return marginType; | ||
} | ||
|
||
public void setMarginType(MarginType marginType) { | ||
this.marginType = marginType; | ||
} | ||
|
||
public long getRecvWindow() { | ||
return recvWindow; | ||
} | ||
|
||
public void setRecvWindow(long recvWindow) { | ||
this.recvWindow = recvWindow; | ||
} | ||
|
||
public long getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(long timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE) | ||
.append("symbol", symbol) | ||
.append("marginType", marginType) | ||
.append("recvWindow", recvWindow) | ||
.append("timestamp", timestamp) | ||
.toString(); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
src/main/java/com/binance/api/client/impl/BinanceApiServiceGenerator.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
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
Oops, something went wrong.