Skip to content

Commit

Permalink
0719
Browse files Browse the repository at this point in the history
  • Loading branch information
ttc-tt committed Jul 19, 2021
1 parent f15eaf6 commit f4a34a6
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void getWallet() {
// this.toResultString(AccountAPITests.LOG, ":", result);

//单一币种账户信息
List<Wallet> result2 = this.accountAPIService.getWallet("EOS");
List<Wallet> result2 = this.accountAPIService.getWallet("BTC");
this.toResultString(AccountAPITests.LOG, ":", result2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public void testGetInstruments() {
*/
@Test
public void testGetInstrumentBook(){
Book book = marketAPIService.getInstrumentBook("BTC-USDT-210625", null, null);
toResultString(LOG, "BTC-USDT-210625", book);
Book book = marketAPIService.getInstrumentBook("BTC-USDT-211231", null, null);
toResultString(LOG, "book", book);
}

/**
Expand All @@ -71,7 +71,7 @@ public void testGetAllInstrumentTicker() {
*/
@Test
public void testGetInstrumentTicker() {
Ticker ticker = marketAPIService.getInstrumentTicker("ETH-USD-210924");
Ticker ticker = marketAPIService.getInstrumentTicker("ETH-USD-211231");
toResultString(LOG, "Instrument-Ticker", ticker);
}

Expand All @@ -81,7 +81,7 @@ public void testGetInstrumentTicker() {
*/
@Test
public void testGetInstrumentTrades() {
List<Trades> trades = marketAPIService.getInstrumentTrades("BTC-USDT-210924", null, null, "20");
List<Trades> trades = marketAPIService.getInstrumentTrades("BTC-USDT-211231", null, null, "20");
toResultString(LOG, "Instrument-Trades", trades);
}

Expand All @@ -98,7 +98,7 @@ public void testGetInstrumentCandles(){
String start = null;
String end = null;

JSONArray array = marketAPIService.getInstrumentCandles("BTC-USDT-210625", start, end, "180");
JSONArray array = marketAPIService.getInstrumentCandles("BTC-USDT-211231", start, end, "180");

System.out.println(array);

Expand All @@ -110,7 +110,7 @@ public void testGetInstrumentCandles(){
*/
@Test
public void testGetInstrumentIndex() {
Index index = marketAPIService.getInstrumentIndex("BTC-USD-210924");
Index index = marketAPIService.getInstrumentIndex("BTC-USD-211231");
toResultString(LOG, "Instrument-Book", index);
}

Expand All @@ -130,7 +130,7 @@ public void testExchangeRate() {
*/
@Test
public void testGetInstrumentEstimatedPrice() {
EstimatedPrice estimatedPrice = marketAPIService.getInstrumentEstimatedPrice("BTC-USD-210326");
EstimatedPrice estimatedPrice = marketAPIService.getInstrumentEstimatedPrice("BTC-USD-211231");
toResultString(LOG, "Instrument-Estimated-Price", estimatedPrice);
}

Expand All @@ -140,7 +140,7 @@ public void testGetInstrumentEstimatedPrice() {
*/
@Test
public void testGetInstrumentHolds() {
Holds holds = marketAPIService.getInstrumentHolds("BTC-USD-210326");
Holds holds = marketAPIService.getInstrumentHolds("BTC-USD-211231");
toResultString(LOG, "Instrument-Holds", holds);
}

Expand All @@ -150,7 +150,7 @@ public void testGetInstrumentHolds() {
*/
@Test
public void testGetInstrumentPriceLimit() {
PriceLimit priceLimit = marketAPIService.getInstrumentPriceLimit("BTC-USD-210326");
PriceLimit priceLimit = marketAPIService.getInstrumentPriceLimit("BTC-USD-211231");
toResultString(LOG, "Instrument-Price-Limit", priceLimit);
}

Expand All @@ -160,7 +160,7 @@ public void testGetInstrumentPriceLimit() {
*/
@Test
public void testGetMarkPrice() {
JSONObject jsonObject = marketAPIService.getMarkPrice("BTC-USD-210326");
JSONObject jsonObject = marketAPIService.getMarkPrice("BTC-USD-211231");
toResultString(LOG, "MarkPrice", jsonObject);
}

Expand All @@ -170,7 +170,7 @@ public void testGetMarkPrice() {
*/
@Test
public void testGetInstrumentLiquidation() {
List<Liquidation> liquidations = marketAPIService.getInstrumentLiquidation("BTC-USDT-210326", "1", null, null, null);
List<Liquidation> liquidations = marketAPIService.getInstrumentLiquidation("BTC-USDT-211231", "1", null, null, null);
toResultString(LOG, "Instrument-Liquidation", liquidations);
}

Expand All @@ -180,7 +180,7 @@ public void testGetInstrumentLiquidation() {
*/
@Test
public void testGetSettlementHistory(){
JSONArray result = marketAPIService.getSettlementHistory("BTC-USDT-210326",null,null,"10",null);
JSONArray result = marketAPIService.getSettlementHistory("BTC-USDT-211231",null,null,"10",null);
toResultString(LOG,"result",result);
}

Expand All @@ -194,7 +194,7 @@ public void testGetInstrumentHistoryCandles() {
// String end = "2021-04-13T08:36:00.000Z";
String start = null;
String end = null;
JSONArray array = marketAPIService.getHistoryCandels("BTC-USD-210625",start,end, "60",null);
JSONArray array = marketAPIService.getHistoryCandels("BTC-USD-211231",start,end, "60",null);
toResultString(LOG, "History-Candles", array);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void testGetPositions() {
*/
@Test
public void testGetPositionByInstrumentId() {
JSONObject positions = tradeAPIService.getPositionByInstrumentId("BTC-USD-210924");
JSONObject positions = tradeAPIService.getPositionByInstrumentId("BTC-USD-211231");
toResultString(LOG, "instrument-Position", positions);

}
Expand Down Expand Up @@ -92,7 +92,7 @@ public void testGetLeverage() {
*/
@Test
public void testSetLeverageOnFixed() {
JSONObject jsonObject = tradeAPIService.setLeverageOnFixed("BTC-USDT", "BTC-USDT-210924", "long", "12");
JSONObject jsonObject = tradeAPIService.setLeverageOnFixed("BTC-USDT", "BTC-USDT-211231", "long", "12");
toResultString(LOG, "Change-fixed-Leverage", jsonObject);
}

Expand Down Expand Up @@ -124,7 +124,7 @@ public void testGetAccountsLedgerByUnderlying() {
public void testOrder() {
Order order = new Order();
order.setClient_oid("xbpwjcr1622602798919");
order.setinstrument_id("ETH-USD-210625");
order.setinstrument_id("ETH-USD-211231");
order.setType("3");
order.setOrder_type("0");
order.setPrice("2593.67");
Expand All @@ -144,7 +144,7 @@ public void testOrders() {

Orders orders = new Orders();
//设置instrument_id
orders.setInstrument_id("MNBTC-USDT-201113");
orders.setInstrument_id("BTC-USDT-211231");
List<OrdersItem> orders_data = new ArrayList<OrdersItem>();
OrdersItem item1 = new OrdersItem();
item1.setOrder_type("0");
Expand Down Expand Up @@ -180,7 +180,7 @@ public void testOrders() {
@Test
public void testCancelOrderByOrderId() {

JSONObject result = tradeAPIService.cancelOrderByOrderId("BTC-USDT-210924", "5915577902225408");
JSONObject result = tradeAPIService.cancelOrderByOrderId("BTC-USDT-211231", "5915577902225408");
toResultString(LOG, "Cancel-Instrument-Order", result);
}

Expand All @@ -190,7 +190,7 @@ public void testCancelOrderByOrderId() {
*/
@Test
public void testCancelOrderByClientOid() {
JSONObject result = tradeAPIService.cancelOrderByClientOid("DOT-USDT-210326","1024funtures02");
JSONObject result = tradeAPIService.cancelOrderByClientOid("DOT-USDT-211231","1024funtures02");
toResultString(LOG, "Cancel-Instrument-Order", result);
}

Expand All @@ -207,7 +207,7 @@ public void testCancelOrdersByOrderId() {
list.add("5915596639496195");

cancelOrders.setOrder_ids(list);
JSONObject result = tradeAPIService.cancelOrdersByOrderId("MNBTC-USDT-201113", cancelOrders);
JSONObject result = tradeAPIService.cancelOrdersByOrderId("BTC-USDT-211231", cancelOrders);
toResultString(LOG, "Cancel-Instrument-Orders", result);
}

Expand All @@ -223,7 +223,7 @@ public void testCancelOrdersByClientOid() {
list.add("1024funtures05");
list.add("1024funtures06");
cancelOrders.setClient_oids(list);
JSONObject result = tradeAPIService.cancelOrdersByClientOid("DOT-USDT-210326", cancelOrders);
JSONObject result = tradeAPIService.cancelOrdersByClientOid("DOT-USDT-211231", cancelOrders);
toResultString(LOG, "Cancel-Instrument-Orders", result);
}

Expand All @@ -240,7 +240,7 @@ public void testAmendOrderByOrderId(){
amendOrder.setNew_size("2");
amendOrder.setNew_price("15200");

JSONObject result = tradeAPIService.amendOrderByOrderId("MNBTC-USDT-201113",amendOrder);
JSONObject result = tradeAPIService.amendOrderByOrderId("BTC-USDT-211231",amendOrder);
toResultString(LOG, "amend-Instrument-Orders", result);
}

Expand All @@ -257,7 +257,7 @@ public void testAmendOrderByClientOid(){
amendOrder.setNew_size("2");
amendOrder.setNew_price("4.83");

JSONObject result = tradeAPIService.amendOrderByClientOId("DOT-USDT-210326",amendOrder);
JSONObject result = tradeAPIService.amendOrderByClientOId("DOT-USDT-211231",amendOrder);
toResultString(LOG, "amend-Instrument-Orders", result);
}

Expand Down Expand Up @@ -290,7 +290,7 @@ public void testAmendBatchOrderByOrderId(){
amendDateParam.setAmend_data(list);


JSONObject result = tradeAPIService.amendBatchOrdersByOrderId("DOT-USDT-210326",amendDateParam);
JSONObject result = tradeAPIService.amendBatchOrdersByOrderId("DOT-USDT-211231",amendDateParam);
toResultString(LOG, "amend-Instrument-Orders", result);
}

Expand Down Expand Up @@ -322,7 +322,7 @@ public void testAmendBatchOrderByClientOid(){
AmendDateParam amendDateParam = new AmendDateParam();
amendDateParam.setAmend_data(list);

JSONObject result = tradeAPIService.amendBatchOrdersByClientOid("MNBTC-USDT-201113",amendDateParam);
JSONObject result = tradeAPIService.amendBatchOrdersByClientOid("BTC-USDT-211231",amendDateParam);
toResultString(LOG, "amend-Instrument-Orders", result);
}

Expand All @@ -332,7 +332,7 @@ public void testAmendBatchOrderByClientOid(){
*/
@Test
public void testGetOrders() {
JSONObject result = tradeAPIService.getOrders("EOS-USDT-201204", "0", null, null, null);
JSONObject result = tradeAPIService.getOrders("EOS-USDT-211231", "0", null, null, null);
toResultString(LOG, "Get-Orders", result);
}

Expand All @@ -342,7 +342,7 @@ public void testGetOrders() {
*/
@Test
public void testGetOrderByOrderId() {
JSONObject result = tradeAPIService.getOrderByOrderId("XRP-USDT-210326", "6402840504753152");
JSONObject result = tradeAPIService.getOrderByOrderId("XRP-USDT-211231", "6402840504753152");
toResultString(LOG, "Get-Order", result);
}

Expand All @@ -352,7 +352,7 @@ public void testGetOrderByOrderId() {
*/
@Test
public void testGetOrderByClientOid() {
JSONObject result = tradeAPIService.getOrderByClientOid("DOT-USDT-210326", "1025futures01");
JSONObject result = tradeAPIService.getOrderByClientOid("DOT-USDT-211231", "1025futures01");
toResultString(LOG, "Get-Order", result);
}

Expand All @@ -363,7 +363,7 @@ public void testGetOrderByClientOid() {
*/
@Test
public void testGetFills() {
JSONArray result = tradeAPIService.getFills("", "BTC-USDT-210326", null, null, "100");
JSONArray result = tradeAPIService.getFills("", "BTC-USDT-211231", null, null, "100");
toResultString(LOG, "Get-Fills", result);
}

Expand All @@ -387,7 +387,7 @@ public void testChangeMarginMode() {
@Test
public void testClosePositions() {
ClosePositions closePositions = new ClosePositions();
closePositions.setInstrument_id("BTC-USDT-201113");
closePositions.setInstrument_id("BTC-USDT-211231");
closePositions.setDirection("short");
JSONObject jsonObject = tradeAPIService.closePositions(closePositions);
toResultString(LOG, "closePositions", jsonObject);
Expand All @@ -400,7 +400,7 @@ public void testClosePositions() {
@Test
public void testcancelAll() {
CancelAll cancelAll = new CancelAll();
cancelAll.setInstrument_id("MNBTC-USDT-201113");
cancelAll.setInstrument_id("BTC-USDT-211231");
cancelAll.setDirection("short");
JSONObject jsonObject = tradeAPIService.cancelAll(cancelAll);
toResultString(LOG, "cancelAll", jsonObject);
Expand All @@ -412,7 +412,7 @@ public void testcancelAll() {
*/
@Test
public void testGetAccountsHoldsByinstrument_id() {
JSONObject ledger = tradeAPIService.getAccountsHoldsByInstrumentId("DOT-USDT-210326");
JSONObject ledger = tradeAPIService.getAccountsHoldsByInstrumentId("DOT-USDT-211231");
toResultString(LOG, "Ledger", ledger);
}

Expand All @@ -424,7 +424,7 @@ public void testGetAccountsHoldsByinstrument_id() {
public void testFuturesOrder(){
FuturesOrderParam futuresOrderParam=new FuturesOrderParam();
//公共参数
futuresOrderParam.setInstrument_id("MNBTC-USDT-201113");
futuresOrderParam.setInstrument_id("BTC-USDT-211231");
futuresOrderParam.setType("1");
futuresOrderParam.setOrder_type("1");
futuresOrderParam.setSize("1");
Expand Down Expand Up @@ -469,7 +469,7 @@ public void testFuturesOrder(){
@Test
public void testCancelFuturesOrder(){
CancelFuturesOrder cancelFuturesOrder=new CancelFuturesOrder();
cancelFuturesOrder.setInstrument_id("MNBTC-USDT-201113");
cancelFuturesOrder.setInstrument_id("BTC-USDT-211231");
cancelFuturesOrder.setOrder_type("1");
List<String> algo_ids=new ArrayList<String>();
algo_ids.add("5915650053551104");
Expand All @@ -486,7 +486,7 @@ public void testCancelFuturesOrder(){
@Test
public void testFindFuturesOrder(){

JSONArray result = tradeAPIService.findFuturesOrder("XRP-USDT-210604", "1", "1",null, null, null,"10");
JSONArray result = tradeAPIService.findFuturesOrder("XRP-USDT-211231", "1", "1",null, null, null,"10");
toResultString(LOG, "Get-FuturesOrders", result);

}
Expand All @@ -508,7 +508,7 @@ public void testGetTradeFee(){
@Test
public void testModifyMargin(){
ModifyMarginParam modifyMarginParam = new ModifyMarginParam();
modifyMarginParam.setInstrument_id("MNBTC-USDT-201113");
modifyMarginParam.setInstrument_id("BTC-USDT-211231");
modifyMarginParam.setDirection("long");
modifyMarginParam.setAmount("0.5");
modifyMarginParam.setType("1");
Expand All @@ -524,7 +524,7 @@ public void testModifyMargin(){
@Test
public void testModifyFixedMargin(){
ModifyFixedMargin modifyFixedMargin = new ModifyFixedMargin();
modifyFixedMargin.setUnderlying("MNBTC-USDT");
modifyFixedMargin.setUnderlying("BTC-USDT");
modifyFixedMargin.setType("1");

JSONObject result = tradeAPIService.modifyFixedMargin(modifyFixedMargin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ public void getBorrowedAccountsByInstrumentId() {
@Test
public void borrow() {
final BorrowRequestDto dto = new BorrowRequestDto();
dto.setInstrument_id("MNBTC-MNUSDT");
dto.setClient_oid("monijiebi01");
dto.setCurrency("MNUSDT");
dto.setInstrument_id("BTC-USDT");
dto.setClient_oid("jiebi01");
dto.setCurrency("USDT");
dto.setAmount("1");
final BorrowResult result = this.marginAccountAPIService.borrow(dto);
this.toResultString(MarginAccountAPITest.LOG, "result", result);
Expand All @@ -119,8 +119,8 @@ public void repayment() {
final RepaymentRequestDto dto = new RepaymentRequestDto();
dto.setBorrow_id("7253125");
dto.setClient_oid("");
dto.setInstrument_id("MNBTC-MNUSDT");
dto.setCurrency("MNUSDT");
dto.setInstrument_id("BTC-USDT");
dto.setCurrency("USDT");
dto.setAmount("4");

final RepaymentResult result = this.marginAccountAPIService.repayment(dto);
Expand All @@ -133,7 +133,7 @@ public void repayment() {
*/
@Test
public void testGetLeverage(){
JSONObject result = marginAccountAPIService.getLeverage("MNBTC-MNUSDT");
JSONObject result = marginAccountAPIService.getLeverage("BTC-USDT");
this.toResultString(MarginAccountAPITest.LOG, "result", result);

}
Expand All @@ -146,7 +146,7 @@ public void testGetLeverage(){
public void testSetLeverage(){
MarginLeverage leverage = new MarginLeverage();
leverage.setLeverage("3");
JSONObject result = marginAccountAPIService.setLeverage("MNBTC-MNUSDT",leverage);
JSONObject result = marginAccountAPIService.setLeverage("BTC-USDT",leverage);
this.toResultString(MarginAccountAPITest.LOG, "result", result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void batchAmendOrderByClientOid(){
@Test
public void cancleOrdersByOrderId() {
PlaceOrderParam orderParam = new PlaceOrderParam();
orderParam.setInstrument_id("MNBTC-MNUSDT");
orderParam.setInstrument_id("BTC-USDT");
final OrderResult orderResult = this.marginOrderAPIService.cancleOrdersByOrderId(orderParam,"5915531078819840" );
this.toResultString(MarginOrderAPITest.LOG, "cancleOrder", orderResult);
}
Expand All @@ -244,7 +244,7 @@ public void batchCancleOrdersByOrderId() {
final List<OrderParamDto> cancleOrders = new ArrayList<>();

final OrderParamDto dto = new OrderParamDto();
dto.setInstrument_id("MNBTC-MNUSDT");
dto.setInstrument_id("BTC-USDT");
final List<String> order_ids = new ArrayList<>();
order_ids.add("5915541774950400");
order_ids.add("5915541775015936");
Expand Down
Loading

0 comments on commit f4a34a6

Please sign in to comment.