Package org.knowm.xchange.gateio.service
Class GateioTradeServiceRaw
java.lang.Object
org.knowm.xchange.service.BaseExchangeService
org.knowm.xchange.gateio.service.GateioBaseService
org.knowm.xchange.gateio.service.GateioTradeServiceRaw
- All Implemented Interfaces:
BaseService
- Direct Known Subclasses:
GateioTradeService
public class GateioTradeServiceRaw extends GateioBaseService
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GateioTradeServiceRaw.GateioCancelOrderParams
-
Field Summary
Fields inherited from class org.knowm.xchange.gateio.service.GateioBaseService
apiKey, bter, signatureCreator
Fields inherited from class org.knowm.xchange.service.BaseExchangeService
exchange
-
Constructor Summary
Constructors Constructor Description GateioTradeServiceRaw(Exchange exchange)
Constructor -
Method Summary
Modifier and Type Method Description boolean
cancelAllOrders(String type, CurrencyPair currencyPair)
Cancels all orders.boolean
cancelOrder(String orderId, CurrencyPair currencyPair)
GateioOpenOrders
getGateioOpenOrders()
GateioOrderStatus
getGateioOrderStatus(String orderId, CurrencyPair currencyPair)
GateioTradeHistoryReturn
getGateioTradeHistory(CurrencyPair currencyPair)
String
placeGateioLimitOrder(CurrencyPair currencyPair, GateioOrderType orderType, BigDecimal rate, BigDecimal amount)
Submits a Limit Order to be executed on the Gateio Exchange for the desired market defined bycurrencyPair
.String
placeGateioLimitOrder(LimitOrder limitOrder)
Submits a Limit Order to be executed on the Gateio Exchange for the desired market defined byCurrencyPair
.Methods inherited from class org.knowm.xchange.gateio.service.GateioBaseService
getApiKey, handleResponse
Methods inherited from class org.knowm.xchange.service.BaseExchangeService
verifyOrder, verifyOrder, verifyOrder
-
Constructor Details
-
GateioTradeServiceRaw
Constructor- Parameters:
exchange
-
-
-
Method Details
-
placeGateioLimitOrder
Submits a Limit Order to be executed on the Gateio Exchange for the desired market defined byCurrencyPair
. WARNING - Gateio will return true regardless of whether or not an order actually gets created. The reason for this is that orders are simply submitted to a queue in their back-end. One example for why an order might not get created is because there are insufficient funds. The best attempt you can make to confirm that the order was created is to pollgetGateioOpenOrders()
. However if the order is created and executed before it is caught in its open state from callinggetGateioOpenOrders()
then the only way to confirm would be confirm the expected difference in funds available for your account.- Parameters:
limitOrder
-- Returns:
- String order id of submitted request.
- Throws:
IOException
-
placeGateioLimitOrder
public String placeGateioLimitOrder(CurrencyPair currencyPair, GateioOrderType orderType, BigDecimal rate, BigDecimal amount) throws IOExceptionSubmits a Limit Order to be executed on the Gateio Exchange for the desired market defined bycurrencyPair
. WARNING - Gateio will return true regardless of whether or not an order actually gets created. The reason for this is that orders are simply submitted to a queue in their back-end. One example for why an order might not get created is because there are insufficient funds. The best attempt you can make to confirm that the order was created is to pollgetGateioOpenOrders()
. However if the order is created and executed before it is caught in its open state from callinggetGateioOpenOrders()
then the only way to confirm would be confirm the expected difference in funds available for your account.- Parameters:
currencyPair
-orderType
-rate
-amount
-- Returns:
- String order id of submitted request.
- Throws:
IOException
-
cancelOrder
- Throws:
IOException
-
cancelAllOrders
Cancels all orders. See https://gate.io/api2.- Parameters:
type
- order type(0:sell,1:buy,-1:all)currencyPair
- currency pair- Returns:
- Throws:
IOException
-
getGateioOpenOrders
- Throws:
IOException
-
getGateioOrderStatus
public GateioOrderStatus getGateioOrderStatus(String orderId, CurrencyPair currencyPair) throws IOException- Throws:
IOException
-
getGateioTradeHistory
public GateioTradeHistoryReturn getGateioTradeHistory(CurrencyPair currencyPair) throws IOException- Throws:
IOException
-