-
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 pull request #4998 from rizer1980/PR/bybit-work
[BYBIT]
- Loading branch information
Showing
36 changed files
with
944 additions
and
310 deletions.
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
xchange-bybit/src/main/java/org/knowm/xchange/bybit/BybitTimeStampFactory.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,14 @@ | ||
package org.knowm.xchange.bybit; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import si.mazi.rescu.SynchronizedValueFactory; | ||
|
||
public class BybitTimeStampFactory implements SynchronizedValueFactory<Long> { | ||
private static final Logger LOG = LoggerFactory.getLogger(BybitTimeStampFactory.class); | ||
|
||
@Override | ||
public Long createValue() { | ||
return System.currentTimeMillis(); | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
...nge-bybit/src/main/java/org/knowm/xchange/bybit/dto/trade/BybitCancelAllOrdersParams.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,45 @@ | ||
package org.knowm.xchange.bybit.dto.trade; | ||
|
||
import lombok.Getter; | ||
import org.knowm.xchange.bybit.dto.BybitCategory; | ||
import org.knowm.xchange.instrument.Instrument; | ||
import org.knowm.xchange.service.trade.params.CancelAllOrders; | ||
|
||
@Getter | ||
public class BybitCancelAllOrdersParams implements CancelAllOrders { | ||
|
||
private final BybitCategory category; | ||
private final Instrument symbol; | ||
private String baseCoin; | ||
private String settleCoin; | ||
private String orderFilter; | ||
private String stopOrderType; | ||
|
||
public BybitCancelAllOrdersParams(BybitCategory category, Instrument symbol) { | ||
this.category = category; | ||
this.symbol = symbol; | ||
} | ||
|
||
public BybitCancelAllOrdersParams(BybitCategory category, Instrument symbol, String baseCoin, | ||
String settleCoin, String orderFilter, String stopOrderType) { | ||
this.category = category; | ||
this.symbol = symbol; | ||
this.baseCoin = baseCoin; | ||
this.settleCoin = settleCoin; | ||
this.orderFilter = orderFilter; | ||
this.stopOrderType = stopOrderType; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "BybitCancelAllOrdersParams{" + | ||
"category=" + category + | ||
", symbol=" + symbol + | ||
", baseCoin='" + baseCoin + '\'' + | ||
", settleCoin='" + settleCoin + '\'' + | ||
", orderFilter='" + orderFilter + '\'' + | ||
", stopOrderType='" + stopOrderType + '\'' + | ||
'}'; | ||
} | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
xchange-bybit/src/main/java/org/knowm/xchange/bybit/dto/trade/BybitCancelOrderParams.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,27 @@ | ||
package org.knowm.xchange.bybit.dto.trade; | ||
|
||
import lombok.Getter; | ||
import org.knowm.xchange.instrument.Instrument; | ||
import org.knowm.xchange.service.trade.params.CancelOrderByUserReferenceParams; | ||
import org.knowm.xchange.service.trade.params.DefaultCancelOrderByInstrumentAndIdParams; | ||
|
||
@Getter | ||
public class BybitCancelOrderParams extends DefaultCancelOrderByInstrumentAndIdParams | ||
implements CancelOrderByUserReferenceParams { | ||
|
||
private final String userReference; | ||
|
||
public BybitCancelOrderParams(Instrument instrument, String orderId, String userReference) { | ||
super(instrument, orderId); | ||
this.userReference = userReference; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "BybitCancelOrderParams{" + | ||
"instrument='" + getInstrument() + '\'' + | ||
", orderId='" + getOrderId() + '\'' + | ||
", userReference=" + getUserReference() + | ||
'}'; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
xchange-bybit/src/main/java/org/knowm/xchange/bybit/dto/trade/BybitOpenOrdersParam.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,23 @@ | ||
package org.knowm.xchange.bybit.dto.trade; | ||
|
||
import lombok.Getter; | ||
import org.knowm.xchange.bybit.dto.BybitCategory; | ||
import org.knowm.xchange.instrument.Instrument; | ||
import org.knowm.xchange.service.trade.params.orders.DefaultOpenOrdersParamInstrument; | ||
|
||
@Getter | ||
public class BybitOpenOrdersParam extends DefaultOpenOrdersParamInstrument { | ||
private final BybitCategory category; | ||
|
||
public BybitOpenOrdersParam(Instrument instrument, BybitCategory category) { | ||
super(instrument); | ||
this.category = category; | ||
} | ||
@Override | ||
public String toString() { | ||
return "BybitOrderQueryParams{" + | ||
"category='" + category + '\'' + | ||
", instrument='" + getInstrument() + '\'' + | ||
'}'; | ||
} | ||
} |
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.